From e7265c2832a4e78266a9946034accb40168c429c Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Mon, 24 Jan 2011 14:56:14 -0500 Subject: [PATCH 01/84] 5001004: Required Security Algorithms need to be defined Reviewed-by: wetmore --- .../security/AlgorithmParameterGenerator.java | 34 +++++++---- .../java/security/AlgorithmParameters.java | 36 ++++++++---- .../classes/java/security/KeyFactory.java | 35 ++++++++---- .../java/security/KeyPairGenerator.java | 48 ++++++++++------ .../share/classes/java/security/KeyStore.java | 31 ++++++---- .../classes/java/security/MessageDigest.java | 49 ++++++++++------ .../share/classes/java/security/Policy.java | 28 +++++----- .../classes/java/security/SecureRandom.java | 32 +++++------ .../share/classes/java/security/Security.java | 21 +++---- .../classes/java/security/Signature.java | 42 +++++++++----- .../classes/java/security/cert/CertPath.java | 15 ++++- .../java/security/cert/CertPathBuilder.java | 39 ++++++++----- .../java/security/cert/CertPathValidator.java | 42 +++++++++----- .../classes/java/security/cert/CertStore.java | 44 +++++++++------ .../java/security/cert/Certificate.java | 8 +-- .../security/cert/CertificateFactory.java | 56 ++++++++++++------- .../security/cert/CertificateFactorySpi.java | 8 +-- .../classes/java/security/cert/package.html | 26 ++++++--- .../share/classes/java/security/package.html | 34 +++++++---- .../share/classes/javax/crypto/Cipher.java | 52 ++++++++++++----- .../javax/crypto/ExemptionMechanism.java | 20 +++---- .../classes/javax/crypto/KeyAgreement.java | 35 +++++++----- .../classes/javax/crypto/KeyGenerator.java | 40 ++++++++----- jdk/src/share/classes/javax/crypto/Mac.java | 34 +++++++---- .../javax/crypto/SecretKeyFactory.java | 34 +++++++---- .../share/classes/javax/crypto/package.html | 15 ++++- .../classes/javax/net/ssl/SSLContext.java | 35 ++++++++---- .../share/classes/javax/net/ssl/package.html | 11 ++-- .../security/auth/login/Configuration.java | 35 ++++++------ .../javax/security/auth/login/package.html | 12 ++-- 30 files changed, 620 insertions(+), 331 deletions(-) diff --git a/jdk/src/share/classes/java/security/AlgorithmParameterGenerator.java b/jdk/src/share/classes/java/security/AlgorithmParameterGenerator.java index 95268601653..f5ece273052 100644 --- a/jdk/src/share/classes/java/security/AlgorithmParameterGenerator.java +++ b/jdk/src/share/classes/java/security/AlgorithmParameterGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,6 +66,20 @@ import java.security.spec.AlgorithmParameterSpec; * default modulus prime size of 1024 bits for the generation of DSA * parameters. * + *

Every implementation of the Java platform is required to support the + * following standard AlgorithmParameterGenerator algorithms and + * keysizes in parentheses: + *

+ * These algorithms are described in the + * AlgorithmParameterGenerator section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. + * * @author Jan Luehe * * @@ -126,9 +140,9 @@ public class AlgorithmParameterGenerator { * * @param algorithm the name of the algorithm this * parameter generator is associated with. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the AlgorithmParameterGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the new AlgorithmParameterGenerator object. @@ -168,9 +182,9 @@ public class AlgorithmParameterGenerator { * * @param algorithm the name of the algorithm this * parameter generator is associated with. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the AlgorithmParameterGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the string name of the Provider. @@ -214,9 +228,9 @@ public class AlgorithmParameterGenerator { * * @param algorithm the string name of the algorithm this * parameter generator is associated with. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the AlgorithmParameterGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the Provider object. diff --git a/jdk/src/share/classes/java/security/AlgorithmParameters.java b/jdk/src/share/classes/java/security/AlgorithmParameters.java index 7dee113a215..a17e8487b72 100644 --- a/jdk/src/share/classes/java/security/AlgorithmParameters.java +++ b/jdk/src/share/classes/java/security/AlgorithmParameters.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,6 +46,22 @@ import java.security.spec.InvalidParameterSpecException; * getParameterSpec, and a byte encoding of the parameters is * obtained via a call to getEncoded. * + *

Every implementation of the Java platform is required to support the + * following standard AlgorithmParameters algorithms: + *

+ * These algorithms are described in the + * AlgorithmParameters section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. + * * @author Jan Luehe * * @@ -111,9 +127,9 @@ public class AlgorithmParameters { * parameter encoding. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the AlgorithmParameters section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the new parameter object. @@ -153,9 +169,9 @@ public class AlgorithmParameters { * parameter encoding. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the AlgorithmParameters section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the name of the provider. @@ -200,9 +216,9 @@ public class AlgorithmParameters { * parameter encoding. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the AlgorithmParameters section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the name of the provider. diff --git a/jdk/src/share/classes/java/security/KeyFactory.java b/jdk/src/share/classes/java/security/KeyFactory.java index f47f88b07ee..edc9724daf2 100644 --- a/jdk/src/share/classes/java/security/KeyFactory.java +++ b/jdk/src/share/classes/java/security/KeyFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,8 +67,21 @@ import sun.security.jca.GetInstance.Instance; * sig.verify(signature); * * - * @author Jan Luehe + *

Every implementation of the Java platform is required to support the + * following standard KeyFactory algorithms: + *

+ * These algorithms are described in the + * KeyFactory section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. * + * @author Jan Luehe * * @see Key * @see PublicKey @@ -141,9 +154,9 @@ public class KeyFactory { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the requested key algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the new KeyFactory object. @@ -172,9 +185,9 @@ public class KeyFactory { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the requested key algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the name of the provider. @@ -211,9 +224,9 @@ public class KeyFactory { * does not have to be registered in the provider list. * * @param algorithm the name of the requested key algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the provider. diff --git a/jdk/src/share/classes/java/security/KeyPairGenerator.java b/jdk/src/share/classes/java/security/KeyPairGenerator.java index 37f922af6ed..66e7e2ce7f9 100644 --- a/jdk/src/share/classes/java/security/KeyPairGenerator.java +++ b/jdk/src/share/classes/java/security/KeyPairGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,8 +105,22 @@ import sun.security.jca.GetInstance.Instance; * the superclass are intended for cryptographic service providers who wish to * supply their own implementations of key pair generators. * - * @author Benjamin Renaud + *

Every implementation of the Java platform is required to support the + * following standard KeyPairGenerator algorithms and keysizes in + * parentheses: + *

+ * These algorithms are described in the + * KeyPairGenerator section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. * + * @author Benjamin Renaud * * @see java.security.spec.AlgorithmParameterSpec */ @@ -122,9 +136,9 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * Creates a KeyPairGenerator object for the specified algorithm. * * @param algorithm the standard string name of the algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyPairGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. */ protected KeyPairGenerator(String algorithm) { @@ -133,9 +147,9 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { /** * Returns the standard name of the algorithm for this key pair generator. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyPairGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the standard string name of the algorithm. @@ -171,9 +185,9 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the standard string name of the algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyPairGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the new KeyPairGenerator object. @@ -227,9 +241,9 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the standard string name of the algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyPairGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the string name of the provider. @@ -266,9 +280,9 @@ public abstract class KeyPairGenerator extends KeyPairGeneratorSpi { * does not have to be registered in the provider list. * * @param algorithm the standard string name of the algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyPairGenerator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the provider. diff --git a/jdk/src/share/classes/java/security/KeyStore.java b/jdk/src/share/classes/java/security/KeyStore.java index c1e2e4649e7..743f3593f31 100644 --- a/jdk/src/share/classes/java/security/KeyStore.java +++ b/jdk/src/share/classes/java/security/KeyStore.java @@ -164,8 +164,19 @@ import javax.security.auth.callback.*; * different passwords or other protection parameters * may also be used. * - * @author Jan Luehe + *

Every implementation of the Java platform is required to support + * the following standard KeyStore type: + *

+ * This type is described in the + * KeyStore section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other types are supported. * + * @author Jan Luehe * * @see java.security.PrivateKey * @see javax.crypto.SecretKey @@ -582,9 +593,9 @@ public class KeyStore { * the {@link Security#getProviders() Security.getProviders()} method. * * @param type the type of keystore. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyStore section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard keystore types. * * @return a keystore object of the specified type. @@ -620,9 +631,9 @@ public class KeyStore { * the {@link Security#getProviders() Security.getProviders()} method. * * @param type the type of keystore. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyStore section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard keystore types. * * @param provider the name of the provider. @@ -663,9 +674,9 @@ public class KeyStore { * does not have to be registered in the provider list. * * @param type the type of keystore. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the KeyStore section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard keystore types. * * @param provider the provider. diff --git a/jdk/src/share/classes/java/security/MessageDigest.java b/jdk/src/share/classes/java/security/MessageDigest.java index 5173ed97836..ce920fffbc0 100644 --- a/jdk/src/share/classes/java/security/MessageDigest.java +++ b/jdk/src/share/classes/java/security/MessageDigest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,7 +37,7 @@ import java.nio.ByteBuffer; /** * This MessageDigest class provides applications the functionality of a - * message digest algorithm, such as MD5 or SHA. + * message digest algorithm, such as SHA-1 or SHA-256. * Message digests are secure one-way hash functions that take arbitrary-sized * data and output a fixed-length hash value. * @@ -81,8 +81,21 @@ import java.nio.ByteBuffer; * the superclass are intended for cryptographic service providers who wish to * supply their own implementations of message digest algorithms. * - * @author Benjamin Renaud + *

Every implementation of the Java platform is required to support + * the following standard MessageDigest algorithms: + *

+ * These algorithms are described in the + * MessageDigest section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. * + * @author Benjamin Renaud * * @see DigestInputStream * @see DigestOutputStream @@ -104,9 +117,9 @@ public abstract class MessageDigest extends MessageDigestSpi { * Creates a message digest with the specified algorithm name. * * @param algorithm the standard name of the digest algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the MessageDigest section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. */ protected MessageDigest(String algorithm) { @@ -127,9 +140,9 @@ public abstract class MessageDigest extends MessageDigestSpi { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the MessageDigest section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return a Message Digest object that implements the specified algorithm. @@ -173,9 +186,9 @@ public abstract class MessageDigest extends MessageDigestSpi { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the MessageDigest section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the name of the provider. @@ -222,9 +235,9 @@ public abstract class MessageDigest extends MessageDigestSpi { * does not have to be registered in the provider list. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the MessageDigest section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the provider. @@ -439,9 +452,9 @@ public abstract class MessageDigest extends MessageDigestSpi { * Returns a string that identifies the algorithm, independent of * implementation details. The name should be a standard * Java Security name (such as "SHA", "MD5", and so on). - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the MessageDigest section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the name of the algorithm diff --git a/jdk/src/share/classes/java/security/Policy.java b/jdk/src/share/classes/java/security/Policy.java index 8ae6d6c0eaf..b92d0625261 100644 --- a/jdk/src/share/classes/java/security/Policy.java +++ b/jdk/src/share/classes/java/security/Policy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,9 +67,6 @@ import sun.security.util.SecurityConstants; * implementation. In addition, an instance of a Policy object can be * constructed by invoking one of the getInstance factory methods * with a standard type. The default policy type is "JavaPolicy". - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference - * for a list of standard Policy types. * *

Once a Policy instance has been installed (either by default, or by * calling setPolicy), @@ -133,7 +130,7 @@ public abstract class Policy { * This method first calls * SecurityManager.checkPermission with a * SecurityPermission("getPolicy") permission - * to ensure it's ok to get the Policy object.. + * to ensure it's ok to get the Policy object. * * @return the installed Policy. * @@ -340,9 +337,10 @@ public abstract class Policy { *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - * @param type the specified Policy type. See Appendix A in the - * - * Java Cryptography Architecture API Specification & Reference + * @param type the specified Policy type. See the Policy section in the + * + * Java Cryptography Architecture Standard Algorithm Name Documentation * for a list of standard Policy types. * * @param params parameters for the Policy, which may be null. @@ -393,9 +391,10 @@ public abstract class Policy { *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - * @param type the specified Policy type. See Appendix A in the - * - * Java Cryptography Architecture API Specification & Reference + * @param type the specified Policy type. See the Policy section in the + * + * Java Cryptography Architecture Standard Algorithm Name Documentation * for a list of standard Policy types. * * @param params parameters for the Policy, which may be null. @@ -456,9 +455,10 @@ public abstract class Policy { * object is returned. Note that the specified Provider object * does not have to be registered in the provider list. * - * @param type the specified Policy type. See Appendix A in the - * - * Java Cryptography Architecture API Specification & Reference + * @param type the specified Policy type. See the Policy section in the + * + * Java Cryptography Architecture Standard Algorithm Name Documentation * for a list of standard Policy types. * * @param params parameters for the Policy, which may be null. diff --git a/jdk/src/share/classes/java/security/SecureRandom.java b/jdk/src/share/classes/java/security/SecureRandom.java index 4243a778940..e51b6098558 100644 --- a/jdk/src/share/classes/java/security/SecureRandom.java +++ b/jdk/src/share/classes/java/security/SecureRandom.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,9 +133,9 @@ public class SecureRandom extends java.util.Random { *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + *

See the SecureRandom section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * *

The returned SecureRandom object has not been seeded. To seed the @@ -171,9 +171,9 @@ public class SecureRandom extends java.util.Random { *

Note that the list of registered providers may be retrieved via * the {@link Security#getProviders() Security.getProviders()} method. * - *

See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + *

See the SecureRandom section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * * @param seed the seed. @@ -256,9 +256,9 @@ public class SecureRandom extends java.util.Random { * previously called. * * @param algorithm the name of the RNG algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the SecureRandom section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * * @return the new SecureRandom object. @@ -299,9 +299,9 @@ public class SecureRandom extends java.util.Random { * previously called. * * @param algorithm the name of the RNG algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the SecureRandom section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * * @param provider the name of the provider. @@ -347,9 +347,9 @@ public class SecureRandom extends java.util.Random { * previously called. * * @param algorithm the name of the RNG algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the SecureRandom section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard RNG algorithm names. * * @param provider the provider. diff --git a/jdk/src/share/classes/java/security/Security.java b/jdk/src/share/classes/java/security/Security.java index 81e029b8e96..5803243927e 100644 --- a/jdk/src/share/classes/java/security/Security.java +++ b/jdk/src/share/classes/java/security/Security.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -277,10 +277,11 @@ public final class Security { /** * Gets a specified property for an algorithm. The algorithm name - * should be a standard name. See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * should be a standard name. See the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. + * * One possible use is by specialized algorithm parsers, which may map * classes to algorithms which they understand (much like Key parsers * do). @@ -513,9 +514,9 @@ public final class Security { * * * - *

See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + *

See the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard cryptographic service names, standard * algorithm names and standard attribute names. * @@ -582,9 +583,9 @@ public final class Security { * constraint expressed by the specified attribute name/value pair. * * - *

See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + *

See the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard cryptographic service names, standard * algorithm names and standard attribute names. * diff --git a/jdk/src/share/classes/java/security/Signature.java b/jdk/src/share/classes/java/security/Signature.java index d303193a6f5..8e321f8946e 100644 --- a/jdk/src/share/classes/java/security/Signature.java +++ b/jdk/src/share/classes/java/security/Signature.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ import sun.security.jca.*; import sun.security.jca.GetInstance.Instance; /** - * This Signature class is used to provide applications the functionality + * The Signature class is used to provide applications the functionality * of a digital signature algorithm. Digital signatures are used for * authentication and integrity assurance of digital data. * @@ -98,6 +98,20 @@ import sun.security.jca.GetInstance.Instance; * the superclass are intended for cryptographic service providers who wish to * supply their own implementations of digital signature algorithms. * + *

Every implementation of the Java platform is required to support the + * following standard Signature algorithms: + *

+ * These algorithms are described in the + * Signature section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. + * * @author Benjamin Renaud * */ @@ -144,9 +158,9 @@ public abstract class Signature extends SignatureSpi { * Creates a Signature object for the specified algorithm. * * @param algorithm the standard string name of the algorithm. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the Signature section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. */ protected Signature(String algorithm) { @@ -184,9 +198,9 @@ public abstract class Signature extends SignatureSpi { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the standard name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the Signature section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @return the new Signature object. @@ -303,9 +317,9 @@ public abstract class Signature extends SignatureSpi { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the Signature section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the name of the provider. @@ -353,9 +367,9 @@ public abstract class Signature extends SignatureSpi { * does not have to be registered in the provider list. * * @param algorithm the name of the algorithm requested. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the Signature section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard algorithm names. * * @param provider the provider. diff --git a/jdk/src/share/classes/java/security/cert/CertPath.java b/jdk/src/share/classes/java/security/cert/CertPath.java index 67e294dfd64..786360aa20f 100644 --- a/jdk/src/share/classes/java/security/cert/CertPath.java +++ b/jdk/src/share/classes/java/security/cert/CertPath.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,6 +83,19 @@ import java.util.List; * may not follow these conventions. PKIX CertPathValidators will * detect any departure from these conventions that cause the certification * path to be invalid and throw a CertPathValidatorException. + * + *

Every implementation of the Java platform is required to support the + * following standard CertPath encodings: + *

+ * These encodings are described in the + * CertPath Encodings section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other encodings are supported. *

* Concurrent Access *

diff --git a/jdk/src/share/classes/java/security/cert/CertPathBuilder.java b/jdk/src/share/classes/java/security/cert/CertPathBuilder.java index 76210ff0984..99035c36af9 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathBuilder.java +++ b/jdk/src/share/classes/java/security/cert/CertPathBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,6 +52,19 @@ import sun.security.jca.GetInstance.Instance; * result (including the CertPath that was built) is returned * in an object that implements the CertPathBuilderResult * interface. + * + *

Every implementation of the Java platform is required to support the + * following standard CertPathBuilder algorithm: + *

+ * This algorithm is described in the + * CertPathBuilder section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. + * *

* Concurrent Access *

@@ -118,10 +131,10 @@ public class CertPathBuilder { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the requested CertPathBuilder - * algorithm. See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard algorithm names. + * algorithm. See the CertPathBuilder section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard algorithm names. * * @return a CertPathBuilder object that implements the * specified algorithm. @@ -153,10 +166,10 @@ public class CertPathBuilder { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the requested CertPathBuilder - * algorithm. See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard algorithm names. + * algorithm. See the CertPathBuilder section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard algorithm names. * * @param provider the name of the provider. * @@ -193,10 +206,10 @@ public class CertPathBuilder { * does not have to be registered in the provider list. * * @param algorithm the name of the requested CertPathBuilder - * algorithm. See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard algorithm names. + * algorithm. See the CertPathBuilder section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard algorithm names. * * @param provider the provider. * diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidator.java b/jdk/src/share/classes/java/security/cert/CertPathValidator.java index e7b95602923..22cbb59b85d 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidator.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,6 +53,19 @@ import sun.security.jca.GetInstance.Instance; * and an algorithm-specific set of parameters. If successful, the result is * returned in an object that implements the * CertPathValidatorResult interface. + * + *

Every implementation of the Java platform is required to support the + * following standard CertPathValidator algorithm: + *

+ * This algorithm is described in the + * CertPathValidator section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other algorithms are supported. + * *

* Concurrent Access *

@@ -118,10 +131,10 @@ public class CertPathValidator { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the requested CertPathValidator - * algorithm. See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard algorithm names. + * algorithm. See the CertPathValidator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard algorithm names. * * @return a CertPathValidator object that implements the * specified algorithm. @@ -153,10 +166,10 @@ public class CertPathValidator { * the {@link Security#getProviders() Security.getProviders()} method. * * @param algorithm the name of the requested CertPathValidator - * algorithm. See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard algorithm names. + * algorithm. See the CertPathValidator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard algorithm names. * * @param provider the name of the provider. * @@ -193,12 +206,11 @@ public class CertPathValidator { * object is returned. Note that the specified Provider object * does not have to be registered in the provider list. * - * @param algorithm the name of the requested - * CertPathValidator algorithm. - * See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard algorithm names. + * @param algorithm the name of the requested CertPathValidator + * algorithm. See the CertPathValidator section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard algorithm names. * * @param provider the provider. * diff --git a/jdk/src/share/classes/java/security/cert/CertStore.java b/jdk/src/share/classes/java/security/cert/CertStore.java index 0d8de632ba9..325b715ed77 100644 --- a/jdk/src/share/classes/java/security/cert/CertStore.java +++ b/jdk/src/share/classes/java/security/cert/CertStore.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,10 +58,20 @@ import sun.security.jca.GetInstance.Instance; * vast repository of untrusted certificates and CRLs. For example, an LDAP * implementation of CertStore provides access to certificates * and CRLs stored in one or more directories using the LDAP protocol and the - * schema as defined in the RFC service attribute. See Appendix A in the - * - * Java Certification Path API Programmer's Guide for more information about - * standard CertStore types. + * schema as defined in the RFC service attribute. + * + *

Every implementation of the Java platform is required to support the + * following standard CertStore type: + *

+ * This type is described in the + * CertStore section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other types are supported. + * *

* Concurrent Access *

@@ -192,10 +202,10 @@ public class CertStore { * cloned. * * @param type the name of the requested CertStore type. - * See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard types. + * See the CertStore section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard types. * * @param params the initialization parameters (may be null). * @@ -252,10 +262,10 @@ public class CertStore { * cloned. * * @param type the requested CertStore type. - * See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard types. + * See the CertStore section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard types. * * @param params the initialization parameters (may be null). * @@ -310,10 +320,10 @@ public class CertStore { * cloned. * * @param type the requested CertStore type. - * See Appendix A in the - * Java Certification Path API Programmer's Guide - * for information about standard types. + * See the CertStore section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard types. * * @param params the initialization parameters (may be null). * diff --git a/jdk/src/share/classes/java/security/cert/Certificate.java b/jdk/src/share/classes/java/security/cert/Certificate.java index be350f326bd..efe37ac7e34 100644 --- a/jdk/src/share/classes/java/security/cert/Certificate.java +++ b/jdk/src/share/classes/java/security/cert/Certificate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,9 +69,9 @@ public abstract class Certificate implements java.io.Serializable { * Creates a certificate of the specified type. * * @param type the standard name of the certificate type. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the CertificateFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard certificate types. */ protected Certificate(String type) { diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactory.java b/jdk/src/share/classes/java/security/cert/CertificateFactory.java index 6b2528b0a44..4cd81f43d81 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateFactory.java +++ b/jdk/src/share/classes/java/security/cert/CertificateFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,11 +91,29 @@ import sun.security.jca.GetInstance.Instance; * } * * + *

Every implementation of the Java platform is required to support the + * following standard CertificateFactory type: + *

+ * and the following standard CertPath encodings: + * + * The type and encodings are described in the + * CertificateFactory section and the + * CertPath Encodings section of the + * Java Cryptography Architecture Standard Algorithm Name Documentation. + * Consult the release documentation for your implementation to see if any + * other types or encodings are supported. + * * @author Hemma Prafullchandra * @author Jan Luehe * @author Sean Mullan * - * * @see Certificate * @see X509Certificate * @see CertPath @@ -146,9 +164,9 @@ public class CertificateFactory { * the {@link Security#getProviders() Security.getProviders()} method. * * @param type the name of the requested certificate type. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the CertificateFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard certificate types. * * @return a certificate factory object for the specified type. @@ -184,9 +202,9 @@ public class CertificateFactory { * the {@link Security#getProviders() Security.getProviders()} method. * * @param type the certificate type. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the CertificateFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard certificate types. * * @param provider the name of the provider. @@ -228,11 +246,10 @@ public class CertificateFactory { * does not have to be registered in the provider list. * * @param type the certificate type. - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference + * See the CertificateFactory section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard certificate types. - * @param provider the provider. * * @return a certificate factory object for the specified type. @@ -325,10 +342,10 @@ public class CertificateFactory { /** * Returns an iteration of the CertPath encodings supported * by this certificate factory, with the default encoding first. See - * Appendix A in the - * - * Java Certification Path API Programmer's Guide for information about - * standard encoding names and their formats. + * the CertPath Encodings section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation + * for information about standard encoding names and their formats. *

* Attempts to modify the returned Iterator via its * remove method result in an @@ -364,9 +381,10 @@ public class CertificateFactory { /** * Generates a CertPath object and initializes it with * the data read from the InputStream inStream. The data - * is assumed to be in the specified encoding. See Appendix A in the - * - * Java Certification Path API Programmer's Guide + * is assumed to be in the specified encoding. See + * the CertPath Encodings section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard encoding names and their formats. * * @param inStream an InputStream containing the data diff --git a/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java b/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java index a9dbae734fa..b7a3c55f8ab 100644 --- a/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java +++ b/jdk/src/share/classes/java/security/cert/CertificateFactorySpi.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -182,9 +182,9 @@ public abstract class CertificateFactorySpi { /** * Returns an iteration of the CertPath encodings supported * by this certificate factory, with the default encoding first. See - * Appendix A in the - * - * Java Certification Path API Programmer's Guide + * the CertPath Encodings section in the + * Java Cryptography Architecture Standard Algorithm Name Documentation * for information about standard encoding names. *

* Attempts to modify the returned Iterator via its diff --git a/jdk/src/share/classes/java/security/cert/package.html b/jdk/src/share/classes/java/security/cert/package.html index 55109aaf3d4..0851accc6c5 100644 --- a/jdk/src/share/classes/java/security/cert/package.html +++ b/jdk/src/share/classes/java/security/cert/package.html @@ -1,5 +1,5 @@ -@since JDK1.4 +@since 1.4 From 43e51855df0ba1407e3c9011cdfe2c3375c4b9f6 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 24 Jan 2011 20:04:08 -0800 Subject: [PATCH 02/84] 7006578: Project Coin: Retrofit JDK libraries with @SafeVarargs Reviewed-by: mduigou, alexp --- jdk/src/share/classes/java/util/Arrays.java | 1 + jdk/src/share/classes/java/util/Collections.java | 1 + jdk/src/share/classes/java/util/EnumSet.java | 1 + jdk/src/share/classes/javax/swing/SwingWorker.java | 1 + jdk/src/share/classes/sun/swing/AccumulativeRunnable.java | 1 + 5 files changed, 5 insertions(+) diff --git a/jdk/src/share/classes/java/util/Arrays.java b/jdk/src/share/classes/java/util/Arrays.java index 6a03fbfb41f..a743e62ca86 100644 --- a/jdk/src/share/classes/java/util/Arrays.java +++ b/jdk/src/share/classes/java/util/Arrays.java @@ -2823,6 +2823,7 @@ public class Arrays { * @param a the array by which the list will be backed * @return a list view of the specified array */ + @SafeVarargs public static List asList(T... a) { return new ArrayList<>(a); } diff --git a/jdk/src/share/classes/java/util/Collections.java b/jdk/src/share/classes/java/util/Collections.java index bfd5a8711d6..1ea0ecb04c0 100644 --- a/jdk/src/share/classes/java/util/Collections.java +++ b/jdk/src/share/classes/java/util/Collections.java @@ -3827,6 +3827,7 @@ public class Collections { * @see Collection#addAll(Collection) * @since 1.5 */ + @SafeVarargs public static boolean addAll(Collection c, T... elements) { boolean result = false; for (T element : elements) diff --git a/jdk/src/share/classes/java/util/EnumSet.java b/jdk/src/share/classes/java/util/EnumSet.java index cbf355fd72a..4e5dd473134 100644 --- a/jdk/src/share/classes/java/util/EnumSet.java +++ b/jdk/src/share/classes/java/util/EnumSet.java @@ -317,6 +317,7 @@ public abstract class EnumSet> extends AbstractSet * or if rest is null * @return an enum set initially containing the specified elements */ + @SafeVarargs public static > EnumSet of(E first, E... rest) { EnumSet result = noneOf(first.getDeclaringClass()); result.add(first); diff --git a/jdk/src/share/classes/javax/swing/SwingWorker.java b/jdk/src/share/classes/javax/swing/SwingWorker.java index 48f2d56bd2b..413f81f9376 100644 --- a/jdk/src/share/classes/javax/swing/SwingWorker.java +++ b/jdk/src/share/classes/javax/swing/SwingWorker.java @@ -404,6 +404,7 @@ public abstract class SwingWorker implements RunnableFuture { * @see #process * */ + @SafeVarargs protected final void publish(V... chunks) { synchronized (this) { if (doProcess == null) { diff --git a/jdk/src/share/classes/sun/swing/AccumulativeRunnable.java b/jdk/src/share/classes/sun/swing/AccumulativeRunnable.java index 583352918e4..2988521f133 100644 --- a/jdk/src/share/classes/sun/swing/AccumulativeRunnable.java +++ b/jdk/src/share/classes/sun/swing/AccumulativeRunnable.java @@ -120,6 +120,7 @@ public abstract class AccumulativeRunnable implements Runnable { * {@code Runnable} for execution. * @param args the arguments to accumulate */ + @SafeVarargs public final synchronized void add(T... args) { boolean isSubmitted = true; if (arguments == null) { From fa97643b69e028e405596f09eec53e03b0f51902 Mon Sep 17 00:00:00 2001 From: Andrei Dmitriev Date: Tue, 25 Jan 2011 15:33:14 +0300 Subject: [PATCH 03/84] 6693961: cross-window focus transfer ability in the Focus Spec should be revised Reviewed-by: ant, art --- jdk/src/share/classes/java/awt/doc-files/FocusSpec.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html b/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html index d233019cdd4..da27abe8ad0 100644 --- a/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html +++ b/jdk/src/share/classes/java/awt/doc-files/FocusSpec.html @@ -894,8 +894,7 @@ not the focused Window and the platform does not support requesting focus across Windows. If the request is denied for this reason, the request is remembered and will be granted when the Window is later focused by the user. Otherwise, the focus change request changes the -focused Window as well. Currently, Microsoft Windows supports cross-Window -focus transfers while Solaris does not. +focused Window as well.

There is no way to determine synchronously whether a focus change request has been granted. Instead, client code must install a From 5c7903af7d978badb77ba2a5a5f287be2ecbb5bd Mon Sep 17 00:00:00 2001 From: Andrei Dmitriev Date: Tue, 25 Jan 2011 19:07:27 +0300 Subject: [PATCH 04/84] 6431076: Cursor gets reset to text cursor in xawt TextArea when autoscrolling on append Reviewed-by: art, anthony --- .../classes/sun/awt/X11/XComponentPeer.java | 16 +- .../sun/awt/X11/XGlobalCursorManager.java | 4 +- .../classes/sun/awt/X11/XTextAreaPeer.java | 39 +- .../MouseOverScrollbarWhenTyping/Test.java | 385 +++++++++++++++++ .../MouseOverScrollbarWhenTyping/Test1.java | 386 ++++++++++++++++++ 5 files changed, 822 insertions(+), 8 deletions(-) create mode 100644 jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test.java create mode 100644 jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test1.java diff --git a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java index a369a7f6831..6e425513c1c 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java @@ -725,7 +725,21 @@ public class XComponentPeer extends XWindow implements ComponentPeer, DropTarget XGlobalCursorManager.getCursorManager().updateCursorImmediately(); } - public void pSetCursor(Cursor cursor) { + public final void pSetCursor(Cursor cursor) { + this.pSetCursor(cursor, true); + } + + /* + * The method changes the cursor. + * @param cursor - a new cursor to change to. + * @param ignoreSubComponents - if {@code true} is passed then + * the new cursor will be installed on window. + * if {@code false} is passed then + * subsequent components will try to handle + * this request and install their cursor. + */ + //ignoreSubComponents not used here + public void pSetCursor(Cursor cursor, boolean ignoreSubComponents) { XToolkit.awtLock(); try { long xcursor = XGlobalCursorManager.getCursor(cursor); diff --git a/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java b/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java index 579586ae047..c28d9d03e11 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java @@ -104,7 +104,9 @@ public final class XGlobalCursorManager extends GlobalCursorManager { nativeContainer = new WeakReference(nc); } - ((XComponentPeer)nc_peer).pSetCursor(cur); + //6431076. A subcomponents (a XTextArea in particular) + //may want to override the cursor over some of their parts. + ((XComponentPeer)nc_peer).pSetCursor(cur, false); // in case of grab we do for Swing we need to update keep cursor updated // (we don't need this in case of AWT menus). Window Manager consider // the grabber as a current window and use its cursor. So we need to diff --git a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java index 4cbca44224d..d9cc3033a3b 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XTextAreaPeer.java @@ -175,6 +175,34 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { super.dispose(); } + + /* + * The method overrides one from XComponentPeer + * If ignoreSubComponents=={@code true} it calls super. + * If ignoreSubComponents=={@code false} it uses the XTextArea machinery + * to change cursor appropriately. In particular it changes the cursor to + * default if over scrollbars. + */ + @Override + public void pSetCursor(Cursor cursor, boolean ignoreSubComponents) { + Point onScreen = getLocationOnScreen(); + if (ignoreSubComponents || + javaMouseEventHandler == null || + onScreen == null) + { + super.pSetCursor(cursor, true); + return; + } + + Point cursorPos = new Point(); + ((XGlobalCursorManager)XGlobalCursorManager.getCursorManager()).getCursorPos(cursorPos); + + Point localPoint = new Point(cursorPos.x - onScreen.x, cursorPos.y - onScreen.y ); + + javaMouseEventHandler.setPointerToUnderPoint(localPoint); + javaMouseEventHandler.setCursor(); + } + void setScrollBarVisibility() { int visibility = ((TextArea)target).getScrollbarVisibility(); jtext.setLineWrap(false); @@ -1264,13 +1292,13 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { void handle( MouseEvent event ) { if ( ! grabbed ) { // dispatch() needs up-to-date pointer in ungrabbed case. - setPointerToUnderEventPoint( event ); + setPointerToUnderPoint( event.getPoint() ); } dispatch( event ); boolean wasGrabbed = grabbed; grabbed_update( event ); if ( wasGrabbed && ! grabbed ) { - setPointerToUnderEventPoint( event ); + setPointerToUnderPoint( event.getPoint() ); } setCursor(); } @@ -1338,7 +1366,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { // 'target.getCursor()' is also applied from elsewhere // (at least now), but only when mouse "entered", and // before 'XTextAreaPeer.handleJavaMouseEvent' is invoked. - outer.pSetCursor( outer.target.getCursor() ); + outer.pSetCursor( outer.target.getCursor(), true ); } else { // We can write here a more intelligent cursor selection @@ -1346,7 +1374,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { // However, I see no point in doing so now. But if you feel // like implementing it, you'll probably need to introduce // 'Pointer.Type.PANEL'. - outer.pSetCursor( outer.textPane.getCursor() ); + outer.pSetCursor( outer.textPane.getCursor(), true ); } } @@ -1391,8 +1419,7 @@ class XTextAreaPeer extends XComponentPeer implements TextAreaPeer { return l; } - private void setPointerToUnderEventPoint( MouseEvent event ) { - Point point = event.getPoint(); + private void setPointerToUnderPoint( Point point ) { if ( outer.textPane.getViewport().getBounds().contains( point ) ) { current.setText(); } diff --git a/jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test.java b/jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test.java new file mode 100644 index 00000000000..098fdac7e8c --- /dev/null +++ b/jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test.java @@ -0,0 +1,385 @@ +/* + @test + @bug 6431076 + @summary Mouse cursor must remain DEFAULT over scrollbar when text is typed + @author Andrei Dmitriev: area=TextArea + @run main/manual Test +*/ + +import java.awt.*; +import java.awt.event.*; + +public class Test { + private static void init() { + Frame f = new Frame("Test for cursor"); + final int dim = 100; + String line = ""; + for( int i=0; i 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + System.out.println(messageIn); + } + + //catch presses of the passed and failed buttons. + //simply call the standard pass() or fail() static methods of + //ManualMainTest + public void actionPerformed( ActionEvent e ) + { + if( e.getActionCommand() == "pass" ) + { + Test.pass(); + } + else + { + Test.fail(); + } + } + +}// TestDialog class diff --git a/jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test1.java b/jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test1.java new file mode 100644 index 00000000000..24d0670b4c2 --- /dev/null +++ b/jdk/test/java/awt/TextArea/MouseOverScrollbarWhenTyping/Test1.java @@ -0,0 +1,386 @@ +/* + @test + @bug 6431076 + @summary Mouse cursor must remain DEFAULT over scrollbar when text is typed + @author Andrei Dmitriev: area=TextArea + @run main/manual Test1 +*/ + +import java.awt.*; +import java.awt.event.*; + +public class Test1 { + private static void init() { + Frame f = new Frame("Test1 for cursor"); + final int dim = 100; + String line = ""; + for( int i=0; i 0 ) + { + //if longer than max then chop off first max chars to print + if( remainingStr.length() >= maxStringLength ) + { + //Try to chop on a word boundary + int posOfSpace = remainingStr. + lastIndexOf( ' ', maxStringLength - 1 ); + + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; + + printStr = remainingStr.substring( 0, posOfSpace + 1 ); + remainingStr = remainingStr.substring( posOfSpace + 1 ); + } + //else just print + else + { + printStr = remainingStr; + remainingStr = ""; + } + + instructionsText.append( printStr + "\n" ); + + }// while + + }// for + + }//printInstructions() + + //DO NOT call this directly, go through Sysout + public void displayMessage( String messageIn ) + { + messageText.append( messageIn + "\n" ); + System.out.println(messageIn); + } + + //catch presses of the passed and failed buttons. + //simply call the standard pass() or fail() static methods of + //ManualMainTest + public void actionPerformed( ActionEvent e ) + { + if( e.getActionCommand() == "pass" ) + { + Test1.pass(); + } + else + { + Test1.fail(); + } + } + +}// TestDialog class From 65c9e92668cbed59471e0248fab2fa4262b77c44 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Wed, 26 Jan 2011 18:01:41 +0000 Subject: [PATCH 05/84] 7012663: javadoc warning in javax.swing.JComponent and javax.swing.plaf.synth.SynthTextPaneUI Reviewed-by: alexp --- jdk/src/share/classes/javax/swing/JComponent.java | 2 +- .../share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/JComponent.java b/jdk/src/share/classes/javax/swing/JComponent.java index 9ef57bacadd..7bed584dca6 100644 --- a/jdk/src/share/classes/javax/swing/JComponent.java +++ b/jdk/src/share/classes/javax/swing/JComponent.java @@ -4911,7 +4911,7 @@ public abstract class JComponent extends Container implements Serializable, * painting to originate from this Component, or one of its ancestors. *

* Calling {@link JComponent#repaint} on a Swing component will be delegated to - * the first ancestor which {@code isPaintingOrigin()} returns {@true}, + * the first ancestor which {@code isPaintingOrigin()} returns {@code true}, * if there are any. *

* {@code JComponent} subclasses that need to be repainted when any of their diff --git a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java index eb7b2959151..aaade50df3d 100644 --- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTextPaneUI.java @@ -92,7 +92,7 @@ public class SynthTextPaneUI extends SynthEditorPaneUI { * * * @param c the editor component - * @see BasicTextUI#installUI + * @see javax.swing.plaf.basic.BasicTextUI#installUI * @see ComponentUI#installUI */ @Override From e5079417fd2e994bfa81a9144d835841b117ebad Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 26 Jan 2011 11:46:40 -0800 Subject: [PATCH 06/84] 7014738: Update jdk repo application manifests with Windows 7 compatibility section Reviewed-by: bae, igor --- jdk/src/windows/resource/java.manifest | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jdk/src/windows/resource/java.manifest b/jdk/src/windows/resource/java.manifest index e5b44609820..24b19c06334 100644 --- a/jdk/src/windows/resource/java.manifest +++ b/jdk/src/windows/resource/java.manifest @@ -41,4 +41,12 @@ + + + + + + + + From 1dd962a92e66b2d1ba5a2138b876082f94999570 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Wed, 26 Jan 2011 12:32:23 -0800 Subject: [PATCH 07/84] 7013420: Project Coin: remove general expression support from try-with-resources statement Reviewed-by: alanb --- .../nio/channels/FileChannel/Truncate.java | 77 ++++++++++--------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/jdk/test/java/nio/channels/FileChannel/Truncate.java b/jdk/test/java/nio/channels/FileChannel/Truncate.java index b0a1ffa0f98..bc81ffb2278 100644 --- a/jdk/test/java/nio/channels/FileChannel/Truncate.java +++ b/jdk/test/java/nio/channels/FileChannel/Truncate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -58,30 +58,31 @@ public class Truncate { for(int i=0; i<100; i++) { long testSize = generator.nextInt(1000) + 10; initTestFile(blah, testSize); - FileChannel fc = (i < 50) ? - new RandomAccessFile(blah, "rw").getChannel() : - FileChannel.open(blah.toPath(), READ, WRITE); - try (fc) { - if (fc.size() != testSize) - throw new RuntimeException("Size failed"); - long position = generator.nextInt((int)testSize); - fc.position(position); + try (FileChannel fc = (i < 50) ? + new RandomAccessFile(blah, "rw").getChannel() : + FileChannel.open(blah.toPath(), READ, WRITE)) + { + if (fc.size() != testSize) + throw new RuntimeException("Size failed"); - long newSize = generator.nextInt((int)testSize); - fc.truncate(newSize); + long position = generator.nextInt((int)testSize); + fc.position(position); - if (fc.size() != newSize) - throw new RuntimeException("Truncate failed"); + long newSize = generator.nextInt((int)testSize); + fc.truncate(newSize); - if (position > newSize) { - if (fc.position() != newSize) - throw new RuntimeException("Position greater than size"); - } else { - if (fc.position() != position) - throw new RuntimeException("Truncate changed position"); - }; - } + if (fc.size() != newSize) + throw new RuntimeException("Truncate failed"); + + if (position > newSize) { + if (fc.position() != newSize) + throw new RuntimeException("Position greater than size"); + } else { + if (fc.position() != position) + throw new RuntimeException("Truncate changed position"); + }; + } } } @@ -92,24 +93,24 @@ public class Truncate { for (int i=0; i<10; i++) { long testSize = generator.nextInt(1000) + 10; initTestFile(blah, testSize); - FileChannel fc = (i < 5) ? - new FileOutputStream(blah, true).getChannel() : - FileChannel.open(blah.toPath(), APPEND); - try (fc) { - // truncate file - long newSize = generator.nextInt((int)testSize); - fc.truncate(newSize); - if (fc.size() != newSize) - throw new RuntimeException("Truncate failed"); + try (FileChannel fc = (i < 5) ? + new FileOutputStream(blah, true).getChannel() : + FileChannel.open(blah.toPath(), APPEND)) + { + // truncate file + long newSize = generator.nextInt((int)testSize); + fc.truncate(newSize); + if (fc.size() != newSize) + throw new RuntimeException("Truncate failed"); - // write one byte - ByteBuffer buf = ByteBuffer.allocate(1); - buf.put((byte)'x'); - buf.flip(); - fc.write(buf); - if (fc.size() != (newSize+1)) - throw new RuntimeException("Unexpected size"); - } + // write one byte + ByteBuffer buf = ByteBuffer.allocate(1); + buf.put((byte)'x'); + buf.flip(); + fc.write(buf); + if (fc.size() != (newSize+1)) + throw new RuntimeException("Unexpected size"); + } } } From eef80dd156d5d507d3c0d63541095e34b2ed3c11 Mon Sep 17 00:00:00 2001 From: Phil Race Date: Wed, 26 Jan 2011 13:26:57 -0800 Subject: [PATCH 08/84] 6940890: Java doesn't pick up the correct fontconfig files in latest Solaris Next builds Reviewed-by: bae, igor --- .../sun/java2d/SunGraphicsEnvironment.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java index 5316005c5fe..ba443ca2ef2 100644 --- a/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java +++ b/jdk/src/share/classes/sun/java2d/SunGraphicsEnvironment.java @@ -95,6 +95,22 @@ public abstract class SunGraphicsEnvironment extends GraphicsEnvironment String line = br.readLine(); if (line.indexOf("OpenSolaris") >= 0) { isOpenSolaris = true; + } else { + /* We are using isOpenSolaris as meaning + * we know the Solaris commercial fonts aren't + * present. "Solaris Next" (03/10) did not + * include these even though its was not + * OpenSolaris. Need to revisit how this is + * handled but for now as in 6ux, we'll use + * the test for a standard font resource as + * being an indicator as to whether we need + * to treat this as OpenSolaris from a font + * config perspective. + */ + String courierNew = + "/usr/openwin/lib/X11/fonts/TrueType/CourierNew.ttf"; + File courierFile = new File(courierNew); + isOpenSolaris = !courierFile.exists(); } fis.close(); } From f771851eb28642e8e57c059847ba4b7623c93179 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Thu, 27 Jan 2011 14:23:42 +0300 Subject: [PATCH 09/84] 6902615: Method JTextComponent.getKeyStrokesForAction() throws StackOverflowError Reviewed-by: peterz --- jdk/src/share/classes/javax/swing/text/Keymap.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/src/share/classes/javax/swing/text/Keymap.java b/jdk/src/share/classes/javax/swing/text/Keymap.java index 082d7707e44..cf503b0f335 100644 --- a/jdk/src/share/classes/javax/swing/text/Keymap.java +++ b/jdk/src/share/classes/javax/swing/text/Keymap.java @@ -137,6 +137,8 @@ public interface Keymap { /** * Sets the parent keymap, which will be used to * resolve key-bindings. + * The behavior is unspecified if a {@code Keymap} has itself + * as one of its resolve parents. * * @param parent the parent keymap */ From 777ccc075e652685ecf23ff4aa4b86db11eea68b Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Thu, 27 Jan 2011 14:33:30 +0300 Subject: [PATCH 10/84] 6935155: @since tag is missing in JTextComponent.save/restoreComposedText Reviewed-by: alexp --- jdk/src/share/classes/javax/swing/text/JTextComponent.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jdk/src/share/classes/javax/swing/text/JTextComponent.java b/jdk/src/share/classes/javax/swing/text/JTextComponent.java index eccf8a5ee7c..c38c7c9a77d 100644 --- a/jdk/src/share/classes/javax/swing/text/JTextComponent.java +++ b/jdk/src/share/classes/javax/swing/text/JTextComponent.java @@ -4822,6 +4822,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * @return {@code true} if the composed text exists and is saved, * {@code false} otherwise * @see #restoreComposedText + * @since 1.7 */ protected boolean saveComposedText(int pos) { if (composedTextExists()) { @@ -4845,6 +4846,7 @@ public abstract class JTextComponent extends JComponent implements Scrollable, A * should be invoked only if {@code saveComposedText} returns {@code true}. * * @see #saveComposedText + * @since 1.7 */ protected void restoreComposedText() { Document doc = getDocument(); From c3ccfc3a2f60a7058cecb87f215ce36cb33fc57a Mon Sep 17 00:00:00 2001 From: Denis Lila Date: Thu, 27 Jan 2011 16:43:28 -0500 Subject: [PATCH 11/84] 4645692: solveCubic does not return all solutions More robust solveCubic implementation. Reviewed-by: flar --- .../classes/java/awt/geom/CubicCurve2D.java | 527 ++++++++++-------- .../awt/geom/CubicCurve2D/ContainsTest.java | 46 ++ .../awt/geom/CubicCurve2D/IntersectsTest.java | 48 ++ .../awt/geom/CubicCurve2D/SolveCubicTest.java | 43 ++ 4 files changed, 429 insertions(+), 235 deletions(-) create mode 100644 jdk/test/java/awt/geom/CubicCurve2D/ContainsTest.java create mode 100644 jdk/test/java/awt/geom/CubicCurve2D/IntersectsTest.java create mode 100644 jdk/test/java/awt/geom/CubicCurve2D/SolveCubicTest.java diff --git a/jdk/src/share/classes/java/awt/geom/CubicCurve2D.java b/jdk/src/share/classes/java/awt/geom/CubicCurve2D.java index 9f8042229d2..393b350e6db 100644 --- a/jdk/src/share/classes/java/awt/geom/CubicCurve2D.java +++ b/jdk/src/share/classes/java/awt/geom/CubicCurve2D.java @@ -31,6 +31,10 @@ import java.util.Arrays; import java.io.Serializable; import sun.awt.geom.Curve; +import static java.lang.Math.abs; +import static java.lang.Math.max; +import static java.lang.Math.ulp; + /** * The CubicCurve2D class defines a cubic parametric curve * segment in {@code (x,y)} coordinate space. @@ -1083,95 +1087,286 @@ public abstract class CubicCurve2D implements Shape, Cloneable { * @since 1.3 */ public static int solveCubic(double eqn[], double res[]) { - // From Numerical Recipes, 5.6, Quadratic and Cubic Equations - double d = eqn[3]; - if (d == 0.0) { - // The cubic has degenerated to quadratic (or line or ...). + // From Graphics Gems: + // http://tog.acm.org/resources/GraphicsGems/gems/Roots3And4.c + final double d = eqn[3]; + if (d == 0) { return QuadCurve2D.solveQuadratic(eqn, res); } - double a = eqn[2] / d; - double b = eqn[1] / d; - double c = eqn[0] / d; - int roots = 0; - double Q = (a * a - 3.0 * b) / 9.0; - double R = (2.0 * a * a * a - 9.0 * a * b + 27.0 * c) / 54.0; - double R2 = R * R; - double Q3 = Q * Q * Q; - a = a / 3.0; - if (R2 < Q3) { - double theta = Math.acos(R / Math.sqrt(Q3)); - Q = -2.0 * Math.sqrt(Q); + + /* normal form: x^3 + Ax^2 + Bx + C = 0 */ + final double A = eqn[2] / d; + final double B = eqn[1] / d; + final double C = eqn[0] / d; + + + // substitute x = y - A/3 to eliminate quadratic term: + // x^3 +Px + Q = 0 + // + // Since we actually need P/3 and Q/2 for all of the + // calculations that follow, we will calculate + // p = P/3 + // q = Q/2 + // instead and use those values for simplicity of the code. + double sq_A = A * A; + double p = 1.0/3 * (-1.0/3 * sq_A + B); + double q = 1.0/2 * (2.0/27 * A * sq_A - 1.0/3 * A * B + C); + + /* use Cardano's formula */ + + double cb_p = p * p * p; + double D = q * q + cb_p; + + final double sub = 1.0/3 * A; + + int num; + if (D < 0) { /* Casus irreducibilis: three real solutions */ + // see: http://en.wikipedia.org/wiki/Cubic_function#Trigonometric_.28and_hyperbolic.29_method + double phi = 1.0/3 * Math.acos(-q / Math.sqrt(-cb_p)); + double t = 2 * Math.sqrt(-p); + if (res == eqn) { - // Copy the eqn so that we don't clobber it with the - // roots. This is needed so that fixRoots can do its - // work with the original equation. - eqn = new double[4]; - System.arraycopy(res, 0, eqn, 0, 4); + eqn = Arrays.copyOf(eqn, 4); } - res[roots++] = Q * Math.cos(theta / 3.0) - a; - res[roots++] = Q * Math.cos((theta + Math.PI * 2.0)/ 3.0) - a; - res[roots++] = Q * Math.cos((theta - Math.PI * 2.0)/ 3.0) - a; - fixRoots(res, eqn); + + res[ 0 ] = ( t * Math.cos(phi)); + res[ 1 ] = (-t * Math.cos(phi + Math.PI / 3)); + res[ 2 ] = (-t * Math.cos(phi - Math.PI / 3)); + num = 3; + + for (int i = 0; i < num; ++i) { + res[ i ] -= sub; + } + } else { - boolean neg = (R < 0.0); - double S = Math.sqrt(R2 - Q3); - if (neg) { - R = -R; + // Please see the comment in fixRoots marked 'XXX' before changing + // any of the code in this case. + double sqrt_D = Math.sqrt(D); + double u = Math.cbrt(sqrt_D - q); + double v = - Math.cbrt(sqrt_D + q); + double uv = u+v; + + num = 1; + + double err = 1200000000*ulp(abs(uv) + abs(sub)); + if (iszero(D, err) || within(u, v, err)) { + if (res == eqn) { + eqn = Arrays.copyOf(eqn, 4); + } + res[1] = -(uv / 2) - sub; + num = 2; } - double A = Math.pow(R + S, 1.0 / 3.0); - if (!neg) { - A = -A; - } - double B = (A == 0.0) ? 0.0 : (Q / A); - res[roots++] = (A + B) - a; + // this must be done after the potential Arrays.copyOf + res[ 0 ] = uv - sub; } - return roots; + + if (num > 1) { // num == 3 || num == 2 + num = fixRoots(eqn, res, num); + } + if (num > 2 && (res[2] == res[1] || res[2] == res[0])) { + num--; + } + if (num > 1 && res[1] == res[0]) { + res[1] = res[--num]; // Copies res[2] to res[1] if needed + } + return num; } - /* - * This pruning step is necessary since solveCubic uses the - * cosine function to calculate the roots when there are 3 - * of them. Since the cosine method can have an error of - * +/- 1E-14 we need to make sure that we don't make any - * bad decisions due to an error. - * - * If the root is not near one of the endpoints, then we will - * only have a slight inaccuracy in calculating the x intercept - * which will only cause a slightly wrong answer for some - * points very close to the curve. While the results in that - * case are not as accurate as they could be, they are not - * disastrously inaccurate either. - * - * On the other hand, if the error happens near one end of - * the curve, then our processing to reject values outside - * of the t=[0,1] range will fail and the results of that - * failure will be disastrous since for an entire horizontal - * range of test points, we will either overcount or undercount - * the crossings and get a wrong answer for all of them, even - * when they are clearly and obviously inside or outside the - * curve. - * - * To work around this problem, we try a couple of Newton-Raphson - * iterations to see if the true root is closer to the endpoint - * or further away. If it is further away, then we can stop - * since we know we are on the right side of the endpoint. If - * we change direction, then either we are now being dragged away - * from the endpoint in which case the first condition will cause - * us to stop, or we have passed the endpoint and are headed back. - * In the second case, we simply evaluate the slope at the - * endpoint itself and place ourselves on the appropriate side - * of it or on it depending on that result. - */ - private static void fixRoots(double res[], double eqn[]) { - final double EPSILON = 1E-5; - for (int i = 0; i < 3; i++) { - double t = res[i]; - if (Math.abs(t) < EPSILON) { - res[i] = findZero(t, 0, eqn); - } else if (Math.abs(t - 1) < EPSILON) { - res[i] = findZero(t, 1, eqn); - } + // preconditions: eqn != res && eqn[3] != 0 && num > 1 + // This method tries to improve the accuracy of the roots of eqn (which + // should be in res). It also might eliminate roots in res if it decideds + // that they're not real roots. It will not check for roots that the + // computation of res might have missed, so this method should only be + // used when the roots in res have been computed using an algorithm + // that never underestimates the number of roots (such as solveCubic above) + private static int fixRoots(double[] eqn, double[] res, int num) { + double[] intervals = {eqn[1], 2*eqn[2], 3*eqn[3]}; + int critCount = QuadCurve2D.solveQuadratic(intervals, intervals); + if (critCount == 2 && intervals[0] == intervals[1]) { + critCount--; } + if (critCount == 2 && intervals[0] > intervals[1]) { + double tmp = intervals[0]; + intervals[0] = intervals[1]; + intervals[1] = tmp; + } + + // below we use critCount to possibly filter out roots that shouldn't + // have been computed. We require that eqn[3] != 0, so eqn is a proper + // cubic, which means that its limits at -/+inf are -/+inf or +/-inf. + // Therefore, if critCount==2, the curve is shaped like a sideways S, + // and it could have 1-3 roots. If critCount==0 it is monotonic, and + // if critCount==1 it is monotonic with a single point where it is + // flat. In the last 2 cases there can only be 1 root. So in cases + // where num > 1 but critCount < 2, we eliminate all roots in res + // except one. + + if (num == 3) { + double xe = getRootUpperBound(eqn); + double x0 = -xe; + + Arrays.sort(res, 0, num); + if (critCount == 2) { + // this just tries to improve the accuracy of the computed + // roots using Newton's method. + res[0] = refineRootWithHint(eqn, x0, intervals[0], res[0]); + res[1] = refineRootWithHint(eqn, intervals[0], intervals[1], res[1]); + res[2] = refineRootWithHint(eqn, intervals[1], xe, res[2]); + return 3; + } else if (critCount == 1) { + // we only need fx0 and fxe for the sign of the polynomial + // at -inf and +inf respectively, so we don't need to do + // fx0 = solveEqn(eqn, 3, x0); fxe = solveEqn(eqn, 3, xe) + double fxe = eqn[3]; + double fx0 = -fxe; + + double x1 = intervals[0]; + double fx1 = solveEqn(eqn, 3, x1); + + // if critCount == 1 or critCount == 0, but num == 3 then + // something has gone wrong. This branch and the one below + // would ideally never execute, but if they do we can't know + // which of the computed roots is closest to the real root; + // therefore, we can't use refineRootWithHint. But even if + // we did know, being here most likely means that the + // curve is very flat close to two of the computed roots + // (or maybe even all three). This might make Newton's method + // fail altogether, which would be a pain to detect and fix. + // This is why we use a very stable bisection method. + if (oppositeSigns(fx0, fx1)) { + res[0] = bisectRootWithHint(eqn, x0, x1, res[0]); + } else if (oppositeSigns(fx1, fxe)) { + res[0] = bisectRootWithHint(eqn, x1, xe, res[2]); + } else /* fx1 must be 0 */ { + res[0] = x1; + } + // return 1 + } else if (critCount == 0) { + res[0] = bisectRootWithHint(eqn, x0, xe, res[1]); + // return 1 + } + } else if (num == 2 && critCount == 2) { + // XXX: here we assume that res[0] has better accuracy than res[1]. + // This is true because this method is only used from solveCubic + // which puts in res[0] the root that it would compute anyway even + // if num==1. If this method is ever used from any other method, or + // if the solveCubic implementation changes, this assumption should + // be reevaluated, and the choice of goodRoot might have to become + // goodRoot = (abs(eqn'(res[0])) > abs(eqn'(res[1]))) ? res[0] : res[1] + // where eqn' is the derivative of eqn. + double goodRoot = res[0]; + double badRoot = res[1]; + double x1 = intervals[0]; + double x2 = intervals[1]; + // If a cubic curve really has 2 roots, one of those roots must be + // at a critical point. That can't be goodRoot, so we compute x to + // be the farthest critical point from goodRoot. If there are two + // roots, x must be the second one, so we evaluate eqn at x, and if + // it is zero (or close enough) we put x in res[1] (or badRoot, if + // |solveEqn(eqn, 3, badRoot)| < |solveEqn(eqn, 3, x)| but this + // shouldn't happen often). + double x = abs(x1 - goodRoot) > abs(x2 - goodRoot) ? x1 : x2; + double fx = solveEqn(eqn, 3, x); + + if (iszero(fx, 10000000*ulp(x))) { + double badRootVal = solveEqn(eqn, 3, badRoot); + res[1] = abs(badRootVal) < abs(fx) ? badRoot : x; + return 2; + } + } // else there can only be one root - goodRoot, and it is already in res[0] + + return 1; + } + + // use newton's method. + private static double refineRootWithHint(double[] eqn, double min, double max, double t) { + if (!inInterval(t, min, max)) { + return t; + } + double[] deriv = {eqn[1], 2*eqn[2], 3*eqn[3]}; + double origt = t; + for (int i = 0; i < 3; i++) { + double slope = solveEqn(deriv, 2, t); + double y = solveEqn(eqn, 3, t); + double delta = - (y / slope); + double newt = t + delta; + + if (slope == 0 || y == 0 || t == newt) { + break; + } + + t = newt; + } + if (within(t, origt, 1000*ulp(origt)) && inInterval(t, min, max)) { + return t; + } + return origt; + } + + private static double bisectRootWithHint(double[] eqn, double x0, double xe, double hint) { + double delta1 = Math.min(abs(hint - x0) / 64, 0.0625); + double delta2 = Math.min(abs(hint - xe) / 64, 0.0625); + double x02 = hint - delta1; + double xe2 = hint + delta2; + double fx02 = solveEqn(eqn, 3, x02); + double fxe2 = solveEqn(eqn, 3, xe2); + while (oppositeSigns(fx02, fxe2)) { + if (x02 >= xe2) { + return x02; + } + x0 = x02; + xe = xe2; + delta1 /= 64; + delta2 /= 64; + x02 = hint - delta1; + xe2 = hint + delta2; + fx02 = solveEqn(eqn, 3, x02); + fxe2 = solveEqn(eqn, 3, xe2); + } + if (fx02 == 0) { + return x02; + } + if (fxe2 == 0) { + return xe2; + } + + return bisectRoot(eqn, x0, xe); + } + + private static double bisectRoot(double[] eqn, double x0, double xe) { + double fx0 = solveEqn(eqn, 3, x0); + double m = x0 + (xe - x0) / 2; + while (m != x0 && m != xe) { + double fm = solveEqn(eqn, 3, m); + if (fm == 0) { + return m; + } + if (oppositeSigns(fx0, fm)) { + xe = m; + } else { + fx0 = fm; + x0 = m; + } + m = x0 + (xe-x0)/2; + } + return m; + } + + private static boolean inInterval(double t, double min, double max) { + return min <= t && t <= max; + } + + private static boolean within(double x, double y, double err) { + double d = y - x; + return (d <= err && d >= -err); + } + + private static boolean iszero(double x, double err) { + return within(x, 0, err); + } + + private static boolean oppositeSigns(double x1, double x2) { + return (x1 < 0 && x2 > 0) || (x1 > 0 && x2 < 0); } private static double solveEqn(double eqn[], int order, double t) { @@ -1182,60 +1377,26 @@ public abstract class CubicCurve2D implements Shape, Cloneable { return v; } - private static double findZero(double t, double target, double eqn[]) { - double slopeqn[] = {eqn[1], 2*eqn[2], 3*eqn[3]}; - double slope; - double origdelta = 0; - double origt = t; - while (true) { - slope = solveEqn(slopeqn, 2, t); - if (slope == 0) { - // At a local minima - must return - return t; - } - double y = solveEqn(eqn, 3, t); - if (y == 0) { - // Found it! - return it - return t; - } - // assert(slope != 0 && y != 0); - double delta = - (y / slope); - // assert(delta != 0); - if (origdelta == 0) { - origdelta = delta; - } - if (t < target) { - if (delta < 0) return t; - } else if (t > target) { - if (delta > 0) return t; - } else { /* t == target */ - return (delta > 0 - ? (target + java.lang.Double.MIN_VALUE) - : (target - java.lang.Double.MIN_VALUE)); - } - double newt = t + delta; - if (t == newt) { - // The deltas are so small that we aren't moving... - return t; - } - if (delta * origdelta < 0) { - // We have reversed our path. - int tag = (origt < t - ? getTag(target, origt, t) - : getTag(target, t, origt)); - if (tag != INSIDE) { - // Local minima found away from target - return the middle - return (origt + t) / 2; - } - // Local minima somewhere near target - move to target - // and let the slope determine the resulting t. - t = target; - } else { - t = newt; - } - } + /* + * Computes M+1 where M is an upper bound for all the roots in of eqn. + * See: http://en.wikipedia.org/wiki/Sturm%27s_theorem#Applications. + * The above link doesn't contain a proof, but I [dlila] proved it myself + * so the result is reliable. The proof isn't difficult, but it's a bit + * long to include here. + * Precondition: eqn must represent a cubic polynomial + */ + private static double getRootUpperBound(double[] eqn) { + double d = eqn[3]; + double a = eqn[2]; + double b = eqn[1]; + double c = eqn[0]; + + double M = 1 + max(max(abs(a), abs(b)), abs(c)) / abs(d); + M += ulp(M) + 1; + return M; } + /** * {@inheritDoc} * @since 1.2 @@ -1273,110 +1434,6 @@ public abstract class CubicCurve2D implements Shape, Cloneable { return contains(p.getX(), p.getY()); } - /* - * Fill an array with the coefficients of the parametric equation - * in t, ready for solving against val with solveCubic. - * We currently have: - *

-     *   val = P(t) = C1(1-t)^3 + 3CP1 t(1-t)^2 + 3CP2 t^2(1-t) + C2 t^3
-     *              = C1 - 3C1t + 3C1t^2 - C1t^3 +
-     *                3CP1t - 6CP1t^2 + 3CP1t^3 +
-     *                3CP2t^2 - 3CP2t^3 +
-     *                C2t^3
-     *            0 = (C1 - val) +
-     *                (3CP1 - 3C1) t +
-     *                (3C1 - 6CP1 + 3CP2) t^2 +
-     *                (C2 - 3CP2 + 3CP1 - C1) t^3
-     *            0 = C + Bt + At^2 + Dt^3
-     *     C = C1 - val
-     *     B = 3*CP1 - 3*C1
-     *     A = 3*CP2 - 6*CP1 + 3*C1
-     *     D = C2 - 3*CP2 + 3*CP1 - C1
-     * 
- */ - private static void fillEqn(double eqn[], double val, - double c1, double cp1, double cp2, double c2) { - eqn[0] = c1 - val; - eqn[1] = (cp1 - c1) * 3.0; - eqn[2] = (cp2 - cp1 - cp1 + c1) * 3.0; - eqn[3] = c2 + (cp1 - cp2) * 3.0 - c1; - return; - } - - /* - * Evaluate the t values in the first num slots of the vals[] array - * and place the evaluated values back into the same array. Only - * evaluate t values that are within the range <0, 1>, including - * the 0 and 1 ends of the range iff the include0 or include1 - * booleans are true. If an "inflection" equation is handed in, - * then any points which represent a point of inflection for that - * cubic equation are also ignored. - */ - private static int evalCubic(double vals[], int num, - boolean include0, - boolean include1, - double inflect[], - double c1, double cp1, - double cp2, double c2) { - int j = 0; - for (int i = 0; i < num; i++) { - double t = vals[i]; - if ((include0 ? t >= 0 : t > 0) && - (include1 ? t <= 1 : t < 1) && - (inflect == null || - inflect[1] + (2*inflect[2] + 3*inflect[3]*t)*t != 0)) - { - double u = 1 - t; - vals[j++] = c1*u*u*u + 3*cp1*t*u*u + 3*cp2*t*t*u + c2*t*t*t; - } - } - return j; - } - - private static final int BELOW = -2; - private static final int LOWEDGE = -1; - private static final int INSIDE = 0; - private static final int HIGHEDGE = 1; - private static final int ABOVE = 2; - - /* - * Determine where coord lies with respect to the range from - * low to high. It is assumed that low <= high. The return - * value is one of the 5 values BELOW, LOWEDGE, INSIDE, HIGHEDGE, - * or ABOVE. - */ - private static int getTag(double coord, double low, double high) { - if (coord <= low) { - return (coord < low ? BELOW : LOWEDGE); - } - if (coord >= high) { - return (coord > high ? ABOVE : HIGHEDGE); - } - return INSIDE; - } - - /* - * Determine if the pttag represents a coordinate that is already - * in its test range, or is on the border with either of the two - * opttags representing another coordinate that is "towards the - * inside" of that test range. In other words, are either of the - * two "opt" points "drawing the pt inward"? - */ - private static boolean inwards(int pttag, int opt1tag, int opt2tag) { - switch (pttag) { - case BELOW: - case ABOVE: - default: - return false; - case LOWEDGE: - return (opt1tag >= INSIDE || opt2tag >= INSIDE); - case INSIDE: - return true; - case HIGHEDGE: - return (opt1tag <= INSIDE || opt2tag <= INSIDE); - } - } - /** * {@inheritDoc} * @since 1.2 diff --git a/jdk/test/java/awt/geom/CubicCurve2D/ContainsTest.java b/jdk/test/java/awt/geom/CubicCurve2D/ContainsTest.java new file mode 100644 index 00000000000..05243717104 --- /dev/null +++ b/jdk/test/java/awt/geom/CubicCurve2D/ContainsTest.java @@ -0,0 +1,46 @@ +/* + * 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 4724552 + * @summary Verifies that CubicCurve2D.contains(Rectangle2D) does not return + * true when the rectangle is only partially contained. + * @run main ContainsTest + */ + + +import java.awt.geom.CubicCurve2D; +import java.awt.geom.Rectangle2D; + +public class ContainsTest { + + public static void main(String[] args) throws Exception { + CubicCurve2D c = new CubicCurve2D.Double(0, 0, 4, -4, -2, -4, 2, 0); + Rectangle2D r = new Rectangle2D.Double(0.75, -2.5, 0.5, 2); + + if (c.contains(r)) { + throw new Exception("The rectangle should not be contained in the curve"); + } + } +} diff --git a/jdk/test/java/awt/geom/CubicCurve2D/IntersectsTest.java b/jdk/test/java/awt/geom/CubicCurve2D/IntersectsTest.java new file mode 100644 index 00000000000..35a12dc5e5c --- /dev/null +++ b/jdk/test/java/awt/geom/CubicCurve2D/IntersectsTest.java @@ -0,0 +1,48 @@ +/* + * 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 4493128 + * @summary Verifies that CubicCurve2D returns true for obvious intersection + * @run main IntersectsTest + */ + +import java.awt.geom.CubicCurve2D; +import java.awt.geom.Rectangle2D; + +public class IntersectsTest { + + public static void main(String[] args) throws Exception { + CubicCurve2D c = new CubicCurve2D.Double(50.0, 300.0, + 150.0, 166.6666717529297, + 238.0, 456.66668701171875, + 350.0, 300.0); + Rectangle2D r = new Rectangle2D.Double(260, 300, 10, 10); + + if (!c.intersects(r)) { + throw new Exception("The rectangle is contained. " + + "intersects(Rectangle2D) should return true"); + } + } +} diff --git a/jdk/test/java/awt/geom/CubicCurve2D/SolveCubicTest.java b/jdk/test/java/awt/geom/CubicCurve2D/SolveCubicTest.java new file mode 100644 index 00000000000..f142d30909e --- /dev/null +++ b/jdk/test/java/awt/geom/CubicCurve2D/SolveCubicTest.java @@ -0,0 +1,43 @@ +/* + * 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 4645692 + * @summary Verifies that SolveCubic doesn't miss any roots. + * @run main SolveCubicTest + */ + +import static java.awt.geom.CubicCurve2D.solveCubic; + +public class SolveCubicTest { + + public static void main(String[] args) throws Exception { + + double[] eqn = {0, 0, 1, 1}; + int numRoots = solveCubic(eqn, eqn); + if (numRoots < 2) { + throw new Exception("There are 2 roots. Only " + numRoots + " were found."); + } + } +} From 2f37110eca5f1916e33782ae97df619f55eed1a9 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Fri, 28 Jan 2011 09:28:43 +0000 Subject: [PATCH 12/84] 7006126: (fs) Updates to file system API (1/2011) Reviewed-by: chegar, sherman --- jdk/make/java/java/FILES_java.gmk | 1 - jdk/make/java/nio/FILES_java.gmk | 7 +- jdk/make/mkdemo/Makefile | 2 +- .../share/classes/java/io/BufferedReader.java | 3 + .../share/classes/java/io/BufferedWriter.java | 1 + jdk/src/share/classes/java/io/File.java | 190 +- .../classes/java/io/FileInputStream.java | 1 + .../classes/java/io/FileOutputStream.java | 1 + .../share/classes/java/io/FilePermission.java | 2 +- .../java/io/SerialCallbackContext.java | 2 - .../java/nio/channels/FileChannel.java | 22 +- .../nio/channels/SeekableByteChannel.java | 2 +- .../classes/java/nio/file/AccessMode.java | 2 - .../classes/java/nio/file/CopyMoveHelper.java | 158 + .../classes/java/nio/file/CopyOption.java | 8 +- .../java/nio/file/DirectoryStream.java | 14 +- .../share/classes/java/nio/file/FileRef.java | 322 -- .../classes/java/nio/file/FileStore.java | 60 +- .../classes/java/nio/file/FileSystem.java | 51 +- .../classes/java/nio/file/FileSystems.java | 42 +- .../classes/java/nio/file/FileTreeWalker.java | 20 +- .../classes/java/nio/file/FileVisitor.java | 21 +- .../share/classes/java/nio/file/Files.java | 2953 ++++++++++++++++- .../classes/java/nio/file/LinkOption.java | 4 +- .../classes/java/nio/file/LinkPermission.java | 4 +- .../classes/java/nio/file/OpenOption.java | 4 +- jdk/src/share/classes/java/nio/file/Path.java | 1319 ++------ .../classes/java/nio/file/PathMatcher.java | 2 +- .../share/classes/java/nio/file/Paths.java | 29 +- .../java/nio/file/SecureDirectoryStream.java | 46 +- .../java/{io => nio/file}/TempFileHelper.java | 110 +- .../classes/java/nio/file/WatchEvent.java | 13 +- .../share/classes/java/nio/file/WatchKey.java | 30 +- .../classes/java/nio/file/WatchService.java | 16 +- .../java/nio/file/attribute/AclEntry.java | 9 +- .../file/attribute/AclFileAttributeView.java | 14 +- .../java/nio/file/attribute/Attributes.java | 460 --- .../attribute/BasicFileAttributeView.java | 22 +- .../file/attribute/BasicFileAttributes.java | 37 +- .../file/attribute/DosFileAttributeView.java | 4 +- .../nio/file/attribute/DosFileAttributes.java | 10 +- .../nio/file/attribute/FileAttribute.java | 4 +- .../nio/file/attribute/FileAttributeView.java | 2 +- .../attribute/FileOwnerAttributeView.java | 4 +- .../FileStoreSpaceAttributeView.java | 83 - .../attribute/FileStoreSpaceAttributes.java | 66 - .../java/nio/file/attribute/FileTime.java | 186 +- .../attribute/PosixFileAttributeView.java | 22 +- .../file/attribute/PosixFileAttributes.java | 2 - .../file/attribute/PosixFilePermission.java | 6 +- .../file/attribute/PosixFilePermissions.java | 6 +- .../UserDefinedFileAttributeView.java | 12 +- .../java/nio/file/attribute/package-info.java | 11 +- .../classes/java/nio/file/package-info.java | 17 +- .../java/nio/file/spi/FileSystemProvider.java | 749 ++++- .../java/nio/file/spi/FileTypeDetector.java | 10 +- jdk/src/share/classes/java/util/Scanner.java | 17 +- .../nio/fs/AbstractAclFileAttributeView.java | 13 +- .../fs/AbstractBasicFileAttributeView.java | 30 +- .../nio/fs/AbstractFileSystemProvider.java | 107 + .../sun/nio/fs/AbstractFileTypeDetector.java | 6 +- .../classes/sun/nio/fs/AbstractPath.java | 392 +-- .../classes/sun/nio/fs/AbstractPoller.java | 4 +- .../AbstractUserDefinedFileAttributeView.java | 9 +- .../classes/sun/nio/fs/AbstractWatchKey.java | 17 +- .../sun/nio/fs/AbstractWatchService.java | 8 +- .../sun/nio/fs/DynamicFileAttributeView.java | 7 +- .../nio/fs/FileOwnerAttributeViewImpl.java | 11 +- .../sun/nio/fs/PollingWatchService.java | 60 +- .../sun/security/provider/SeedGenerator.java | 110 +- jdk/src/share/classes/sun/tools/jar/Main.java | 9 +- jdk/src/share/sample/nio/file/AclEdit.java | 2 +- jdk/src/share/sample/nio/file/Chmod.java | 17 +- jdk/src/share/sample/nio/file/Copy.java | 31 +- jdk/src/share/sample/nio/file/DiskUsage.java | 10 +- jdk/src/share/sample/nio/file/FileType.java | 5 +- jdk/src/share/sample/nio/file/WatchDir.java | 4 +- jdk/src/share/sample/nio/file/Xdd.java | 6 +- .../sun/nio/fs/GnomeFileTypeDetector.java | 4 +- .../sun/nio/fs/LinuxDosFileAttributeView.java | 15 +- .../classes/sun/nio/fs/LinuxFileSystem.java | 37 +- .../sun/nio/fs/LinuxFileSystemProvider.java | 58 + .../fs/LinuxUserDefinedFileAttributeView.java | 2 +- .../classes/sun/nio/fs/LinuxWatchService.java | 6 +- .../nio/fs/SolarisAclFileAttributeView.java | 6 +- .../classes/sun/nio/fs/SolarisFileSystem.java | 36 +- .../sun/nio/fs/SolarisFileSystemProvider.java | 41 + .../SolarisUserDefinedFileAttributeView.java | 2 +- .../sun/nio/fs/SolarisWatchService.java | 20 +- .../classes/sun/nio/fs/UnixCopyFile.java | 14 +- .../sun/nio/fs/UnixFileAttributeViews.java | 36 +- .../sun/nio/fs/UnixFileAttributes.java | 4 +- .../classes/sun/nio/fs/UnixFileStore.java | 95 +- .../classes/sun/nio/fs/UnixFileSystem.java | 112 +- .../sun/nio/fs/UnixFileSystemProvider.java | 379 ++- .../solaris/classes/sun/nio/fs/UnixPath.java | 464 +-- .../sun/nio/fs/UnixSecureDirectoryStream.java | 26 +- .../sun/nio/fs/RegistryFileTypeDetector.java | 4 +- .../sun/nio/fs/WindowsFileAttributeViews.java | 18 +- .../classes/sun/nio/fs/WindowsFileCopy.java | 4 +- .../classes/sun/nio/fs/WindowsFileStore.java | 87 +- .../classes/sun/nio/fs/WindowsFileSystem.java | 59 +- .../sun/nio/fs/WindowsFileSystemProvider.java | 515 ++- .../classes/sun/nio/fs/WindowsPath.java | 584 +--- .../classes/sun/nio/fs/WindowsPathParser.java | 4 +- .../sun/nio/fs/WindowsSecurityDescriptor.java | 6 +- .../WindowsUserDefinedFileAttributeView.java | 10 +- .../sun/nio/fs/WindowsWatchService.java | 9 +- jdk/test/demo/zipfs/basic.sh | 1 + jdk/test/java/io/File/IsHidden.java | 3 +- jdk/test/java/io/File/SetAccess.java | 3 +- jdk/test/java/io/File/SymLinks.java | 36 +- .../FileInputStream/LargeFileAvailable.java | 3 +- .../channels/FileChannel/AtomicAppend.java | 3 +- .../nio/channels/FileChannel/Transfer.java | 2 +- .../java/nio/file/DirectoryStream/Basic.java | 50 +- .../nio/file/DirectoryStream/DriveLetter.java | 6 +- .../nio/file/DirectoryStream/SecureDS.java | 64 +- jdk/test/java/nio/file/FileStore/Basic.java | 43 +- .../java/nio/file/Files/BytesAndLines.java | 252 ++ .../{Path => Files}/CheckPermissions.java | 302 +- .../nio/file/{Path => Files}/CopyAndMove.java | 600 ++-- .../file/{Path => Files}/DeleteOnClose.java | 29 +- .../file/{Path => Files}/FileAttributes.java | 161 +- .../file/{Path => Files}/InterruptCopy.java | 15 +- .../java/nio/file/{Path => Files}/Links.java | 74 +- jdk/test/java/nio/file/Files/Misc.java | 397 ++- .../PassThroughFileSystem.java | 419 ++- .../java/nio/file/{Path => Files}/SBC.java | 163 +- .../java/nio/file/Files/TemporaryFiles.java | 171 + .../file/{Path => Files}/delete_on_close.sh | 0 .../Basic.java} | 21 +- .../{ => probeContentType}/ForceLoad.java | 0 .../java.nio.file.spi.FileTypeDetector | 0 .../SimpleFileTypeDetector.java | 15 +- .../{ => walkFileTree}/CreateFileTree.java | 21 +- .../Files/{ => walkFileTree}/MaxDepth.java | 2 +- .../nio/file/Files/walkFileTree/Nulls.java | 99 + .../{ => walkFileTree}/PrintFileTree.java | 10 +- .../{ => walkFileTree}/SkipSiblings.java | 0 .../{ => walkFileTree}/TerminateWalk.java | 0 .../{ => walkFileTree}/WalkWithSecurity.java | 9 +- .../Files/{ => walkFileTree}/denyAll.policy | 0 .../Files/{ => walkFileTree}/grantAll.policy | 0 .../{ => walkFileTree}/grantTopOnly.policy | 0 .../{ => walkFileTree}/walk_file_tree.sh | 0 jdk/test/java/nio/file/Path/Misc.java | 308 +- jdk/test/java/nio/file/Path/PathOps.java | 305 +- .../java/nio/file/Path/TemporaryFiles.java | 98 - jdk/test/java/nio/file/TestUtil.java | 23 +- .../java/nio/file/WatchService/Basic.java | 55 +- .../file/WatchService/FileTreeModifier.java | 23 +- .../nio/file/WatchService/LotsOfEvents.java | 30 +- .../WatchService/SensitivityModifier.java | 12 +- .../attribute/AclFileAttributeView/Basic.java | 29 +- .../BasicFileAttributeView/Basic.java | 19 +- .../attribute/DosFileAttributeView/Basic.java | 46 +- .../FileStoreAttributeView/Basic.java | 135 - .../nio/file/attribute/FileTime/Basic.java | 57 +- .../PosixFileAttributeView/Basic.java | 78 +- .../UserDefinedFileAttributeView/Basic.java | 58 +- .../java/nio/file/spi/SetDefaultProvider.java | 3 +- jdk/test/java/nio/file/spi/TestProvider.java | 123 +- 163 files changed, 8680 insertions(+), 6426 deletions(-) create mode 100644 jdk/src/share/classes/java/nio/file/CopyMoveHelper.java delete mode 100644 jdk/src/share/classes/java/nio/file/FileRef.java rename jdk/src/share/classes/java/{io => nio/file}/TempFileHelper.java (56%) delete mode 100644 jdk/src/share/classes/java/nio/file/attribute/Attributes.java delete mode 100644 jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java delete mode 100644 jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributes.java create mode 100644 jdk/src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java create mode 100644 jdk/test/java/nio/file/Files/BytesAndLines.java rename jdk/test/java/nio/file/{Path => Files}/CheckPermissions.java (70%) rename jdk/test/java/nio/file/{Path => Files}/CopyAndMove.java (63%) rename jdk/test/java/nio/file/{Path => Files}/DeleteOnClose.java (73%) rename jdk/test/java/nio/file/{Path => Files}/FileAttributes.java (51%) rename jdk/test/java/nio/file/{Path => Files}/InterruptCopy.java (90%) rename jdk/test/java/nio/file/{Path => Files}/Links.java (72%) rename jdk/test/java/nio/file/{Path => Files}/PassThroughFileSystem.java (74%) rename jdk/test/java/nio/file/{Path => Files}/SBC.java (74%) create mode 100644 jdk/test/java/nio/file/Files/TemporaryFiles.java rename jdk/test/java/nio/file/{Path => Files}/delete_on_close.sh (100%) rename jdk/test/java/nio/file/Files/{ContentType.java => probeContentType/Basic.java} (85%) rename jdk/test/java/nio/file/Files/{ => probeContentType}/ForceLoad.java (100%) rename jdk/test/java/nio/file/Files/{ => probeContentType}/META-INF/services/java.nio.file.spi.FileTypeDetector (100%) rename jdk/test/java/nio/file/Files/{ => probeContentType}/SimpleFileTypeDetector.java (81%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/CreateFileTree.java (81%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/MaxDepth.java (96%) create mode 100644 jdk/test/java/nio/file/Files/walkFileTree/Nulls.java rename jdk/test/java/nio/file/Files/{ => walkFileTree}/PrintFileTree.java (89%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/SkipSiblings.java (100%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/TerminateWalk.java (100%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/WalkWithSecurity.java (94%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/denyAll.policy (100%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/grantAll.policy (100%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/grantTopOnly.policy (100%) rename jdk/test/java/nio/file/Files/{ => walkFileTree}/walk_file_tree.sh (100%) delete mode 100644 jdk/test/java/nio/file/Path/TemporaryFiles.java delete mode 100644 jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java diff --git a/jdk/make/java/java/FILES_java.gmk b/jdk/make/java/java/FILES_java.gmk index 47179069c17..fdd4b551912 100644 --- a/jdk/make/java/java/FILES_java.gmk +++ b/jdk/make/java/java/FILES_java.gmk @@ -443,7 +443,6 @@ JAVA_JAVA_java = \ java/io/FileReader.java \ java/io/PipedReader.java \ java/io/StringReader.java \ - java/io/TempFileHelper.java \ java/io/Writer.java \ java/io/BufferedWriter.java \ java/io/PrintWriter.java \ diff --git a/jdk/make/java/nio/FILES_java.gmk b/jdk/make/java/nio/FILES_java.gmk index cb416fe0932..9fbeafb48a3 100644 --- a/jdk/make/java/nio/FILES_java.gmk +++ b/jdk/make/java/nio/FILES_java.gmk @@ -81,12 +81,12 @@ FILES_src = \ java/nio/file/ClosedDirectoryStreamException.java \ java/nio/file/ClosedFileSystemException.java \ java/nio/file/ClosedWatchServiceException.java \ + java/nio/file/CopyMoveHelper.java \ java/nio/file/CopyOption.java \ java/nio/file/DirectoryIteratorException.java \ java/nio/file/DirectoryNotEmptyException.java \ java/nio/file/DirectoryStream.java \ java/nio/file/FileAlreadyExistsException.java \ - java/nio/file/FileRef.java \ java/nio/file/FileStore.java \ java/nio/file/FileSystem.java \ java/nio/file/FileSystemAlreadyExistsException.java \ @@ -116,6 +116,7 @@ FILES_src = \ java/nio/file/StandardCopyOption.java \ java/nio/file/StandardOpenOption.java \ java/nio/file/StandardWatchEventKind.java \ + java/nio/file/TempFileHelper.java \ java/nio/file/WatchEvent.java \ java/nio/file/WatchKey.java \ java/nio/file/WatchService.java \ @@ -127,7 +128,6 @@ FILES_src = \ java/nio/file/attribute/AclEntryType.java \ java/nio/file/attribute/AclFileAttributeView.java \ java/nio/file/attribute/AttributeView.java \ - java/nio/file/attribute/Attributes.java \ java/nio/file/attribute/BasicFileAttributeView.java \ java/nio/file/attribute/BasicFileAttributes.java \ java/nio/file/attribute/DosFileAttributeView.java \ @@ -136,8 +136,6 @@ FILES_src = \ java/nio/file/attribute/FileAttributeView.java \ java/nio/file/attribute/FileOwnerAttributeView.java \ java/nio/file/attribute/FileStoreAttributeView.java \ - java/nio/file/attribute/FileStoreSpaceAttributeView.java \ - java/nio/file/attribute/FileStoreSpaceAttributes.java \ java/nio/file/attribute/FileTime.java \ java/nio/file/attribute/GroupPrincipal.java \ java/nio/file/attribute/UserDefinedFileAttributeView.java \ @@ -246,6 +244,7 @@ FILES_src = \ sun/nio/fs/AbstractAclFileAttributeView.java \ sun/nio/fs/AbstractBasicFileAttributeView.java \ sun/nio/fs/AbstractFileTypeDetector.java \ + sun/nio/fs/AbstractFileSystemProvider.java \ sun/nio/fs/AbstractPath.java \ sun/nio/fs/AbstractPoller.java \ sun/nio/fs/AbstractUserDefinedFileAttributeView.java \ diff --git a/jdk/make/mkdemo/Makefile b/jdk/make/mkdemo/Makefile index 1e1739467cc..bb29498d5a7 100644 --- a/jdk/make/mkdemo/Makefile +++ b/jdk/make/mkdemo/Makefile @@ -31,7 +31,7 @@ BUILDDIR = .. PRODUCT = demos include $(BUILDDIR)/common/Defs.gmk -SUBDIRS = jni nio +SUBDIRS = jni SUBDIRS_desktop = applets jfc SUBDIRS_management = management SUBDIRS_misc = scripting diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java index b12eaa0d0b5..e8583e046f0 100644 --- a/jdk/src/share/classes/java/io/BufferedReader.java +++ b/jdk/src/share/classes/java/io/BufferedReader.java @@ -54,6 +54,7 @@ package java.io; * * @see FileReader * @see InputStreamReader + * @see java.nio.file.Files#newBufferedReader * * @author Mark Reinhold * @since JDK1.1 @@ -374,6 +375,8 @@ public class BufferedReader extends Reader { * stream has been reached * * @exception IOException If an I/O error occurs + * + * @see java.nio.file.Files#readAllLines */ public String readLine() throws IOException { return readLine(false); diff --git a/jdk/src/share/classes/java/io/BufferedWriter.java b/jdk/src/share/classes/java/io/BufferedWriter.java index 457c73f512d..4322683d367 100644 --- a/jdk/src/share/classes/java/io/BufferedWriter.java +++ b/jdk/src/share/classes/java/io/BufferedWriter.java @@ -57,6 +57,7 @@ package java.io; * @see PrintWriter * @see FileWriter * @see OutputStreamWriter + * @see java.nio.file.Files#newBufferedWriter * * @author Mark Reinhold * @since JDK1.1 diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java index 1ff3e936bae..cde70d0b977 100644 --- a/jdk/src/share/classes/java/io/File.java +++ b/jdk/src/share/classes/java/io/File.java @@ -35,8 +35,7 @@ import java.util.ArrayList; import java.security.AccessController; import java.security.SecureRandom; import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.FileAttribute; +import java.nio.file.FileSystems; import sun.security.action.GetPropertyAction; /** @@ -139,9 +138,10 @@ import sun.security.action.GetPropertyAction; * many of the limitations of the {@code java.io.File} class. * The {@link #toPath toPath} method may be used to obtain a {@link * Path} that uses the abstract path represented by a {@code File} object to - * locate a file. The resulting {@code Path} provides more efficient and - * extensive access to file attributes, additional file operations, and I/O - * exceptions to help diagnose errors when an operation on a file fails. + * locate a file. The resulting {@code Path} may be used with the {@link + * java.nio.file.Files} class to provide more efficient and extensive access to + * additional file operations, file attributes, and I/O exceptions to help + * diagnose errors when an operation on a file fails. * * @author unascribed * @since JDK1.0 @@ -778,6 +778,12 @@ public class File * Tests whether the file denoted by this abstract pathname is a * directory. * + *

Where it is required to distinguish an I/O exception from the case + * that the file is not a directory, or where several attributes of the + * same file are required at the same time, then the {@link + * java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) + * Files.readAttributes} method may be used. + * * @return true if and only if the file denoted by this * abstract pathname exists and is a directory; * false otherwise @@ -786,8 +792,6 @@ public class File * If a security manager exists and its {@link * java.lang.SecurityManager#checkRead(java.lang.String)} * method denies read access to the file - * - * @see java.nio.file.attribute.Attributes#readBasicFileAttributes */ public boolean isDirectory() { SecurityManager security = System.getSecurityManager(); @@ -804,6 +808,12 @@ public class File * addition, satisfies other system-dependent criteria. Any non-directory * file created by a Java application is guaranteed to be a normal file. * + *

Where it is required to distinguish an I/O exception from the case + * that the file is not a normal file, or where several attributes of the + * same file are required at the same time, then the {@link + * java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) + * Files.readAttributes} method may be used. + * * @return true if and only if the file denoted by this * abstract pathname exists and is a normal file; * false otherwise @@ -812,8 +822,6 @@ public class File * If a security manager exists and its {@link * java.lang.SecurityManager#checkRead(java.lang.String)} * method denies read access to the file - * - * @see java.nio.file.attribute.Attributes#readBasicFileAttributes */ public boolean isFile() { SecurityManager security = System.getSecurityManager(); @@ -853,6 +861,13 @@ public class File * Returns the time that the file denoted by this abstract pathname was * last modified. * + *

Where it is required to distinguish an I/O exception from the case + * where {@code 0L} is returned, or where several attributes of the + * same file are required at the same time, or where the time of last + * access or the creation time are required, then the {@link + * java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) + * Files.readAttributes} method may be used. + * * @return A long value representing the time the file was * last modified, measured in milliseconds since the epoch * (00:00:00 GMT, January 1, 1970), or 0L if the @@ -862,8 +877,6 @@ public class File * If a security manager exists and its {@link * java.lang.SecurityManager#checkRead(java.lang.String)} * method denies read access to the file - * - * @see java.nio.file.attribute.Attributes#readBasicFileAttributes */ public long lastModified() { SecurityManager security = System.getSecurityManager(); @@ -877,6 +890,12 @@ public class File * Returns the length of the file denoted by this abstract pathname. * The return value is unspecified if this pathname denotes a directory. * + *

Where it is required to distinguish an I/O exception from the case + * that {@code 0L} is returned, or where several attributes of the same file + * are required at the same time, then the {@link + * java.nio.file.Files#readAttributes(Path,Class,LinkOption[]) + * Files.readAttributes} method may be used. + * * @return The length, in bytes, of the file denoted by this abstract * pathname, or 0L if the file does not exist. Some * operating systems may return 0L for pathnames @@ -886,8 +905,6 @@ public class File * If a security manager exists and its {@link * java.lang.SecurityManager#checkRead(java.lang.String)} * method denies read access to the file - * - * @see java.nio.file.attribute.Attributes#readBasicFileAttributes */ public long length() { SecurityManager security = System.getSecurityManager(); @@ -937,11 +954,10 @@ public class File * this pathname denotes a directory, then the directory must be empty in * order to be deleted. * - *

Note that the {@link Path} class defines the {@link Path#delete - * delete} method to throw an {@link IOException} when a file cannot be - * deleted. This is useful for error reporting and to diagnose why a file - * cannot be deleted. The {@link #toPath toPath} method may be used to - * obtain a {@code Path} representing this abstract pathname. + *

Note that the {@link java.nio.file.Files} class defines the {@link + * java.nio.file.Files#delete(Path) delete} method to throw an {@link IOException} + * when a file cannot be deleted. This is useful for error reporting and to + * diagnose why a file cannot be deleted. * * @return true if and only if the file or directory is * successfully deleted; false otherwise @@ -1009,12 +1025,11 @@ public class File * will appear in any specific order; they are not, in particular, * guaranteed to appear in alphabetical order. * - *

Note that the {@link Path} class defines the {@link - * Path#newDirectoryStream newDirectoryStream} method to open a directory - * and iterate over the names of the files in the directory. This may use - * less resources when working with very large directories. The {@link - * #toPath toPath} method may be used to obtain a {@code Path} representing - * this abstract pathname. + *

Note that the {@link java.nio.file.Files} class defines the {@link + * java.nio.file.Files#newDirectoryStream(Path) newDirectoryStream} method to + * open a directory and iterate over the names of the files in the directory. + * This may use less resources when working with very large directories, and + * may be more responsive when working with remote directories. * * @return An array of strings naming the files and directories in the * directory denoted by this abstract pathname. The array will be @@ -1061,6 +1076,8 @@ public class File * If a security manager exists and its {@link * SecurityManager#checkRead(String)} method denies read access to * the directory + * + * @see java.nio.file.Files#newDirectoryStream(Path,String) */ public String[] list(FilenameFilter filter) { String names[] = list(); @@ -1095,12 +1112,11 @@ public class File * will appear in any specific order; they are not, in particular, * guaranteed to appear in alphabetical order. * - *

Note that the {@link Path} class defines the {@link - * Path#newDirectoryStream newDirectoryStream} method to open a directory - * and iterate over the names of the files in the directory. This may use - * less resources when working with very large directories. The {@link - * #toPath toPath} method may be used to obtain a {@code Path} representing - * this abstract pathname. + *

Note that the {@link java.nio.file.Files} class defines the {@link + * java.nio.file.Files#newDirectoryStream(Path) newDirectoryStream} method + * to open a directory and iterate over the names of the files in the + * directory. This may use less resources when working with very large + * directories. * * @return An array of abstract pathnames denoting the files and * directories in the directory denoted by this abstract pathname. @@ -1154,6 +1170,7 @@ public class File * the directory * * @since 1.2 + * @see java.nio.file.Files#newDirectoryStream(Path,String) */ public File[] listFiles(FilenameFilter filter) { String ss[] = list(); @@ -1191,6 +1208,7 @@ public class File * the directory * * @since 1.2 + * @see java.nio.file.Files#newDirectoryStream(Path,java.nio.file.DirectoryStream.Filter) */ public File[] listFiles(FileFilter filter) { String ss[] = list(); @@ -1207,12 +1225,6 @@ public class File /** * Creates the directory named by this abstract pathname. * - *

Note that the {@link Path} class defines the {@link Path#createDirectory - * createDirectory} method to throw an {@link IOException} when a directory - * cannot be created. This is useful for error reporting and to diagnose why - * a directory cannot be created. The {@link #toPath toPath} method may be - * used to obtain a {@code Path} representing this abstract pathname. - * * @return true if and only if the directory was * created; false otherwise * @@ -1278,10 +1290,9 @@ public class File * already exists. The return value should always be checked to make sure * that the rename operation was successful. * - *

Note that the {@link Path} class defines the {@link Path#moveTo - * moveTo} method to move or rename a file in a platform independent manner. - * The {@link #toPath toPath} method may be used to obtain a {@code Path} - * representing this abstract pathname. + *

Note that the {@link java.nio.file.Files} class defines the {@link + * java.nio.file.Files#move move} method to move or rename a file in a + * platform independent manner. * * @param dest The new abstract pathname for the named file * @@ -1369,10 +1380,9 @@ public class File * Sets the owner's or everybody's write permission for this abstract * pathname. * - *

The {@link java.nio.file.attribute.Attributes Attributes} class - * defines methods that operate on file attributes including file - * permissions. This may be used when finer manipulation of file permissions - * is required. + *

The {@link java.nio.file.Files} class defines methods that operate on + * file attributes including file permissions. This may be used when finer + * manipulation of file permissions is required. * * @param writable * If true, sets the access permission to allow write @@ -1437,10 +1447,9 @@ public class File * Sets the owner's or everybody's read permission for this abstract * pathname. * - *

The {@link java.nio.file.attribute.Attributes Attributes} class - * defines methods that operate on file attributes including file - * permissions. This may be used when finer manipulation of file permissions - * is required. + *

The {@link java.nio.file.Files} class defines methods that operate on + * file attributes including file permissions. This may be used when finer + * manipulation of file permissions is required. * * @param readable * If true, sets the access permission to allow read @@ -1511,10 +1520,9 @@ public class File * Sets the owner's or everybody's execute permission for this abstract * pathname. * - *

The {@link java.nio.file.attribute.Attributes Attributes} class - * defines methods that operate on file attributes including file - * permissions. This may be used when finer manipulation of file permissions - * is required. + *

The {@link java.nio.file.Files} class defines methods that operate on + * file attributes including file permissions. This may be used when finer + * manipulation of file permissions is required. * * @param executable * If true, sets the access permission to allow execute @@ -1646,6 +1654,7 @@ public class File * filesystem roots. * * @since 1.2 + * @see java.nio.file.FileStore */ public static File[] listRoots() { return fs.listRoots(); @@ -1753,7 +1762,7 @@ public class File /* -- Temporary files -- */ - static class TempDirectory { + private static class TempDirectory { private TempDirectory() { } // temporary directory location @@ -1880,11 +1889,12 @@ public class File * java.lang.String, java.io.File) * createTempFile(prefix, suffix, null)}. * - *

The {@link #createTemporaryFile(String,String,FileAttribute[])} method - * provides an alternative method to create an empty file in the - * temporary-file directory. Files created by that method may have more - * restrictive access permissions to files created by this method and so - * may be more suited to security-sensitive applications. + *

The {@link + * java.nio.file.Files#createTempFile(String,String,java.nio.file.attribute.FileAttribute[]) + * Files.createTempFile} method provides an alternative method to create an + * empty file in the temporary-file directory. Files created by that method + * may have more restrictive access permissions to files created by this + * method and so may be more suited to security-sensitive applications. * * @param prefix The prefix string to be used in generating the file's * name; must be at least three characters long @@ -1907,6 +1917,7 @@ public class File * method does not allow a file to be created * * @since 1.2 + * @see java.nio.file.Files#createTempDirectory(String,FileAttribute[]) */ public static File createTempFile(String prefix, String suffix) throws IOException @@ -1914,61 +1925,6 @@ public class File return createTempFile(prefix, suffix, null); } - /** - * Creates an empty file in the default temporary-file directory, using - * the given prefix and suffix to generate its name. - * - *

The {@code attrs} parameter is an optional array of {@link FileAttribute - * attributes} to set atomically when creating the file. Each attribute is - * identified by its {@link FileAttribute#name name}. If more than one attribute - * of the same name is included in the array then all but the last occurrence - * is ignored. - * - *

Where the {@code attrs} parameter does not specify access - * permissions to set atomically when creating the file, then the - * resulting file may have more restrictive access permissions than files - * created by the {@link #createTempFile(java.lang.String, java.lang.String)} - * method. - * - * @param prefix - * The prefix string to be used in generating the file's - * name; must be at least three characters long - * @param suffix - * The suffix string to be used in generating the file's - * name; may be {@code null}, in which case the suffix - * {@code ".tmp"} will be used - * @param attrs - * An optional list of file attributes to set atomically when creating - * the file - * - * @return An abstract pathname denoting a newly-created empty file - * - * @throws IllegalArgumentException - * If the {@code prefix} argument contains fewer than three - * characters - * @throws UnsupportedOperationException - * If the array contains an attribute that cannot be set atomically - * when creating the file - * @throws IOException - * If a file could not be created - * @throws SecurityException - * If a security manager exists and its {@link - * java.lang.SecurityManager#checkWrite(java.lang.String)} - * method does not allow a file to be created. - * - * @since 1.7 - */ - public static File createTemporaryFile(String prefix, - String suffix, - FileAttribute... attrs) - throws IOException - { - if (prefix.length() < 3) - throw new IllegalArgumentException("Prefix string too short"); - suffix = (suffix == null) ? ".tmp" : suffix; - return TempFileHelper.createFile(prefix, suffix, attrs); - } - /* -- Basic infrastructure -- */ /** @@ -2104,6 +2060,7 @@ public class File * path (see {@link java.nio.file.FileSystem#getPath FileSystem.getPath}) * * @since 1.7 + * @see Path#toFile */ public Path toPath() { Path result = filePath; @@ -2111,12 +2068,7 @@ public class File synchronized (this) { result = filePath; if (result == null) { - if (path.length() == 0) { - // assume default file system treats "." as current directory - result = Paths.get("."); - } else { - result = Paths.get(path); - } + result = FileSystems.getDefault().getPath(path); filePath = result; } } diff --git a/jdk/src/share/classes/java/io/FileInputStream.java b/jdk/src/share/classes/java/io/FileInputStream.java index 23530c19e1f..da7ad18a532 100644 --- a/jdk/src/share/classes/java/io/FileInputStream.java +++ b/jdk/src/share/classes/java/io/FileInputStream.java @@ -42,6 +42,7 @@ import sun.nio.ch.FileChannelImpl; * @see java.io.File * @see java.io.FileDescriptor * @see java.io.FileOutputStream + * @see java.nio.file.Files#newInputStream * @since JDK1.0 */ public diff --git a/jdk/src/share/classes/java/io/FileOutputStream.java b/jdk/src/share/classes/java/io/FileOutputStream.java index 3fe3a594fd2..d714679164a 100644 --- a/jdk/src/share/classes/java/io/FileOutputStream.java +++ b/jdk/src/share/classes/java/io/FileOutputStream.java @@ -46,6 +46,7 @@ import sun.nio.ch.FileChannelImpl; * @see java.io.File * @see java.io.FileDescriptor * @see java.io.FileInputStream + * @see java.nio.file.Files#newOutputStream * @since JDK1.0 */ public diff --git a/jdk/src/share/classes/java/io/FilePermission.java b/jdk/src/share/classes/java/io/FilePermission.java index 06b4f3bb267..b5feb367e13 100644 --- a/jdk/src/share/classes/java/io/FilePermission.java +++ b/jdk/src/share/classes/java/io/FilePermission.java @@ -72,7 +72,7 @@ import sun.security.util.SecurityConstants; *

readlink *
read link permission. Allows the target of a * symbolic link - * to be read by invoking the {@link java.nio.file.Path#readSymbolicLink + * to be read by invoking the {@link java.nio.file.Files#readSymbolicLink * readSymbolicLink } method. * *

diff --git a/jdk/src/share/classes/java/io/SerialCallbackContext.java b/jdk/src/share/classes/java/io/SerialCallbackContext.java index 90d022e53ea..f62bdbf9a3e 100644 --- a/jdk/src/share/classes/java/io/SerialCallbackContext.java +++ b/jdk/src/share/classes/java/io/SerialCallbackContext.java @@ -54,5 +54,3 @@ thread = null; } } - - diff --git a/jdk/src/share/classes/java/nio/channels/FileChannel.java b/jdk/src/share/classes/java/nio/channels/FileChannel.java index 8dff4bfc316..80961dd3f8e 100644 --- a/jdk/src/share/classes/java/nio/channels/FileChannel.java +++ b/jdk/src/share/classes/java/nio/channels/FileChannel.java @@ -248,7 +248,7 @@ public abstract class FileChannel * FileSystemProvider#newFileChannel newFileChannel} method on the * provider that created the {@code Path}. * - * @param file + * @param path * The path of the file to open or create * @param options * Options specifying how the file is opened @@ -261,7 +261,7 @@ public abstract class FileChannel * @throws IllegalArgumentException * If the set contains an invalid combination of options * @throws UnsupportedOperationException - * If the {@code file} is associated with a provider that does not + * If the {@code path} is associated with a provider that does not * support creating file channels, or an unsupported open option is * specified, or the array contains an attribute that cannot be set * atomically when creating the file @@ -278,13 +278,13 @@ public abstract class FileChannel * * @since 1.7 */ - public static FileChannel open(Path file, + public static FileChannel open(Path path, Set options, FileAttribute... attrs) throws IOException { - FileSystemProvider provider = file.getFileSystem().provider(); - return provider.newFileChannel(file, options, attrs); + FileSystemProvider provider = path.getFileSystem().provider(); + return provider.newFileChannel(path, options, attrs); } private static final FileAttribute[] NO_ATTRIBUTES = new FileAttribute[0]; @@ -295,10 +295,12 @@ public abstract class FileChannel *

An invocation of this method behaves in exactly the same way as the * invocation *

-     *     fc.{@link #open(Path,Set,FileAttribute[]) open}(file, options, new FileAttribute<?>[0]);
+     *     fc.{@link #open(Path,Set,FileAttribute[]) open}(file, opts, new FileAttribute<?>[0]);
      * 
+ * where {@code opts} is a set of the options specified in the {@code + * options} array. * - * @param file + * @param path * The path of the file to open or create * @param options * Options specifying how the file is opened @@ -308,7 +310,7 @@ public abstract class FileChannel * @throws IllegalArgumentException * If the set contains an invalid combination of options * @throws UnsupportedOperationException - * If the {@code file} is associated with a provider that does not + * If the {@code path} is associated with a provider that does not * support creating file channels, or an unsupported open option is * specified * @throws IOException @@ -324,12 +326,12 @@ public abstract class FileChannel * * @since 1.7 */ - public static FileChannel open(Path file, OpenOption... options) + public static FileChannel open(Path path, OpenOption... options) throws IOException { Set set = new HashSet(options.length); Collections.addAll(set, options); - return open(file, set, NO_ATTRIBUTES); + return open(path, set, NO_ATTRIBUTES); } // -- Channel operations -- diff --git a/jdk/src/share/classes/java/nio/channels/SeekableByteChannel.java b/jdk/src/share/classes/java/nio/channels/SeekableByteChannel.java index 4e75723b261..c2378546370 100644 --- a/jdk/src/share/classes/java/nio/channels/SeekableByteChannel.java +++ b/jdk/src/share/classes/java/nio/channels/SeekableByteChannel.java @@ -47,7 +47,7 @@ import java.io.IOException; * so that method invocations on the implementation class can be chained. * * @since 1.7 - * @see java.nio.file.Path#newByteChannel + * @see java.nio.file.Files#newByteChannel */ public interface SeekableByteChannel diff --git a/jdk/src/share/classes/java/nio/file/AccessMode.java b/jdk/src/share/classes/java/nio/file/AccessMode.java index c040bec01c8..43b06c25a64 100644 --- a/jdk/src/share/classes/java/nio/file/AccessMode.java +++ b/jdk/src/share/classes/java/nio/file/AccessMode.java @@ -29,8 +29,6 @@ package java.nio.file; * Defines access modes used to test the accessibility of a file. * * @since 1.7 - * - * @see Path#checkAccess */ public enum AccessMode { diff --git a/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java b/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java new file mode 100644 index 00000000000..70ca6ee50ad --- /dev/null +++ b/jdk/src/share/classes/java/nio/file/CopyMoveHelper.java @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package java.nio.file; + +import java.nio.file.attribute.*; +import java.io.InputStream; +import java.io.IOException; + +/** + * Helper class to support copying or moving files when the source and target + * are associated with different providers. + */ + +class CopyMoveHelper { + private CopyMoveHelper() { } + + /** + * Parses the arguments for a file copy operation. + */ + private static class CopyOptions { + boolean replaceExisting = false; + boolean copyAttributes = false; + boolean followLinks = true; + + private CopyOptions() { } + + static CopyOptions parse(CopyOption... options) { + CopyOptions result = new CopyOptions(); + for (CopyOption option: options) { + if (option == StandardCopyOption.REPLACE_EXISTING) { + result.replaceExisting = true; + continue; + } + if (option == LinkOption.NOFOLLOW_LINKS) { + result.followLinks = false; + continue; + } + if (option == StandardCopyOption.COPY_ATTRIBUTES) { + result.copyAttributes = true; + continue; + } + if (option == null) + throw new NullPointerException(); + throw new UnsupportedOperationException("'" + option + + "' is not a recognized copy option"); + } + return result; + } + } + + /** + * Converts the given array of options for moving a file to options suitable + * for copying the file when a move is implemented as copy + delete. + */ + private static CopyOption[] convertMoveToCopyOptions(CopyOption... options) + throws AtomicMoveNotSupportedException + { + int len = options.length; + CopyOption[] newOptions = new CopyOption[len+2]; + for (int i=0; i Objects of this type may be used with the {@link Path#copyTo copyTo} and - * {@link Path#moveTo moveTo} methods to configure how a file is copied or moved. + *

Objects of this type may be used with the {@link + * Files#copy(Path,Path,CopyOption[]) Files.copy(Path,Path,CopyOption...)}, + * {@link Files#copy(java.io.InputStream,Path,CopyOption[]) + * Files.copy(InputStream,Path,CopyOption...)} and {@link Files#move + * Files.move(Path,Path,CopyOption...)} methods to configure how a file is + * copied or moved. * *

The {@link StandardCopyOption} enumeration type defines the * standard options. diff --git a/jdk/src/share/classes/java/nio/file/DirectoryStream.java b/jdk/src/share/classes/java/nio/file/DirectoryStream.java index 5601c9d99a8..d34f8dbd450 100644 --- a/jdk/src/share/classes/java/nio/file/DirectoryStream.java +++ b/jdk/src/share/classes/java/nio/file/DirectoryStream.java @@ -54,7 +54,7 @@ import java.io.IOException; * construct to ensure that the stream is closed: *

  *   Path dir = ...
- *   try (DirectoryStream<Path> stream = dir.newDirectoryStream()) {
+ *   try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
  *       for (Path entry: stream) {
  *           ...
  *       }
@@ -97,8 +97,8 @@ import java.io.IOException;
  * both the for-each and try-with-resources constructs.
  * 
  *   List<Path> listSourceFiles(Path dir) throws IOException {
- *       List<Path> result = new ArrayList<Path>();
- *       try (DirectoryStream<Path> stream = dir.newDirectoryStream("*.{c,h,cpp,hpp,java}")) {
+ *       List<Path> result = new ArrayList<>();
+ *       try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.{c,h,cpp,hpp,java}")) {
  *           for (Path entry: stream) {
  *               result.add(entry);
  *           }
@@ -113,7 +113,7 @@ import java.io.IOException;
  *
  * @since 1.7
  *
- * @see Path#newDirectoryStream
+ * @see Files#newDirectoryStream(Path)
  */
 
 public interface DirectoryStream
@@ -122,9 +122,9 @@ public interface DirectoryStream
     /**
      * An interface that is implemented by objects that decide if a directory
      * entry should be accepted or filtered. A {@code Filter} is passed as the
-     * parameter to the {@link Path#newDirectoryStream(DirectoryStream.Filter)
-     * newDirectoryStream} method when opening a directory to iterate over the
-     * entries in the directory.
+     * parameter to the {@link Files#newDirectoryStream(Path,DirectoryStream.Filter)}
+     * method when opening a directory to iterate over the entries in the
+     * directory.
      *
      * @param        the type of the directory entry
      *
diff --git a/jdk/src/share/classes/java/nio/file/FileRef.java b/jdk/src/share/classes/java/nio/file/FileRef.java
deleted file mode 100644
index fea3b7c3dfe..00000000000
--- a/jdk/src/share/classes/java/nio/file/FileRef.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*
- * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package java.nio.file;
-
-import java.nio.file.attribute.*;
-import java.util.Map;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.IOException;
-
-/**
- * A reference to a file.
- *
- * 

A {@code FileRef} is an object that locates a file and defines methods to - * open the file for reading or writing. It also provides access to associated - * metadata or file attributes. - * - * @since 1.7 - * @see java.nio.file.attribute.Attributes - * @see java.io.File#toPath - */ - -public interface FileRef { - - /** - * Opens the file referenced by this object, returning an input stream to - * read from the file. The stream will not be buffered, and is not required - * to support the {@link InputStream#mark mark} or {@link InputStream#reset - * reset} methods. The stream will be safe for access by multiple concurrent - * threads. Reading commences at the beginning of the file. - * - *

The {@code options} parameter determines how the file is opened. - * If no options are present then it is equivalent to opening the file with - * the {@link StandardOpenOption#READ READ} option. In addition to the {@code - * READ} option, an implementation may also support additional implementation - * specific options. - * - * @return an input stream to read bytes from the file - * - * @throws IllegalArgumentException - * if an invalid combination of options is specified - * @throws UnsupportedOperationException - * if an unsupported option is specified - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the file. - */ - InputStream newInputStream(OpenOption... options) throws IOException; - - /** - * Opens or creates the file located by this object for writing, returning - * an output stream to write bytes to the file. - * - *

The {@code options} parameter determines how the file is opened. - * If no options are present then this method creates a new file for writing - * or truncates an existing file. In addition to the {@link StandardOpenOption - * standard} options, an implementation may also support additional - * implementation specific options. - * - *

The resulting stream will not be buffered. The stream will be safe - * for access by multiple concurrent threads. - * - * @param options - * options specifying how the file is opened - * - * @return a new output stream - * - * @throws IllegalArgumentException - * if {@code options} contains an invalid combination of options - * @throws UnsupportedOperationException - * if an unsupported option is specified - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the file. - */ - OutputStream newOutputStream(OpenOption... options) throws IOException; - - /** - * Returns a file attribute view of a given type. - * - *

A file attribute view provides a read-only or updatable view of a - * set of file attributes. This method is intended to be used where the file - * attribute view defines type-safe methods to read or update the file - * attributes. The {@code type} parameter is the type of the attribute view - * required and the method returns an instance of that type if supported. - * The {@link BasicFileAttributeView} type supports access to the basic - * attributes of a file. Invoking this method to select a file attribute - * view of that type will always return an instance of that class. - * - *

The {@code options} array may be used to indicate how symbolic links - * are handled by the resulting file attribute view for the case that the - * file is a symbolic link. By default, symbolic links are followed. If the - * option {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} is present then - * symbolic links are not followed. This option is ignored by implementations - * that do not support symbolic links. - * - * @param type - * the {@code Class} object corresponding to the file attribute view - * @param options - * options indicating how symbolic links are handled - * - * @return a file attribute view of the specified type, or {@code null} if - * the attribute view type is not available - * - * @throws UnsupportedOperationException - * If options contains an unsupported option. This exception is - * specified to allow the {@code LinkOption} enum be extended - * in future releases. - * - * @see Attributes#readBasicFileAttributes - */ - V getFileAttributeView(Class type, - LinkOption... options); - - /** - * Sets the value of a file attribute. - * - *

The {@code attribute} parameter identifies the attribute to be set - * and takes the form: - *

- * [view-name:]attribute-name - *
- * where square brackets [...] delineate an optional component and the - * character {@code ':'} stands for itself. - * - *

view-name is the {@link FileAttributeView#name name} of a {@link - * FileAttributeView} that identifies a set of file attributes. If not - * specified then it defaults to {@code "basic"}, the name of the file - * attribute view that identifies the basic set of file attributes common to - * many file systems. attribute-name is the name of the attribute - * within the set. - * - *

Usage Example: - * Suppose we want to set the DOS "hidden" attribute: - *

-     *    file.setAttribute("dos:hidden", true);
-     * 
- * - * @param attribute - * the attribute to set - * @param value - * the attribute value - * @param options - * options indicating how symbolic links are handled - * - * @throws UnsupportedOperationException - * if the attribute view is not available or it does not support - * updating the attribute - * @throws IllegalArgumentException - * if the attribute value is of the correct type but has an - * inappropriate value - * @throws ClassCastException - * If the attribute value is not of the expected type or is a - * collection containing elements that are not of the expected - * type - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, its {@link SecurityManager#checkWrite(String) checkWrite} - * method denies write access to the file. If this method is invoked - * to set security sensitive attributes then the security manager - * may be invoked to check for additional permissions. - */ - void setAttribute(String attribute, Object value, LinkOption... options) - throws IOException; - - /** - * Reads the value of a file attribute. - * - *

The {@code attribute} parameter identifies the attribute to be read - * and takes the form: - *

- * [view-name:]attribute-name - *
- * where square brackets [...] delineate an optional component and the - * character {@code ':'} stands for itself. - * - *

view-name is the {@link FileAttributeView#name name} of a {@link - * FileAttributeView} that identifies a set of file attributes. If not - * specified then it defaults to {@code "basic"}, the name of the file - * attribute view that identifies the basic set of file attributes common to - * many file systems. attribute-name is the name of the attribute. - * - *

The {@code options} array may be used to indicate how symbolic links - * are handled for the case that the file is a symbolic link. By default, - * symbolic links are followed and the file attribute of the final target - * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS - * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attribute of the symbolic link. - * - *

Usage Example: - * Suppose we require the user ID of the file owner on a system that - * supports a "{@code unix}" view: - *

-     *    int uid = (Integer)file.getAttribute("unix:uid");
-     * 
- * - * @param attribute - * the attribute to read - * @param options - * options indicating how symbolic links are handled - * @return the attribute value or {@code null} if the attribute view - * is not available or it does not support reading the attribute - * - * reading the attribute - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, its {@link SecurityManager#checkRead(String) checkRead} - * method denies read access to the file. If this method is invoked - * to read security sensitive attributes then the security manager - * may be invoked to check for additional permissions. - */ - Object getAttribute(String attribute, LinkOption... options) throws IOException; - - /** - * Reads a set of file attributes as a bulk operation. - * - *

The {@code attributes} parameter identifies the attributes to be read - * and takes the form: - *

- * [view-name:]attribute-list - *
- * where square brackets [...] delineate an optional component and the - * character {@code ':'} stands for itself. - * - *

view-name is the {@link FileAttributeView#name name} of a {@link - * FileAttributeView} that identifies a set of file attributes. If not - * specified then it defaults to {@code "basic"}, the name of the file - * attribute view that identifies the basic set of file attributes common to - * many file systems. - * - *

The attribute-list component is a comma separated list of - * zero or more names of attributes to read. If the list contains the value - * {@code "*"} then all attributes are read. Attributes that are not supported - * are ignored and will not be present in the returned map. It is - * implementation specific if all attributes are read as an atomic operation - * with respect to other file system operations. - * - *

The following examples demonstrate possible values for the {@code - * attributes} parameter: - * - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
{@code "*"} Read all {@link BasicFileAttributes basic-file-attributes}.
{@code "size,lastModifiedTime,lastAccessTime"} Reads the file size, last modified time, and last access time - * attributes.
{@code "posix:*"} Read all {@link PosixFileAttributes POSIX-file-attributes}..
{@code "posix:permissions,owner,size"} Reads the POSX file permissions, owner, and file size.
- *
- * - *

The {@code options} array may be used to indicate how symbolic links - * are handled for the case that the file is a symbolic link. By default, - * symbolic links are followed and the file attribute of the final target - * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS - * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attribute of the symbolic link. - * - * @param attributes - * The attributes to read - * @param options - * Options indicating how symbolic links are handled - * - * @return A map of the attributes returned; may be empty. The map's keys - * are the attribute names, its values are the attribute values - * - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, its {@link SecurityManager#checkRead(String) checkRead} - * method denies read access to the file. If this method is invoked - * to read security sensitive attributes then the security manager - * may be invoke to check for additional permissions. - */ - Map readAttributes(String attributes, LinkOption... options) - throws IOException; -} diff --git a/jdk/src/share/classes/java/nio/file/FileStore.java b/jdk/src/share/classes/java/nio/file/FileStore.java index 4a79cccdff5..4284a8ad5e9 100644 --- a/jdk/src/share/classes/java/nio/file/FileStore.java +++ b/jdk/src/share/classes/java/nio/file/FileStore.java @@ -32,16 +32,13 @@ import java.io.IOException; * Storage for files. A {@code FileStore} represents a storage pool, device, * partition, volume, concrete file system or other implementation specific means * of file storage. The {@code FileStore} for where a file is stored is obtained - * by invoking the {@link Path#getFileStore getFileStore} method, or all file + * by invoking the {@link Files#getFileStore getFileStore} method, or all file * stores can be enumerated by invoking the {@link FileSystem#getFileStores * getFileStores} method. * *

In addition to the methods defined by this class, a file store may support * one or more {@link FileStoreAttributeView FileStoreAttributeView} classes * that provide a read-only or updatable view of a set of file store attributes. - * File stores associated with the default provider support the {@link - * FileStoreSpaceAttributeView} to read the space related attributes of the - * file store. * * @since 1.7 */ @@ -86,6 +83,51 @@ public abstract class FileStore { */ public abstract boolean isReadOnly(); + /** + * Returns the size, in bytes, of the file store. + * + * @return the size of the file store, in bytes + * + * @throws IOException + * if an I/O error occurs + */ + public abstract long getTotalSpace() throws IOException; + + /** + * Returns the number of bytes available to this Java virtual machine on the + * file store. + * + *

The returned number of available bytes is a hint, but not a + * guarantee, that it is possible to use most or any of these bytes. The + * number of usable bytes is most likely to be accurate immediately + * after the space attributes are obtained. It is likely to be made inaccurate + * by any external I/O operations including those made on the system outside + * of this Java virtual machine. + * + * @return the number of bytes available + * + * @throws IOException + * if an I/O error occurs + */ + public abstract long getUsableSpace() throws IOException; + + /** + * Returns the number of unallocated bytes in the file store. + * + *

The returned number of unallocated bytes is a hint, but not a + * guarantee, that it is possible to use most or any of these bytes. The + * number of unallocated bytes is most likely to be accurate immediately + * after the space attributes are obtained. It is likely to be + * made inaccurate by any external I/O operations including those made on + * the system outside of this virtual machine. + * + * @return the number of unallocated bytes + * + * @throws IOException + * if an I/O error occurs + */ + public abstract long getUnallocatedSpace() throws IOException; + /** * Tells whether or not this file store supports the file attributes * identified by the given file attribute view. @@ -131,12 +173,6 @@ public abstract class FileStore { * The {@code type} parameter is the type of the attribute view required and * the method returns an instance of that type if supported. * - *

For {@code FileStore} objects created by the default provider, then - * the file stores support the {@link FileStoreSpaceAttributeView} that - * provides access to space attributes. In that case invoking this method - * with a parameter value of {@code FileStoreSpaceAttributeView.class} will - * always return an instance of that class. - * * @param type * the {@code Class} object corresponding to the attribute view * @@ -160,10 +196,6 @@ public abstract class FileStore { * a {@link FileStore AttributeView} that identifies a set of file attributes. * attribute-name is the name of the attribute. * - *

For {@code FileStore} objects created by the default provider, then - * the file stores support the {@link FileStoreSpaceAttributeView} that - * provides access to space attributes. - * *

Usage Example: * Suppose we want to know if ZFS compression is enabled (assuming the "zfs" * view is supported): diff --git a/jdk/src/share/classes/java/nio/file/FileSystem.java b/jdk/src/share/classes/java/nio/file/FileSystem.java index 8c7637a3947..15b6ca2cd0f 100644 --- a/jdk/src/share/classes/java/nio/file/FileSystem.java +++ b/jdk/src/share/classes/java/nio/file/FileSystem.java @@ -38,8 +38,8 @@ import java.io.IOException; *

The default file system, obtained by invoking the {@link FileSystems#getDefault * FileSystems.getDefault} method, provides access to the file system that is * accessible to the Java virtual machine. The {@link FileSystems} class defines - * methods to create file systems that provide access to other types of file - * systems. + * methods to create file systems that provide access to other types of (custom) + * file systems. * *

A file system is the factory for several types of objects: * @@ -214,10 +214,9 @@ public abstract class FileSystem * Suppose we want to print the space usage for all file stores: *

      *     for (FileStore store: FileSystems.getDefault().getFileStores()) {
-     *         FileStoreSpaceAttributes attrs = Attributes.readFileStoreSpaceAttributes(store);
-     *         long total = attrs.totalSpace() / 1024;
-     *         long used = (attrs.totalSpace() - attrs.unallocatedSpace()) / 1024;
-     *         long avail = attrs.usableSpace() / 1024;
+     *         long total = store.getTotalSpace() / 1024;
+     *         long used = (store.getTotalSpace() - store.getUnallocatedSpace()) / 1024;
+     *         long avail = store.getUsableSpace() / 1024;
      *         System.out.format("%-20s %12d %12d %12d%n", store, total, used, avail);
      *     }
      * 
@@ -244,7 +243,20 @@ public abstract class FileSystem public abstract Set supportedFileAttributeViews(); /** - * Converts a path string to a {@code Path}. + * Converts a path string, or a sequence of strings that when joined form + * a path string, to a {@code Path}. If {@code more} does not specify any + * elements then the value of the {@code first} parameter is the path string + * to convert. If {@code more} specifies one or more elements then each + * non-empty string, including {@code first}, is considered to be a sequence + * of name elements (see {@link Path}) and is joined to form a path string. + * The details as to how the Strings are joined is provider specific but + * typically they will be joined using the {@link #getSeparator + * name-separator} as the separator. For example, if the name separator is + * "{@code /}" and {@code getPath("/foo","bar","gus")} is invoked, then the + * path string {@code "/foo/bar/gus"} is converted to a {@code Path}. + * A {@code Path} representing an empty path is returned if {@code first} + * is the empty string and {@code more} does not contain any non-empty + * strings. * *

The parsing and conversion to a path object is inherently * implementation dependent. In the simplest case, the path string is rejected, @@ -270,18 +282,17 @@ public abstract class FileSystem * index} value indicating the first position in the {@code path} parameter * that caused the path string to be rejected. * - *

Invoking this method with an empty path string throws - * {@code InvalidPathException}. + * @param first + * the path string or initial part of the path string + * @param more + * additional strings to be joined to form the path string * - * @param path - * The path string - * - * @return A {@code Path} object + * @return the resulting {@code Path} * * @throws InvalidPathException * If the path string cannot be converted */ - public abstract Path getPath(String path); + public abstract Path getPath(String first, String... more); /** * Returns a {@code PathMatcher} that performs match operations on the @@ -290,9 +301,9 @@ public abstract class FileSystem * * The {@code syntaxAndPattern} parameter identifies the syntax and the * pattern and takes the form: - *

+ *
      * syntax:pattern
-     * 
+ *
* where {@code ':'} stands for itself. * *

A {@code FileSystem} implementation supports the "{@code glob}" and @@ -409,7 +420,7 @@ public abstract class FileSystem * @throws UnsupportedOperationException * If the pattern syntax is not known to the implementation * - * @see Path#newDirectoryStream(String) + * @see Files#newDirectoryStream(Path,String) */ public abstract PathMatcher getPathMatcher(String syntaxAndPattern); @@ -421,10 +432,8 @@ public abstract class FileSystem *

Usage Example: * Suppose we want to make "joe" the owner of a file: *

-     *     Path file = ...
-     *     UserPrincipal joe = file.getFileSystem().getUserPrincipalLookupService()
-     *         .lookupPrincipalByName("joe");
-     *     Attributes.setOwner(file, joe);
+     *     UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService();
+     *     Files.setOwner(path, lookupService.lookupPrincipalByName("joe"));
      * 
* * @throws UnsupportedOperationException diff --git a/jdk/src/share/classes/java/nio/file/FileSystems.java b/jdk/src/share/classes/java/nio/file/FileSystems.java index 3fc348b09f4..3d7ab7a20f1 100644 --- a/jdk/src/share/classes/java/nio/file/FileSystems.java +++ b/jdk/src/share/classes/java/nio/file/FileSystems.java @@ -164,8 +164,8 @@ public final class FileSystems { * to the first provider instance. The third provider class is instantiated * by invoking it with a reference to the second instance, and so on. The * last provider to be instantiated becomes the default provider; its {@code - * getFileSystem} method is invoked with the URI {@code "file:///"} to create - * the default file system. + * getFileSystem} method is invoked with the URI {@code "file:///"} to + * get a reference to the default file system. * *

Subsequent invocations of this method return the file system that was * returned by the first invocation. @@ -238,7 +238,7 @@ public final class FileSystems { * Suppose there is a provider identified by the scheme {@code "memory"} * installed: *

-     *   Map<String,String> env = new HashMap<String,String>();
+     *   Map<String,String> env = new HashMap<>();
      *   env.put("capacity", "16G");
      *   env.put("blockSize", "4k");
      *   FileSystem fs = FileSystems.newFileSystem(URI.create("memory:///?name=logfs"), env);
@@ -343,33 +343,25 @@ public final class FileSystems {
      *
      * 

This method makes use of specialized providers that create pseudo file * systems where the contents of one or more files is treated as a file - * system. The {@code file} parameter is a reference to an existing file - * and the {@code env} parameter is a map of provider specific properties to - * configure the file system. + * system. * *

This method iterates over the {@link FileSystemProvider#installedProviders() * installed} providers. It invokes, in turn, each provider's {@link - * FileSystemProvider#newFileSystem(FileRef,Map) newFileSystem(FileRef,Map)} method. - * If a provider returns a file system then the iteration terminates - * and the file system is returned. If none of the installed providers return - * a {@code FileSystem} then an attempt is made to locate the provider using - * the given class loader. If a provider returns a file system then the lookup - * terminates and the file system is returned. + * FileSystemProvider#newFileSystem(Path,Map) newFileSystem(Path,Map)} method + * with an empty map. If a provider returns a file system then the iteration + * terminates and the file system is returned. If none of the installed + * providers return a {@code FileSystem} then an attempt is made to locate + * the provider using the given class loader. If a provider returns a file + * system then the lookup terminates and the file system is returned. * - * @param file - * a reference to a file - * @param env - * a map of provider specific properties to configure the file system; - * may be empty + * @param path + * the path to the file * @param loader * the class loader to locate the provider or {@code null} to only * attempt to locate an installed provider * * @return a new file system * - * @throws IllegalArgumentException - * if the {@code env} parameter does not contain properties required - * by the provider, or a property value is invalid * @throws ProviderNotFoundException * if a provider supporting this file type cannot be located * @throws ServiceConfigurationError @@ -380,18 +372,18 @@ public final class FileSystems { * if a security manager is installed and it denies an unspecified * permission */ - public static FileSystem newFileSystem(FileRef file, - Map env, + public static FileSystem newFileSystem(Path path, ClassLoader loader) throws IOException { - if (file == null) + if (path == null) throw new NullPointerException(); + Map env = Collections.emptyMap(); // check installed providers for (FileSystemProvider provider: FileSystemProvider.installedProviders()) { try { - return provider.newFileSystem(file, env); + return provider.newFileSystem(path, env); } catch (UnsupportedOperationException uoe) { } } @@ -402,7 +394,7 @@ public final class FileSystems { .load(FileSystemProvider.class, loader); for (FileSystemProvider provider: sl) { try { - return provider.newFileSystem(file, env); + return provider.newFileSystem(path, env); } catch (UnsupportedOperationException uoe) { } } diff --git a/jdk/src/share/classes/java/nio/file/FileTreeWalker.java b/jdk/src/share/classes/java/nio/file/FileTreeWalker.java index b3f422e6ac0..fb3995315cc 100644 --- a/jdk/src/share/classes/java/nio/file/FileTreeWalker.java +++ b/jdk/src/share/classes/java/nio/file/FileTreeWalker.java @@ -69,7 +69,8 @@ class FileTreeWalker { FileVisitResult result = walk(start, 0, new ArrayList()); - Objects.nonNull(result, "FileVisitor returned null"); + if (result == null) + throw new NullPointerException("FileVisitor returned null"); } /** @@ -102,12 +103,13 @@ class FileTreeWalker { if (attrs == null) { try { try { - attrs = Attributes.readBasicFileAttributes(file, linkOptions); + attrs = Files.readAttributes(file, BasicFileAttributes.class, linkOptions); } catch (IOException x1) { if (followLinks) { try { - attrs = Attributes - .readBasicFileAttributes(file, LinkOption.NOFOLLOW_LINKS); + attrs = Files.readAttributes(file, + BasicFileAttributes.class, + LinkOption.NOFOLLOW_LINKS); } catch (IOException x2) { exc = x2; } @@ -151,7 +153,7 @@ class FileTreeWalker { } else { boolean isSameFile = false; try { - isSameFile = file.isSameFile(ancestor.file()); + isSameFile = Files.isSameFile(file, ancestor.file()); } catch (IOException x) { // ignore } catch (SecurityException x) { @@ -175,7 +177,7 @@ class FileTreeWalker { // open the directory try { - stream = file.newDirectoryStream(); + stream = Files.newDirectoryStream(file); } catch (IOException x) { return visitor.visitFileFailed(file, x); } catch (SecurityException x) { @@ -212,7 +214,11 @@ class FileTreeWalker { } finally { try { stream.close(); - } catch (IOException x) { } + } catch (IOException e) { + // IOException will be notified to postVisitDirectory + if (ioe == null) + ioe = e; + } } // invoke postVisitDirectory last diff --git a/jdk/src/share/classes/java/nio/file/FileVisitor.java b/jdk/src/share/classes/java/nio/file/FileVisitor.java index bd6bac15d59..3c507a8d443 100644 --- a/jdk/src/share/classes/java/nio/file/FileVisitor.java +++ b/jdk/src/share/classes/java/nio/file/FileVisitor.java @@ -30,8 +30,8 @@ import java.io.IOException; /** * A visitor of files. An implementation of this interface is provided to the - * {@link Files#walkFileTree walkFileTree} utility method to visit each file - * in a tree. + * {@link Files#walkFileTree Files.walkFileTree} methods to visit each file in + * a file tree. * *

Usage Examples: * Suppose we want to delete a file tree. In that case, each directory should @@ -43,19 +43,20 @@ import java.io.IOException; * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) * throws IOException * { - * file.delete(); + * Files.delete(file); * return FileVisitResult.CONTINUE; * } * @Override * public FileVisitResult postVisitDirectory(Path dir, IOException e) * throws IOException * { - * if (e != null) { + * if (e == null) { + * Files.delete(dir); + * return FileVisitResult.CONTINUE; + * } else { * // directory iteration failed * throw e; * } - * dir.delete(); - * return FileVisitResult.CONTINUE; * } * }); *

@@ -72,10 +73,12 @@ import java.io.IOException; * public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) * throws IOException * { + * Path targetdir = target.resolve(source.relativize(dir)); * try { - * dir.copyTo(target.resolve(source.relativize(dir))); + * Files.copy(dir, targetdir); * } catch (FileAlreadyExistsException e) { - * // ignore + * if (!Files.isDirectory(targetdir)) + * throw e; * } * return CONTINUE; * } @@ -83,7 +86,7 @@ import java.io.IOException; * public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) * throws IOException * { - * file.copyTo(target.resolve(source.relativize(file))); + * Files.copy(file, target.resolve(source.relativize(file))); * return CONTINUE; * } * }); diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java index a0f00855b74..cb1fde29685 100644 --- a/jdk/src/share/classes/java/nio/file/Files.java +++ b/jdk/src/share/classes/java/nio/file/Files.java @@ -25,16 +25,32 @@ package java.nio.file; -import java.nio.file.spi.FileTypeDetector; import java.nio.file.attribute.*; +import java.nio.file.spi.FileSystemProvider; +import java.nio.file.spi.FileTypeDetector; +import java.nio.channels.SeekableByteChannel; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Reader; +import java.io.Writer; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import java.io.IOException; import java.util.*; import java.security.AccessController; import java.security.PrivilegedAction; +import java.nio.charset.Charset; +import java.nio.charset.CharsetDecoder; +import java.nio.charset.CharsetEncoder; /** - * This class consists exclusively of static methods that operate on files or - * directories. + * This class consists exclusively of static methods that operate on files, + * directories, or other types of files. + * + *

In most cases, the methods defined here will delegate to the associated + * file system provider to perform the file operations. * * @since 1.7 */ @@ -42,8 +58,1422 @@ import java.security.PrivilegedAction; public final class Files { private Files() { } + /** + * Returns the {@code FileSystemProvider} to delegate to. + */ + private static FileSystemProvider provider(Path path) { + return path.getFileSystem().provider(); + } + + // -- File contents -- + + /** + * Opens a file, returning an input stream to read from the file. The stream + * will not be buffered, and is not required to support the {@link + * InputStream#mark mark} or {@link InputStream#reset reset} methods. The + * stream will be safe for access by multiple concurrent threads. Reading + * commences at the beginning of the file. Whether the returned stream is + * asynchronously closeable and/or interruptible is highly + * file system provider specific and therefore not specified. + * + *

The {@code options} parameter determines how the file is opened. + * If no options are present then it is equivalent to opening the file with + * the {@link StandardOpenOption#READ READ} option. In addition to the {@code + * READ} option, an implementation may also support additional implementation + * specific options. + * + * @param path + * the path to the file to open + * @param options + * options specifying how the file is opened + * + * @return a new input stream + * + * @throws IllegalArgumentException + * if an invalid combination of options is specified + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + */ + public static InputStream newInputStream(Path path, OpenOption... options) + throws IOException + { + return provider(path).newInputStream(path, options); + } + + /** + * Opens or creates a file, returning an output stream that may be used to + * write bytes to the file. The resulting stream will not be buffered. The + * stream will be safe for access by multiple concurrent threads. Whether + * the returned stream is asynchronously closeable and/or + * interruptible is highly file system provider specific and + * therefore not specified. + * + *

This method opens or creates a file in exactly the manner specified + * by the {@link #newByteChannel(Path,Set,FileAttribute[]) newByteChannel} + * method with the exception that the {@link StandardOpenOption#READ READ} + * option may not be present in the array of options. If no options are + * present then this method works as if the {@link StandardOpenOption#CREATE + * CREATE}, {@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, + * and {@link StandardOpenOption#WRITE WRITE} options are present. In other + * words, it opens the file for writing, creating the file if it doesn't + * exist, or initially truncating an existing {@link #isRegularFile + * regular-file} to a size of {@code 0} if it exists. + * + *

Usage Examples: + *

+     *     Path path = ...
+     *
+     *     // replace an existing file or create the file if it doesn't initially exist
+     *     OutputStream out = Files.newOutputStream(path);
+     *
+     *     // append to an existing file, fail if the file does not exist
+     *     out = Files.newOutputStream(path, APPEND);
+     *
+     *     // append to an existing file, create file if it doesn't initially exist
+     *     out = Files.newOutputStream(CREATE, APPEND);
+     *
+     *     // always create new file, failing if it already exists
+     *     out = Files.newOutputStream(CREATE_NEW);
+     * 
+ * + * @param path + * the path to the file to open or create + * @param options + * options specifying how the file is opened + * + * @return a new output stream + * + * @throws IllegalArgumentException + * if {@code options} contains an invalid combination of options + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. + */ + public static OutputStream newOutputStream(Path path, OpenOption... options) + throws IOException + { + return provider(path).newOutputStream(path, options); + } + + /** + * Opens or creates a file, returning a seekable byte channel to access the + * file. + * + *

The {@code options} parameter determines how the file is opened. + * The {@link StandardOpenOption#READ READ} and {@link + * StandardOpenOption#WRITE WRITE} options determine if the file should be + * opened for reading and/or writing. If neither option (or the {@link + * StandardOpenOption#APPEND APPEND} option) is present then the file is + * opened for reading. By default reading or writing commence at the + * beginning of the file. + * + *

In the addition to {@code READ} and {@code WRITE}, the following + * options may be present: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Option Description
{@link StandardOpenOption#APPEND APPEND} If this option is present then the file is opened for writing and + * each invocation of the channel's {@code write} method first advances + * the position to the end of the file and then writes the requested + * data. Whether the advancement of the position and the writing of the + * data are done in a single atomic operation is system-dependent and + * therefore unspecified. This option may not be used in conjunction + * with the {@code READ} or {@code TRUNCATE_EXISTING} options.
{@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} If this option is present then the existing file is truncated to + * a size of 0 bytes. This option is ignored when the file is opened only + * for reading.
{@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if + * the file already exists or is a symbolic link. When creating a file the + * check for the existence of the file and the creation of the file if it + * does not exist is atomic with respect to other file system operations. + * This option is ignored when the file is opened only for reading.
{@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it + * exists, otherwise a new file is created. This option is ignored if the + * {@code CREATE_NEW} option is also present or the file is opened only + * for reading.
{@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a + * best effort attempt to delete the file when closed by the + * {@link SeekableByteChannel#close close} method. If the {@code close} + * method is not invoked then a best effort attempt is made to + * delete the file when the Java virtual machine terminates.
{@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the + * new file will be sparse. This option is ignored when not creating + * a new file.
{@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be + * written synchronously to the underlying storage device. (see Synchronized I/O file + * integrity).
{@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written + * synchronously to the underlying storage device. (see Synchronized I/O file + * integrity).
+ * + *

An implementation may also support additional implementation specific + * options. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * file-attributes} to set atomically when a new file is created. + * + *

In the case of the default provider, the returned seekable byte channel + * is a {@link java.nio.channels.FileChannel}. + * + *

Usage Examples: + *

+     *     Path path = ...
+     *
+     *     // open file for reading
+     *     ReadableByteChannel rbc = Files.newByteChannel(path, EnumSet.of(READ)));
+     *
+     *     // open file for writing to the end of an existing file, creating
+     *     // the file if it doesn't already exist
+     *     WritableByteChannel wbc = Files.newByteChannel(path, EnumSet.of(CREATE,APPEND));
+     *
+     *     // create file with initial permissions, opening it for both reading and writing
+     *     {@code FileAttribute<> perms = ...}
+     *     SeekableByteChannel sbc = Files.newByteChannel(path, EnumSet.of(CREATE_NEW,READ,WRITE), perms);
+     * 
+ * + * @param path + * the path to the file to open or create + * @param options + * options specifying how the file is opened + * @param attrs + * an optional list of file attributes to set atomically when + * creating the file + * + * @return a new seekable byte channel + * + * @throws IllegalArgumentException + * if the set contains an invalid combination of options + * @throws UnsupportedOperationException + * if an unsupported open option is specified or the array contains + * attributes that cannot be set atomically when creating the file + * @throws FileAlreadyExistsException + * if a file of that name already exists and the {@link + * StandardOpenOption#CREATE_NEW CREATE_NEW} option is specified + * (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the path if the file is + * opened for reading. The {@link SecurityManager#checkWrite(String) + * checkWrite} method is invoked to check write access to the path + * if the file is opened for writing. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. + * + * @see java.nio.channels.FileChannel#open(Path,Set,FileAttribute[]) + */ + public static SeekableByteChannel newByteChannel(Path path, + Set options, + FileAttribute... attrs) + throws IOException + { + return provider(path).newByteChannel(path, options, attrs); + } + + /** + * Opens or creates a file, returning a seekable byte channel to access the + * file. + * + *

This method opens or creates a file in exactly the manner specified + * by the {@link #newByteChannel(Path,Set,FileAttribute[]) newByteChannel} + * method. + * + * @param path + * the path to the file to open or create + * @param options + * options specifying how the file is opened + * + * @return a new seekable byte channel + * + * @throws IllegalArgumentException + * if the set contains an invalid combination of options + * @throws UnsupportedOperationException + * if an unsupported open option is specified + * @throws FileAlreadyExistsException + * if a file of that name already exists and the {@link + * StandardOpenOption#CREATE_NEW CREATE_NEW} option is specified + * (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the path if the file is + * opened for reading. The {@link SecurityManager#checkWrite(String) + * checkWrite} method is invoked to check write access to the path + * if the file is opened for writing. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. + * + * @see java.nio.channels.FileChannel#open(Path,OpenOption[]) + */ + public static SeekableByteChannel newByteChannel(Path path, OpenOption... options) + throws IOException + { + Set set = new HashSet(options.length); + Collections.addAll(set, options); + return newByteChannel(path, set); + } + + // -- Directories -- + + /** + * Opens a directory, returning a {@link DirectoryStream} to iterate over + * all entries in the directory. The elements returned by the directory + * stream's {@link DirectoryStream#iterator iterator} are of type {@code + * Path}, each one representing an entry in the directory. The {@code Path} + * objects are obtained as if by {@link Path#resolve(Path) resolving} the + * name of the directory entry against {@code dir}. + * + *

When not using the try-with-resources construct, then directory + * stream's {@code close} method should be invoked after iteration is + * completed so as to free any resources held for the open directory. + * + *

When an implementation supports operations on entries in the + * directory that execute in a race-free manner then the returned directory + * stream is a {@link SecureDirectoryStream}. + * + * @param dir + * the path to the directory + * + * @return a new and open {@code DirectoryStream} object + * + * @throws NotDirectoryException + * if the file could not otherwise be opened because it is not + * a directory (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the directory. + */ + public static DirectoryStream newDirectoryStream(Path dir) + throws IOException + { + return provider(dir).newDirectoryStream(dir, new DirectoryStream.Filter() { + @Override + public boolean accept(Path entry) { + return true; + } + }); + } + + /** + * Opens a directory, returning a {@link DirectoryStream} to iterate over + * the entries in the directory. The elements returned by the directory + * stream's {@link DirectoryStream#iterator iterator} are of type {@code + * Path}, each one representing an entry in the directory. The {@code Path} + * objects are obtained as if by {@link Path#resolve(Path) resolving} the + * name of the directory entry against {@code dir}. The entries returned by + * the iterator are filtered by matching the {@code String} representation + * of their file names against the given globbing pattern. + * + *

For example, suppose we want to iterate over the files ending with + * ".java" in a directory: + *

+     *     Path dir = ...
+     *     try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, "*.java")) {
+     *         :
+     *     }
+     * 
+ * + *

The globbing pattern is specified by the {@link + * FileSystem#getPathMatcher getPathMatcher} method. + * + *

When not using the try-with-resources construct, then directory + * stream's {@code close} method should be invoked after iteration is + * completed so as to free any resources held for the open directory. + * + *

When an implementation supports operations on entries in the + * directory that execute in a race-free manner then the returned directory + * stream is a {@link SecureDirectoryStream}. + * + * @param dir + * the path to the directory + * @param glob + * the glob pattern + * + * @return a new and open {@code DirectoryStream} object + * + * @throws java.util.regex.PatternSyntaxException + * if the pattern is invalid + * @throws NotDirectoryException + * if the file could not otherwise be opened because it is not + * a directory (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the directory. + */ + public static DirectoryStream newDirectoryStream(Path dir, String glob) + throws IOException + { + // avoid creating a matcher if all entries are required. + if (glob.equals("*")) + return newDirectoryStream(dir); + + // create a matcher and return a filter that uses it. + FileSystem fs = dir.getFileSystem(); + final PathMatcher matcher = fs.getPathMatcher("glob:" + glob); + DirectoryStream.Filter filter = new DirectoryStream.Filter() { + @Override + public boolean accept(Path entry) { + return matcher.matches(entry.getFileName()); + } + }; + return fs.provider().newDirectoryStream(dir, filter); + } + + /** + * Opens a directory, returning a {@link DirectoryStream} to iterate over + * the entries in the directory. The elements returned by the directory + * stream's {@link DirectoryStream#iterator iterator} are of type {@code + * Path}, each one representing an entry in the directory. The {@code Path} + * objects are obtained as if by {@link Path#resolve(Path) resolving} the + * name of the directory entry against {@code dir}. The entries returned by + * the iterator are filtered by the given {@link DirectoryStream.Filter + * filter}. + * + *

When not using the try-with-resources construct, then directory + * stream's {@code close} method should be invoked after iteration is + * completed so as to free any resources held for the open directory. + * + *

Where the filter terminates due to an uncaught error or runtime + * exception then it is propagated to the {@link Iterator#hasNext() + * hasNext} or {@link Iterator#next() next} method. Where an {@code + * IOException} is thrown, it results in the {@code hasNext} or {@code + * next} method throwing a {@link DirectoryIteratorException} with the + * {@code IOException} as the cause. + * + *

When an implementation supports operations on entries in the + * directory that execute in a race-free manner then the returned directory + * stream is a {@link SecureDirectoryStream}. + * + *

Usage Example: + * Suppose we want to iterate over the files in a directory that are + * larger than 8K. + *

+     *     DirectoryStream.Filter<Path> filter = new DirectoryStream.Filter<Path>() {
+     *         public boolean accept(Path file) throws IOException {
+     *             return (Files.size(file) > 8192L);
+     *         }
+     *     };
+     *     Path dir = ...
+     *     try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir, filter)) {
+     *         :
+     *     }
+     * 
+ * + * @param dir + * the path to the directory + * @param filter + * the directory stream filter + * + * @return a new and open {@code DirectoryStream} object + * + * @throws NotDirectoryException + * if the file could not otherwise be opened because it is not + * a directory (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the directory. + */ + public static DirectoryStream newDirectoryStream(Path dir, + DirectoryStream.Filter filter) + throws IOException + { + return provider(dir).newDirectoryStream(dir, filter); + } + + // -- Creation and deletion -- + + /** + * Creates a new and empty file, failing if the file already exists. The + * check for the existence of the file and the creation of the new file if + * it does not exist are a single operation that is atomic with respect to + * all other filesystem activities that might affect the directory. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * file-attributes} to set atomically when creating the file. Each attribute + * is identified by its {@link FileAttribute#name name}. If more than one + * attribute of the same name is included in the array then all but the last + * occurrence is ignored. + * + * @param path + * the path to the file to create + * @param attrs + * an optional list of file attributes to set atomically when + * creating the file + * + * @return the file + * + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the file + * @throws FileAlreadyExistsException + * if a file of that name already exists + * (optional specific exception) + * @throws IOException + * if an I/O error occurs or the parent directory does not exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the new file. + */ + public static Path createFile(Path path, FileAttribute... attrs) + throws IOException + { + EnumSet options = + EnumSet.of(StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE); + newByteChannel(path, options, attrs).close(); + return path; + } + + /** + * Creates a new directory. The check for the existence of the file and the + * creation of the directory if it does not exist are a single operation + * that is atomic with respect to all other filesystem activities that might + * affect the directory. The {@link #createDirectories createDirectories} + * method should be used where it is required to create all nonexistent + * parent directories first. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * file-attributes} to set atomically when creating the directory. Each + * attribute is identified by its {@link FileAttribute#name name}. If more + * than one attribute of the same name is included in the array then all but + * the last occurrence is ignored. + * + * @param dir + * the directory to create + * @param attrs + * an optional list of file attributes to set atomically when + * creating the directory + * + * @return the directory + * + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws FileAlreadyExistsException + * if a directory could not otherwise be created because a file of + * that name already exists (optional specific exception) + * @throws IOException + * if an I/O error occurs or the parent directory does not exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the new directory. + */ + public static Path createDirectory(Path dir, FileAttribute... attrs) + throws IOException + { + provider(dir).createDirectory(dir, attrs); + return dir; + } + + /** + * Creates a directory by creating all nonexistent parent directories first. + * Unlike the {@link #createDirectory createDirectory} method, an exception + * is not thrown if the directory could not be created because it already + * exists. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * file-attributes} to set atomically when creating the nonexistent + * directories. Each file attribute is identified by its {@link + * FileAttribute#name name}. If more than one attribute of the same name is + * included in the array then all but the last occurrence is ignored. + * + *

If this method fails, then it may do so after creating some, but not + * all, of the parent directories. + * + * @param dir + * the directory to create + * + * @param attrs + * an optional list of file attributes to set atomically when + * creating the directory + * + * @return the directory + * + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws FileAlreadyExistsException + * if {@code dir} exists but is not a directory (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * in the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked prior to attempting to create a directory and + * its {@link SecurityManager#checkRead(String) checkRead} is + * invoked for each parent directory that is checked. If {@code + * dir} is not an absolute path then its {@link Path#toAbsolutePath + * toAbsolutePath} may need to be invoked to get its absolute path. + * This may invoke the security manager's {@link + * SecurityManager#checkPropertyAccess(String) checkPropertyAccess} + * method to check access to the system property {@code user.dir} + */ + public static Path createDirectories(Path dir, FileAttribute... attrs) + throws IOException + { + // attempt to create the directory + try { + createAndCheckIsDirectory(dir, attrs); + return dir; + } catch (FileAlreadyExistsException x) { + // file exists and is not a directory + throw x; + } catch (IOException x) { + // parent may not exist or other reason + } + SecurityException se = null; + try { + dir = dir.toAbsolutePath(); + } catch (SecurityException x) { + // don't have permission to get absolute path + se = x; + } + // find a decendent that exists + Path parent = dir.getParent(); + while (parent != null) { + try { + provider(parent).checkAccess(parent); + break; + } catch (NoSuchFileException x) { + // does not exist + } + parent = parent.getParent(); + } + if (parent == null) { + // unable to find existing parent + if (se != null) + throw se; + throw new IOException("Root directory does not exist"); + } + + // create directories + Path child = parent; + for (Path name: parent.relativize(dir)) { + child = child.resolve(name); + createAndCheckIsDirectory(child, attrs); + } + return dir; + } + + /** + * Used by createDirectories to attempt to create a directory. A no-op + * if the directory already exists. + */ + private static void createAndCheckIsDirectory(Path dir, + FileAttribute... attrs) + throws IOException + { + try { + createDirectory(dir, attrs); + } catch (FileAlreadyExistsException x) { + if (!isDirectory(dir, LinkOption.NOFOLLOW_LINKS)) + throw x; + } + } + + /** + * Creates a new empty file in the specified directory, using the given + * prefix and suffix strings to generate its name. The resulting + * {@code Path} is associated with the same {@code FileSystem} as the given + * directory. + * + *

The details as to how the name of the file is constructed is + * implementation dependent and therefore not specified. Where possible + * the {@code prefix} and {@code suffix} are used to construct candidate + * names in the same manner as the {@link + * java.io.File#createTempFile(String,String,File)} method. + * + *

As with the {@code File.createTempFile} methods, this method is only + * part of a temporary-file facility. Where used as a work files, + * the resulting file may be opened using the {@link + * StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} option so that the + * file is deleted when the appropriate {@code close} method is invoked. + * Alternatively, a {@link Runtime#addShutdownHook shutdown-hook}, or the + * {@link java.io.File#deleteOnExit} mechanism may be used to delete the + * file automatically. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * file-attributes} to set atomically when creating the file. Each attribute + * is identified by its {@link FileAttribute#name name}. If more than one + * attribute of the same name is included in the array then all but the last + * occurrence is ignored. When no file attributes are specified, then the + * resulting file may have more restrictive access permissions to files + * created by the {@link java.io.File#createTempFile(String,String,File)} + * method. + * + * @param dir + * the path to directory in which to create the file + * @param prefix + * the prefix string to be used in generating the file's name; + * may be {@code null} + * @param suffix + * the suffix string to be used in generating the file's name; + * may be {@code null}, in which case "{@code .tmp}" is used + * @param attrs + * an optional list of file attributes to set atomically when + * creating the file + * + * @return the path to the newly created file that did not exist before + * this method was invoked + * + * @throws IllegalArgumentException + * if the prefix or suffix parameters cannot be used to generate + * a candidate file name + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws IOException + * if an I/O error occurs or {@code dir} does not exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + */ + public static Path createTempFile(Path dir, + String prefix, + String suffix, + FileAttribute... attrs) + throws IOException + { + return TempFileHelper.createTempFile(dir, prefix, suffix, attrs); + } + + /** + * Creates an empty file in the default temporary-file directory, using + * the given prefix and suffix to generate its name. The resulting {@code + * Path} is associated with the default {@code FileSystem}. + * + *

This method works in exactly the manner specified by the + * {@link #createTempFile(Path,String,String,FileAttribute[])} method for + * the case that the {@code dir} parameter is the temporary-file directory. + * + * @param prefix + * the prefix string to be used in generating the file's name; + * may be {@code null} + * @param suffix + * the suffix string to be used in generating the file's name; + * may be {@code null}, in which case "{@code .tmp}" is used + * @param attrs + * an optional list of file attributes to set atomically when + * creating the file + * + * @return the path to the newly created file that did not exist before + * this method was invoked + * + * @throws IllegalArgumentException + * if the prefix or suffix parameters cannot be used to generate + * a candidate file name + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws IOException + * if an I/O error occurs or the temporary-file directory does not + * exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + */ + public static Path createTempFile(String prefix, + String suffix, + FileAttribute... attrs) + throws IOException + { + return TempFileHelper.createTempFile(null, prefix, suffix, attrs); + } + + /** + * Creates a new directory in the specified directory, using the given + * prefix to generate its name. The resulting {@code Path} is associated + * with the same {@code FileSystem} as the given directory. + * + *

The details as to how the name of the directory is constructed is + * implementation dependent and therefore not specified. Where possible + * the {@code prefix} is used to construct candidate names. + * + *

As with the {@code createTempFile} methods, this method is only + * part of a temporary-file facility. A {@link Runtime#addShutdownHook + * shutdown-hook}, or the {@link java.io.File#deleteOnExit} mechanism may be + * used to delete the directory automatically. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * file-attributes} to set atomically when creating the directory. Each + * attribute is identified by its {@link FileAttribute#name name}. If more + * than one attribute of the same name is included in the array then all but + * the last occurrence is ignored. + * + * @param dir + * the path to directory in which to create the directory + * @param prefix + * the prefix string to be used in generating the directory's name; + * may be {@code null} + * @param attrs + * an optional list of file attributes to set atomically when + * creating the directory + * + * @return the path to the newly created directory that did not exist before + * this method was invoked + * + * @throws IllegalArgumentException + * if the prefix cannot be used to generate a candidate directory name + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws IOException + * if an I/O error occurs or {@code dir} does not exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access when creating the + * directory. + */ + public static Path createTempDirectory(Path dir, + String prefix, + FileAttribute... attrs) + throws IOException + { + return TempFileHelper.createTempDirectory(dir, prefix, attrs); + } + + /** + * Creates a new directory in the default temporary-file directory, using + * the given prefix and suffix to generate its name. The resulting {@code + * Path} is associated with the default {@code FileSystem}. + * + *

This method works in exactly the manner specified by {@link + * #createTempDirectory(Path,String,FileAttribute[])} method for the case + * that the {@code dir} parameter is the temporary-file directory. + * + * @param prefix + * the prefix string to be used in generating the directory's name; + * may be {@code null} + * @param attrs + * an optional list of file attributes to set atomically when + * creating the directory + * + * @return the path to the newly created directory that did not exist before + * this method was invoked + * + * @throws IllegalArgumentException + * if the prefix cannot be used to generate a candidate directory name + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws IOException + * if an I/O error occurs or the temporary-file directory does not + * exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access when creating the + * directory. + */ + public static Path createTempDirectory(String prefix, + FileAttribute... attrs) + throws IOException + { + return TempFileHelper.createTempDirectory(null, prefix, attrs); + } + + /** + * Creates a symbolic link to a target (optional operation). + * + *

The {@code target} parameter is the target of the link. It may be an + * {@link Path#isAbsolute absolute} or relative path and may not exist. When + * the target is a relative path then file system operations on the resulting + * link are relative to the path of the link. + * + *

The {@code attrs} parameter is optional {@link FileAttribute + * attributes} to set atomically when creating the link. Each attribute is + * identified by its {@link FileAttribute#name name}. If more than one attribute + * of the same name is included in the array then all but the last occurrence + * is ignored. + * + *

Where symbolic links are supported, but the underlying {@link FileStore} + * does not support symbolic links, then this may fail with an {@link + * IOException}. Additionally, some operating systems may require that the + * Java virtual machine be started with implementation specific privileges to + * create symbolic links, in which case this method may throw {@code IOException}. + * + * @param link + * the path of the symbolic link to create + * @param target + * the target of the symbolic link + * @param attrs + * the array of attributes to set atomically when creating the + * symbolic link + * + * @return the path to the symbolic link + * + * @throws UnsupportedOperationException + * if the implementation does not support symbolic links or the + * array contains an attribute that cannot be set atomically when + * creating the symbolic link + * @throws FileAlreadyExistsException + * if a file with the name already exists (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager + * is installed, it denies {@link LinkPermission}("symbolic") + * or its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to the path of the symbolic link. + */ + public static Path createSymbolicLink(Path link, Path target, + FileAttribute... attrs) + throws IOException + { + provider(link).createSymbolicLink(link, target, attrs); + return link; + } + + /** + * Creates a new link (directory entry) for an existing file (optional + * operation). + * + *

The {@code link} parameter locates the directory entry to create. + * The {@code existing} parameter is the path to an existing file. This + * method creates a new directory entry for the file so that it can be + * accessed using {@code link} as the path. On some file systems this is + * known as creating a "hard link". Whether the file attributes are + * maintained for the file or for each directory entry is file system + * specific and therefore not specified. Typically, a file system requires + * that all links (directory entries) for a file be on the same file system. + * Furthermore, on some platforms, the Java virtual machine may require to + * be started with implementation specific privileges to create hard links + * or to create links to directories. + * + * @param link + * the link (directory entry) to create + * @param existing + * a path to an existing file + * + * @return the path to the link (directory entry) + * + * @throws UnsupportedOperationException + * if the implementation does not support adding an existing file + * to a directory + * @throws FileAlreadyExistsException + * if the entry could not otherwise be created because a file of + * that name already exists (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager + * is installed, it denies {@link LinkPermission}("hard") + * or its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to either the link or the + * existing file. + */ + public static Path createLink(Path link, Path existing) throws IOException { + provider(link).createLink(link, existing); + return link; + } + + /** + * Deletes a file. + * + *

An implementation may require to examine the file to determine if the + * file is a directory. Consequently this method may not be atomic with respect + * to other file system operations. If the file is a symbolic link then the + * symbolic link itself, not the final target of the link, is deleted. + * + *

If the file is a directory then the directory must be empty. In some + * implementations a directory has entries for special files or links that + * are created when the directory is created. In such implementations a + * directory is considered empty when only the special entries exist. + * This method can be used with the {@link #walkFileTree walkFileTree} + * method to delete a directory and all entries in the directory, or an + * entire file-tree where required. + * + *

On some operating systems it may not be possible to remove a file when + * it is open and in use by this Java virtual machine or other programs. + * + * @param path + * the path to the file to delete + * + * @throws NoSuchFileException + * if the file does not exist (optional specific exception) + * @throws DirectoryNotEmptyException + * if the file is a directory and could not otherwise be deleted + * because the directory is not empty (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkDelete(String)} method + * is invoked to check delete access to the file + */ + public static void delete(Path path) throws IOException { + provider(path).delete(path); + } + + /** + * Deletes a file if it exists. + * + *

As with the {@link #delete(Path) delete(Path)} method, an + * implementation may need to examine the file to determine if the file is a + * directory. Consequently this method may not be atomic with respect to + * other file system operations. If the file is a symbolic link, then the + * symbolic link itself, not the final target of the link, is deleted. + * + *

If the file is a directory then the directory must be empty. In some + * implementations a directory has entries for special files or links that + * are created when the directory is created. In such implementations a + * directory is considered empty when only the special entries exist. + * + *

On some operating systems it may not be possible to remove a file when + * it is open and in use by this Java virtual machine or other programs. + * + * @param path + * the path to the file to delete + * + * @return {@code true} if the file was deleted by this method; {@code + * false} if the file could not be deleted because it did not + * exist + * + * @throws DirectoryNotEmptyException + * if the file is a directory and could not otherwise be deleted + * because the directory is not empty (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkDelete(String)} method + * is invoked to check delete access to the file. + */ + public static boolean deleteIfExists(Path path) throws IOException { + return provider(path).deleteIfExists(path); + } + + // -- Copying and moving files -- + + /** + * Copy a file to a target file. + * + *

This method copies a file to the target file with the {@code + * options} parameter specifying how the copy is performed. By default, the + * copy fails if the target file already exists or is a symbolic link, + * except if the source and target are the {@link #isSameFile same} file, in + * which case the method completes without copying the file. File attributes + * are not required to be copied to the target file. If symbolic links are + * supported, and the file is a symbolic link, then the final target of the + * link is copied. If the file is a directory then it creates an empty + * directory in the target location (entries in the directory are not + * copied). This method can be used with the {@link #walkFileTree + * walkFileTree} method to copy a directory and all entries in the directory, + * or an entire file-tree where required. + * + *

The {@code options} parameter may include any of the following: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Option Description
{@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it + * is not a non-empty directory. If the target file exists and is a + * symbolic link, then the symbolic link itself, not the target of + * the link, is replaced.
{@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} Attempts to copy the file attributes associated with this file to + * the target file. The exact file attributes that are copied is platform + * and file system dependent and therefore unspecified. Minimally, the + * {@link BasicFileAttributes#lastModifiedTime last-modified-time} is + * copied to the target file if supported by both the source and target + * file store. Copying of file timestamps may result in precision + * loss.
{@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} Symbolic links are not followed. If the file is a symbolic link, + * then the symbolic link itself, not the target of the link, is copied. + * It is implementation specific if file attributes can be copied to the + * new link. In other words, the {@code COPY_ATTRIBUTES} option may be + * ignored when copying a symbolic link.
+ * + *

An implementation of this interface may support additional + * implementation specific options. + * + *

Copying a file is not an atomic operation. If an {@link IOException} + * is thrown then it possible that the target file is incomplete or some of + * its file attributes have not been copied from the source file. When the + * {@code REPLACE_EXISTING} option is specified and the target file exists, + * then the target file is replaced. The check for the existence of the file + * and the creation of the new file may not be atomic with respect to other + * file system activities. + * + *

Usage Example: + * Suppose we want to copy a file into a directory, giving it the same file + * name as the source file: + *

+     *     Path source = ...
+     *     Path newdir = ...
+     *     Files.copy(source, newdir.resolve(source.getFileName());
+     * 
+ * + * @param source + * the path to the file to copy + * @param target + * the path to the target file (may be associated with a different + * provider to the source path) + * @param options + * options specifying how the copy should be done + * + * @return the path to the target file + * + * @throws UnsupportedOperationException + * if the array contains a copy option that is not supported + * @throws FileAlreadyExistsException + * if the target file exists but cannot be replaced because the + * {@code REPLACE_EXISTING} option is not specified (optional + * specific exception) + * @throws DirectoryNotEmptyException + * the {@code REPLACE_EXISTING} option is specified but the file + * cannot be replaced because it is a non-empty directory + * (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the source file, the + * {@link SecurityManager#checkWrite(String) checkWrite} is invoked + * to check write access to the target file. If a symbolic link is + * copied the security manager is invoked to check {@link + * LinkPermission}{@code ("symbolic")}. + */ + public static Path copy(Path source, Path target, CopyOption... options) + throws IOException + { + FileSystemProvider provider = provider(source); + if (provider(target) == provider) { + // same provider + provider.copy(source, target, options); + } else { + // different providers + CopyMoveHelper.copyToForeignTarget(source, target, options); + } + return target; + } + + /** + * Move or rename a file to a target file. + * + *

By default, this method attempts to move the file to the target + * file, failing if the target file exists except if the source and + * target are the {@link #isSameFile same} file, in which case this method + * has no effect. If the file is a symbolic link then the symbolic link + * itself, not the target of the link, is moved. This method may be + * invoked to move an empty directory. In some implementations a directory + * has entries for special files or links that are created when the + * directory is created. In such implementations a directory is considered + * empty when only the special entries exist. When invoked to move a + * directory that is not empty then the directory is moved if it does not + * require moving the entries in the directory. For example, renaming a + * directory on the same {@link FileStore} will usually not require moving + * the entries in the directory. When moving a directory requires that its + * entries be moved then this method fails (by throwing an {@code + * IOException}). To move a file tree may involve copying rather + * than moving directories and this can be done using the {@link + * #copy copy} method in conjunction with the {@link + * #walkFileTree Files.walkFileTree} utility method. + * + *

The {@code options} parameter may include any of the following: + * + * + * + * + * + * + * + * + * + * + *
Option Description
{@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it + * is not a non-empty directory. If the target file exists and is a + * symbolic link, then the symbolic link itself, not the target of + * the link, is replaced.
{@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} The move is performed as an atomic file system operation and all + * other options are ignored. If the target file exists then it is + * implementation specific if the existing file is replaced or this method + * fails by throwing an {@link IOException}. If the move cannot be + * performed as an atomic file system operation then {@link + * AtomicMoveNotSupportedException} is thrown. This can arise, for + * example, when the target location is on a different {@code FileStore} + * and would require that the file be copied, or target location is + * associated with a different provider to this object.
+ * + *

An implementation of this interface may support additional + * implementation specific options. + * + *

Where the move requires that the file be copied then the {@link + * BasicFileAttributes#lastModifiedTime last-modified-time} is copied to the + * new file. An implementation may also attempt to copy other file + * attributes but is not required to fail if the file attributes cannot be + * copied. When the move is performed as a non-atomic operation, and a {@code + * IOException} is thrown, then the state of the files is not defined. The + * original file and the target file may both exist, the target file may be + * incomplete or some of its file attributes may not been copied from the + * original file. + * + *

Usage Examples: + * Suppose we want to rename a file to "newname", keeping the file in the + * same directory: + *

+     *     Path source = ...
+     *     Files.move(source, source.resolveSibling("newname"));
+     * 
+ * Alternatively, suppose we want to move a file to new directory, keeping + * the same file name, and replacing any existing file of that name in the + * directory: + *
+     *     Path source = ...
+     *     Path newdir = ...
+     *     Files.move(source, newdir.resolve(source.getFileName()), REPLACE_EXISTING);
+     * 
+ * + * @param source + * the path to the file to move + * @param target + * the path to the target file (may be associated with a different + * provider to the source path) + * @param options + * options specifying how the move should be done + * + * @return the path to the target file + * + * @throws UnsupportedOperationException + * if the array contains a copy option that is not supported + * @throws FileAlreadyExistsException + * if the target file exists but cannot be replaced because the + * {@code REPLACE_EXISTING} option is not specified (optional + * specific exception) + * @throws DirectoryNotEmptyException + * the {@code REPLACE_EXISTING} option is specified but the file + * cannot be replaced because it is a non-empty directory + * (optional specific exception) + * @throws AtomicMoveNotSupportedException + * if the options array contains the {@code ATOMIC_MOVE} option but + * the file cannot be moved as an atomic file system operation. + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to both the source and + * target file. + */ + public static Path move(Path source, Path target, CopyOption... options) + throws IOException + { + FileSystemProvider provider = provider(source); + if (provider(target) == provider) { + // same provider + provider.move(source, target, options); + } else { + // different providers + CopyMoveHelper.moveToForeignTarget(source, target, options); + } + return target; + } + + // -- Miscellenous -- + + /** + * Reads the target of a symbolic link (optional operation). + * + *

If the file system supports symbolic + * links then this method is used to read the target of the link, failing + * if the file is not a symbolic link. The target of the link need not exist. + * The returned {@code Path} object will be associated with the same file + * system as {@code link}. + * + * @param link + * the path to the symbolic link + * + * @return a {@code Path} object representing the target of the link + * + * @throws UnsupportedOperationException + * if the implementation does not support symbolic links + * @throws NotLinkException + * if the target could otherwise not be read because the file + * is not a symbolic link (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager + * is installed, it checks that {@code FilePermission} has been + * granted with the "{@code readlink}" action to read the link. + */ + public static Path readSymbolicLink(Path link) throws IOException { + return provider(link).readSymbolicLink(link); + } + + /** + * Returns the {@link FileStore} representing the file store where a file + * is located. + * + *

Once a reference to the {@code FileStore} is obtained it is + * implementation specific if operations on the returned {@code FileStore}, + * or {@link FileStoreAttributeView} objects obtained from it, continue + * to depend on the existence of the file. In particular the behavior is not + * defined for the case that the file is deleted or moved to a different + * file store. + * + * @param path + * the path to the file + * + * @return the file store where the file is stored + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file, and in + * addition it checks {@link RuntimePermission} + * ("getFileStoreAttributes") + */ + public static FileStore getFileStore(Path path) throws IOException { + return provider(path).getFileStore(path); + } + + /** + * Tests if two paths locate the same file. + * + *

If both {@code Path} objects are {@link Path#equals(Object) equal} + * then this method returns {@code true} without checking if the file exists. + * If the two {@code Path} objects are associated with different providers + * then this method returns {@code false}. Otherwise, this method checks if + * both {@code Path} objects locate the same file, and depending on the + * implementation, may require to open or access both files. + * + *

If the file system and files remain static, then this method implements + * an equivalence relation for non-null {@code Paths}. + *

    + *
  • It is reflexive: for {@code Path} {@code f}, + * {@code isSameFile(f,f)} should return {@code true}. + *
  • It is symmetric: for two {@code Paths} {@code f} and {@code g}, + * {@code isSameFile(f,g)} will equal {@code isSameFile(g,f)}. + *
  • It is transitive: for three {@code Paths} + * {@code f}, {@code g}, and {@code h}, if {@code isSameFile(f,g)} returns + * {@code true} and {@code isSameFile(g,h)} returns {@code true}, then + * {@code isSameFile(g,h)} will return return {@code true}. + *
+ * + * @param path + * one path to the file + * @param path2 + * the other path + * + * @return {@code true} if, and only if, the two paths locate the same file + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to both files. + * + * @see java.nio.file.attribute.BasicFileAttributes#fileKey + */ + public static boolean isSameFile(Path path, Path path2) throws IOException { + return provider(path).isSameFile(path, path2); + } + + /** + * Tells whether or not a file is considered hidden. The exact + * definition of hidden is platform or provider dependent. On UNIX for + * example a file is considered to be hidden if its name begins with a + * period character ('.'). On Windows a file is considered hidden if it + * isn't a directory and the DOS {@link DosFileAttributes#isHidden hidden} + * attribute is set. + * + *

Depending on the implementation this method may require to access + * the file system to determine if the file is considered hidden. + * + * @param path + * the path to the file to test + * + * @return {@code true} if the file is considered hidden + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + */ + public static boolean isHidden(Path path) throws IOException { + return provider(path).isHidden(path); + } + // lazy loading of default and installed file type detectors - private static class DefaultFileTypeDetectorHolder { + private static class FileTypeDetectors{ static final FileTypeDetector defaultFileTypeDetector = sun.nio.fs.DefaultFileTypeDetector.create(); static final List installeDetectors = @@ -54,7 +1484,7 @@ public final class Files { return AccessController .doPrivileged(new PrivilegedAction>() { @Override public List run() { - List list = new ArrayList(); + List list = new ArrayList<>(); ServiceLoader loader = ServiceLoader .load(FileTypeDetector.class, ClassLoader.getSystemClassLoader()); for (FileTypeDetector detector: loader) { @@ -100,33 +1530,948 @@ public final class Files { * Message Bodies. The string is guaranteed to be parsable according * to the grammar in the RFC. * - * @param file - * The file reference + * @param path + * the path to the file to probe * * @return The content type of the file, or {@code null} if the content * type cannot be determined * * @throws IOException - * If an I/O error occurs + * if an I/O error occurs * @throws SecurityException * If a security manager is installed and it denies an unspecified * permission required by a file type detector implementation. */ - public static String probeContentType(FileRef file) + public static String probeContentType(Path path) throws IOException { // try installed file type detectors - for (FileTypeDetector detector: DefaultFileTypeDetectorHolder.installeDetectors) { - String result = detector.probeContentType(file); + for (FileTypeDetector detector: FileTypeDetectors.installeDetectors) { + String result = detector.probeContentType(path); if (result != null) return result; } // fallback to default - return DefaultFileTypeDetectorHolder.defaultFileTypeDetector - .probeContentType(file); + return FileTypeDetectors.defaultFileTypeDetector.probeContentType(path); } + // -- File Attributes -- + + /** + * Returns a file attribute view of a given type. + * + *

A file attribute view provides a read-only or updatable view of a + * set of file attributes. This method is intended to be used where the file + * attribute view defines type-safe methods to read or update the file + * attributes. The {@code type} parameter is the type of the attribute view + * required and the method returns an instance of that type if supported. + * The {@link BasicFileAttributeView} type supports access to the basic + * attributes of a file. Invoking this method to select a file attribute + * view of that type will always return an instance of that class. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled by the resulting file attribute view for the case that the + * file is a symbolic link. By default, symbolic links are followed. If the + * option {@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} is present then + * symbolic links are not followed. This option is ignored by implementations + * that do not support symbolic links. + * + *

Usage Example: + * Suppose we want read or set a file's ACL, if supported: + *

+     *     Path path = ...
+     *     AclFileAttributeView view = Files.getFileAttributeView(path, AclFileAttributeView.class);
+     *     if (view != null) {
+     *         List<AclEntry> acl = view.getAcl();
+     *         :
+     *     }
+     * 
+ * + * + * @param path + * the path to the file + * @param type + * the {@code Class} object corresponding to the file attribute view + * @param options + * options indicating how symbolic links are handled + * + * @return a file attribute view of the specified type, or {@code null} if + * the attribute view type is not available + */ + public static V getFileAttributeView(Path path, + Class type, + LinkOption... options) + { + return provider(path).getFileAttributeView(path, type, options); + } + + /** + * Reads a file's attributes as a bulk operation. + * + *

The {@code type} parameter is the type of the attributes required + * and this method returns an instance of that type if supported. All + * implementations support a basic set of file attributes and so invoking + * this method with a {@code type} parameter of {@code + * BasicFileAttributes.class} will not throw {@code + * UnsupportedOperationException}. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

It is implementation specific if all file attributes are read as an + * atomic operation with respect to other file system operations. + * + *

Usage Example: + * Suppose we want to read a file's attributes in bulk: + *

+     *    Path path = ...
+     *    BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
+     * 
+ * Alternatively, suppose we want to read file's POSIX attributes without + * following symbolic links: + *
+     *    PosixFileAttributes attrs = Files.readAttributes(path, PosixFileAttributes.class, NOFOLLOW_LINKS);
+     * 
+ * + * @param path + * the path to the file + * @param type + * the {@code Class} of the file attributes required + * to read + * @param options + * options indicating how symbolic links are handled + * + * @return the file attributes + * + * @throws UnsupportedOperationException + * if an attributes of the given type are not supported + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. If this + * method is invoked to read security sensitive attributes then the + * security manager may be invoke to check for additional permissions. + */ + public static A readAttributes(Path path, + Class type, + LinkOption... options) + throws IOException + { + return provider(path).readAttributes(path, type, options); + } + + /** + * Sets the value of a file attribute. + * + *

The {@code attribute} parameter identifies the attribute to be set + * and takes the form: + *

+ * [view-name:]attribute-name + *
+ * where square brackets [...] delineate an optional component and the + * character {@code ':'} stands for itself. + * + *

view-name is the {@link FileAttributeView#name name} of a {@link + * FileAttributeView} that identifies a set of file attributes. If not + * specified then it defaults to {@code "basic"}, the name of the file + * attribute view that identifies the basic set of file attributes common to + * many file systems. attribute-name is the name of the attribute + * within the set. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is set. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

Usage Example: + * Suppose we want to set the DOS "hidden" attribute: + *

+     *    Path path = ...
+     *    Files.setAttribute(path, "dos:hidden", true);
+     * 
+ * + * @param path + * the path to the file + * @param attribute + * the attribute to set + * @param value + * the attribute value + * @param options + * options indicating how symbolic links are handled + * + * @return the {@code path} parameter + * + * @throws UnsupportedOperationException + * if the attribute view is not available or it does not support + * updating the attribute + * @throws IllegalArgumentException + * if the attribute value is of the correct type but has an + * inappropriate value + * @throws ClassCastException + * if the attribute value is not of the expected type or is a + * collection containing elements that are not of the expected + * type + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to the file. If this method is invoked + * to set security sensitive attributes then the security manager + * may be invoked to check for additional permissions. + */ + public static Path setAttribute(Path path, String attribute, Object value, + LinkOption... options) + throws IOException + { + provider(path).setAttribute(path, attribute, value, options); + return path; + } + + /** + * Reads the value of a file attribute. + * + *

The {@code attribute} parameter identifies the attribute to be read + * and takes the form: + *

+ * [view-name:]attribute-name + *
+ * where square brackets [...] delineate an optional component and the + * character {@code ':'} stands for itself. + * + *

view-name is the {@link FileAttributeView#name name} of a {@link + * FileAttributeView} that identifies a set of file attributes. If not + * specified then it defaults to {@code "basic"}, the name of the file + * attribute view that identifies the basic set of file attributes common to + * many file systems. attribute-name is the name of the attribute. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

Usage Example: + * Suppose we require the user ID of the file owner on a system that + * supports a "{@code unix}" view: + *

+     *    Path path = ...
+     *    int uid = (Integer)Files.getAttribute(path, "unix:uid");
+     * 
+ * + * @param path + * the path to the file + * @param attribute + * the attribute to read + * @param options + * options indicating how symbolic links are handled + * + * @return the attribute value or {@code null} if the attribute view + * is not available or it does not support reading the attribute + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. If this method is invoked + * to read security sensitive attributes then the security manager + * may be invoked to check for additional permissions. + */ + public static Object getAttribute(Path path, String attribute, + LinkOption... options) + throws IOException + { + // only one attribute should be read + if (attribute.indexOf('*') >= 0 || attribute.indexOf(',') >= 0) + return null; + Map map = readAttributes(path, attribute, options); + String name; + int pos = attribute.indexOf(':'); + if (pos == -1) { + name = attribute; + } else { + name = (pos == attribute.length()) ? "" : attribute.substring(pos+1); + } + return map.get(name); + } + + /** + * Reads a set of file attributes as a bulk operation. + * + *

The {@code attributes} parameter identifies the attributes to be read + * and takes the form: + *

+ * [view-name:]attribute-list + *
+ * where square brackets [...] delineate an optional component and the + * character {@code ':'} stands for itself. + * + *

view-name is the {@link FileAttributeView#name name} of a {@link + * FileAttributeView} that identifies a set of file attributes. If not + * specified then it defaults to {@code "basic"}, the name of the file + * attribute view that identifies the basic set of file attributes common to + * many file systems. + * + *

The attribute-list component is a comma separated list of + * zero or more names of attributes to read. If the list contains the value + * {@code "*"} then all attributes are read. Attributes that are not supported + * are ignored and will not be present in the returned map. It is + * implementation specific if all attributes are read as an atomic operation + * with respect to other file system operations. + * + *

The following examples demonstrate possible values for the {@code + * attributes} parameter: + * + *

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
{@code "*"} Read all {@link BasicFileAttributes basic-file-attributes}.
{@code "size,lastModifiedTime,lastAccessTime"} Reads the file size, last modified time, and last access time + * attributes.
{@code "posix:*"} Read all {@link PosixFileAttributes POSIX-file-attributes}.
{@code "posix:permissions,owner,size"} Reads the POSX file permissions, owner, and file size.
+ *
+ * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + * @param path + * the path to the file + * @param attributes + * the attributes to read + * @param options + * options indicating how symbolic links are handled + * + * @return a map of the attributes returned; may be empty. The map's keys + * are the attribute names, its values are the attribute values + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. If this method is invoked + * to read security sensitive attributes then the security manager + * may be invoke to check for additional permissions. + */ + public static Map readAttributes(Path path, String attributes, + LinkOption... options) + throws IOException + { + return provider(path).readAttributes(path, attributes, options); + } + + /** + * Returns a file's POSIX file permissions. + * + *

The {@code path} parameter is associated with a {@code FileSystem} + * that supports the {@link PosixFileAttributeView}. This attribute view + * provides access to file attributes commonly associated with files on file + * systems used by operating systems that implement the Portable Operating + * System Interface (POSIX) family of standards. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + * @param path + * the path to the file + * @param options + * options indicating how symbolic links are handled + * + * @return the file permissions + * + * @throws UnsupportedOperationException + * if the associated file system does not support the {@code + * PosixFileAttributeView} + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, a security manager is + * installed, and it denies {@link RuntimePermission}("accessUserInformation") + * or its {@link SecurityManager#checkRead(String) checkRead} method + * denies read access to the file. + */ + public static Set getPosixFilePermissions(Path path, + LinkOption... options) + throws IOException + { + return readAttributes(path, PosixFileAttributes.class, options).permissions(); + } + + /** + * Sets a file's POSIX permissions. + * + *

The {@code path} parameter is associated with a {@code FileSystem} + * that supports the {@link PosixFileAttributeView}. This attribute view + * provides access to file attributes commonly associated with files on file + * systems used by operating systems that implement the Portable Operating + * System Interface (POSIX) family of standards. + * + * @param path + * A file reference that locates the file + * @param perms + * The new set of permissions + * + * @throws UnsupportedOperationException + * if the associated file system does not support the {@code + * PosixFileAttributeView} + * @throws ClassCastException + * if the sets contains elements that are not of type {@code + * PosixFilePermission} + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, it denies {@link RuntimePermission}("accessUserInformation") + * or its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to the file. + */ + public static Path setPosixFilePermissions(Path path, + Set perms) + throws IOException + { + PosixFileAttributeView view = + getFileAttributeView(path, PosixFileAttributeView.class); + if (view == null) + throw new UnsupportedOperationException(); + view.setPermissions(perms); + return path; + } + + /** + * Returns the owner of a file. + * + *

The {@code path} parameter is associated with a file system that + * supports {@link FileOwnerAttributeView}. This file attribute view provides + * access to a file attribute that is the owner of the file. + * + * @param path + * A file reference that locates the file + * @param options + * options indicating how symbolic links are handled + * + * @return A user principal representing the owner of the file + * + * @throws UnsupportedOperationException + * if the associated file system does not support the {@code + * FileOwnerAttributeView} + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, it denies {@link RuntimePermission}("accessUserInformation") + * or its {@link SecurityManager#checkRead(String) checkRead} method + * denies read access to the file. + */ + public static UserPrincipal getOwner(Path path, LinkOption... options) throws IOException { + FileOwnerAttributeView view = + getFileAttributeView(path, FileOwnerAttributeView.class, options); + if (view == null) + throw new UnsupportedOperationException(); + return view.getOwner(); + } + + /** + * Updates the file owner. + * + *

The {@code path} parameter is associated with a file system that + * supports {@link FileOwnerAttributeView}. This file attribute view provides + * access to a file attribute that is the owner of the file. + * + *

Usage Example: + * Suppose we want to make "joe" the owner of a file: + *

+     *     Path path = ...
+     *     UserPrincipalLookupService lookupService =
+     *         provider(path).getUserPrincipalLookupService();
+     *     UserPrincipal joe = lookupService.lookupPrincipalByName("joe");
+     *     Files.setOwner(path, joe);
+     * 
+ * + * @param path + * A file reference that locates the file + * @param owner + * The new file owner + * + * @throws UnsupportedOperationException + * if the associated file system does not support the {@code + * FileOwnerAttributeView} + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, it denies {@link RuntimePermission}("accessUserInformation") + * or its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to the file. + * + * @see FileSystem#getUserPrincipalLookupService + * @see java.nio.file.attribute.UserPrincipalLookupService + */ + public static Path setOwner(Path path, UserPrincipal owner) + throws IOException + { + FileOwnerAttributeView view = + getFileAttributeView(path, FileOwnerAttributeView.class); + if (view == null) + throw new UnsupportedOperationException(); + view.setOwner(owner); + return path; + } + + /** + * Tests whether a file is a symbolic link. + * + *

Where is it required to distinguish an I/O exception from the case + * that the file is not a symbolic link then the file attributes can be + * read with the {@link #readAttributes(Path,Class,LinkOption[]) + * readAttributes} method and the file type tested with the {@link + * BasicFileAttributes#isSymbolicLink} method. + * + * @return {@code true} if the file is a symbolic link; {@code false} if + * the file does not exist, is not a symbolic link, or it cannot + * be determined if the file is symbolic link or not. + * + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. + */ + public static boolean isSymbolicLink(Path path) { + try { + return readAttributes(path, + BasicFileAttributes.class, + LinkOption.NOFOLLOW_LINKS).isSymbolicLink(); + } catch (IOException ioe) { + return false; + } + } + + /** + * Tests whether a file is a directory. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

Where is it required to distinguish an I/O exception from the case + * that the file is not a directory then the file attributes can be + * read with the {@link #readAttributes(Path,Class,LinkOption[]) + * readAttributes} method and the file type tested with the {@link + * BasicFileAttributes#isDirectory} method. + * + * @param path + * the path to the file to test + * @param options + * options indicating how symbolic links are handled + * + * @return {@code true} if the file is a directory; {@code false} if + * the file does not exist, is not a directory, or it cannot + * be determined if the file is directory or not. + * + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. + */ + public static boolean isDirectory(Path path, LinkOption... options) { + try { + return readAttributes(path, BasicFileAttributes.class, options).isDirectory(); + } catch (IOException ioe) { + return false; + } + } + + /** + * Tests whether a file is a regular file with opaque content. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

Where is it required to distinguish an I/O exception from the case + * that the file is not a regular file then the file attributes can be + * read with the {@link #readAttributes(Path,Class,LinkOption[]) + * readAttributes} method and the file type tested with the {@link + * BasicFileAttributes#isRegularFile} method. + * + * @param path + * the path to the file + * @param options + * options indicating how symbolic links are handled + * + * @return {@code true} if the file is a regular file; {@code false} if + * the file does not exist, is not a direcregular filetory, or it + * cannot be determined if the file is regular file or not. + * + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. + */ + public static boolean isRegularFile(Path path, LinkOption... options) { + try { + return readAttributes(path, BasicFileAttributes.class, options).isRegularFile(); + } catch (IOException ioe) { + return false; + } + } + + /** + * Returns a file's last modified time. + * + *

The {@code options} array may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed and the file attribute of the final target + * of the link is read. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + * @param path + * the path to the file + * @param options + * options indicating how symbolic links are handled + * + * @return a {@code FileTime} representing the time the file was last + * modified, or an implementation specific default when a time + * stamp to indicate the time of last modification is not supported + * by the file system + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. + * + * @see BasicFileAttributes#lastModifiedTime + */ + public static FileTime getLastModifiedTime(Path path, LinkOption... options) + throws IOException + { + return readAttributes(path, BasicFileAttributes.class, options).lastModifiedTime(); + } + + /** + * Updates a file's last modified time attribute. The file time is converted + * to the epoch and precision supported by the file system. Converting from + * finer to coarser granularities result in precision loss. The behavior of + * this method when attempting to set the last modified time when it is not + * supported by the file system or is outside the range supported by the + * underlying file store is not defined. It may or not fail by throwing an + * {@code IOException}. + * + *

Usage Example: + * Suppose we want to set the last modified time to the current time: + *

+     *    Path path = ...
+     *    FileTime now = FileTime.fromMillis(System.currentTimeMillis());
+     *    Files.setLastModifiedTime(path, now);
+     * 
+ * + * @param path + * the path to the file + * @param time + * the new last modified time + * + * @return the file + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, the security manager's {@link + * SecurityManager#checkWrite(String) checkWrite} method is invoked + * to check write access to file + * + * @see BasicFileAttributeView#setTimes + */ + public static Path setLastModifiedTime(Path path, FileTime time) + throws IOException + { + getFileAttributeView(path, BasicFileAttributeView.class) + .setTimes(time, null, null); + return path; + } + + /** + * Returns the size of a file (in bytes). The size may differ from the + * actual size on the file system due to compression, support for sparse + * files, or other reasons. The size of files that are not {@link + * #isRegularFile regular} files is implementation specific and + * therefore unspecified. + * + * @param path + * the path to the file + * + * @return the file size, in bytes + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. + * + * @see BasicFileAttributes#size + */ + public static long size(Path path) throws IOException { + return readAttributes(path, BasicFileAttributes.class).size(); + } + + // -- Accessibility -- + + /** + * Returns {@code false} if NOFOLLOW_LINKS is present. + */ + private static boolean followLinks(LinkOption... options) { + boolean followLinks = true; + for (LinkOption opt: options) { + if (opt == LinkOption.NOFOLLOW_LINKS) { + followLinks = false; + continue; + } + if (opt == null) + throw new NullPointerException(); + throw new AssertionError("Should not get here"); + } + return followLinks; + } + + /** + * Tests whether a file exists. + * + *

The {@code options} parameter may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

Note that the result of this method is immediately outdated. If this + * method indicates the file exists then there is no guarantee that a + * subsequence access will succeed. Care should be taken when using this + * method in security sensitive applications. + * + * @param path + * the path to the file to test + * @param options + * options indicating how symbolic links are handled + * . + * @return {@code true} if the file exists; {@code false} if the file does + * not exist or its existence cannot be determined. + * + * @throws SecurityException + * In the case of the default provider, the {@link + * SecurityManager#checkRead(String)} is invoked to check + * read access to the file. + * + * @see #notExists + */ + public static boolean exists(Path path, LinkOption... options) { + try { + if (followLinks(options)) { + provider(path).checkAccess(path); + } else { + // attempt to read attributes without following links + readAttributes(path, BasicFileAttributes.class, + LinkOption.NOFOLLOW_LINKS); + } + // file exists + return true; + } catch (IOException x) { + // does not exist or unable to determine if file exists + return false; + } + + } + + /** + * Tests whether the file located by this path does not exist. This method + * is intended for cases where it is required to take action when it can be + * confirmed that a file does not exist. + * + *

The {@code options} parameter may be used to indicate how symbolic links + * are handled for the case that the file is a symbolic link. By default, + * symbolic links are followed. If the option {@link LinkOption#NOFOLLOW_LINKS + * NOFOLLOW_LINKS} is present then symbolic links are not followed. + * + *

Note that this method is not the complement of the {@link #exists + * exists} method. Where it is not possible to determine if a file exists + * or not then both methods return {@code false}. As with the {@code exists} + * method, the result of this method is immediately outdated. If this + * method indicates the file does exist then there is no guarantee that a + * subsequence attempt to create the file will succeed. Care should be taken + * when using this method in security sensitive applications. + * + * @param path + * the path to the file to test + * @param options + * options indicating how symbolic links are handled + * + * @return {@code true} if the file does not exist; {@code false} if the + * file exists or its existence cannot be determined + * + * @throws SecurityException + * In the case of the default provider, the {@link + * SecurityManager#checkRead(String)} is invoked to check + * read access to the file. + */ + public static boolean notExists(Path path, LinkOption... options) { + try { + if (followLinks(options)) { + provider(path).checkAccess(path); + } else { + // attempt to read attributes without following links + readAttributes(path, BasicFileAttributes.class, + LinkOption.NOFOLLOW_LINKS); + } + // file exists + return false; + } catch (NoSuchFileException x) { + // file confirmed not to exist + return true; + } catch (IOException x) { + return false; + } + } + + /** + * Used by isReadbale, isWritable, isExecutable to test access to a file. + */ + private static boolean isAccessible(Path path, AccessMode... modes) { + try { + provider(path).checkAccess(path, modes); + return true; + } catch (IOException x) { + return false; + } + } + + /** + * Tests whether a file is readable. This method checks that a file exists + * and that this Java virtual machine has appropriate privileges that would + * allow it open the file for reading. Depending on the implementation, this + * method may require to read file permissions, access control lists, or + * other file attributes in order to check the effective access to the file. + * Consequently, this method may not be atomic with respect to other file + * system operations. + * + *

Note that the result of this method is immediately outdated, there is + * no guarantee that a subsequent attempt to open the file for reading will + * succeed (or even that it will access the same file). Care should be taken + * when using this method in security sensitive applications. + * + * @param path + * the path to the file to check + * + * @return {@code true} if the file exists and is readable; {@code false} + * if the file does not exist, read access would be denied because + * the Java virtual machine has insufficient privileges, or access + * cannot be determined + * + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * is invoked to check read access to the file. + */ + public static boolean isReadable(Path path) { + return isAccessible(path, AccessMode.READ); + } + + /** + * Tests whether a file is writable. This method checks that a file exists + * and that this Java virtual machine has appropriate privileges that would + * allow it open the file for writing. Depending on the implementation, this + * method may require to read file permissions, access control lists, or + * other file attributes in order to check the effective access to the file. + * Consequently, this method may not be atomic with respect to other file + * system operations. + * + *

Note that result of this method is immediately outdated, there is no + * guarantee that a subsequent attempt to open the file for writing will + * succeed (or even that it will access the same file). Care should be taken + * when using this method in security sensitive applications. + * + * @param path + * the path to the file to check + * + * @return {@code true} if the file exists and is writable; {@code false} + * if the file does not exist, write access would be denied because + * the Java virtual machine has insufficient privileges, or access + * cannot be determined + * + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * is invoked to check write access to the file. + */ + public static boolean isWritable(Path path) { + return isAccessible(path, AccessMode.WRITE); + } + + /** + * Tests whether a file is executable. This method checks that a file exists + * and that this Java virtual machine has appropriate privileges to {@link + * Runtime#exec execute} the file. The semantics may differ when checking + * access to a directory. For example, on UNIX systems, checking for + * execute access checks that the Java virtual machine has permission to + * search the directory in order to access file or subdirectories. + * + *

Depending on the implementation, this method may require to read file + * permissions, access control lists, or other file attributes in order to + * check the effective access to the file. Consequently, this method may not + * be atomic with respect to other file system operations. + * + *

Note that the result of this method is immediately outdated, there is + * no guarantee that a subsequent attempt to execute the file will succeed + * (or even that it will access the same file). Care should be taken when + * using this method in security sensitive applications. + * + * @param path + * the path to the file to check + * + * @return {@code true} if the file exists and is executable; {@code false} + * if the file does not exist, execute access would be denied because + * the Java virtual machine has insufficient privileges, or access + * cannot be determined + * + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkExec(String) + * checkExec} is invoked to check execute access to the file. + */ + public static boolean isExecutable(Path path) { + return isAccessible(path, AccessMode.EXECUTE); + } + + // -- Recursive operations -- + /** * Walks a file tree. * @@ -139,7 +2484,7 @@ public final class Files { * an uncaught error, or runtime exception, then the traversal is terminated * and the error or exception is propagated to the caller of this method. * - *

For each file encountered this method attempts to gets its {@link + *

For each file encountered this method attempts to read its {@link * java.nio.file.attribute.BasicFileAttributes}. If the file is not a * directory then the {@link FileVisitor#visitFile visitFile} method is * invoked with the file attributes. If the file attributes cannot be read, @@ -174,7 +2519,7 @@ public final class Files { * arises when there is an entry in a directory that is an ancestor of the * directory. Cycle detection is done by recording the {@link * java.nio.file.attribute.BasicFileAttributes#fileKey file-key} of directories, - * or if file keys are not available, by invoking the {@link Path#isSameFile + * or if file keys are not available, by invoking the {@link #isSameFile * isSameFile} method to test if a directory is the same file as an * ancestor. When a cycle is detected it is treated as an I/O error, and the * {@link FileVisitor#visitFileFailed visitFileFailed} method is invoked with @@ -197,25 +2542,27 @@ public final class Files { * that file (or directory). * * @param start - * The starting file + * the starting file * @param options - * Options to configure the traversal + * options to configure the traversal * @param maxDepth - * The maximum number of directory levels to visit + * the maximum number of directory levels to visit * @param visitor - * The file visitor to invoke for each file + * the file visitor to invoke for each file + * + * @return the starting file * * @throws IllegalArgumentException - * If the {@code maxDepth} parameter is negative + * if the {@code maxDepth} parameter is negative * @throws SecurityException * If the security manager denies access to the starting file. * In the case of the default provider, the {@link * SecurityManager#checkRead(String) checkRead} method is invoked * to check read access to the directory. * @throws IOException - * If an I/O error is thrown by a visitor method + * if an I/O error is thrown by a visitor method */ - public static void walkFileTree(Path start, + public static Path walkFileTree(Path start, Set options, int maxDepth, FileVisitor visitor) @@ -224,6 +2571,7 @@ public final class Files { if (maxDepth < 0) throw new IllegalArgumentException("'maxDepth' is negative"); new FileTreeWalker(options, visitor, maxDepth).walk(start); + return start; } /** @@ -234,11 +2582,15 @@ public final class Files { *

      * walkFileTree(start, EnumSet.noneOf(FileVisitOption.class), Integer.MAX_VALUE, visitor)
      * 
+ * In other words, it does not follow symbolic links, and visits all levels + * of the file level. * * @param start - * The starting file + * the starting file * @param visitor - * The file visitor to invoke for each file + * the file visitor to invoke for each file + * + * @return the starting file * * @throws SecurityException * If the security manager denies access to the starting file. @@ -246,118 +2598,511 @@ public final class Files { * SecurityManager#checkRead(String) checkRead} method is invoked * to check read access to the directory. * @throws IOException - * If an I/O error is thrown by a visitor method + * if an I/O error is thrown by a visitor method */ - public static void walkFileTree(Path start, FileVisitor visitor) + public static Path walkFileTree(Path start, FileVisitor visitor) throws IOException { - walkFileTree(start, - EnumSet.noneOf(FileVisitOption.class), - Integer.MAX_VALUE, - visitor); + return walkFileTree(start, + EnumSet.noneOf(FileVisitOption.class), + Integer.MAX_VALUE, + visitor); + } + + + // -- Utility methods for simple usages -- + + // buffer size used for reading and writing + private static final int BUFFER_SIZE = 8192; + + /** + * Opens a file for reading, returning a {@code BufferedReader} that may be + * used to read text from the file in an efficient manner. Bytes from the + * file are decoded into characters using the specified charset. Reading + * commences at the beginning of the file. + * + *

The {@code Reader} methods that read from the file throw {@code + * IOException} if a malformed or unmappable byte sequence is read. + * + * @param path + * the path to the file + * @param cs + * the charset to use for decoding + * + * @return a new buffered reader, with default buffer size, to read text + * from the file + * + * @throws IOException + * if an I/O error occurs opening the file + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @see #readAllLines + */ + public static BufferedReader newBufferedReader(Path path, Charset cs) + throws IOException + { + CharsetDecoder decoder = cs.newDecoder(); + Reader reader = new InputStreamReader(newInputStream(path), decoder); + return new BufferedReader(reader); } /** - * Creates a directory by creating all nonexistent parent directories first. + * Opens or creates a file for writing, returning a {@code BufferedWriter} + * that may be used to write text to the file in an efficient manner. + * The {@code options} parameter specifies how the the file is created or + * opened. If no options are present then this method works as if the {@link + * StandardOpenOption#CREATE CREATE}, {@link + * StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link + * StandardOpenOption#WRITE WRITE} options are present. In other words, it + * opens the file for writing, creating the file if it doesn't exist, or + * initially truncating an existing {@link #isRegularFile regular-file} to + * a size of {@code 0} if it exists. * - *

The {@code attrs} parameter is an optional array of {@link FileAttribute - * file-attributes} to set atomically when creating the nonexistent - * directories. Each file attribute is identified by its {@link - * FileAttribute#name name}. If more than one attribute of the same name is - * included in the array then all but the last occurrence is ignored. + *

The {@code Writer} methods to write text throw {@code IOException} + * if the text cannot be encoded using the specified charset. * - *

If this method fails, then it may do so after creating some, but not - * all, of the parent directories. + * @param path + * the path to the file + * @param cs + * the charset to use for encoding + * @param options + * options specifying how the file is opened * - * @param dir - * the directory to create + * @return a new buffered writer, with default buffer size, to write text + * to the file * - * @param attrs - * an optional list of file attributes to set atomically when - * creating the directory - * - * @throws UnsupportedOperationException - * if the array contains an attribute that cannot be set atomically - * when creating the directory - * @throws FileAlreadyExistsException - * if {@code dir} exists but is not a directory (optional specific - * exception) * @throws IOException - * if an I/O error occurs + * if an I/O error occurs opening or creating the file + * @throws UnsupportedOperationException + * if an unsupported option is specified * @throws SecurityException - * in the case of the default provider, and a security manager is + * In the case of the default provider, and a security manager is * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked prior to attempting to create a directory and - * its {@link SecurityManager#checkRead(String) checkRead} is - * invoked for each parent directory that is checked. If {@code - * dir} is not an absolute path then its {@link Path#toAbsolutePath - * toAbsolutePath} may need to be invoked to get its absolute path. - * This may invoke the security manager's {@link - * SecurityManager#checkPropertyAccess(String) checkPropertyAccess} - * method to check access to the system property {@code user.dir} + * method is invoked to check write access to the file. * + * @see #write(Path,Iterable,Charset,OpenOption[]) */ - public static void createDirectories(Path dir, FileAttribute... attrs) + public static BufferedWriter newBufferedWriter(Path path, Charset cs, + OpenOption... options) throws IOException { - // attempt to create the directory - try { - createAndCheckIsDirectory(dir, attrs); - return; - } catch (FileAlreadyExistsException x) { - // file exists and is not a directory - throw x; - } catch (IOException x) { - // parent may not exist or other reason + CharsetEncoder encoder = cs.newEncoder(); + Writer writer = new OutputStreamWriter(newOutputStream(path, options), encoder); + return new BufferedWriter(writer); + } + + /** + * Reads all bytes from an input stream and writes them to an output stream. + */ + private static long copy(InputStream source, OutputStream sink) + throws IOException + { + long nread = 0L; + byte[] buf = new byte[BUFFER_SIZE]; + int n; + while ((n = source.read(buf)) > 0) { + sink.write(buf, 0, n); + nread += n; + } + return nread; + } + + /** + * Copies all bytes from an input stream to a file. On return, the input + * stream will be at end of stream. + * + *

By default, the copy fails if the target file already exists or is a + * symbolic link. If the {@link StandardCopyOption#REPLACE_EXISTING + * REPLACE_EXISTING} option is specified, and the target file already exists, + * then it is replaced if it is not a non-empty directory. If the target + * file exists and is a symbolic link, then the symbolic link is replaced. + * In this release, the {@code REPLACE_EXISTING} option is the only option + * required to be supported by this method. Additional options may be + * supported in future releases. + * + *

If an I/O error occurs reading from the input stream or writing to + * the file, then it may do so after the target file has been created and + * after some bytes have been read or written. Consequently the input + * stream may not be at end of stream and may be in an inconsistent state. + * It is strongly recommended that the input stream be promptly closed if an + * I/O error occurs. + * + *

This method may block indefinitely reading from the input stream (or + * writing to the file). The behavior for the case that the input stream is + * asynchronously closed or the thread interrupted during the copy is + * highly input stream and file system provider specific and therefore not + * specified. + * + *

Usage example: Suppose we want to capture a web page and save + * it to a file: + *

+     *     Path path = ...
+     *     URI u = URI.create("http://java.sun.com/");
+     *     try (InputStream in = u.toURL().openStream()) {
+     *         Files.copy(in, path);
+     *     }
+     * 
+ * + * @param in + * the input stream to read from + * @param target + * the path to the file + * @param options + * options specifying how the copy should be done + * + * @return the number of bytes read or written + * + * @throws IOException + * if an I/O error occurs when reading or writing + * @throws FileAlreadyExistsException + * if the target file exists but cannot be replaced because the + * {@code REPLACE_EXISTING} option is not specified (optional + * specific exception) + * @throws DirectoryNotEmptyException + * the {@code REPLACE_EXISTING} option is specified but the file + * cannot be replaced because it is a non-empty directory + * (optional specific exception) * + * @throws UnsupportedOperationException + * if {@code options} contains a copy option that is not supported + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. Where the + * {@code REPLACE_EXISTING} option is specified, the security + * manager's {@link SecurityManager#checkDelete(String) checkDelete} + * method is invoked to check that an existing file can be deleted. + */ + public static long copy(InputStream in, Path target, CopyOption... options) + throws IOException + { + // ensure not null before opening file + Objects.nonNull(in); + + // check for REPLACE_EXISTING + boolean replaceExisting = false; + for (CopyOption opt: options) { + if (opt == StandardCopyOption.REPLACE_EXISTING) { + replaceExisting = true; + } else { + if (opt == null) { + throw new NullPointerException("options contains 'null'"); + } else { + throw new UnsupportedOperationException(opt + " not supported"); + } + } } - // find existing parent (may require absolute path) + // attempt to delete an existing file SecurityException se = null; - try { - dir = dir.toAbsolutePath(); - } catch (SecurityException x) { - // don't have permission to get absolute path - se = x; - } - Path parent = dir.getParent(); - while (parent != null) { + if (replaceExisting) { try { - parent.checkAccess(); - break; - } catch (NoSuchFileException x) { - // does not exist + deleteIfExists(target); + } catch (SecurityException x) { + se = x; } - parent = parent.getParent(); } - if (parent == null) { - // unable to find existing parent + + // attempt to create target file. If it fails with + // FileAlreadyExistsException then it may be because the security + // manager prevented us from deleting the file, in which case we just + // throw the SecurityException. + OutputStream ostream; + try { + ostream = newOutputStream(target, StandardOpenOption.CREATE_NEW, + StandardOpenOption.WRITE); + } catch (FileAlreadyExistsException x) { if (se != null) throw se; - throw new IOException("Root directory does not exist"); + // someone else won the race and created the file + throw x; } - // create directories - Path child = parent; - for (Path name: parent.relativize(dir)) { - child = child.resolve(name); - createAndCheckIsDirectory(child, attrs); + // do the copy + try (OutputStream out = ostream) { + return copy(in, out); } } /** - * Attempts to create a directory. Does nothing if the directory already - * exists. + * Copies all bytes from a file to an output stream. + * + *

If an I/O error occurs reading from the file or writing to the output + * stream, then it may do so after some bytes have been read or written. + * Consequently the output stream may be in an inconsistent state. It is + * strongly recommended that the output stream be promptly closed if an I/O + * error occurs. + * + *

This method may block indefinitely writing to the output stream (or + * reading from the file). The behavior for the case that the output stream + * is asynchronously closed or the thread interrupted during the copy + * is highly output stream and file system provider specific and therefore + * not specified. + * + *

Note that if the given output stream is {@link java.io.Flushable} + * then its {@link java.io.Flushable#flush flush} method may need to invoked + * after this method completes so as to flush any buffered output. + * + * @param source + * the path to the file + * @param out + * the output stream to write to + * + * @return the number of bytes read or written + * + * @throws IOException + * if an I/O error occurs when reading or writing + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. */ - private static void createAndCheckIsDirectory(Path dir, FileAttribute... attrs) - throws IOException - { - try { - dir.createDirectory(attrs); - } catch (FileAlreadyExistsException x) { - boolean isDirectory = Attributes - .readBasicFileAttributes(dir, LinkOption.NOFOLLOW_LINKS).isDirectory(); - if (!isDirectory) - throw x; + public static long copy(Path source, OutputStream out) throws IOException { + // ensure not null before opening file + Objects.nonNull(out); + + try (InputStream in = newInputStream(source)) { + return copy(in, out); } } + + /** + * Read all the bytes from an input stream. The {@code initialSize} + * parameter indicates the initial size of the byte[] to allocate. + */ + private static byte[] read(InputStream source, int initialSize) + throws IOException + { + int capacity = initialSize; + byte[] buf = new byte[capacity]; + int nread = 0; + int rem = buf.length; + int n; + // read to EOF which may read more or less than initialSize (eg: file + // is truncated while we are reading) + while ((n = source.read(buf, nread, rem)) > 0) { + nread += n; + rem -= n; + assert rem >= 0; + if (rem == 0) { + // need larger buffer + int newCapacity = capacity << 1; + if (newCapacity < 0) { + if (capacity == Integer.MAX_VALUE) + throw new OutOfMemoryError("Required array size too large"); + newCapacity = Integer.MAX_VALUE; + } + rem = newCapacity - capacity; + buf = Arrays.copyOf(buf, newCapacity); + capacity = newCapacity; + } + } + return (capacity == nread) ? buf : Arrays.copyOf(buf, nread); + } + + /** + * Read all the bytes from a file. The method ensures that the file is + * closed when all bytes have been read or an I/O error, or other runtime + * exception, is thrown. + * + *

Note that this method is intended for simple cases where it is + * convenient to read all bytes into a byte array. It is not intended for + * reading in large files. + * + * @param path + * the path to the file + * + * @return a byte array containing the bytes read from the file + * + * @throws IOException + * if an I/O error occurs reading from the stream + * @throws OutOfMemoryError + * if an array of the required size cannot be allocated, for + * example the file is larger that {@code 2GB} + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + */ + public static byte[] readAllBytes(Path path) throws IOException { + long size = size(path); + if (size > (long)Integer.MAX_VALUE) + throw new OutOfMemoryError("Required array size too large"); + + try (InputStream in = newInputStream(path)) { + return read(in, (int)size); + } + } + + /** + * Read all lines from a file. This method ensures that the file is + * closed when all bytes have been read or an I/O error, or other runtime + * exception, is thrown. Bytes from the file are decoded into characters + * using the specified charset. + * + *

This method recognizes the following as line terminators: + *

    + *
  • \u000D followed by \u000A, + * CARRIAGE RETURN followed by LINE FEED
  • + *
  • \u000A, LINE FEED
  • + *
  • \u000D, CARRIAGE RETURN
  • + *
+ *

Additional Unicode line terminators may be recognized in future + * releases. + * + *

Note that this method is intended for simple cases where it is + * convenient to read all lines in a single operation. It is not intended + * for reading in large files. + * + * @param path + * the path to the file + * @param cs + * the charset to use for decoding + * + * @return the lines from the file as a {@code List}; whether the {@code + * List} is modifiable or not is implementation dependent and + * therefore not specified + * + * @throws IOException + * if an I/O error occurs reading from the file or a malformed or + * unmappable byte sequence is read + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + * + * @see #newBufferedReader + */ + public static List readAllLines(Path path, Charset cs) + throws IOException + { + try (BufferedReader reader = newBufferedReader(path, cs)) { + List result = new ArrayList<>(); + for (;;) { + String line = reader.readLine(); + if (line == null) + break; + result.add(line); + } + return result; + } + } + + /** + * Writes bytes to a file. The {@code options} parameter specifies how the + * the file is created or opened. If no options are present then this method + * works as if the {@link StandardOpenOption#CREATE CREATE}, {@link + * StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link + * StandardOpenOption#WRITE WRITE} options are present. In other words, it + * opens the file for writing, creating the file if it doesn't exist, or + * initially truncating an existing {@link #isRegularFile regular-file} to + * a size of {@code 0}. All bytes in the byte array are written to the file. + * The method ensures that the file is closed when all bytes have been + * written (or an I/O error or other runtime exception is thrown). If an I/O + * error occurs then it may do so after the file has created or truncated, + * or after some bytes have been written to the file. + * + *

Usage example: By default the method creates a new file or + * overrides an existing file. Suppose you instead want to append bytes + * to an existing file: + *

+     *     Path path = ...
+     *     byte[] bytes = ...
+     *     Files.write(path, bytes, StandardOpenOption.APPEND);
+     * 
+ * + * @param path + * the path to the file + * @param bytes + * the byte array with the bytes to write + * @param options + * options specifying how the file is opened + * + * @return the path + * + * @throws IOException + * if an I/O error occurs writing to or creating the file + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + */ + public static Path write(Path path, byte[] bytes, OpenOption... options) + throws IOException + { + // ensure bytes is not null before opening file + Objects.nonNull(bytes); + + try (OutputStream out = Files.newOutputStream(path, options)) { + int len = bytes.length; + int rem = len; + while (rem > 0) { + int n = Math.min(rem, BUFFER_SIZE); + out.write(bytes, (len-rem), n); + rem -= n; + } + } + return path; + } + + /** + * Write lines of text to a file. Each line is a char sequence and is + * written to the file in sequence with each line terminated by the + * platform's line separator, as defined by the system property {@code + * line.separator}. Characters are encoded into bytes using the specified + * charset. + * + *

The {@code options} parameter specifies how the the file is created + * or opened. If no options are present then this method works as if the + * {@link StandardOpenOption#CREATE CREATE}, {@link + * StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING}, and {@link + * StandardOpenOption#WRITE WRITE} options are present. In other words, it + * opens the file for writing, creating the file if it doesn't exist, or + * initially truncating an existing {@link #isRegularFile regular-file} to + * a size of {@code 0}. The method ensures that the file is closed when all + * lines have been written (or an I/O error or other runtime exception is + * thrown). If an I/O error occurs then it may do so after the file has + * created or truncated, or after some bytes have been written to the file. + * + * @param path + * the path to the file + * @param lines + * an object to iterate over the char sequences + * @param cs + * the charset to use for encoding + * @param options + * options specifying how the file is opened + * + * @return the path + * + * @throws IOException + * if an I/O error occurs writing to or creating the file, or the + * text cannot be encoded using the specified charset + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. + */ + public static Path write(Path path, Iterable lines, + Charset cs, OpenOption... options) + throws IOException + { + // ensure lines is not null before opening file + Objects.nonNull(lines); + CharsetEncoder encoder = cs.newEncoder(); + OutputStream out = newOutputStream(path, options); + try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) { + for (CharSequence line: lines) { + writer.append(line); + writer.newLine(); + } + } + return path; + } } diff --git a/jdk/src/share/classes/java/nio/file/LinkOption.java b/jdk/src/share/classes/java/nio/file/LinkOption.java index 7c8d97d4c3f..13a42ef7143 100644 --- a/jdk/src/share/classes/java/nio/file/LinkOption.java +++ b/jdk/src/share/classes/java/nio/file/LinkOption.java @@ -35,8 +35,8 @@ public enum LinkOption implements OpenOption, CopyOption { /** * Do not follow symbolic links. * - * @see FileRef#getFileAttributeView(Class,LinkOption[]) - * @see Path#copyTo + * @see Files#getFileAttributeView(Path,Class,LinkOption[]) + * @see Files#copy * @see SecureDirectoryStream#newByteChannel */ NOFOLLOW_LINKS; diff --git a/jdk/src/share/classes/java/nio/file/LinkPermission.java b/jdk/src/share/classes/java/nio/file/LinkPermission.java index 25d799f8c74..161d1b9d7af 100644 --- a/jdk/src/share/classes/java/nio/file/LinkPermission.java +++ b/jdk/src/share/classes/java/nio/file/LinkPermission.java @@ -59,8 +59,8 @@ import java.security.BasicPermission; * * @since 1.7 * - * @see Path#createLink - * @see Path#createSymbolicLink + * @see Files#createLink + * @see Files#createSymbolicLink */ public final class LinkPermission extends BasicPermission { static final long serialVersionUID = -1441492453772213220L; diff --git a/jdk/src/share/classes/java/nio/file/OpenOption.java b/jdk/src/share/classes/java/nio/file/OpenOption.java index aae5e27911d..522d5ddc4f0 100644 --- a/jdk/src/share/classes/java/nio/file/OpenOption.java +++ b/jdk/src/share/classes/java/nio/file/OpenOption.java @@ -29,8 +29,8 @@ package java.nio.file; * An object that configures how to open or create a file. * *

Objects of this type are used by methods such as {@link - * Path#newOutputStream(OpenOption[]) newOutputStream}, {@link - * Path#newByteChannel newByteChannel}, {@link + * Files#newOutputStream(Path,OpenOption[]) newOutputStream}, {@link + * Files#newByteChannel newByteChannel}, {@link * java.nio.channels.FileChannel#open FileChannel.open}, and {@link * java.nio.channels.AsynchronousFileChannel#open AsynchronousFileChannel.open} * when opening or creating a file. diff --git a/jdk/src/share/classes/java/nio/file/Path.java b/jdk/src/share/classes/java/nio/file/Path.java index b41e03f91be..85436b01d9a 100644 --- a/jdk/src/share/classes/java/nio/file/Path.java +++ b/jdk/src/share/classes/java/nio/file/Path.java @@ -25,147 +25,95 @@ package java.nio.file; -import java.nio.file.attribute.*; -import java.nio.channels.SeekableByteChannel; +import java.io.File; import java.io.IOException; -import java.io.OutputStream; import java.net.URI; import java.util.Iterator; -import java.util.Set; /** - * A file reference that locates a file using a system dependent path. The file - * is not required to exist. + * An object that may be used to locate a file in a file system. It will + * typically represent a system dependent file path. * - *

On many platforms a path is the means to locate and access files - * in a file system. A path is hierarchical and composed of a sequence of - * directory and file name elements separated by a special separator or - * delimiter. - * - *

Path operations

- * - *

A system dependent path represented by this class is conceptually a - * sequence of name elements and optionally a root component. The name - * that is farthest from the root of the directory hierarchy is the - * name of a file or directory. The other elements are directory names. The root - * component typically identifies a file system hierarchy. A {@code Path} can - * represent a root, a root and a sequence of names, or simply one or more name - * elements. It defines the {@link #getName() getName}, {@link #getParent - * getParent}, {@link #getRoot getRoot}, and {@link #subpath subpath} methods - * to access the components or a subsequence of its name elements. + *

A {@code Path} represents a path that is hierarchical and composed of a + * sequence of directory and file name elements separated by a special separator + * or delimiter. A root component, that identifies a file system + * hierarchy, may also be present. The name element that is farthest + * from the root of the directory hierarchy is the name of a file or directory. + * The other name elements are directory names. A {@code Path} can represent a + * root, a root and a sequence of names, or simply one or more name elements. + * A {@code Path} is considered to be an empty path if it consists + * solely of one name element that is empty. Accessing a file using an + * empty path is equivalent to accessing the default directory of the + * file system. {@code Path} defines the {@link #getFileName() getFileName}, + * {@link #getParent getParent}, {@link #getRoot getRoot}, and {@link #subpath + * subpath} methods to access the path components or a subsequence of its name + * elements. * *

In addition to accessing the components of a path, a {@code Path} also - * defines {@link #resolve(Path) resolve} and {@link #relativize relativize} - * operations. Paths can also be {@link #compareTo compared}, and tested - * against each other using using the {@link #startsWith startsWith} and {@link - * #endsWith endWith} methods. + * defines the {@link #resolve(Path) resolve} and {@link #resolveSibling(Path) + * resolveSibling} methods to combine paths. The {@link #relativize relativize} + * method that can be used to construct a relative path between two paths. + * Paths can be {@link #compareTo compared}, and tested against each other using + * the {@link #startsWith startsWith} and {@link #endsWith endWith} methods. * - *

File operations

+ *

This interface extends {@link Watchable} interface so that a directory + * located by a path can be {@link #register registered} with a {@link + * WatchService} and entries in the directory watched.

* - *

A {@code Path} is either absolute or relative. An - * absolute path is complete in that does not need to be combined with another - * path in order to locate a file. All operations on relative paths are first - * resolved against a file system's default directory as if by invoking the - * {@link #toAbsolutePath toAbsolutePath} method. + *

WARNING: This interface is only intended to be implemented by + * those developing custom file system implementations. Methods may be added to + * this interface in future releases.

* - *

In addition to the operations defined by the {@link FileRef} interface, - * this class defines the following operations: - * - *

    - *
  • The {@link #newByteChannel newByteChannel} method - * may be used to open a file and obtain a byte channel for reading or - * writing.

  • - *
  • Files may be {@link #createFile(FileAttribute[]) created}, or - * directories may be {@link #createDirectory(FileAttribute[]) created}. - *

  • - *
  • The {@link #delete delete} method may be used to delete a file. - *

  • - *
  • The {@link #checkAccess checkAccess} method may be used to check - * the existence or accessibility of a file.

  • - *
  • The {@link #isSameFile isSameFile} method may be used to test if - * two file references locate the same file.

  • - *
  • The {@link #getFileStore getFileStore} method may be used to - * obtain the {@link FileStore} representing the storage where a file is - * located.

  • - *
  • Directories can be {@link #newDirectoryStream opened} so as to - * iterate over the entries in the directory.

  • - *
  • Files can be {@link #copyTo(Path,CopyOption[]) copied} or - * {@link #moveTo(Path,CopyOption[]) moved}.

  • - *
  • Symbolic links may be {@link #createSymbolicLink created}, or the - * target of a symbolic link may be {@link #readSymbolicLink read}.

  • - *
  • The {@link #toRealPath real} path of an existing file may be - * obtained.

  • - *
- * - *

This class implements {@link Watchable} interface so that a directory - * located by a path can be {@link #register registered} with a {@link WatchService}. - * and entries in the directory watched. - * - *

File attributes

- * - * In addition to the {@link #setAttribute setAttribute} and {@link #getAttribute - * getAttribute} methods, the
{@code - * java.nio.file.attribute} package provides type-safe and efficient access - * to file attributes or meta-data associated with files. The {@link - * Attributes Attributes} class defines methods that operate on or return file - * attributes. For example, the file type, size, timestamps, and other - * basic meta-data are obtained, in bulk, by invoking the {@link - * Attributes#readBasicFileAttributes Attributes.readBasicFileAttributes} method: + *

Accessing Files

+ *

Paths may be used with the {@link Files} class to operate on files, + * directories, and other types of files. For example, suppose we want a {@link + * java.io.BufferedReader} to read text from a file "{@code access.log}". The + * file is located in a directory "{@code logs}" relative to the current working + * directory and is UTF-8 encoded. *

- *     Path file = ...
- *     BasicFileAttributes attrs = Attributes.readBasicFileAttributes(file);
+ *     Path path = FileSystems.getDefault().getPath("logs", "access.log");
+ *     BufferReader reader = Files.newBufferedReader(path, Charset.forName("UTF-8"));
  * 
* *

Interoperability

- * - *

Paths created by file systems associated with the default {@link + *

Paths associated with the default {@link * java.nio.file.spi.FileSystemProvider provider} are generally interoperable * with the {@link java.io.File java.io.File} class. Paths created by other * providers are unlikely to be interoperable with the abstract path names - * represented by {@code java.io.File}. The {@link java.io.File#toPath - * File.toPath} method may be used to obtain a {@code Path} from the abstract - * path name represented by a {@code java.io.File java.io.File} object. The - * resulting {@code Path} can be used to operate on the same file as the {@code - * java.io.File} object. - * - *

Path objects created by file systems associated with the default - * provider are interoperable with objects created by other file systems created - * by the same provider. Path objects created by file systems associated with - * other providers may not be interoperable with other file systems created by - * the same provider. The reasons for this are provider specific. + * represented by {@code java.io.File}. The {@link java.io.File#toPath toPath} + * method may be used to obtain a {@code Path} from the abstract path name + * represented by a {@code java.io.File} object. The resulting {@code Path} can + * be used to operate on the same file as the {@code java.io.File} object. In + * addition, the {@link #toFile toFile} method is useful to construct a {@code + * File} from the {@code String} representation of a {@code Path}. * *

Concurrency

- * - *

Instances of this class are immutable and safe for use by multiple concurrent - * threads. + *

Implementations of this interface are immutable and safe for use by + * multiple concurrent threads. * * @since 1.7 + * @see Paths */ -public abstract class Path - implements FileRef, Comparable, Iterable, Watchable +public interface Path + extends Comparable, Iterable, Watchable { - /** - * Initializes a new instance of this class. - */ - protected Path() { } - /** * Returns the file system that created this object. * * @return the file system that created this object */ - public abstract FileSystem getFileSystem(); + FileSystem getFileSystem(); /** * Tells whether or not this path is absolute. * - *

An absolute path is complete in that it doesn't need to be - * combined with other path information in order to locate a file. + *

An absolute path is complete in that it doesn't need to be combined + * with other path information in order to locate a file. * * @return {@code true} if, and only if, this path is absolute */ - public abstract boolean isAbsolute(); + boolean isAbsolute(); /** * Returns the root component of this path as a {@code Path} object, @@ -174,17 +122,17 @@ public abstract class Path * @return a path representing the root component of this path, * or {@code null} */ - public abstract Path getRoot(); + Path getRoot(); /** - * Returns the name of the file or directory denoted by this path. The - * file name is the farthest element from the root in the directory - * hierarchy. + * Returns the name of the file or directory denoted by this path as a + * {@code Path} object. The file name is the farthest element from + * the root in the directory hierarchy. * * @return a path representing the name of the file or directory, or * {@code null} if this path has zero elements */ - public abstract Path getName(); + Path getFileName(); /** * Returns the parent path, or {@code null} if this path does not @@ -209,7 +157,7 @@ public abstract class Path * * @return a path representing the path's parent */ - public abstract Path getParent(); + Path getParent(); /** * Returns the number of name elements in the path. @@ -217,10 +165,10 @@ public abstract class Path * @return the number of elements in the path, or {@code 0} if this path * only represents a root component */ - public abstract int getNameCount(); + int getNameCount(); - /** - * Returns a name element of this path. + /** + * Returns a name element of this path as a {@code Path} object. * *

The {@code index} parameter is the index of the name element to return. * The element that is closest to the root in the directory hierarchy @@ -237,7 +185,7 @@ public abstract class Path * equal to the number of elements, or this path has zero name * elements */ - public abstract Path getName(int index); + Path getName(int index); /** * Returns a relative {@code Path} that is a subsequence of the name @@ -264,7 +212,7 @@ public abstract class Path * the number of elements. If {@code endIndex} is less than or * equal to {@code beginIndex}, or larger than the number of elements. */ - public abstract Path subpath(int beginIndex, int endIndex); + Path subpath(int beginIndex, int endIndex); /** * Tests if this path starts with the given path. @@ -286,7 +234,25 @@ public abstract class Path * @return {@code true} if this path starts with the given path; otherwise * {@code false} */ - public abstract boolean startsWith(Path other); + boolean startsWith(Path other); + + /** + * Tests if this path starts with a {@code Path}, constructed by converting + * the given path string, in exactly the manner specified by the {@link + * #startsWith(Path) startsWith(Path)} method. On UNIX for example, the path + * "{@code foo/bar}" starts with "{@code foo}" and "{@code foo/bar}". It + * does not start with "{@code f}" or "{@code fo}". + * + * @param other + * the given path string + * + * @return {@code true} if this path starts with the given path; otherwise + * {@code false} + * + * @throws InvalidPathException + * If the path string cannot be converted to a Path. + */ + boolean startsWith(String other); /** * Tests if this path ends with the given path. @@ -310,7 +276,25 @@ public abstract class Path * @return {@code true} if this path ends with the given path; otherwise * {@code false} */ - public abstract boolean endsWith(Path other); + boolean endsWith(Path other); + + /** + * Tests if this path ends with a {@code Path}, constructed by converting + * the given path string, in exactly the manner specified by the {@link + * #endsWith(Path) endsWith(Path)} method. On UNIX for example, the path + * "{@code foo/bar}" ends with "{@code foo/bar}" and "{@code bar}". It does + * not end with "{@code r}" or "{@code /bar}". + * + * @param other + * the given path string + * + * @return {@code true} if this path starts with the given path; otherwise + * {@code false} + * + * @throws InvalidPathException + * If the path string cannot be converted to a Path. + */ + boolean endsWith(String other); /** * Returns a path that is this path with redundant name elements eliminated. @@ -330,14 +314,14 @@ public abstract class Path * path may result in the path that locates a different file than the original * path. This can arise when the preceding name is a symbolic link. * - * @return the resulting path, or this path if it does not contain - * redundant name elements, or {@code null} if this path does not - * have a root component and all name elements are redundant + * @return the resulting path or this path if it does not contain + * redundant name elements; an empty path is returned if this path + * does have a root component and all name elements are redundant * * @see #getParent * @see #toRealPath */ - public abstract Path normalize(); + Path normalize(); // -- resolution and relativization -- @@ -346,28 +330,31 @@ public abstract class Path * *

If the {@code other} parameter is an {@link #isAbsolute() absolute} * path then this method trivially returns {@code other}. If {@code other} - * is {@code null} then this path is returned. Otherwise this method - * considers this path to be a directory and resolves the given path - * against this path. In the simplest case, the given path does not have - * a {@link #getRoot root} component, in which case this method joins - * the given path to this path and returns a resulting path that {@link - * #endsWith ends} with the given path. Where the given path has a root - * component then resolution is highly implementation dependent and therefore - * unspecified. + * is an empty path then this method trivially returns this path. + * Otherwise this method considers this path to be a directory and resolves + * the given path against this path. In the simplest case, the given path + * does not have a {@link #getRoot root} component, in which case this method + * joins the given path to this path and returns a resulting path + * that {@link #endsWith ends} with the given path. Where the given path has + * a root component then resolution is highly implementation dependent and + * therefore unspecified. * * @param other - * the path to resolve against this path; can be {@code null} + * the path to resolve against this path * * @return the resulting path * * @see #relativize */ - public abstract Path resolve(Path other); + Path resolve(Path other); /** * Converts a given path string to a {@code Path} and resolves it against * this {@code Path} in exactly the manner specified by the {@link - * #resolve(Path) resolve} method. + * #resolve(Path) resolve} method. For example, suppose that the name + * separator is "{@code /}" and a path represents "{@code foo/bar}", then + * invoking this method with the path string "{@code gus}" will result in + * the {@code Path} "{@code foo/bar/gus}". * * @param other * the path string to resolve against this path @@ -375,11 +362,49 @@ public abstract class Path * @return the resulting path * * @throws InvalidPathException - * If the path string cannot be converted to a Path. + * if the path string cannot be converted to a Path. * * @see FileSystem#getPath */ - public abstract Path resolve(String other); + Path resolve(String other); + + /** + * Resolves the given path against this path's {@link #getParent parent} + * path. This is useful where a file name needs to be replaced with + * another file name. For example, suppose that the name separator is + * "{@code /}" and a path represents "{@code dir1/dir2/foo}", then invoking + * this method with the {@code Path} "{@code bar}" will result in the {@code + * Path} "{@code dir1/dir2/bar}". If this path does not have a parent path, + * or {@code other} is {@link #isAbsolute() absolute}, then this method + * returns {@code other}. If {@code other} is an empty path then this method + * returns this path's parent, or where this path doesn't have a parent, the + * empty path. + * + * @param other + * the path to resolve against this path's parent + * + * @return the resulting path + * + * @see #resolve(Path) + */ + Path resolveSibling(Path other); + + /** + * Converts a given path string to a {@code Path} and resolves it against + * this path's {@link #getParent parent} path in exactly the manner + * specified by the {@link #resolveSibling(Path) resolveSibling} method. + * + * @param other + * the path string to resolve against this path's parent + * + * @return the resulting path + * + * @throws InvalidPathException + * if the path string cannot be converted to a Path. + * + * @see FileSystem#getPath + */ + Path resolveSibling(String other); /** * Constructs a relative path between this path and a given path. @@ -395,17 +420,17 @@ public abstract class Path * constructed if only one of the paths have a root component. Where both * paths have a root component then it is implementation dependent if a * relative path can be constructed. If this path and the given path are - * {@link #equals equal} then {@code null} is returned. + * {@link #equals equal} then an empty path is returned. * - *

For any two paths p and q, where q does not have - * a root component, + *

For any two {@link #normalize normalized} paths p and + * q, where q does not have a root component, *

* p.relativize(p.resolve(q)).equals(q) *
* *

When symbolic links are supported, then whether the resulting path, * when resolved against this path, yields a path that can be used to locate - * the {@link #isSameFile same} file as {@code other} is implementation + * the {@link Files#isSameFile same} file as {@code other} is implementation * dependent. For example, if this path is {@code "/a/b"} and the given * path is {@code "/a/x"} then the resulting relative path may be {@code * "../x"}. If {@code "b"} is a symbolic link then is implementation @@ -414,185 +439,14 @@ public abstract class Path * @param other * the path to relativize against this path * - * @return the resulting relative path, or {@code null} if both paths are + * @return the resulting relative path, or an empty path if both paths are * equal * * @throws IllegalArgumentException * if {@code other} is not a {@code Path} that can be relativized * against this path */ - public abstract Path relativize(Path other); - - // -- file operations -- - - /** - * Deletes the file located by this path. - * - *

An implementation may require to examine the file to determine if the - * file is a directory. Consequently this method may not be atomic with respect - * to other file system operations. If the file is a symbolic link then the - * symbolic link itself, not the final target of the link, is deleted. - * - *

If the file is a directory then the directory must be empty. In some - * implementations a directory has entries for special files or links that - * are created when the directory is created. In such implementations a - * directory is considered empty when only the special entries exist. - * - *

On some operating systems it may not be possible to remove a file when - * it is open and in use by this Java virtual machine or other programs. - * - * @throws NoSuchFileException - * if the file does not exist (optional specific exception) - * @throws DirectoryNotEmptyException - * if the file is a directory and could not otherwise be deleted - * because the directory is not empty (optional specific - * exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkDelete(String)} method - * is invoked to check delete access to the file - */ - public abstract void delete() throws IOException; - - /** - * Deletes the file located by this path, if it exists. - * - *

As with the {@link #delete delete()} method, an implementation may - * need to examine the file to determine if the file is a directory. - * Consequently this method may not be atomic with respect to other file - * system operations. If the file is a symbolic link, then the symbolic - * link itself, not the final target of the link, is deleted. - * - *

If the file is a directory then the directory must be empty. In some - * implementations a directory has entries for special files or links that - * are created when the directory is created. In such implementations a - * directory is considered empty when only the special entries exist. - * - *

On some operating systems it may not be possible to remove a file when - * it is open and in use by this Java virtual machine or other programs. - * - * @throws DirectoryNotEmptyException - * if the file is a directory and could not otherwise be deleted - * because the directory is not empty (optional specific - * exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkDelete(String)} method - * is invoked to check delete access to the file. - */ - public abstract void deleteIfExists() throws IOException; - - /** - * Creates a symbolic link to a target (optional operation). - * - *

The {@code target} parameter is the target of the link. It may be an - * {@link Path#isAbsolute absolute} or relative path and may not exist. When - * the target is a relative path then file system operations on the resulting - * link are relative to the path of the link. - * - *

The {@code attrs} parameter is an optional array of {@link FileAttribute - * attributes} to set atomically when creating the link. Each attribute is - * identified by its {@link FileAttribute#name name}. If more than one attribute - * of the same name is included in the array then all but the last occurrence - * is ignored. - * - *

Where symbolic links are supported, but the underlying {@link FileStore} - * does not support symbolic links, then this may fail with an {@link - * IOException}. Additionally, some operating systems may require that the - * Java virtual machine be started with implementation specific privileges to - * create symbolic links, in which case this method may throw {@code IOException}. - * - * @param target - * the target of the symbolic link - * @param attrs - * the array of attributes to set atomically when creating the - * symbolic link - * - * @return this path - * - * @throws UnsupportedOperationException - * if the implementation does not support symbolic links or the - * array contains an attribute that cannot be set atomically when - * creating the symbolic link - * @throws FileAlreadyExistsException - * if a file with the name already exists (optional specific - * exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager - * is installed, it denies {@link LinkPermission}("symbolic") - * or its {@link SecurityManager#checkWrite(String) checkWrite} - * method denies write access to the path of the symbolic link. - */ - public abstract Path createSymbolicLink(Path target, FileAttribute... attrs) - throws IOException; - - /** - * Creates a new link (directory entry) for an existing file (optional - * operation). - * - *

This path locates the directory entry to create. The {@code existing} - * parameter is the path to an existing file. This method creates a new - * directory entry for the file so that it can be accessed using this path. - * On some file systems this is known as creating a "hard link". Whether the - * file attributes are maintained for the file or for each directory entry - * is file system specific and therefore not specified. Typically, a file - * system requires that all links (directory entries) for a file be on the - * same file system. Furthermore, on some platforms, the Java virtual machine - * may require to be started with implementation specific privileges to - * create hard links or to create links to directories. - * - * @param existing - * a reference to an existing file - * - * @return this path - * - * @throws UnsupportedOperationException - * if the implementation does not support adding an existing file - * to a directory - * @throws FileAlreadyExistsException - * if the entry could not otherwise be created because a file of - * that name already exists (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager - * is installed, it denies {@link LinkPermission}("hard") - * or its {@link SecurityManager#checkWrite(String) checkWrite} - * method denies write access to both this path and the path of the - * existing file. - */ - public abstract Path createLink(Path existing) throws IOException; - - /** - * Reads the target of a symbolic link (optional operation). - * - *

If the file system supports symbolic - * links then this method is used to read the target of the link, failing - * if the file is not a symbolic link. The target of the link need not exist. - * The returned {@code Path} object will be associated with the same file - * system as this {@code Path}. - * - * @return a {@code Path} object representing the target of the link - * - * @throws UnsupportedOperationException - * if the implementation does not support symbolic links - * @throws NotLinkException - * if the target could otherwise not be read because the file - * is not a symbolic link (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager - * is installed, it checks that {@code FilePermission} has been - * granted with the "{@code readlink}" action to read the link. - */ - public abstract Path readSymbolicLink() throws IOException; + Path relativize(Path other); /** * Returns a URI to represent this path. @@ -647,7 +501,7 @@ public abstract class Path * is installed, the {@link #toAbsolutePath toAbsolutePath} method * throws a security exception. */ - public abstract URI toUri(); + URI toUri(); /** * Returns a {@code Path} object representing the absolute path of this @@ -670,14 +524,14 @@ public abstract class Path * checkPropertyAccess} method is invoked to check access to the * system property {@code user.dir} */ - public abstract Path toAbsolutePath(); + Path toAbsolutePath(); /** * Returns the real path of an existing file. * *

The precise definition of this method is implementation dependent but * in general it derives from this path, an {@link #isAbsolute absolute} - * path that locates the {@link #isSameFile same} file as this path, but + * path that locates the {@link Files#isSameFile same} file as this path, but * with name elements that represent the actual name of the directories * and the file. For example, where filename comparisons on a file system * are case insensitive then the name elements represent the names in their @@ -713,756 +567,25 @@ public abstract class Path * checkPropertyAccess} method is invoked to check access to the * system property {@code user.dir} */ - public abstract Path toRealPath(boolean resolveLinks) throws IOException; + Path toRealPath(boolean resolveLinks) throws IOException; /** - * Copy the file located by this path to a target location. + * Returns a {@link File} object representing this path. Where this {@code + * Path} is associated with the default provider, then this method is + * equivalent to returning a {@code File} object constructed with the + * {@code String} representation of this path. * - *

This method copies the file located by this {@code Path} to the - * target location with the {@code options} parameter specifying how the - * copy is performed. By default, the copy fails if the target file already - * exists, except if the source and target are the {@link #isSameFile same} - * file, in which case this method has no effect. File attributes are not - * required to be copied to the target file. If symbolic links are supported, - * and the file is a symbolic link, then the final target of the link is copied. - * If the file is a directory then it creates an empty directory in the target - * location (entries in the directory are not copied). This method can be - * used with the {@link Files#walkFileTree Files.walkFileTree} utility - * method to copy a directory and all entries in the directory, or an entire - * file-tree where required. + *

If this path was created by invoking the {@code File} {@link + * File#toPath toPath} method then there is no guarantee that the {@code + * File} object returned by this method is {@link #equals equal} to the + * original {@code File}. * - *

The {@code options} parameter is an array of options and may contain - * any of the following: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Option Description
{@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it - * is not a non-empty directory. If the target file exists and is a - * symbolic link, then the symbolic link itself, not the target of - * the link, is replaced.
{@link StandardCopyOption#COPY_ATTRIBUTES COPY_ATTRIBUTES} Attempts to copy the file attributes associated with this file to - * the target file. The exact file attributes that are copied is platform - * and file system dependent and therefore unspecified. Minimally, the - * {@link BasicFileAttributes#lastModifiedTime last-modified-time} is - * copied to the target file if supported by both the source and target - * file store. Copying of file timestamps may result in precision - * loss.
{@link LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} Symbolic links are not followed. If the file, located by this path, - * is a symbolic link, then the symbolic link itself, not the target of - * the link, is copied. It is implementation specific if file attributes - * can be copied to the new link. In other words, the {@code - * COPY_ATTRIBUTES} option may be ignored when copying a symbolic link.
- * - *

An implementation of this interface may support additional - * implementation specific options. - * - *

Copying a file is not an atomic operation. If an {@link IOException} - * is thrown then it possible that the target file is incomplete or some of - * its file attributes have not been copied from the source file. When the - * {@code REPLACE_EXISTING} option is specified and the target file exists, - * then the target file is replaced. The check for the existence of the file - * and the creation of the new file may not be atomic with respect to other - * file system activities. - * - * @param target - * the target location - * @param options - * options specifying how the copy should be done - * - * @return the target + * @return a {@code File} object representing this path * * @throws UnsupportedOperationException - * if the array contains a copy option that is not supported - * @throws FileAlreadyExistsException - * if the target file exists and cannot be replaced because the - * {@code REPLACE_EXISTING} option is not specified, or the target - * file is a non-empty directory (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the source file, the - * {@link SecurityManager#checkWrite(String) checkWrite} is invoked - * to check write access to the target file. If a symbolic link is - * copied the security manager is invoked to check {@link - * LinkPermission}{@code ("symbolic")}. + * if this {@code Path} is not associated with the default provider */ - public abstract Path copyTo(Path target, CopyOption... options) - throws IOException; - - /** - * Move or rename the file located by this path to a target location. - * - *

By default, this method attempts to move the file to the target - * location, failing if the target file exists except if the source and - * target are the {@link #isSameFile same} file, in which case this method - * has no effect. If the file is a symbolic link then the symbolic link - * itself, not the target of the link, is moved. This method may be - * invoked to move an empty directory. In some implementations a directory - * has entries for special files or links that are created when the - * directory is created. In such implementations a directory is considered - * empty when only the special entries exist. When invoked to move a - * directory that is not empty then the directory is moved if it does not - * require moving the entries in the directory. For example, renaming a - * directory on the same {@link FileStore} will usually not require moving - * the entries in the directory. When moving a directory requires that its - * entries be moved then this method fails (by throwing an {@code - * IOException}). To move a file tree may involve copying rather - * than moving directories and this can be done using the {@link - * #copyTo copyTo} method in conjunction with the {@link - * Files#walkFileTree Files.walkFileTree} utility method. - * - *

The {@code options} parameter is an array of options and may contain - * any of the following: - * - * - * - * - * - * - * - * - * - * - *
Option Description
{@link StandardCopyOption#REPLACE_EXISTING REPLACE_EXISTING} If the target file exists, then the target file is replaced if it - * is not a non-empty directory. If the target file exists and is a - * symbolic link, then the symbolic link itself, not the target of - * the link, is replaced.
{@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} The move is performed as an atomic file system operation and all - * other options are ignored. If the target file exists then it is - * implementation specific if the existing file is replaced or this method - * fails by throwing an {@link IOException}. If the move cannot be - * performed as an atomic file system operation then {@link - * AtomicMoveNotSupportedException} is thrown. This can arise, for - * example, when the target location is on a different {@code FileStore} - * and would require that the file be copied, or target location is - * associated with a different provider to this object.
- * - *

An implementation of this interface may support additional - * implementation specific options. - * - *

Where the move requires that the file be copied then the {@link - * BasicFileAttributes#lastModifiedTime last-modified-time} is copied to the - * new file. An implementation may also attempt to copy other file - * attributes but is not required to fail if the file attributes cannot be - * copied. When the move is performed as a non-atomic operation, and a {@code - * IOException} is thrown, then the state of the files is not defined. The - * original file and the target file may both exist, the target file may be - * incomplete or some of its file attributes may not been copied from the - * original file. - * - * @param target - * the target location - * @param options - * options specifying how the move should be done - * - * @return the target - * - * @throws UnsupportedOperationException - * if the array contains a copy option that is not supported - * @throws FileAlreadyExistsException - * if the target file exists and cannot be replaced because the - * {@code REPLACE_EXISTING} option is not specified, or the target - * file is a non-empty directory - * @throws AtomicMoveNotSupportedException - * if the options array contains the {@code ATOMIC_MOVE} option but - * the file cannot be moved as an atomic file system operation. - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to both the source and - * target file. - */ - public abstract Path moveTo(Path target, CopyOption... options) - throws IOException; - - /** - * Opens the directory referenced by this object, returning a {@code - * DirectoryStream} to iterate over all entries in the directory. The - * elements returned by the directory stream's {@link DirectoryStream#iterator - * iterator} are of type {@code Path}, each one representing an entry in the - * directory. The {@code Path} objects are obtained as if by {@link - * #resolve(Path) resolving} the name of the directory entry against this - * path. - * - *

The directory stream's {@code close} method should be invoked after - * iteration is completed so as to free any resources held for the open - * directory. - * - *

When an implementation supports operations on entries in the - * directory that execute in a race-free manner then the returned directory - * stream is a {@link SecureDirectoryStream}. - * - * @return a new and open {@code DirectoryStream} object - * - * @throws NotDirectoryException - * if the file could not otherwise be opened because it is not - * a directory (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the directory. - */ - public abstract DirectoryStream newDirectoryStream() - throws IOException; - - /** - * Opens the directory referenced by this object, returning a {@code - * DirectoryStream} to iterate over the entries in the directory. The - * elements returned by the directory stream's {@link DirectoryStream#iterator - * iterator} are of type {@code Path}, each one representing an entry in the - * directory. The {@code Path} objects are obtained as if by {@link - * #resolve(Path) resolving} the name of the directory entry against this - * path. The entries returned by the iterator are filtered by matching the - * {@code String} representation of their file names against the given - * globbing pattern. - * - *

For example, suppose we want to iterate over the files ending with - * ".java" in a directory: - *

-     *     Path dir = ...
-     *     DirectoryStream<Path> stream = dir.newDirectoryStream("*.java");
-     * 
- * - *

The globbing pattern is specified by the {@link - * FileSystem#getPathMatcher getPathMatcher} method. - * - *

The directory stream's {@code close} method should be invoked after - * iteration is completed so as to free any resources held for the open - * directory. - * - *

When an implementation supports operations on entries in the - * directory that execute in a race-free manner then the returned directory - * stream is a {@link SecureDirectoryStream}. - * - * @param glob - * the glob pattern - * - * @return a new and open {@code DirectoryStream} object - * - * @throws java.util.regex.PatternSyntaxException - * if the pattern is invalid - * @throws NotDirectoryException - * if the file could not otherwise be opened because it is not - * a directory (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the directory. - */ - public abstract DirectoryStream newDirectoryStream(String glob) - throws IOException; - - /** - * Opens the directory referenced by this object, returning a {@code - * DirectoryStream} to iterate over the entries in the directory. The - * elements returned by the directory stream's {@link DirectoryStream#iterator - * iterator} are of type {@code Path}, each one representing an entry in the - * directory. The {@code Path} objects are obtained as if by {@link - * #resolve(Path) resolving} the name of the directory entry against this - * path. The entries returned by the iterator are filtered by the given - * {@link DirectoryStream.Filter filter}. - * - *

The directory stream's {@code close} method should be invoked after - * iteration is completed so as to free any resources held for the open - * directory. - * - *

Where the filter terminates due to an uncaught error or runtime - * exception then it is propagated to the {@link Iterator#hasNext() - * hasNext} or {@link Iterator#next() next} method. Where an {@code - * IOException} is thrown, it results in the {@code hasNext} or {@code - * next} method throwing a {@link DirectoryIteratorException} with the - * {@code IOException} as the cause. - * - *

When an implementation supports operations on entries in the - * directory that execute in a race-free manner then the returned directory - * stream is a {@link SecureDirectoryStream}. - * - *

Usage Example: - * Suppose we want to iterate over the files in a directory that are - * larger than 8K. - *

-     *     DirectoryStream.Filter<Path> filter = new DirectoryStream.Filter<Path>() {
-     *         public boolean accept(Path file) throws IOException {
-     *             long size = Attributes.readBasicFileAttributes(file).size();
-     *             return (size > 8192L);
-     *         }
-     *     };
-     *     Path dir = ...
-     *     DirectoryStream<Path> stream = dir.newDirectoryStream(filter);
-     * 
- * @param filter - * the directory stream filter - * - * @return a new and open {@code DirectoryStream} object - * - * @throws NotDirectoryException - * if the file could not otherwise be opened because it is not - * a directory (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the directory. - */ - public abstract DirectoryStream newDirectoryStream(DirectoryStream.Filter filter) - throws IOException; - - /** - * Creates a new and empty file, failing if the file already exists. - * - *

This {@code Path} locates the file to create. The check for the - * existence of the file and the creation of the new file if it does not - * exist are a single operation that is atomic with respect to all other - * filesystem activities that might affect the directory. - * - *

The {@code attrs} parameter is an optional array of {@link FileAttribute - * file-attributes} to set atomically when creating the file. Each attribute - * is identified by its {@link FileAttribute#name name}. If more than one - * attribute of the same name is included in the array then all but the last - * occurrence is ignored. - * - * @param attrs - * an optional list of file attributes to set atomically when - * creating the file - * - * @return this path - * - * @throws UnsupportedOperationException - * if the array contains an attribute that cannot be set atomically - * when creating the file - * @throws FileAlreadyExistsException - * if a file of that name already exists - * (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the new file. - */ - public abstract Path createFile(FileAttribute... attrs) throws IOException; - - /** - * Creates a new directory. - * - *

This {@code Path} locates the directory to create. The check for the - * existence of the file and the creation of the directory if it does not - * exist are a single operation that is atomic with respect to all other - * filesystem activities that might affect the directory. - * - *

The {@code attrs} parameter is an optional array of {@link FileAttribute - * file-attributes} to set atomically when creating the directory. Each - * file attribute is identified by its {@link FileAttribute#name name}. If - * more than one attribute of the same name is included in the array then all - * but the last occurrence is ignored. - * - * @param attrs - * an optional list of file attributes to set atomically when - * creating the directory - * - * @return this path - * - * @throws UnsupportedOperationException - * if the array contains an attribute that cannot be set atomically - * when creating the directory - * @throws FileAlreadyExistsException - * if a directory could not otherwise be created because a file of - * that name already exists (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkWrite(String) checkWrite} - * method is invoked to check write access to the new directory. - * - * @see Files#createDirectories - */ - public abstract Path createDirectory(FileAttribute... attrs) - throws IOException; - - /** - * Opens or creates a file, returning a seekable byte channel to access the - * file. - * - *

The {@code options} parameter determines how the file is opened. - * The {@link StandardOpenOption#READ READ} and {@link StandardOpenOption#WRITE WRITE} - * options determine if the file should be opened for reading and/or writing. - * If neither option (or the {@link StandardOpenOption#APPEND APPEND} - * option) is contained in the array then the file is opened for reading. - * By default reading or writing commences at the beginning of the file. - * - *

In the addition to {@code READ} and {@code WRITE}, the following - * options may be present: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Option Description
{@link StandardOpenOption#APPEND APPEND} If this option is present then the file is opened for writing and - * each invocation of the channel's {@code write} method first advances - * the position to the end of the file and then writes the requested - * data. Whether the advancement of the position and the writing of the - * data are done in a single atomic operation is system-dependent and - * therefore unspecified. This option may not be used in conjunction - * with the {@code READ} or {@code TRUNCATE_EXISTING} options.
{@link StandardOpenOption#TRUNCATE_EXISTING TRUNCATE_EXISTING} If this option is present then the existing file is truncated to - * a size of 0 bytes. This option is ignored when the file is opened only - * for reading.
{@link StandardOpenOption#CREATE_NEW CREATE_NEW} If this option is present then a new file is created, failing if - * the file already exists or is a symbolic link. When creating a file the - * check for the existence of the file and the creation of the file if it - * does not exist is atomic with respect to other file system operations. - * This option is ignored when the file is opened only for reading.
{@link StandardOpenOption#CREATE CREATE} If this option is present then an existing file is opened if it - * exists, otherwise a new file is created. This option is ignored if the - * {@code CREATE_NEW} option is also present or the file is opened only - * for reading.
{@link StandardOpenOption#DELETE_ON_CLOSE DELETE_ON_CLOSE} When this option is present then the implementation makes a - * best effort attempt to delete the file when closed by the - * {@link SeekableByteChannel#close close} method. If the {@code close} - * method is not invoked then a best effort attempt is made to - * delete the file when the Java virtual machine terminates.
{@link StandardOpenOption#SPARSE SPARSE} When creating a new file this option is a hint that the - * new file will be sparse. This option is ignored when not creating - * a new file.
{@link StandardOpenOption#SYNC SYNC} Requires that every update to the file's content or metadata be - * written synchronously to the underlying storage device. (see Synchronized I/O file - * integrity).
{@link StandardOpenOption#DSYNC DSYNC} Requires that every update to the file's content be written - * synchronously to the underlying storage device. (see Synchronized I/O file - * integrity).
- * - *

An implementation may also support additional implementation specific - * options. - * - *

The {@code attrs} parameter is an optional array of file {@link - * FileAttribute file-attributes} to set atomically when a new file is created. - * - *

In the case of the default provider, the returned seekable byte channel - * is a {@link java.nio.channels.FileChannel}. - * - *

Usage Examples: - *

-     *     Path file = ...
-     *
-     *     // open file for reading
-     *     ReadableByteChannel rbc = file.newByteChannel(EnumSet.of(READ)));
-     *
-     *     // open file for writing to the end of an existing file, creating
-     *     // the file if it doesn't already exist
-     *     WritableByteChannel wbc = file.newByteChannel(EnumSet.of(CREATE,APPEND));
-     *
-     *     // create file with initial permissions, opening it for both reading and writing
-     *     FileAttribute<Set<PosixFilePermission>> perms = ...
-     *     SeekableByteChannel sbc = file.newByteChannel(EnumSet.of(CREATE_NEW,READ,WRITE), perms);
-     * 
- * - * @param options - * Options specifying how the file is opened - * @param attrs - * An optional list of file attributes to set atomically when - * creating the file - * - * @return a new seekable byte channel - * - * @throws IllegalArgumentException - * if the set contains an invalid combination of options - * @throws UnsupportedOperationException - * if an unsupported open option is specified or the array contains - * attributes that cannot be set atomically when creating the file - * @throws FileAlreadyExistsException - * if a file of that name already exists and the {@link - * StandardOpenOption#CREATE_NEW CREATE_NEW} option is specified - * (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the path if the file is - * opened for reading. The {@link SecurityManager#checkWrite(String) - * checkWrite} method is invoked to check write access to the path - * if the file is opened for writing. - */ - public abstract SeekableByteChannel newByteChannel(Set options, - FileAttribute... attrs) - throws IOException; - - /** - * Opens or creates a file, returning a seekable byte channel to access the - * file. - * - *

This method opens or creates a file in exactly the manner specified - * by the {@link Path#newByteChannel(Set,FileAttribute[]) newByteChannel} - * method. - * - * @param options - * options specifying how the file is opened - * - * @return a new seekable byte channel - * - * @throws IllegalArgumentException - * if the set contains an invalid combination of options - * @throws UnsupportedOperationException - * if an unsupported open option is specified - * @throws FileAlreadyExistsException - * if a file of that name already exists and the {@link - * StandardOpenOption#CREATE_NEW CREATE_NEW} option is specified - * (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the path if the file is - * opened for reading. The {@link SecurityManager#checkWrite(String) - * checkWrite} method is invoked to check write access to the path - * if the file is opened for writing. - */ - public abstract SeekableByteChannel newByteChannel(OpenOption... options) - throws IOException; - - /** - * Opens or creates the file located by this object for writing, returning - * an output stream to write bytes to the file. - * - *

This method opens or creates a file in exactly the manner specified - * by the {@link Path#newByteChannel(Set,FileAttribute[]) newByteChannel} - * method except that the {@link StandardOpenOption#READ READ} option may not - * be present in the array of open options. - * - * @param options - * options specifying how the file is opened - * - * @return a new output stream - * - * @throws IllegalArgumentException {@inheritDoc} - * @throws UnsupportedOperationException {@inheritDoc} - * @throws IOException {@inheritDoc} - * @throws SecurityException {@inheritDoc} - */ - @Override - public abstract OutputStream newOutputStream(OpenOption... options) - throws IOException; - - /** - * Tells whether or not the file located by this object is considered - * hidden. The exact definition of hidden is platform or provider - * dependent. On UNIX for example a file is considered to be hidden if its - * name begins with a period character ('.'). On Windows a file is - * considered hidden if it isn't a directory and the DOS {@link - * DosFileAttributes#isHidden hidden} attribute is set. - * - *

Depending on the implementation this method may require to access - * the file system to determine if the file is considered hidden. - * - * @return {@code true} if the file is considered hidden - * - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the file. - */ - public abstract boolean isHidden() throws IOException; - - /** - * Checks the existence and optionally the accessibility of the file - * located by this path. - * - *

This method checks the existence of a file and that this Java virtual - * machine has appropriate privileges that would allow it access the file - * according to all of access modes specified in the {@code modes} parameter - * as follows: - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Value Description
{@link AccessMode#READ READ} Checks that the file exists and that the Java virtual machine has - * permission to read the file.
{@link AccessMode#WRITE WRITE} Checks that the file exists and that the Java virtual machine has - * permission to write to the file,
{@link AccessMode#EXECUTE EXECUTE} Checks that the file exists and that the Java virtual machine has - * permission to {@link Runtime#exec execute} the file. The semantics - * may differ when checking access to a directory. For example, on UNIX - * systems, checking for {@code EXECUTE} access checks that the Java - * virtual machine has permission to search the directory in order to - * access file or subdirectories.
- * - *

If the {@code modes} parameter is of length zero, then the existence - * of the file is checked. - * - *

This method follows symbolic links if the file referenced by this - * object is a symbolic link. Depending on the implementation, this method - * may require to read file permissions, access control lists, or other - * file attributes in order to check the effective access to the file. To - * determine the effective access to a file may require access to several - * attributes and so in some implementations this method may not be atomic - * with respect to other file system operations. Furthermore, as the result - * of this method is immediately outdated, there is no guarantee that a - * subsequence access will succeed (or even that it will access the same - * file). Care should be taken when using this method in security sensitive - * applications. - * - * @param modes - * The access modes to check; may have zero elements - * - * @throws UnsupportedOperationException - * an implementation is required to support checking for - * {@code READ}, {@code WRITE}, and {@code EXECUTE} access. This - * exception is specified to allow for the {@code Access} enum to - * be extended in future releases. - * @throws NoSuchFileException - * if a file does not exist (optional specific exception) - * @throws AccessDeniedException - * the requested access would be denied or the access cannot be - * determined because the Java virtual machine has insufficient - * privileges or other reasons. (optional specific exception) - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * is invoked when checking read access to the file or only the - * existence of the file, the {@link SecurityManager#checkWrite(String) - * checkWrite} is invoked when checking write access to the file, - * and {@link SecurityManager#checkExec(String) checkExec} is invoked - * when checking execute access. - */ - public abstract void checkAccess(AccessMode... modes) throws IOException; - - /** - * Tests whether the file located by this path exists. - * - *

This convenience method is intended for cases where it is required to - * take action when it can be confirmed that a file exists. This method simply - * invokes the {@link #checkAccess checkAccess} method to check if the file - * exists. If the {@code checkAccess} method succeeds then this method returns - * {@code true}, otherwise if an {@code IOException} is thrown (because the - * file doesn't exist or cannot be accessed by this Java virtual machine) - * then {@code false} is returned. - * - *

Note that the result of this method is immediately outdated. If this - * method indicates the file exists then there is no guarantee that a - * subsequence access will succeed. Care should be taken when using this - * method in security sensitive applications. - * - * @return {@code true} if the file exists; {@code false} if the file does - * not exist or its existence cannot be determined. - * - * @throws SecurityException - * In the case of the default provider, the {@link - * SecurityManager#checkRead(String)} is invoked to check - * read access to the file. - * - * @see #notExists - */ - public abstract boolean exists(); - - /** - * Tests whether the file located by this path does not exist. - * - *

This convenience method is intended for cases where it is required to - * take action when it can be confirmed that a file does not exist. This - * method invokes the {@link #checkAccess checkAccess} method to check if the - * file exists. If the file does not exist then {@code true} is returned, - * otherwise the file exists or cannot be accessed by this Java virtual - * machine and {@code false} is returned. - * - *

Note that this method is not the complement of the {@link #exists - * exists} method. Where it is not possible to determine if a file exists - * or not then both methods return {@code false}. As with the {@code exists} - * method, the result of this method is immediately outdated. If this - * method indicates the file does exist then there is no guarantee that a - * subsequence attempt to create the file will succeed. Care should be taken - * when using this method in security sensitive applications. - * - * @return {@code true} if the file does not exist; {@code false} if the - * file exists or its existence cannot be determined. - * - * @throws SecurityException - * In the case of the default provider, the {@link - * SecurityManager#checkRead(String)} is invoked to check - * read access to the file. - */ - public abstract boolean notExists(); - - /** - * Returns the {@link FileStore} representing the file store where an - * existing file, located by this path, is stored. - * - *

Once a reference to the {@code FileStore} is obtained it is - * implementation specific if operations on the returned {@code FileStore}, - * or {@link FileStoreAttributeView} objects obtained from it, continue - * to depend on the existence of the file. In particular the behavior is not - * defined for the case that the file is deleted or moved to a different - * file store. - * - * @return the file store where the file is stored - * - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to the file, and in - * addition it checks {@link RuntimePermission} - * ("getFileStoreAttributes") - */ - public abstract FileStore getFileStore() throws IOException; + File toFile(); // -- watchable -- @@ -1471,8 +594,8 @@ public abstract class Path * *

In this release, this path locates a directory that exists. The * directory is registered with the watch service so that entries in the - * directory can be watched. The {@code events} parameter is an array of - * events to register and may contain the following events: + * directory can be watched. The {@code events} parameter is the events to + * register and may contain the following events: *

    *
  • {@link StandardWatchEventKind#ENTRY_CREATE ENTRY_CREATE} - * entry created or moved into the directory
  • @@ -1489,10 +612,10 @@ public abstract class Path *

    The set of events may include additional implementation specific * event that are not defined by the enum {@link StandardWatchEventKind} * - *

    The {@code modifiers} parameter is an array of modifiers - * that qualify how the directory is registered. This release does not - * define any standard modifiers. The array may contain - * implementation specific modifiers. + *

    The {@code modifiers} parameter specifies modifiers that + * qualify how the directory is registered. This release does not define any + * standard modifiers. It may contain implementation specific + * modifiers. * *

    Where a file is registered with a watch service by means of a symbolic * link then it is implementation specific if the watch continues to depend @@ -1525,9 +648,9 @@ public abstract class Path * method is invoked to check read access to the file. */ @Override - public abstract WatchKey register(WatchService watcher, - WatchEvent.Kind[] events, - WatchEvent.Modifier... modifiers) + WatchKey register(WatchService watcher, + WatchEvent.Kind[] events, + WatchEvent.Modifier... modifiers) throws IOException; /** @@ -1573,8 +696,8 @@ public abstract class Path * method is invoked to check read access to the file. */ @Override - public abstract WatchKey register(WatchService watcher, - WatchEvent.Kind... events) + WatchKey register(WatchService watcher, + WatchEvent.Kind... events) throws IOException; // -- Iterable -- @@ -1591,7 +714,7 @@ public abstract class Path * @return an iterator over the name elements of this path. */ @Override - public abstract Iterator iterator(); + Iterator iterator(); // -- compareTo/equals/hashCode -- @@ -1609,50 +732,7 @@ public abstract class Path * lexicographically greater than the argument */ @Override - public abstract int compareTo(Path other); - - /** - * Tests if the file referenced by this object is the same file referenced - * by another object. - * - *

    If this {@code Path} and the given {@code Path} are {@link - * #equals(Object) equal} then this method returns {@code true} without checking - * if the file exists. If the {@code Path} and the given {@code Path} - * are associated with different providers, or the given {@code Path} is - * {@code null} then this method returns {@code false}. Otherwise, this method - * checks if both {@code Paths} locate the same file, and depending on the - * implementation, may require to open or access both files. - * - *

    If the file system and files remain static, then this method implements - * an equivalence relation for non-null {@code Paths}. - *

      - *
    • It is reflexive: for a non-null {@code Path} {@code f}, - * {@code f.isSameFile(f)} should return {@code true}. - *
    • It is symmetric: for two non-null {@code Path} - * {@code f} and {@code g}, {@code f.isSameFile(g)} will equal - * {@code g.isSameFile(f)}. - *
    • It is transitive: for three {@code Paths} - * {@code f}, {@code g}, and {@code h}, if {@code f.isSameFile(g)} returns - * {@code true} and {@code g.isSameFile(h)} returns {@code true}, then - * {@code f.isSameFile(h)} will return return {@code true}. - *
    - * - * @param other - * the other file reference - * - * @return {@code true} if, and only if, this object and the given object - * locate the same file - * - * @throws IOException - * if an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, the {@link SecurityManager#checkRead(String) checkRead} - * method is invoked to check read access to both files. - * - * @see java.nio.file.attribute.BasicFileAttributes#fileKey - */ - public abstract boolean isSameFile(Path other) throws IOException; + int compareTo(Path other); /** * Tests this path for equality with the given object. @@ -1663,7 +743,9 @@ public abstract class Path *

    Whether or not two path are equal depends on the file system * implementation. In some cases the paths are compared without regard * to case, and others are case sensitive. This method does not access the - * file system and the file is not required to exist. + * file system and the file is not required to exist. Where required, the + * {@link Files#isSameFile isSameFile} method may be used to check if two + * paths locate the same file. * *

    This method satisfies the general contract of the {@link * java.lang.Object#equals(Object) Object.equals} method.

    @@ -1674,8 +756,7 @@ public abstract class Path * @return {@code true} if, and only if, the given object is a {@code Path} * that is identical to this {@code Path} */ - @Override - public abstract boolean equals(Object other); + boolean equals(Object other); /** * Computes a hash code for this path. @@ -1686,8 +767,7 @@ public abstract class Path * * @return the hash-code value for this path */ - @Override - public abstract int hashCode(); + int hashCode(); /** * Returns the string representation of this path. @@ -1701,6 +781,5 @@ public abstract class Path * * @return the string representation of this path */ - @Override - public abstract String toString(); + String toString(); } diff --git a/jdk/src/share/classes/java/nio/file/PathMatcher.java b/jdk/src/share/classes/java/nio/file/PathMatcher.java index 39af77d6b06..952f18f17f9 100644 --- a/jdk/src/share/classes/java/nio/file/PathMatcher.java +++ b/jdk/src/share/classes/java/nio/file/PathMatcher.java @@ -32,7 +32,7 @@ package java.nio.file; * @since 1.7 * * @see FileSystem#getPathMatcher - * @see Path#newDirectoryStream(String) + * @see Files#newDirectoryStream(Path,String) */ public interface PathMatcher { diff --git a/jdk/src/share/classes/java/nio/file/Paths.java b/jdk/src/share/classes/java/nio/file/Paths.java index be51761c486..d0906d4443f 100644 --- a/jdk/src/share/classes/java/nio/file/Paths.java +++ b/jdk/src/share/classes/java/nio/file/Paths.java @@ -39,14 +39,27 @@ public final class Paths { private Paths() { } /** - * Constructs a {@code Path} by converting the given path string. + * Converts a path string, or a sequence of strings that when joined form + * a path string, to a {@code Path}. If {@code more} does not specify any + * elements then the value of the {@code first} parameter is the path string + * to convert. If {@code more} specifies one or more elements then each + * non-empty string, including {@code first}, is considered to be a sequence + * of name elements (see {@link Path}) and is joined to form a path string. + * The details as to how the Strings are joined is provider specific but + * typically they will be joined using the {@link FileSystem#getSeparator + * name-separator} as the separator. For example, if the name separator is + * "{@code /}" and {@code getPath("/foo","bar","gus")} is invoked, then the + * path string {@code "/foo/bar/gus"} is converted to a {@code Path}. + * A {@code Path} representing an empty path is returned if {@code first} + * is the empty string and {@code more} does not contain any non-empty + * strings. * *

    The {@code Path} is obtained by invoking the {@link FileSystem#getPath * getPath} method of the {@link FileSystems#getDefault default} {@link * FileSystem}. * - *

    Note that while this method is very convenient, using it will - * imply an assumed reference to the default FileSystem and limit the + *

    Note that while this method is very convenient, using it will imply + * an assumed reference to the default {@code FileSystem} and limit the * utility of the calling code. Hence it should not be used in library code * intended for flexible reuse. A more flexible alternative is to use an * existing {@code Path} instance as an anchor, such as: @@ -55,8 +68,10 @@ public final class Paths { * Path path = dir.resolve("file"); *

* - * @param path - * the path string to convert + * @param first + * the path string or initial part of the path string + * @param more + * additional strings to be joined to form the path string * * @return the resulting {@code Path} * @@ -65,8 +80,8 @@ public final class Paths { * * @see FileSystem#getPath */ - public static Path get(String path) { - return FileSystems.getDefault().getPath(path); + public static Path get(String first, String... more) { + return FileSystems.getDefault().getPath(first, more); } /** diff --git a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java index 319237bfe96..fa26e513fd9 100644 --- a/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java +++ b/jdk/src/share/classes/java/nio/file/SecureDirectoryStream.java @@ -43,7 +43,7 @@ import java.io.IOException; * *

A {@code SecureDirectoryStream} requires corresponding support from the * underlying operating system. Where an implementation supports this features - * then the {@code DirectoryStream} returned by the {@link Path#newDirectoryStream + * then the {@code DirectoryStream} returned by the {@link Files#newDirectoryStream * newDirectoryStream} method will be a {@code SecureDirectoryStream} and must * be cast to that type in order to invoke the methods defined by this interface. * @@ -56,20 +56,15 @@ import java.io.IOException; * @since 1.7 */ -public abstract class SecureDirectoryStream - implements DirectoryStream +public interface SecureDirectoryStream + extends DirectoryStream { - /** - * Initialize a new instance of this class. - */ - protected SecureDirectoryStream() { } - /** * Opens the directory identified by the given path, returning a {@code * SecureDirectoryStream} to iterate over the entries in the directory. * *

This method works in exactly the manner specified by the {@link - * Path#newDirectoryStream() newDirectoryStream} method for the case that + * Files#newDirectoryStream(Path) newDirectoryStream} method for the case that * the {@code path} parameter is an {@link Path#isAbsolute absolute} path. * When the parameter is a relative path then the directory to open is * relative to this open directory. The {@link @@ -99,8 +94,7 @@ public abstract class SecureDirectoryStream * installed, the {@link SecurityManager#checkRead(String) checkRead} * method is invoked to check read access to the directory. */ - public abstract SecureDirectoryStream newDirectoryStream(T path, - LinkOption... options) + SecureDirectoryStream newDirectoryStream(T path, LinkOption... options) throws IOException; /** @@ -108,11 +102,11 @@ public abstract class SecureDirectoryStream * channel to access the file. * *

This method works in exactly the manner specified by the {@link - * Path#newByteChannel Path.newByteChannel} method for the + * Files#newByteChannel Files.newByteChannel} method for the * case that the {@code path} parameter is an {@link Path#isAbsolute absolute} * path. When the parameter is a relative path then the file to open or * create is relative to this open directory. In addition to the options - * defined by the {@code Path.newByteChannel} method, the {@link + * defined by the {@code Files.newByteChannel} method, the {@link * LinkOption#NOFOLLOW_LINKS NOFOLLOW_LINKS} option may be used to * ensure that this method fails if the file is a symbolic link. * @@ -149,15 +143,15 @@ public abstract class SecureDirectoryStream * checkWrite} method is invoked to check write access to the path * if the file is opened for writing. */ - public abstract SeekableByteChannel newByteChannel(T path, - Set options, - FileAttribute... attrs) + SeekableByteChannel newByteChannel(T path, + Set options, + FileAttribute... attrs) throws IOException; /** * Deletes a file. * - *

Unlike the {@link Path#delete delete()} method, this method does + *

Unlike the {@link Files#delete delete()} method, this method does * not first examine the file to determine if the file is a directory. * Whether a directory is deleted by this method is system dependent and * therefore not specified. If the file is a symbolic link, then the link @@ -179,12 +173,12 @@ public abstract class SecureDirectoryStream * installed, the {@link SecurityManager#checkDelete(String) checkDelete} * method is invoked to check delete access to the file */ - public abstract void deleteFile(T path) throws IOException; + void deleteFile(T path) throws IOException; /** * Deletes a directory. * - *

Unlike the {@link Path#delete delete()} method, this method + *

Unlike the {@link Files#delete delete()} method, this method * does not first examine the file to determine if the file is a directory. * Whether non-directories are deleted by this method is system dependent and * therefore not specified. When the parameter is a relative path then the @@ -207,12 +201,12 @@ public abstract class SecureDirectoryStream * installed, the {@link SecurityManager#checkDelete(String) checkDelete} * method is invoked to check delete access to the directory */ - public abstract void deleteDirectory(T path) throws IOException; + void deleteDirectory(T path) throws IOException; /** * Move a file from this directory to another directory. * - *

This method works in a similar manner to {@link Path#moveTo moveTo} + *

This method works in a similar manner to {@link Files#move move} * method when the {@link StandardCopyOption#ATOMIC_MOVE ATOMIC_MOVE} option * is specified. That is, this method moves a file as an atomic file system * operation. If the {@code srcpath} parameter is an {@link Path#isAbsolute @@ -247,7 +241,7 @@ public abstract class SecureDirectoryStream * method is invoked to check write access to both the source and * target file. */ - public abstract void move(T srcpath, SecureDirectoryStream targetdir, T targetpath) + void move(T srcpath, SecureDirectoryStream targetdir, T targetpath) throws IOException; /** @@ -273,7 +267,7 @@ public abstract class SecureDirectoryStream * this directory stream, or {@code null} if the attribute view * type is not available */ - public abstract V getFileAttributeView(Class type); + V getFileAttributeView(Class type); /** * Returns a new file attribute view to access the file attributes of a file @@ -306,7 +300,7 @@ public abstract class SecureDirectoryStream * type is not available * */ - public abstract V getFileAttributeView(T path, - Class type, - LinkOption... options); + V getFileAttributeView(T path, + Class type, + LinkOption... options); } diff --git a/jdk/src/share/classes/java/io/TempFileHelper.java b/jdk/src/share/classes/java/nio/file/TempFileHelper.java similarity index 56% rename from jdk/src/share/classes/java/io/TempFileHelper.java rename to jdk/src/share/classes/java/nio/file/TempFileHelper.java index 19852f32d1a..377730b4455 100644 --- a/jdk/src/share/classes/java/io/TempFileHelper.java +++ b/jdk/src/share/classes/java/nio/file/TempFileHelper.java @@ -23,54 +23,82 @@ * questions. */ -package java.io; +package java.nio.file; -import java.nio.file.FileSystems; -import java.nio.file.InvalidPathException; -import java.nio.file.FileAlreadyExistsException; +import java.util.Set; +import java.util.EnumSet; +import java.security.SecureRandom; +import static java.security.AccessController.*; +import java.io.IOException; import java.nio.file.attribute.FileAttribute; import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.PosixFilePermissions; import static java.nio.file.attribute.PosixFilePermission.*; -import java.util.Set; -import java.util.EnumSet; +import sun.security.action.GetPropertyAction; + /** - * Helper class to support creation of temporary files and directory with + * Helper class to support creation of temporary files and directories with * initial attributes. */ class TempFileHelper { private TempFileHelper() { } + // temporary directory location + private static final Path tmpdir = + Paths.get(doPrivileged(new GetPropertyAction("java.io.tmpdir"))); + + private static final boolean isPosix = + FileSystems.getDefault().supportedFileAttributeViews().contains("posix"); + + // file name generation, same as java.io.File for now + private static final SecureRandom random = new SecureRandom(); + private static Path generatePath(String prefix, String suffix, Path dir) { + long n = random.nextLong(); + n = (n == Long.MIN_VALUE) ? 0 : Math.abs(n); + Path name = dir.getFileSystem().getPath(prefix + Long.toString(n) + suffix); + // the generated name should be a simple file name + if (name.getParent() != null) + throw new IllegalArgumentException("Invalid prefix or suffix"); + return dir.resolve(name); + } + // default file and directory permissions (lazily initialized) - private static class PermissionsHolder { - static final boolean hasPosixPermissions = FileSystems.getDefault() - .supportedFileAttributeViews().contains("posix"); + private static class PosixPermissions { static final FileAttribute> filePermissions = PosixFilePermissions.asFileAttribute(EnumSet.of(OWNER_READ, OWNER_WRITE)); - static final FileAttribute> directoryPermissions = + static final FileAttribute> dirPermissions = PosixFilePermissions.asFileAttribute(EnumSet .of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE)); } /** - * Creates a file or directory in the temporary directory. + * Creates a file or directory in in the given given directory (or in the + * temporary directory if dir is {@code null}). */ - private static File create(String prefix, + private static Path create(Path dir, + String prefix, String suffix, - FileAttribute[] attrs, - boolean isDirectory) + boolean createDirectory, + FileAttribute[] attrs) throws IOException { + if (prefix == null) + prefix = ""; + if (suffix == null) + suffix = (createDirectory) ? "" : ".tmp"; + if (dir == null) + dir = tmpdir; + // in POSIX environments use default file and directory permissions // if initial permissions not given by caller. - if (PermissionsHolder.hasPosixPermissions) { + if (isPosix && (dir.getFileSystem() == FileSystems.getDefault())) { if (attrs.length == 0) { // no attributes so use default permissions attrs = new FileAttribute[1]; - attrs[0] = (isDirectory) ? PermissionsHolder.directoryPermissions : - PermissionsHolder.filePermissions; + attrs[0] = (createDirectory) ? PosixPermissions.dirPermissions : + PosixPermissions.filePermissions; } else { // check if posix permissions given; if not use default boolean hasPermissions = false; @@ -84,9 +112,9 @@ class TempFileHelper { FileAttribute[] copy = new FileAttribute[attrs.length+1]; System.arraycopy(attrs, 0, copy, 0, attrs.length); attrs = copy; - attrs[attrs.length-1] = (isDirectory) ? - PermissionsHolder.directoryPermissions : - PermissionsHolder.filePermissions; + attrs[attrs.length-1] = (createDirectory) ? + PosixPermissions.dirPermissions : + PosixPermissions.filePermissions; } } } @@ -94,24 +122,25 @@ class TempFileHelper { // loop generating random names until file or directory can be created SecurityManager sm = System.getSecurityManager(); for (;;) { - File tmpdir = File.TempDirectory.location(); - File f = File.TempDirectory.generateFile(prefix, suffix, tmpdir); + Path f; try { - if (isDirectory) { - f.toPath().createDirectory(attrs); - } else { - f.toPath().createFile(attrs); - } - return f; + f = generatePath(prefix, suffix, dir); } catch (InvalidPathException e) { // don't reveal temporary directory location if (sm != null) throw new IllegalArgumentException("Invalid prefix or suffix"); throw e; + } + try { + if (createDirectory) { + return Files.createDirectory(f, attrs); + } else { + return Files.createFile(f, attrs); + } } catch (SecurityException e) { // don't reveal temporary directory location - if (sm != null) - throw new SecurityException("Unable to create temporary file"); + if (dir == tmpdir && sm != null) + throw new SecurityException("Unable to create temporary file or directory"); throw e; } catch (FileAlreadyExistsException e) { // ignore @@ -120,20 +149,27 @@ class TempFileHelper { } /** - * Creates a file in the temporary directory. + * Creates a temporary file in the given directory, or in in the + * temporary directory if dir is {@code null}. */ - static File createFile(String prefix, String suffix, FileAttribute[] attrs) + static Path createTempFile(Path dir, + String prefix, + String suffix, + FileAttribute[] attrs) throws IOException { - return create(prefix, suffix, attrs, false); + return create(dir, prefix, suffix, false, attrs); } /** - * Creates a directory in the temporary directory. + * Creates a temporary directory in the given directory, or in in the + * temporary directory if dir is {@code null}. */ - static File createDirectory(String prefix, FileAttribute[] attrs) + static Path createTempDirectory(Path dir, + String prefix, + FileAttribute[] attrs) throws IOException { - return create(prefix, "", attrs, true); + return create(dir, prefix, null, true, attrs); } } diff --git a/jdk/src/share/classes/java/nio/file/WatchEvent.java b/jdk/src/share/classes/java/nio/file/WatchEvent.java index 68c93a117a4..2753fb2c3ac 100644 --- a/jdk/src/share/classes/java/nio/file/WatchEvent.java +++ b/jdk/src/share/classes/java/nio/file/WatchEvent.java @@ -44,7 +44,7 @@ package java.nio.file; * @since 1.7 */ -public abstract class WatchEvent { +public interface WatchEvent { /** * An event kind, for the purposes of identification. @@ -64,11 +64,6 @@ public abstract class WatchEvent { Class type(); } - /** - * Initializes a new instance of this class. - */ - protected WatchEvent() { } - /** * An event modifier that qualifies how a {@link Watchable} is registered * with a {@link WatchService}. @@ -90,7 +85,7 @@ public abstract class WatchEvent { * * @return the event kind */ - public abstract Kind kind(); + Kind kind(); /** * Returns the event count. If the event count is greater than {@code 1} @@ -98,7 +93,7 @@ public abstract class WatchEvent { * * @return the event count */ - public abstract int count(); + int count(); /** * Returns the context for the event. @@ -112,5 +107,5 @@ public abstract class WatchEvent { * * @return the event context; may be {@code null} */ - public abstract T context(); + T context(); } diff --git a/jdk/src/share/classes/java/nio/file/WatchKey.java b/jdk/src/share/classes/java/nio/file/WatchKey.java index 72997866b20..23897dba454 100644 --- a/jdk/src/share/classes/java/nio/file/WatchKey.java +++ b/jdk/src/share/classes/java/nio/file/WatchKey.java @@ -81,11 +81,7 @@ import java.util.List; * @since 1.7 */ -public abstract class WatchKey { - /** - * Initializes a new instance of this class. - */ - protected WatchKey() { } +public interface WatchKey { /** * Tells whether or not this watch key is valid. @@ -95,7 +91,7 @@ public abstract class WatchKey { * * @return {@code true} if, and only if, this watch key is valid */ - public abstract boolean isValid(); + boolean isValid(); /** * Retrieves and removes all pending events for this watch key, returning @@ -105,7 +101,7 @@ public abstract class WatchKey { * * @return the list of the events retrieved; may be empty */ - public abstract List> pollEvents(); + List> pollEvents(); /** * Resets this watch key. @@ -121,7 +117,7 @@ public abstract class WatchKey { * {@code false} if the watch key could not be reset because it is * no longer {@link #isValid valid} */ - public abstract boolean reset(); + boolean reset(); /** * Cancels the registration with the watch service. Upon return the watch key @@ -134,5 +130,21 @@ public abstract class WatchKey { *

If this watch key has already been cancelled then invoking this * method has no effect. Once cancelled, a watch key remains forever invalid. */ - public abstract void cancel(); + void cancel(); + + /** + * Returns the object for which this watch key was created. This method will + * continue to return the object even after the key is cancelled. + * + *

As the {@code WatchService} is intended to map directly on to the + * native file event notification facility (where available) then many of + * details on how registered objects are watched is highly implementation + * specific. When watching a directory for changes for example, and the + * directory is moved or renamed in the file system, there is no guarantee + * that the watch key will be cancelled and so the object returned by this + * method may no longer be a valid path to the directory. + * + * @return the object for which this watch key was created + */ + //T watchable(); } diff --git a/jdk/src/share/classes/java/nio/file/WatchService.java b/jdk/src/share/classes/java/nio/file/WatchService.java index 048472b6cdb..255e03fe518 100644 --- a/jdk/src/share/classes/java/nio/file/WatchService.java +++ b/jdk/src/share/classes/java/nio/file/WatchService.java @@ -103,13 +103,9 @@ import java.util.concurrent.TimeUnit; * @see FileSystem#newWatchService */ -public abstract class WatchService - implements Closeable +public interface WatchService + extends Closeable { - /** - * Initializes a new instance of this class. - */ - protected WatchService() { } /** * Closes this watch service. @@ -129,7 +125,7 @@ public abstract class WatchService * if an I/O error occurs */ @Override - public abstract void close() throws IOException; + void close() throws IOException; /** * Retrieves and removes the next watch key, or {@code null} if none are @@ -140,7 +136,7 @@ public abstract class WatchService * @throws ClosedWatchServiceException * if this watch service is closed */ - public abstract WatchKey poll(); + WatchKey poll(); /** * Retrieves and removes the next watch key, waiting if necessary up to the @@ -160,7 +156,7 @@ public abstract class WatchService * @throws InterruptedException * if interrupted while waiting */ - public abstract WatchKey poll(long timeout, TimeUnit unit) + WatchKey poll(long timeout, TimeUnit unit) throws InterruptedException; /** @@ -174,5 +170,5 @@ public abstract class WatchService * @throws InterruptedException * if interrupted while waiting */ - public abstract WatchKey take() throws InterruptedException; + WatchKey take() throws InterruptedException; } diff --git a/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java b/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java index b49944c1894..a0ea1fd16d5 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java +++ b/jdk/src/share/classes/java/nio/file/attribute/AclEntry.java @@ -176,7 +176,7 @@ public final class AclEntry { */ public Builder setPermissions(Set perms) { // copy and check for erroneous elements - perms = new HashSet(perms); + perms = EnumSet.copyOf(perms); checkSet(perms, AclEntryPermission.class); this.perms = perms; return this; @@ -190,8 +190,7 @@ public final class AclEntry { * @return this builder */ public Builder setPermissions(AclEntryPermission... perms) { - Set set = - new HashSet(perms.length); + Set set = EnumSet.noneOf(AclEntryPermission.class); // copy and check for null elements for (AclEntryPermission p: perms) { if (p == null) @@ -214,7 +213,7 @@ public final class AclEntry { */ public Builder setFlags(Set flags) { // copy and check for erroneous elements - flags = new HashSet(flags); + flags = EnumSet.copyOf(flags); checkSet(flags, AclEntryFlag.class); this.flags = flags; return this; @@ -228,7 +227,7 @@ public final class AclEntry { * @return this builder */ public Builder setFlags(AclEntryFlag... flags) { - Set set = new HashSet(flags.length); + Set set = EnumSet.noneOf(AclEntryFlag.class); // copy and check for null elements for (AclEntryFlag f: flags) { if (f == null) diff --git a/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java index 13673116623..d4a8ba8b27e 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java @@ -65,7 +65,7 @@ import java.io.IOException; * UserPrincipalLookupService} may be used to obtain a {@link UserPrincipal} * to represent these special identities by invoking the {@link * UserPrincipalLookupService#lookupPrincipalByName lookupPrincipalByName} - * method. + * method.

* *

Usage Example: * Suppose we wish to add an entry to an existing ACL to grant "joe" access: @@ -75,7 +75,7 @@ import java.io.IOException; * .lookupPrincipalByName("joe"); * * // get view - * AclFileAttributeView view = file.getFileAttributeView(AclFileAttributeView.class); + * AclFileAttributeView view = Files.getFileAttributeView(file, AclFileAttributeView.class); * * // create ACE to give "joe" read access * AclEntry entry = AclEntry.newBuilder() @@ -110,11 +110,11 @@ import java.io.IOException; * * * - *

The {@link FileRef#getAttribute getAttribute} method may be used to read + *

The {@link Files#getAttribute getAttribute} method may be used to read * the ACL or owner attributes as if by invoking the {@link #getAcl getAcl} or * {@link #getOwner getOwner} methods. * - *

The {@link FileRef#setAttribute setAttribute} method may be used to + *

The {@link Files#setAttribute setAttribute} method may be used to * update the ACL or owner attributes as if by invoking the {@link #setAcl setAcl} * or {@link #setOwner setOwner} methods. * @@ -122,8 +122,8 @@ import java.io.IOException; * *

Implementations supporting this attribute view may also support setting * the initial ACL when creating a file or directory. The initial ACL - * may be provided to methods such as {@link Path#createFile createFile} or {@link - * Path#createDirectory createDirectory} as an {@link FileAttribute} with {@link + * may be provided to methods such as {@link Files#createFile createFile} or {@link + * Files#createDirectory createDirectory} as an {@link FileAttribute} with {@link * FileAttribute#name name} {@code "acl:acl"} and a {@link FileAttribute#value * value} that is the list of {@code AclEntry} objects. * @@ -135,8 +135,6 @@ import java.io.IOException; * translation. * * @since 1.7 - * @see Attributes#getAcl - * @see Attributes#setAcl */ public interface AclFileAttributeView diff --git a/jdk/src/share/classes/java/nio/file/attribute/Attributes.java b/jdk/src/share/classes/java/nio/file/attribute/Attributes.java deleted file mode 100644 index 32dbec38ee6..00000000000 --- a/jdk/src/share/classes/java/nio/file/attribute/Attributes.java +++ /dev/null @@ -1,460 +0,0 @@ -/* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.nio.file.attribute; - -import java.nio.file.*; -import java.io.IOException; -import java.util.*; - -/** - * This class consists exclusively of static methods that operate on or return - * the attributes of files or file stores. These methods provide for convenient - * use of the {@link AttributeView attribute-views} defined in this package. - * - * @since 1.7 - */ - -public final class Attributes { - private Attributes() { } - - /** - * Reads the basic file attributes of a file. - * - *

The {@code options} array may be used to indicate how symbolic links - * are handled for the case that the file is a symbolic link. By default, - * symbolic links are followed and the file attributes of the final target - * of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS - * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attributes of the symbolic link itself. - * This option should be used where there is a need to determine if a - * file is a symbolic link: - *

-     *    boolean isSymbolicLink = Attributes.readBasicFileAttributes(file, NOFOLLOW_LINKS).isSymbolicLink();
-     * 
- * - *

It is implementation specific if all file attributes are read as an - * atomic operation with respect to other file system operations. - * - * @param file - * A file reference that locates the file - * @param options - * Options indicating how symbolic links are handled - * - * @return The basic file attributes - * - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, the security manager's {@link - * SecurityManager#checkRead(String) checkRead} method is invoked - * to check read access to file - * - * @see BasicFileAttributeView#readAttributes - */ - public static BasicFileAttributes readBasicFileAttributes(FileRef file, - LinkOption... options) - throws IOException - { - return file.getFileAttributeView(BasicFileAttributeView.class, options) - .readAttributes(); - } - - /** - * Reads the POSIX file attributes of a file. - * - *

The {@code file} parameter locates a file that supports the {@link - * PosixFileAttributeView}. This file attribute view provides access to a - * subset of the file attributes commonly associated with files on file - * systems used by operating systems that implement the Portable Operating - * System Interface (POSIX) family of standards. It is implementation - * specific if all file attributes are read as an atomic operation with - * respect to other file system operations. - * - *

The {@code options} array may be used to indicate how symbolic links - * are handled for the case that the file is a symbolic link. By default, - * symbolic links are followed and the file attributes of the final target - * of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS - * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attributes of the symbolic link itself. - * - * @param file - * A file reference that locates the file - * @param options - * Options indicating how symbolic links are handled - * - * @return The POSIX file attributes - * - * @throws UnsupportedOperationException - * If the {@code PosixFileAttributeView} is not available - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") - * or its {@link SecurityManager#checkRead(String) checkRead} method - * denies read access to the file. - * - * @see PosixFileAttributeView#readAttributes - */ - public static PosixFileAttributes readPosixFileAttributes(FileRef file, - LinkOption... options) - throws IOException - { - PosixFileAttributeView view = - file.getFileAttributeView(PosixFileAttributeView.class, options); - if (view == null) - throw new UnsupportedOperationException(); - return view.readAttributes(); - } - - /** - * Reads the DOS file attributes of a file. - * - *

The {@code file} parameter locates a file that supports the {@link - * DosFileAttributeView}. This file attribute view provides access to - * legacy "DOS" attributes supported by the file systems such as File - * Allocation Table (FAT), commonly used in consumer devices. It is - * implementation specific if all file attributes are read as an atomic - * operation with respect to other file system operations. - * - *

The {@code options} array may be used to indicate how symbolic links - * are handled for the case that the file is a symbolic link. By default, - * symbolic links are followed and the file attributes of the final target - * of the link are read. If the option {@link LinkOption#NOFOLLOW_LINKS - * NOFOLLOW_LINKS} is present then symbolic links are not followed and so - * the method returns the file attributes of the symbolic link itself. - * - * @param file - * A file reference that locates the file - * @param options - * Options indicating how symbolic links are handled - * - * @return The DOS file attributes - * - * @throws UnsupportedOperationException - * If the {@code DosFileAttributeView} is not available - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, the security manager's {@link - * SecurityManager#checkRead(String) checkRead} method is invoked - * to check read access to file - * - * @see DosFileAttributeView#readAttributes - */ - public static DosFileAttributes readDosFileAttributes(FileRef file, - LinkOption... options) - throws IOException - { - DosFileAttributeView view = - file.getFileAttributeView(DosFileAttributeView.class, options); - if (view == null) - throw new UnsupportedOperationException(); - return view.readAttributes(); - } - - /** - * Returns the owner of a file. - * - *

The {@code file} parameter locates a file that supports the {@link - * FileOwnerAttributeView}. This file attribute view provides access to - * a file attribute that is the owner of the file. - * - * @param file - * A file reference that locates the file - * - * @return A user principal representing the owner of the file - * - * @throws UnsupportedOperationException - * If the {@code FileOwnerAttributeView} is not available - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") - * or its {@link SecurityManager#checkRead(String) checkRead} method - * denies read access to the file. - * - * @see FileOwnerAttributeView#getOwner - */ - public static UserPrincipal getOwner(FileRef file) throws IOException { - FileOwnerAttributeView view = - file.getFileAttributeView(FileOwnerAttributeView.class); - if (view == null) - throw new UnsupportedOperationException(); - return view.getOwner(); - } - - /** - * Updates the file owner. - * - *

The {@code file} parameter locates a file that supports the {@link - * FileOwnerAttributeView}. This file attribute view provides access to - * a file attribute that is the owner of the file. - * - * @param file - * A file reference that locates the file - * @param owner - * The new file owner - * - * @throws UnsupportedOperationException - * If the {@code FileOwnerAttributeView} is not available - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") - * or its {@link SecurityManager#checkWrite(String) checkWrite} - * method denies write access to the file. - * - * @see FileOwnerAttributeView#setOwner - */ - public static void setOwner(FileRef file, UserPrincipal owner) - throws IOException - { - FileOwnerAttributeView view = - file.getFileAttributeView(FileOwnerAttributeView.class); - if (view == null) - throw new UnsupportedOperationException(); - view.setOwner(owner); - } - - /** - * Reads a file's Access Control List (ACL). - * - *

The {@code file} parameter locates a file that supports the {@link - * AclFileAttributeView}. This file attribute view provides access to ACLs - * based on the ACL model specified in - * RFC 3530. - * - * @param file - * A file reference that locates the file - * - * @return An ordered list of {@link AclEntry entries} representing the - * ACL. The returned list is modifiable. - * - * @throws UnsupportedOperationException - * If the {@code AclAttributeView} is not available - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") - * or its {@link SecurityManager#checkRead(String) checkRead} method - * denies read access to the file. - * - * @see AclFileAttributeView#getAcl - */ - public static List getAcl(FileRef file) throws IOException { - AclFileAttributeView view = - file.getFileAttributeView(AclFileAttributeView.class); - if (view == null) - throw new UnsupportedOperationException(); - return view.getAcl(); - } - - /** - * Updates a file's Access Control List (ACL). - * - *

The {@code file} parameter locates a file that supports the {@link - * AclFileAttributeView}. This file attribute view provides access to ACLs - * based on the ACL model specified in - * RFC 3530. - * - * @param file - * A file reference that locates the file - * @param acl - * The new file ACL - * - * @throws UnsupportedOperationException - * If the {@code AclFileAttributeView} is not available - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") - * or its {@link SecurityManager#checkWrite(String) checkWrite} - * method denies write access to the file. - * - * @see AclFileAttributeView#setAcl - */ - public static void setAcl(FileRef file, List acl) - throws IOException - { - AclFileAttributeView view = - file.getFileAttributeView(AclFileAttributeView.class); - if (view == null) - throw new UnsupportedOperationException(); - view.setAcl(acl); - } - - /** - * Updates a file's last modified time attribute. The file time is converted - * to the epoch and precision supported by the file system. Converting from - * finer to coarser granularities result in precision loss. The behavior of - * this method when attempting to set a timestamp to a value that is outside - * the range supported by the underlying file store is not defined. It may - * or not fail by throwing an {@code IOException}. - * - *

If the file system does not support a last modified time attribute - * then this method has no effect. - * - *

Usage Example: - * Suppose we want to set the last modified time to the current time: - *

-     *    FileTime now = FileTime.fromMillis(System.currentTimeMillis());
-     *    Attributes.setLastModifiedTime(file, now);
-     * 
- * - * @param file - * A file reference that locates the file - * @param lastModifiedTime - * The new last modified time - * - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, the security manager's {@link - * SecurityManager#checkWrite(String) checkWrite} method is invoked - * to check write access to file - * - * @see BasicFileAttributeView#setTimes - */ - public static void setLastModifiedTime(FileRef file, - FileTime lastModifiedTime) - throws IOException - { - if (lastModifiedTime == null) - throw new NullPointerException("'lastModifiedTime' is null"); - file.getFileAttributeView(BasicFileAttributeView.class) - .setTimes(lastModifiedTime, null, null); - } - - /** - * Updates a file's last access time attribute. The file time is converted - * to the epoch and precision supported by the file system. Converting from - * finer to coarser granularities result in precision loss. The behavior of - * this method when attempting to set a timestamp to a value that is outside - * the range supported by the underlying file store is not defined. It may - * or not fail by throwing an {@code IOException}. - * - *

If the file system does not support a last access time attribute then - * this method has no effect. - * - * @param file - * A file reference that locates the file - * @param lastAccessTime - * The new last access time - * - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, the security manager's {@link - * SecurityManager#checkWrite(String) checkWrite} method is invoked - * to check write access to file - * - * @see BasicFileAttributeView#setTimes - */ - public static void setLastAccessTime(FileRef file, - FileTime lastAccessTime) - throws IOException - { - if (lastAccessTime == null) - throw new NullPointerException("'lastAccessTime' is null"); - file.getFileAttributeView(BasicFileAttributeView.class) - .setTimes(null, lastAccessTime, null); - } - - /** - * Sets a file's POSIX permissions. - * - *

The {@code file} parameter is a reference to an existing file. It - * supports the {@link PosixFileAttributeView} that provides access to file - * attributes commonly associated with files on file systems used by - * operating systems that implement the Portable Operating System Interface - * (POSIX) family of standards. - * - * @param file - * A file reference that locates the file - * @param perms - * The new set of permissions - * - * @throws UnsupportedOperationException - * If {@code PosixFileAttributeView} is not available - * @throws ClassCastException - * If the sets contains elements that are not of type {@code - * PosixFilePermission} - * @throws IOException - * If an I/O error occurs - * @throws SecurityException - * In the case of the default provider, and a security manager is - * installed, it denies {@link RuntimePermission}("accessUserInformation") - * or its {@link SecurityManager#checkWrite(String) checkWrite} - * method denies write access to the file. - * - * @see PosixFileAttributeView#setPermissions - */ - public static void setPosixFilePermissions(FileRef file, - Set perms) - throws IOException - { - PosixFileAttributeView view = - file.getFileAttributeView(PosixFileAttributeView.class); - if (view == null) - throw new UnsupportedOperationException(); - view.setPermissions(perms); - } - - /** - * Reads the space attributes of a file store. - * - *

The {@code store} parameter is a file store that supports the - * {@link FileStoreSpaceAttributeView} providing access to the space related - * attributes of the file store. It is implementation specific if all attributes - * are read as an atomic operation with respect to other file system operations. - * - * @param store - * The file store - * - * @return The file store space attributes - * - * @throws UnsupportedOperationException - * If the file store space attribute view is not supported - * @throws IOException - * If an I/O error occurs - * - * @see FileStoreSpaceAttributeView#readAttributes() - */ - public static FileStoreSpaceAttributes readFileStoreSpaceAttributes(FileStore store) - throws IOException - { - FileStoreSpaceAttributeView view = - store.getFileStoreAttributeView(FileStoreSpaceAttributeView.class); - if (view == null) - throw new UnsupportedOperationException(); - return view.readAttributes(); - } -} diff --git a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java index e2534812e99..4c50f82e952 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java @@ -85,16 +85,15 @@ import java.io.IOException; * * * - *

The {@link java.nio.file.FileRef#getAttribute getAttribute} method may be + *

The {@link java.nio.file.Files#getAttribute getAttribute} method may be * used to read any of these attributes as if by invoking the {@link * #readAttributes() readAttributes()} method. * - *

The {@link java.nio.file.FileRef#setAttribute setAttribute} method may be + *

The {@link java.nio.file.Files#setAttribute setAttribute} method may be * used to update the file's last modified time, last access time or create time * attributes as if by invoking the {@link #setTimes setTimes} method. * * @since 1.7 - * @see Attributes */ public interface BasicFileAttributeView @@ -131,9 +130,10 @@ public interface BasicFileAttributeView *

This method updates the file's timestamp attributes. The values are * converted to the epoch and precision supported by the file system. * Converting from finer to coarser granularities result in precision loss. - * The behavior of this method when attempting to set a timestamp to a value - * that is outside the range supported by the underlying file store is not - * defined. It may or not fail by throwing an {@code IOException}. + * The behavior of this method when attempting to set a timestamp that is + * not supported or to a value that is outside the range supported by the + * underlying file store is not defined. It may or not fail by throwing an + * {@code IOException}. * *

If any of the {@code lastModifiedTime}, {@code lastAccessTime}, * or {@code createTime} parameters has the value {@code null} then the @@ -146,6 +146,14 @@ public interface BasicFileAttributeView * lastAccessTime} and {@code createTime} parameters are {@code null} then * this method has no effect. * + *

Usage Example: + * Suppose we want to change a file's creation time. + *

+     *    Path path = ...
+     *    FileTime time = ...
+     *    Files.getFileAttributeView(path, BasicFileAttributeView.class).setTimes(null, null, time);
+     * 
+ * * @param lastModifiedTime * the new last modified time, or {@code null} to not change the * value @@ -160,6 +168,8 @@ public interface BasicFileAttributeView * In the case of the default provider, a security manager is * installed, its {@link SecurityManager#checkWrite(String) checkWrite} * method is invoked to check write access to the file + * + * @see java.nio.file.Files#setLastModifiedTime */ void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, diff --git a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java index 31e076b9286..aa5d2f56156 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java +++ b/jdk/src/share/classes/java/nio/file/attribute/BasicFileAttributes.java @@ -34,8 +34,8 @@ package java.nio.file.attribute; * *

Usage Example: *

- *    FileRef file = ...
- *    BasicFileAttributes attrs = Attributes.readBasicFileAttributes(file);
+ *    Path file = ...
+ *    BasicFileAttributes attrs = Files.readAttributes(file, BasicFileAttributes.class);
  * 
* * @since 1.7 @@ -48,25 +48,40 @@ public interface BasicFileAttributes { /** * Returns the time of last modification. * + *

If the file system implementation does not support a time stamp + * to indicate the time of last modification then this method returns an + * implementation specific default value, typically a {@code FileTime} + * representing the epoch (1970-01-01T00:00:00Z). + * * @return a {@code FileTime} representing the time the file was last - * modified or {@code null} if the attribute is not supported. + * modified */ FileTime lastModifiedTime(); /** - * Returns the time of last access if supported. + * Returns the time of last access. * - * @return a {@code FileTime} representing the time of last access or - * {@code null} if the attribute is not supported. + *

If the file system implementation does not support a time stamp + * to indicate the time of last access then this method returns + * an implementation specific default value, typically the {@link + * #lastModifiedTime() last-modified-time} or a {@code FileTime} + * representing the epoch (1970-01-01T00:00:00Z). + * + * @return a {@code FileTime} representing the time of last access */ FileTime lastAccessTime(); /** - * Returns the creation time if supported. The creation time is the time - * that the file was created. + * Returns the creation time. The creation time is the time that the file + * was created. * - * @return a {@code FileTime} representing the time the file was created - * or {@code null} if the attribute is not supported. + *

If the file system implementation does not support a time stamp + * to indicate the time when the file was created then this method returns + * an implementation specific default value, typically the {@link + * #lastModifiedTime() last-modified-time} or a {@code FileTime} + * representing the epoch (1970-01-01T00:00:00Z). + * + * @return a {@code FileTime} representing the time the file was created */ FileTime creationTime(); @@ -120,7 +135,7 @@ public interface BasicFileAttributes { * *

File keys returned by this method can be compared for equality and are * suitable for use in collections. If the file system and files remain static, - * and two files are the {@link java.nio.file.Path#isSameFile same} with + * and two files are the {@link java.nio.file.Files#isSameFile same} with * non-{@code null} file keys, then their file keys are equal. * * @see java.nio.file.Files#walkFileTree diff --git a/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java index def09013e78..7a21bae5fec 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java @@ -65,12 +65,12 @@ import java.io.IOException; * * * - *

The {@link java.nio.file.FileRef#getAttribute getAttribute} method may + *

The {@link java.nio.file.Files#getAttribute getAttribute} method may * be used to read any of these attributes, or any of the attributes defined by * {@link BasicFileAttributeView} as if by invoking the {@link #readAttributes * readAttributes()} method. * - *

The {@link java.nio.file.FileRef#setAttribute setAttribute} method may + *

The {@link java.nio.file.Files#setAttribute setAttribute} method may * be used to update the file's last modified time, last access time or create * time attributes as defined by {@link BasicFileAttributeView}. It may also be * used to update the DOS attributes as if by invoking the {@link #setReadOnly diff --git a/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributes.java b/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributes.java index d8d22174e84..d095d213358 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributes.java +++ b/jdk/src/share/classes/java/nio/file/attribute/DosFileAttributes.java @@ -29,13 +29,13 @@ package java.nio.file.attribute; * File attributes associated with a file in a file system that supports * legacy "DOS" attributes. * - *

The DOS attributes of a file are retrieved using a {@link - * DosFileAttributeView} by invoking its {@link DosFileAttributeView#readAttributes - * readAttributes} method. + *

Usage Example: + *

+ *    Path file = ...
+ *    DosFileAttributes attrs = Files.readAttributes(file, DosFileAttributes.class);
+ * 
* * @since 1.7 - * - * @see Attributes#readDosFileAttributes */ public interface DosFileAttributes diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java b/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java index d8c32fd7bbe..cd11d43dde8 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java +++ b/jdk/src/share/classes/java/nio/file/attribute/FileAttribute.java @@ -28,8 +28,8 @@ package java.nio.file.attribute; /** * An object that encapsulates the value of a file attribute that can be set * atomically when creating a new file or directory by invoking the {@link - * java.nio.file.Path#createFile createFile} or {@link - * java.nio.file.Path#createDirectory createDirectory} methods. + * java.nio.file.Files#createFile createFile} or {@link + * java.nio.file.Files#createDirectory createDirectory} methods. * * @param The type of the file attribute value * diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/FileAttributeView.java index c9d7327494e..ee90ba07dba 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/FileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/FileAttributeView.java @@ -33,7 +33,7 @@ package java.nio.file.attribute; * * @since 1.7 * - * @see java.nio.file.FileRef#getFileAttributeView(Class,java.nio.file.LinkOption[]) + * @see java.nio.file.Files#getFileAttributeView(Path,Class,java.nio.file.LinkOption[]) */ public interface FileAttributeView diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java index 8bf3a0932eb..09bc7ca02d6 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java @@ -37,8 +37,8 @@ import java.io.IOException; *

The {@link #getOwner getOwner} or {@link #setOwner setOwner} methods may * be used to read or update the owner of the file. * - *

The {@link java.nio.file.FileRef#getAttribute getAttribute} and - * {@link java.nio.file.FileRef#setAttribute setAttribute} methods may also be + *

The {@link java.nio.file.Files#getAttribute getAttribute} and + * {@link java.nio.file.Files#setAttribute setAttribute} methods may also be * used to read or update the owner. In that case, the owner attribute is * identified by the name {@code "owner"}, and the value of the attribute is * a {@link UserPrincipal}. diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java deleted file mode 100644 index dca8d4f010c..00000000000 --- a/jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.nio.file.attribute; - -import java.io.IOException; - -/** - * A file store attribute view that supports reading of space attributes. - * - *

Where dynamic access to file attributes is required, the attributes - * supported by this attribute view have the following names and types: - *

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Name Type
"totalSpace" {@link Long}
"usableSpace" {@link Long}
"unallocatedSpace" {@link Long}
- *
- *

The {@link java.nio.file.FileStore#getAttribute getAttribute} method may - * be used to read any of these attributes. - * - * @since 1.7 - */ - -public interface FileStoreSpaceAttributeView - extends FileStoreAttributeView -{ - /** - * Returns the name of the attribute view. Attribute views of this type - * have the name {@code "space"}. - */ - @Override - String name(); - - /** - * Reads the disk space attributes as a bulk operation. - * - *

It is file system specific if all attributes are read as an - * atomic operation with respect to other file system operations. - * - * @return The disk space attributes - * - * @throws IOException - * If an I/O error occurs - */ - FileStoreSpaceAttributes readAttributes() throws IOException; -} diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributes.java b/jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributes.java deleted file mode 100644 index ff2bfb66f61..00000000000 --- a/jdk/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributes.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2007, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package java.nio.file.attribute; - -/** - * Space related attributes of a file store. - * - * @since 1.7 - * - * @see Attributes#readFileStoreSpaceAttributes - */ - -public interface FileStoreSpaceAttributes { - /** - * Returns the size, in bytes, of the file store. - */ - long totalSpace(); - - /** - * Returns the number of bytes available to this Java virtual machine on the - * file store. - * - *

The returned number of available bytes is a hint, but not a - * guarantee, that it is possible to use most or any of these bytes. The - * number of usable bytes is most likely to be accurate immediately - * after the space attributes are obtained. It is likely to be made inaccurate - * by any external I/O operations including those made on the system outside - * of this Java virtual machine. - */ - long usableSpace(); - - /** - * Returns the number of unallocated bytes in the file store. - * - *

The returned number of unallocated bytes is a hint, but not a - * guarantee, that it is possible to use most or any of these bytes. The - * number of unallocated bytes is most likely to be accurate immediately - * after the space attributes are obtained. It is likely to be - * made inaccurate by any external I/O operations including those made on - * the system outside of this virtual machine. - */ - long unallocatedSpace(); -} diff --git a/jdk/src/share/classes/java/nio/file/attribute/FileTime.java b/jdk/src/share/classes/java/nio/file/attribute/FileTime.java index 1b3d2ff2f84..6cac437cdce 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/FileTime.java +++ b/jdk/src/share/classes/java/nio/file/attribute/FileTime.java @@ -35,20 +35,53 @@ import java.util.concurrent.TimeUnit; /** * Represents the value of a file's time stamp attribute. For example, it may - * represent the time that the file was last modified, accessed, or created. + * represent the time that the file was last + * {@link BasicFileAttributes#lastModifiedTime() modified}, + * {@link BasicFileAttributes#lastAccessTime() accessed}, + * or {@link BasicFileAttributes#creationTime() created}. * *

Instances of this class are immutable. * * @since 1.7 - * @see BasicFileAttributes - * @see Attributes#setLastModifiedTime + * @see java.nio.file.Files#setLastModifiedTime + * @see java.nio.file.Files#getLastModifiedTime */ -public final class FileTime implements Comparable { +public final class FileTime + implements Comparable +{ + /** + * The value since the epoch; can be negative. + */ private final long value; - private final TimeUnit unit; - private String valueAsString; // created lazily + /** + * The unit of granularity to interpret the value. + */ + private final TimeUnit unit; + + /** + * The value return by toString (created lazily) + */ + private String valueAsString; + + /** + * The value in days and excess nanos (created lazily) + */ + private DaysAndNanos daysAndNanos; + + /** + * Returns a DaysAndNanos object representing the value. + */ + private DaysAndNanos asDaysAndNanos() { + if (daysAndNanos == null) + daysAndNanos = new DaysAndNanos(value, unit); + return daysAndNanos; + } + + /** + * Initializes a new instance of this class. + */ private FileTime(long value, TimeUnit unit) { if (unit == null) throw new NullPointerException(); @@ -143,9 +176,8 @@ public final class FileTime implements Comparable { */ @Override public int hashCode() { - // hash value for fixed granularity to satisfy contract with equals - long ms = toMillis(); - return (int)(ms ^ (ms >>> 32)); + // hashcode of days/nanos representation to satisfy contract with equals + return asDaysAndNanos().hashCode(); } /** @@ -162,46 +194,12 @@ public final class FileTime implements Comparable { @Override public int compareTo(FileTime other) { // same granularity - if (unit == other.unit) + if (unit == other.unit) { return (value < other.value) ? -1 : (value == other.value ? 0 : 1); - - // compare in days - long thisValueInDays = unit.toDays(value); - long otherValueInDays = other.unit.toDays(other.value); - if (thisValueInDays != otherValueInDays) - return (thisValueInDays < otherValueInDays) ? -1 : 1; - - // compare remainder in nanoseconds - long thisRemainder = remainderInNanos(thisValueInDays); - long otherRemainder = other.remainderInNanos(otherValueInDays); - return (thisRemainder < otherRemainder) ? -1 : - (thisRemainder == otherRemainder) ? 0 : 1; - } - - private long remainderInNanos(long days) { - // constants for conversion - final long C0 = 1L; - final long C1 = C0 * 24L; - final long C2 = C1 * 60L; - final long C3 = C2 * 60L; - final long C4 = C3 * 1000L; - final long C5 = C4 * 1000L; - final long C6 = C5 * 1000L; - - long scale; - switch (unit) { - case DAYS : scale = C0; break; - case HOURS : scale = C1; break; - case MINUTES : scale = C2; break; - case SECONDS : scale = C3; break; - case MILLISECONDS : scale = C4; break; - case MICROSECONDS : scale = C5; break; - case NANOSECONDS : scale = C6; break; - default: - throw new AssertionError("Unit not handled"); + } else { + // compare using days/nanos representation when unit differs + return asDaysAndNanos().compareTo(other.asDaysAndNanos()); } - long rem = value - (days * scale); - return unit.toNanos(rem); } /** @@ -239,26 +237,12 @@ public final class FileTime implements Comparable { // nothing to do when seconds/minutes/hours/days String fractionAsString = ""; if (unit.compareTo(TimeUnit.SECONDS) < 0) { - // constants for conversion - final long C0 = 1L; - final long C1 = C0 * 1000L; - final long C2 = C1 * 1000L; - final long C3 = C2 * 1000L; - - long scale; - int width; - switch (unit) { - case MILLISECONDS : scale = C1; width = 3; break; - case MICROSECONDS : scale = C2; width = 6; break; - case NANOSECONDS : scale = C3; width = 9; break; - default: - throw new AssertionError("Unit not handled"); - } - long fraction = value % scale; + long fraction = asDaysAndNanos().fractionOfSecondInNanos(); if (fraction != 0L) { // fraction must be positive if (fraction < 0L) { - fraction += scale; + final long MAX_FRACTION_PLUS_1 = 1000L * 1000L * 1000L; + fraction += MAX_FRACTION_PLUS_1; if (ms != Long.MIN_VALUE) ms--; } @@ -266,7 +250,7 @@ public final class FileTime implements Comparable { // stripping any trailing zeros String s = Long.toString(fraction); int len = s.length(); - width -= len; + int width = 9 - len; StringBuilder sb = new StringBuilder("."); while (width-- > 0) { sb.append('0'); @@ -302,4 +286,76 @@ public final class FileTime implements Comparable { } return v; } + + /** + * Represents a FileTime's value as two longs: the number of days since + * the epoch, and the excess (in nanoseconds). This is used for comparing + * values with different units of granularity. + */ + private static class DaysAndNanos implements Comparable { + // constants for conversion + private static final long C0 = 1L; + private static final long C1 = C0 * 24L; + private static final long C2 = C1 * 60L; + private static final long C3 = C2 * 60L; + private static final long C4 = C3 * 1000L; + private static final long C5 = C4 * 1000L; + private static final long C6 = C5 * 1000L; + + /** + * The value (in days) since the epoch; can be negative. + */ + private final long days; + + /** + * The excess (in nanoseconds); can be negative if days <= 0. + */ + private final long excessNanos; + + /** + * Initializes a new instance of this class. + */ + DaysAndNanos(long value, TimeUnit unit) { + long scale; + switch (unit) { + case DAYS : scale = C0; break; + case HOURS : scale = C1; break; + case MINUTES : scale = C2; break; + case SECONDS : scale = C3; break; + case MILLISECONDS : scale = C4; break; + case MICROSECONDS : scale = C5; break; + case NANOSECONDS : scale = C6; break; + default : throw new AssertionError("Unit not handled"); + } + this.days = unit.toDays(value); + this.excessNanos = unit.toNanos(value - (this.days * scale)); + } + + /** + * Returns the fraction of a second, in nanoseconds. + */ + long fractionOfSecondInNanos() { + return excessNanos % (1000L * 1000L * 1000L); + } + + @Override + public boolean equals(Object obj) { + return (obj instanceof DaysAndNanos) ? + compareTo((DaysAndNanos)obj) == 0 : false; + } + + @Override + public int hashCode() { + return (int)(days ^ (days >>> 32) ^ + excessNanos ^ (excessNanos >>> 32)); + } + + @Override + public int compareTo(DaysAndNanos other) { + if (this.days != other.days) + return (this.days < other.days) ? -1 : 1; + return (this.excessNanos < other.excessNanos) ? -1 : + (this.excessNanos == other.excessNanos) ? 0 : 1; + } + } } diff --git a/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java index 2ec2008d382..9f1a668a8c6 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java @@ -60,8 +60,8 @@ import java.io.IOException; *

Usage Example: * Suppose we need to print out the owner and access permissions of a file: *

- *     FileRef file = ...
- *     PosixFileAttributes attrs = file.getFileAttributeView(PosixFileAttributeView.class)
+ *     Path file = ...
+ *     PosixFileAttributes attrs = Files.getFileAttributeView(file, PosixFileAttributeView.class)
  *         .readAttributes();
  *     System.out.format("%s %s%n",
  *         attrs.owner().getName(),
@@ -90,12 +90,12 @@ import java.io.IOException;
  * 
  * 
  *
- * 

The {@link FileRef#getAttribute getAttribute} method may be used to read + *

The {@link Files#getAttribute getAttribute} method may be used to read * any of these attributes, or any of the attributes defined by {@link * BasicFileAttributeView} as if by invoking the {@link #readAttributes * readAttributes()} method. * - *

The {@link FileRef#setAttribute setAttribute} method may be used to update + *

The {@link Files#setAttribute setAttribute} method may be used to update * the file's last modified time, last access time or create time attributes as * defined by {@link BasicFileAttributeView}. It may also be used to update * the permissions, owner, or group-owner as if by invoking the {@link @@ -105,8 +105,8 @@ import java.io.IOException; *

Setting Initial Permissions

*

Implementations supporting this attribute view may also support setting * the initial permissions when creating a file or directory. The - * initial permissions are provided to the {@link Path#createFile createFile} - * or {@link Path#createDirectory createDirectory} methods as a {@link + * initial permissions are provided to the {@link Files#createFile createFile} + * or {@link Files#createDirectory createDirectory} methods as a {@link * FileAttribute} with {@link FileAttribute#name name} {@code "posix:permissions"} * and a {@link FileAttribute#value value} that is the set of permissions. The * following example uses the {@link PosixFilePermissions#asFileAttribute @@ -117,7 +117,7 @@ import java.io.IOException; * Path path = ... * Set<PosixFilePermission> perms = * EnumSet.of(OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, GROUP_READ); - * path.createFile(PosixFilePermissions.asFileAttribute(perms)); + * Files.createFile(path, PosixFilePermissions.asFileAttribute(perms)); *

* *

When the access permissions are set at file creation time then the actual @@ -128,13 +128,11 @@ import java.io.IOException; * the access permissions, and the underlying file system supports access * permissions, then it is required that the value of the actual access * permissions will be equal or less than the value of the attribute - * provided to the {@link java.nio.file.Path#createFile createFile} or - * {@link java.nio.file.Path#createDirectory createDirectory} methods. In - * other words, the file may be more secure than requested. + * provided to the {@link Files#createFile createFile} or {@link + * Files#createDirectory createDirectory} methods. In other words, the file may + * be more secure than requested. * * @since 1.7 - * - * @see Attributes#readPosixFileAttributes */ public interface PosixFileAttributeView diff --git a/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributes.java b/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributes.java index 6dfd650c327..361d4c2cc6e 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributes.java +++ b/jdk/src/share/classes/java/nio/file/attribute/PosixFileAttributes.java @@ -37,8 +37,6 @@ import java.util.Set; * PosixFileAttributeView#readAttributes readAttributes} method. * * @since 1.7 - * - * @see Attributes#readPosixFileAttributes */ public interface PosixFileAttributes diff --git a/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermission.java b/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermission.java index 3c5f33f86c7..52419b7b0aa 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermission.java +++ b/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermission.java @@ -25,14 +25,12 @@ package java.nio.file.attribute; -import java.util.*; - /** * Defines the bits for use with the {@link PosixFileAttributes#permissions() * permissions} attribute. * - *

The {@link PosixFileAttributes} class defines method methods for - * manipulating {@link Set sets} of permissions. + *

The {@link PosixFilePermissions} class defines methods for manipulating + * set of permissions. * * @since 1.7 */ diff --git a/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermissions.java b/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermissions.java index b3903957ef3..7499fa9498f 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermissions.java +++ b/jdk/src/share/classes/java/nio/file/attribute/PosixFilePermissions.java @@ -126,7 +126,7 @@ public final class PosixFilePermissions { public static Set fromString(String perms) { if (perms.length() != 9) throw new IllegalArgumentException("Invalid mode"); - Set result = new HashSet(); + Set result = EnumSet.noneOf(PosixFilePermission.class); if (isR(perms.charAt(0))) result.add(OWNER_READ); if (isW(perms.charAt(1))) result.add(OWNER_WRITE); if (isX(perms.charAt(2))) result.add(OWNER_EXECUTE); @@ -141,8 +141,8 @@ public final class PosixFilePermissions { /** * Creates a {@link FileAttribute}, encapsulating a copy of the given file - * permissions, suitable for passing to the {@link java.nio.file.Path#createFile - * createFile} or {@link java.nio.file.Path#createDirectory createDirectory} + * permissions, suitable for passing to the {@link java.nio.file.Files#createFile + * createFile} or {@link java.nio.file.Files#createDirectory createDirectory} * methods. * * @param perms diff --git a/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java b/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java index 04493e39369..41aaf2f107d 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java +++ b/jdk/src/share/classes/java/nio/file/attribute/UserDefinedFileAttributeView.java @@ -59,9 +59,9 @@ import java.io.IOException; * attributes. * *

Where dynamic access to file attributes is required, the {@link - * java.nio.file.FileRef#getAttribute getAttribute} method may be used to read + * java.nio.file.Files#getAttribute getAttribute} method may be used to read * the attribute value. The attribute value is returned as a byte array (byte[]). - * The {@link java.nio.file.FileRef#setAttribute setAttribute} method may be used + * The {@link java.nio.file.Files#setAttribute setAttribute} method may be used * to write the value of a user-defined attribute from a buffer (as if by * invoking the {@link #write write} method), or byte array (byte[]). * @@ -132,8 +132,8 @@ public interface UserDefinedFileAttributeView * Suppose we want to read a file's MIME type that is stored as a user-defined * attribute with the name "{@code user.mimetype}". *

-     *    UserDefinedFileAttributeView view = file
-     *        .getFileAttributeView(UserDefinedFileAttributeView.class);
+     *    UserDefinedFileAttributeView view =
+     *        Files.getFileAttributeView(path, UserDefinedFileAttributeView.class);
      *    String name = "user.mimetype";
      *    ByteBuffer buf = ByteBuffer.allocate(view.size(name));
      *    view.read(name, buf);
@@ -189,8 +189,8 @@ public interface UserDefinedFileAttributeView
      * 

Usage Example: * Suppose we want to write a file's MIME type as a user-defined attribute: *

-     *    UserDefinedFileAttributeView view = file
-     *        .getFileAttributeView(UserDefinedFileAttributeView.class);
+     *    UserDefinedFileAttributeView view =
+     *        FIles.getFileAttributeView(path, UserDefinedFileAttributeView.class);
      *    view.write("user.mimetype", Charset.defaultCharset().encode("text/html"));
      * 
* diff --git a/jdk/src/share/classes/java/nio/file/attribute/package-info.java b/jdk/src/share/classes/java/nio/file/attribute/package-info.java index a82881176df..0f06fded673 100644 --- a/jdk/src/share/classes/java/nio/file/attribute/package-info.java +++ b/jdk/src/share/classes/java/nio/file/attribute/package-info.java @@ -46,8 +46,6 @@ * Can read or update user-defined file attributes *   {@link java.nio.file.attribute.FileStoreAttributeView} * Can read or update file system attributes - *     {@link java.nio.file.attribute.FileStoreSpaceAttributeView}   - * Can read file system space usage related attributes * * *

An attribute view provides a read-only or updatable view of the non-opaque @@ -55,7 +53,7 @@ * The {@link java.nio.file.attribute.FileAttributeView} interface is * extended by several other interfaces that that views to specific sets of file * attributes. {@code FileAttributeViews} are selected by invoking the {@link - * java.nio.file.FileRef#getFileAttributeView} method with a + * java.nio.file.Files#getFileAttributeView} method with a * type-token to identify the required view. Views can also be identified * by name. The {@link java.nio.file.attribute.FileStoreAttributeView} interface * provides access to file store attributes. A {@code FileStoreAttributeView} of @@ -83,13 +81,6 @@ * on the model defined by * RFC 3530: Network File System (NFS) version 4 Protocol. * - *

The {@link java.nio.file.attribute.FileStoreSpaceAttributeView} class - * defines methods to read file system space usage related attributes of a file system. - * - *

The {@link java.nio.file.attribute.Attributes} utility class defines - * static methods to access file or file system attribute using the above - * attribute views. - * *

In addition to attribute views, this package also defines classes and * interfaces that are used when accessing attributes: * diff --git a/jdk/src/share/classes/java/nio/file/package-info.java b/jdk/src/share/classes/java/nio/file/package-info.java index d5fa4d6bbd7..5a687774aef 100644 --- a/jdk/src/share/classes/java/nio/file/package-info.java +++ b/jdk/src/share/classes/java/nio/file/package-info.java @@ -31,7 +31,7 @@ * systems. The API to access file and file system attributes is defined in the * {@link java.nio.file.attribute} package. The {@link java.nio.file.spi} * package is used by service provider implementors wishing to extend the - * platform default provider, or to construct other provider implementations. + * platform default provider, or to construct other provider implementations.

* *

Symbolic Links

* Many operating systems and file systems support for symbolic links. @@ -43,7 +43,7 @@ * target of the link. This package includes support for symbolic links where * implementations provide these semantics. File systems may support other types * that are semantically close but support for these other types of links is - * not included in this package. + * not included in this package.

* *

Interoperability

* The {@link java.io.File} class defines the {@link java.io.File#toPath @@ -52,7 +52,7 @@ * {@code Path} can be used to operate on the same file as the {@code File} * object. The {@code Path} specification provides further information * on the interoperability between {@code Path} - * and {@code java.io.File} objects. + * and {@code java.io.File} objects.

* *

Visibility

* The view of the files and file system provided by classes in this package are @@ -63,7 +63,7 @@ * network-filesystem protocols. This is true regardless of the language in which * these other programs are written, and whether they are running on the same machine * or on some other machine. The exact nature of any such inconsistencies are - * system-dependent and are therefore unspecified. + * system-dependent and are therefore unspecified.

* *

Synchronized I/O File Integrity

* The {@link java.nio.file.StandardOpenOption#SYNC SYNC} and {@link @@ -80,14 +80,14 @@ * crash. If the file does not reside on a local device then no such guarantee * is made. Whether this guarantee is possible with other {@link * java.nio.file.spi.FileSystemProvider provider} implementations is provider - * specific. + * specific.

* *

General Exceptions

* Unless otherwise noted, passing a {@code null} argument to a constructor * or method of any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. Additionally, * invoking a method with a collection containing a {@code null} element will - * cause a {@code NullPointerException}, unless otherwise specified. + * cause a {@code NullPointerException}, unless otherwise specified.

* *

Unless otherwise noted, methods that attempt to access the file system * will throw {@link java.nio.file.ClosedFileSystemException} when invoked on @@ -95,12 +95,13 @@ * {@link java.nio.file.FileSystem#close closed}. Additionally, any methods * that attempt write access to a file system will throw {@link * java.nio.file.ReadOnlyFileSystemException} when invoked on an object associated - * with a {@link java.nio.file.FileSystem} that only provides read-only access. + * with a {@link java.nio.file.FileSystem} that only provides read-only + * access.

* *

Unless otherwise noted, invoking a method of any class or interface in * this package created by one {@link java.nio.file.spi.FileSystemProvider * provider} with a parameter that is an object created by another provider, - * will throw {@link java.nio.file.ProviderMismatchException}. + * will throw {@link java.nio.file.ProviderMismatchException}.

* *

Optional Specific Exceptions

* Most of the methods defined by classes in this package that access the diff --git a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java index a267ad11bba..ad285bd6ddb 100644 --- a/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java +++ b/jdk/src/share/classes/java/nio/file/spi/FileSystemProvider.java @@ -26,17 +26,21 @@ package java.nio.file.spi; import java.nio.file.*; -import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.*; import java.nio.channels.*; import java.net.URI; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.IOException; import java.util.*; import java.util.concurrent.ExecutorService; import java.security.AccessController; import java.security.PrivilegedAction; -import java.io.IOException; /** - * Service-provider class for file systems. + * Service-provider class for file systems. The methods defined by the {@link + * java.nio.file.Files} class will typically delegate to an instance of this + * class. * *

A file system provider is a concrete implementation of this class that * implements the abstract methods defined by this class. A provider is @@ -64,13 +68,6 @@ import java.io.IOException; * the {@code newFileSystem} method is invoked. In the case of the default * provider, the {@code FileSystem} is created when the provider is initialized. * - *

In addition to file systems, a provider is also a factory for {@link - * FileChannel} and {@link AsynchronousFileChannel} channels. The {@link - * #newFileChannel newFileChannel} and {@link #newAsynchronousFileChannel - * AsynchronousFileChannel} methods are defined to open or create files, returning - * a channel to access the file. These methods are invoked by static factory - * methods defined in the {@link java.nio.channels} package. - * *

All of the methods in this class are safe for use by multiple concurrent * threads. * @@ -202,9 +199,10 @@ public abstract class FileSystemProvider { * *

This method throws {@link FileSystemAlreadyExistsException} if the * file system already exists because it was previously created by an - * invocation of this method. Once a file system is {@link FileSystem#close - * closed} it is provider-dependent if the provider allows a new file system - * to be created with the same URI as a file system it previously created. + * invocation of this method. Once a file system is {@link + * java.nio.file.FileSystem#close closed} it is provider-dependent if the + * provider allows a new file system to be created with the same URI as a + * file system it previously created. * * @param uri * URI reference @@ -234,20 +232,21 @@ public abstract class FileSystemProvider { * *

This method returns a reference to a {@code FileSystem} that was * created by invoking the {@link #newFileSystem(URI,Map) newFileSystem(URI,Map)} - * method. File systems created the {@link #newFileSystem(FileRef,Map) - * newFileSystem(FileRef,Map)} method are not returned by this method. + * method. File systems created the {@link #newFileSystem(Path,Map) + * newFileSystem(Path,Map)} method are not returned by this method. * The file system is identified by its {@code URI}. Its exact form * is highly provider dependent. In the case of the default provider the URI's * path component is {@code "/"} and the authority, query and fragment components * are undefined (Undefined components are represented by {@code null}). * - *

Once a file system created by this provider is {@link FileSystem#close - * closed} it is provider-dependent if this method returns a reference to - * the closed file system or throws {@link FileSystemNotFoundException}. - * If the provider allows a new file system to be created with the same URI - * as a file system it previously created then this method throws the - * exception if invoked after the file system is closed (and before a new - * instance is created by the {@link #newFileSystem newFileSystem} method). + *

Once a file system created by this provider is {@link + * java.nio.file.FileSystem#close closed} it is provider-dependent if this + * method returns a reference to the closed file system or throws {@link + * FileSystemNotFoundException}. If the provider allows a new file system to + * be created with the same URI as a file system it previously created then + * this method throws the exception if invoked after the file system is + * closed (and before a new instance is created by the {@link #newFileSystem + * newFileSystem} method). * *

If a security manager is installed then a provider implementation * may require to check a permission before returning a reference to an @@ -306,17 +305,16 @@ public abstract class FileSystemProvider { * *

This method is intended for specialized providers of pseudo file * systems where the contents of one or more files is treated as a file - * system. The {@code file} parameter is a reference to an existing file - * and the {@code env} parameter is a map of provider specific properties to - * configure the file system. + * system. The {@code env} parameter is a map of provider specific properties + * to configure the file system. * *

If this provider does not support the creation of such file systems * or if the provider does not recognize the file type of the given file then * it throws {@code UnsupportedOperationException}. The default implementation * of this method throws {@code UnsupportedOperationException}. * - * @param file - * The file + * @param path + * The path to the file * @param env * A map of provider specific properties to configure the file system; * may be empty @@ -336,32 +334,121 @@ public abstract class FileSystemProvider { * If a security manager is installed and it denies an unspecified * permission. */ - public FileSystem newFileSystem(FileRef file, Map env) + public FileSystem newFileSystem(Path path, Map env) throws IOException { throw new UnsupportedOperationException(); } /** - * Opens or creates a file for reading and/or writing, returning a file - * channel to access the file. + * Opens a file, returning an input stream to read from the file. This + * method works in exactly the manner specified by the {@link + * Files#newInputStream} method. * - *

This method is invoked by the {@link FileChannel#open(Path,Set,FileAttribute[]) - * FileChannel.open} method to open a file channel. A provider that does not - * support all the features required to construct a file channel throws - * {@code UnsupportedOperationException}. The default provider is required - * to support the creation of file channels. When not overridden, the - * default implementation throws {@code UnsupportedOperationException}. + *

The default implementation of this method opens a channel to the file + * as if by invoking the {@link #newByteChannel} method and constructs a + * stream that reads bytes from the channel. This method should be overridden + * where appropriate. * * @param path - * The path of the file to open or create + * the path to the file to open * @param options - * Options specifying how the file is opened + * options specifying how the file is opened + * + * @return a new input stream + * + * @throws IllegalArgumentException + * if an invalid combination of options is specified + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + */ + public InputStream newInputStream(Path path, OpenOption... options) + throws IOException + { + if (options.length > 0) { + for (OpenOption opt: options) { + if (opt != StandardOpenOption.READ) + throw new UnsupportedOperationException("'" + opt + "' not allowed"); + } + } + return Channels.newInputStream(Files.newByteChannel(path)); + } + + /** + * Opens or creates a file, returning an output stream that may be used to + * write bytes to the file. This method works in exactly the manner + * specified by the {@link Files#newOutputStream} method. + * + *

The default implementation of this method opens a channel to the file + * as if by invoking the {@link #newByteChannel} method and constructs a + * stream that writes bytes to the channel. This method should be overridden + * where appropriate. + * + * @param path + * the path to the file to open or create + * @param options + * options specifying how the file is opened + * + * @return a new output stream + * + * @throws IllegalArgumentException + * if {@code options} contains an invalid combination of options + * @throws UnsupportedOperationException + * if an unsupported option is specified + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the file. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. + */ + public OutputStream newOutputStream(Path path, OpenOption... options) + throws IOException + { + int len = options.length; + Set opts = new HashSet(len + 3); + if (len == 0) { + opts.add(StandardOpenOption.CREATE); + opts.add(StandardOpenOption.TRUNCATE_EXISTING); + } else { + for (OpenOption opt: options) { + if (opt == StandardOpenOption.READ) + throw new IllegalArgumentException("READ not allowed"); + opts.add(opt); + } + } + opts.add(StandardOpenOption.WRITE); + return Channels.newOutputStream(newByteChannel(path, opts)); + } + + /** + * Opens or creates a file for reading and/or writing, returning a file + * channel to access the file. This method works in exactly the manner + * specified by the {@link FileChannel#open(Path,Set,FileAttribute[]) + * FileChannel.open} method. A provider that does not support all the + * features required to construct a file channel throws {@code + * UnsupportedOperationException}. The default provider is required to + * support the creation of file channels. When not overridden, the default + * implementation throws {@code UnsupportedOperationException}. + * + * @param path + * the path of the file to open or create + * @param options + * options specifying how the file is opened * @param attrs - * An optional list of file attributes to set atomically when + * an optional list of file attributes to set atomically when * creating the file * - * @return A new file channel + * @return a new file channel * * @throws IllegalArgumentException * If the set contains an invalid combination of options @@ -387,11 +474,10 @@ public abstract class FileSystemProvider { /** * Opens or creates a file for reading and/or writing, returning an - * asynchronous file channel to access the file. - * - *

This method is invoked by the {@link + * asynchronous file channel to access the file. This method works in + * exactly the manner specified by the {@link * AsynchronousFileChannel#open(Path,Set,ExecutorService,FileAttribute[]) - * AsynchronousFileChannel.open} method to open an asynchronous file channel. + * AsynchronousFileChannel.open} method. * A provider that does not support all the features required to construct * an asynchronous file channel throws {@code UnsupportedOperationException}. * The default provider is required to support the creation of asynchronous @@ -399,17 +485,17 @@ public abstract class FileSystemProvider { * method throws {@code UnsupportedOperationException}. * * @param path - * The path of the file to open or create + * the path of the file to open or create * @param options - * Options specifying how the file is opened + * options specifying how the file is opened * @param executor - * The thread pool or {@code null} to associate the channel with + * the thread pool or {@code null} to associate the channel with * the default thread pool * @param attrs - * An optional list of file attributes to set atomically when + * an optional list of file attributes to set atomically when * creating the file * - * @return A new asynchronous file channel + * @return a new asynchronous file channel * * @throws IllegalArgumentException * If the set contains an invalid combination of options @@ -434,4 +520,569 @@ public abstract class FileSystemProvider { { throw new UnsupportedOperationException(); } + + /** + * Opens or creates a file, returning a seekable byte channel to access the + * file. This method works in exactly the manner specified by the {@link + * Files#newByteChannel(Path,Set,FileAttribute[])} method. + * + * @param path + * the path to the file to open or create + * @param options + * options specifying how the file is opened + * @param attrs + * an optional list of file attributes to set atomically when + * creating the file + * + * @return a new seekable byte channel + * + * @throws IllegalArgumentException + * if the set contains an invalid combination of options + * @throws UnsupportedOperationException + * if an unsupported open option is specified or the array contains + * attributes that cannot be set atomically when creating the file + * @throws FileAlreadyExistsException + * if a file of that name already exists and the {@link + * StandardOpenOption#CREATE_NEW CREATE_NEW} option is specified + * (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the path if the file is + * opened for reading. The {@link SecurityManager#checkWrite(String) + * checkWrite} method is invoked to check write access to the path + * if the file is opened for writing. The {@link + * SecurityManager#checkDelete(String) checkDelete} method is + * invoked to check delete access if the file is opened with the + * {@code DELETE_ON_CLOSE} option. + */ + public abstract SeekableByteChannel newByteChannel(Path path, + Set options, FileAttribute... attrs) throws IOException; + + /** + * Opens a directory, returning a {@code DirectoryStream} to iterate over + * the entries in the directory. This method works in exactly the manner + * specified by the {@link + * Files#newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter)} + * method. + * + * @param dir + * the path to the directory + * @param filter + * the directory stream filter + * + * @return a new and open {@code DirectoryStream} object + * + * @throws NotDirectoryException + * if the file could not otherwise be opened because it is not + * a directory (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the directory. + */ + public abstract DirectoryStream newDirectoryStream(Path dir, + DirectoryStream.Filter filter) throws IOException; + + /** + * Creates a new directory. This method works in exactly the manner + * specified by the {@link Files#createDirectory} method. + * + * @param dir + * the directory to create + * @param attrs + * an optional list of file attributes to set atomically when + * creating the directory + * + * @throws UnsupportedOperationException + * if the array contains an attribute that cannot be set atomically + * when creating the directory + * @throws FileAlreadyExistsException + * if a directory could not otherwise be created because a file of + * that name already exists (optional specific exception) + * @throws IOException + * if an I/O error occurs or the parent directory does not exist + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to the new directory. + */ + public abstract void createDirectory(Path dir, FileAttribute... attrs) + throws IOException; + + /** + * Creates a symbolic link to a target. This method works in exactly the + * manner specified by the {@link Files#createSymbolicLink} method. + * + *

The default implementation of this method throws {@code + * UnsupportedOperationException}. + * + * @param link + * the path of the symbolic link to create + * @param target + * the target of the symbolic link + * @param attrs + * the array of attributes to set atomically when creating the + * symbolic link + * + * @throws UnsupportedOperationException + * if the implementation does not support symbolic links or the + * array contains an attribute that cannot be set atomically when + * creating the symbolic link + * @throws FileAlreadyExistsException + * if a file with the name already exists (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager + * is installed, it denies {@link LinkPermission}("symbolic") + * or its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to the path of the symbolic link. + */ + public void createSymbolicLink(Path link, Path target, FileAttribute... attrs) + throws IOException + { + throw new UnsupportedOperationException(); + } + + /** + * Creates a new link (directory entry) for an existing file. This method + * works in exactly the manner specified by the {@link Files#createLink} + * method. + * + *

The default implementation of this method throws {@code + * UnsupportedOperationException}. + * + * @param link + * the link (directory entry) to create + * @param existing + * a path to an existing file + * + * @throws UnsupportedOperationException + * if the implementation does not support adding an existing file + * to a directory + * @throws FileAlreadyExistsException + * if the entry could not otherwise be created because a file of + * that name already exists (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager + * is installed, it denies {@link LinkPermission}("hard") + * or its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to either the link or the + * existing file. + */ + public void createLink(Path link, Path existing) throws IOException { + throw new UnsupportedOperationException(); + } + + /** + * Deletes a file. This method works in exactly the manner specified by the + * {@link Files#delete} method. + * + * @param path + * the path to the file to delete + * + * @throws NoSuchFileException + * if the file does not exist (optional specific exception) + * @throws DirectoryNotEmptyException + * if the file is a directory and could not otherwise be deleted + * because the directory is not empty (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkDelete(String)} method + * is invoked to check delete access to the file + */ + public abstract void delete(Path path) throws IOException; + + /** + * Deletes a file if it exists. This method works in exactly the manner + * specified by the {@link Files#deleteIfExists} method. + * + *

The default implementation of this method simply invokes {@link + * #delete} ignoring the {@code NoSuchFileException} when the file does not + * exist. It may be overridden where appropriate. + * + * @param path + * the path to the file to delete + * + * @return {@code true} if the file was deleted by this method; {@code + * false} if the file could not be deleted because it did not + * exist + * + * @throws DirectoryNotEmptyException + * if the file is a directory and could not otherwise be deleted + * because the directory is not empty (optional specific + * exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkDelete(String)} method + * is invoked to check delete access to the file + */ + public boolean deleteIfExists(Path path) throws IOException { + try { + delete(path); + return true; + } catch (NoSuchFileException ignore) { + return false; + } + } + + /** + * Reads the target of a symbolic link. This method works in exactly the + * manner specified by the {@link Files#readSymbolicLink} method. + * + *

The default implementation of this method throws {@code + * UnsupportedOperationException}. + * + * @param link + * the path to the symbolic link + * + * @throws UnsupportedOperationException + * if the implementation does not support symbolic links + * @throws NotLinkException + * if the target could otherwise not be read because the file + * is not a symbolic link (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager + * is installed, it checks that {@code FilePermission} has been + * granted with the "{@code readlink}" action to read the link. + */ + public Path readSymbolicLink(Path link) throws IOException { + throw new UnsupportedOperationException(); + } + + /** + * Copy a file to a target file. This method works in exactly the manner + * specified by the {@link Files#copy(Path,Path,CopyOption[])} method + * except that both the source and target paths must be associated with + * this provider. + * + * @param source + * the path to the file to copy + * @param target + * the path to the target file + * @param options + * options specifying how the copy should be done + * + * @throws UnsupportedOperationException + * if the array contains a copy option that is not supported + * @throws FileAlreadyExistsException + * if the target file exists but cannot be replaced because the + * {@code REPLACE_EXISTING} option is not specified (optional + * specific exception) + * @throws DirectoryNotEmptyException + * the {@code REPLACE_EXISTING} option is specified but the file + * cannot be replaced because it is a non-empty directory + * (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the source file, the + * {@link SecurityManager#checkWrite(String) checkWrite} is invoked + * to check write access to the target file. If a symbolic link is + * copied the security manager is invoked to check {@link + * LinkPermission}{@code ("symbolic")}. + */ + public abstract void copy(Path source, Path target, CopyOption... options) + throws IOException; + + /** + * Move or rename a file to a target file. This method works in exactly the + * manner specified by the {@link Files#move} method except that both the + * source and target paths must be associated with this provider. + * + * @param source + * the path to the file to move + * @param target + * the path to the target file + * @param options + * options specifying how the move should be done + * + * @throws UnsupportedOperationException + * if the array contains a copy option that is not supported + * @throws FileAlreadyExistsException + * if the target file exists but cannot be replaced because the + * {@code REPLACE_EXISTING} option is not specified (optional + * specific exception) + * @throws DirectoryNotEmptyException + * the {@code REPLACE_EXISTING} option is specified but the file + * cannot be replaced because it is a non-empty directory + * (optional specific exception) + * @throws AtomicMoveNotSupportedException + * if the options array contains the {@code ATOMIC_MOVE} option but + * the file cannot be moved as an atomic file system operation. + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkWrite(String) checkWrite} + * method is invoked to check write access to both the source and + * target file. + */ + public abstract void move(Path source, Path target, CopyOption... options) + throws IOException; + + /** + * Tests if two paths locate the same file. This method works in exactly the + * manner specified by the {@link Files#isSameFile} method. + * + * @param path + * one path to the file + * @param path2 + * the other path + * + * @return {@code true} if, and only if, the two paths locate the same file + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to both files. + */ + public abstract boolean isSameFile(Path path, Path path2) + throws IOException; + + /** + * Tells whether or not a file is considered hidden. This method + * works in exactly the manner specified by the {@link Files#isHidden} + * method. + * + *

This method is invoked by the {@link Files#isHidden isHidden} method. + * + * @param path + * the path to the file to test + * + * @return {@code true} if the file is considered hidden + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file. + */ + public abstract boolean isHidden(Path path) throws IOException; + + /** + * Returns the {@link FileStore} representing the file store where a file + * is located. This method works in exactly the manner specified by the + * {@link Files#getFileStore} method. + * + * @param path + * the path to the file + * + * @return the file store where the file is stored + * + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file, and in + * addition it checks {@link RuntimePermission} + * ("getFileStoreAttributes") + */ + public abstract FileStore getFileStore(Path path) throws IOException; + + /** + * Checks the existence, and optionally the accessibility, of a file. + * + *

This method may be used by the {@link Files#isReadable isReadable}, + * {@link Files#isWritable isWritable} and {@link Files#isExecutable + * isExecutable} methods to check the accessibility of a file. + * + *

This method checks the existence of a file and that this Java virtual + * machine has appropriate privileges that would allow it access the file + * according to all of access modes specified in the {@code modes} parameter + * as follows: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Value Description
{@link AccessMode#READ READ} Checks that the file exists and that the Java virtual machine has + * permission to read the file.
{@link AccessMode#WRITE WRITE} Checks that the file exists and that the Java virtual machine has + * permission to write to the file,
{@link AccessMode#EXECUTE EXECUTE} Checks that the file exists and that the Java virtual machine has + * permission to {@link Runtime#exec execute} the file. The semantics + * may differ when checking access to a directory. For example, on UNIX + * systems, checking for {@code EXECUTE} access checks that the Java + * virtual machine has permission to search the directory in order to + * access file or subdirectories.
+ * + *

If the {@code modes} parameter is of length zero, then the existence + * of the file is checked. + * + *

This method follows symbolic links if the file referenced by this + * object is a symbolic link. Depending on the implementation, this method + * may require to read file permissions, access control lists, or other + * file attributes in order to check the effective access to the file. To + * determine the effective access to a file may require access to several + * attributes and so in some implementations this method may not be atomic + * with respect to other file system operations. + * + * @param path + * the path to the file to check + * @param modes + * The access modes to check; may have zero elements + * + * @throws UnsupportedOperationException + * an implementation is required to support checking for + * {@code READ}, {@code WRITE}, and {@code EXECUTE} access. This + * exception is specified to allow for the {@code Access} enum to + * be extended in future releases. + * @throws NoSuchFileException + * if a file does not exist (optional specific exception) + * @throws AccessDeniedException + * the requested access would be denied or the access cannot be + * determined because the Java virtual machine has insufficient + * privileges or other reasons. (optional specific exception) + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, the {@link SecurityManager#checkRead(String) checkRead} + * is invoked when checking read access to the file or only the + * existence of the file, the {@link SecurityManager#checkWrite(String) + * checkWrite} is invoked when checking write access to the file, + * and {@link SecurityManager#checkExec(String) checkExec} is invoked + * when checking execute access. + */ + public abstract void checkAccess(Path path, AccessMode... modes) + throws IOException; + + /** + * Returns a file attribute view of a given type. This method works in + * exactly the manner specified by the {@link Files#getFileAttributeView} + * method. + * + * @param path + * the path to the file + * @param type + * the {@code Class} object corresponding to the file attribute view + * @param options + * options indicating how symbolic links are handled + * + * @return a file attribute view of the specified type, or {@code null} if + * the attribute view type is not available + */ + public abstract V + getFileAttributeView(Path path, Class type, LinkOption... options); + + /** + * Reads a file's attributes as a bulk operation. This method works in + * exactly the manner specified by the {@link + * Files#readAttributes(Path,Class,LinkOption[])} method. + * + * @param path + * the path to the file + * @param type + * the {@code Class} of the file attributes required + * to read + * @param options + * options indicating how symbolic links are handled + * + * @return the file attributes + * + * @throws UnsupportedOperationException + * if an attributes of the given type are not supported + * @throws IOException + * if an I/O error occurs + * @throws SecurityException + * In the case of the default provider, a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method is invoked to check read access to the file + */ + public abstract A + readAttributes(Path path, Class type, LinkOption... options) throws IOException; + + /** + * Reads a set of file attributes as a bulk operation. This method works in + * exactly the manner specified by the {@link + * Files#readAttributes(Path,String,LinkOption[])} method. + * + * @param path + * the path to the file + * @param attributes + * the attributes to read + * @param options + * options indicating how symbolic links are handled + * + * @return a map of the attributes returned; may be empty. The map's keys + * are the attribute names, its values are the attribute values + * + * @throws IOException + * If an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkRead(String) checkRead} + * method denies read access to the file. If this method is invoked + * to read security sensitive attributes then the security manager + * may be invoke to check for additional permissions. + */ + public abstract Map readAttributes(Path path, String attributes, + LinkOption... options) + throws IOException; + + /** + * Sets the value of a file attribute. This method works in exactly the + * manner specified by the {@link Files#setAttribute} method. + * + * @param path + * the path to the file + * @param attribute + * the attribute to set + * @param value + * the attribute value + * @param options + * options indicating how symbolic links are handled + * + * @throws UnsupportedOperationException + * if the attribute view is not available or it does not support + * updating the attribute + * @throws IllegalArgumentException + * if the attribute value is of the correct type but has an + * inappropriate value + * @throws ClassCastException + * If the attribute value is not of the expected type or is a + * collection containing elements that are not of the expected + * type + * @throws IOException + * If an I/O error occurs + * @throws SecurityException + * In the case of the default provider, and a security manager is + * installed, its {@link SecurityManager#checkWrite(String) checkWrite} + * method denies write access to the file. If this method is invoked + * to set security sensitive attributes then the security manager + * may be invoked to check for additional permissions. + */ + public abstract void setAttribute(Path path, String attribute, + Object value, LinkOption... options) + throws IOException; } diff --git a/jdk/src/share/classes/java/nio/file/spi/FileTypeDetector.java b/jdk/src/share/classes/java/nio/file/spi/FileTypeDetector.java index 21c130188fb..fd062804d6a 100644 --- a/jdk/src/share/classes/java/nio/file/spi/FileTypeDetector.java +++ b/jdk/src/share/classes/java/nio/file/spi/FileTypeDetector.java @@ -25,7 +25,7 @@ package java.nio.file.spi; -import java.nio.file.FileRef; +import java.nio.file.Path; import java.io.IOException; /** @@ -42,7 +42,7 @@ import java.io.IOException; * href="../attribute/package-summary.html"> attribute or the bytes in a * file may be examined to guess its file type. * - * @see java.nio.file.Files#probeContentType(FileRef) + * @see java.nio.file.Files#probeContentType(Path) * * @since 1.7 */ @@ -83,8 +83,8 @@ public abstract class FileTypeDetector { * Message Bodies. The string must be parsable according to the * grammar in the RFC 2045. * - * @param file - * The file to probe + * @param path + * the path to the file to probe * * @return The content type or {@code null} if the file type is not * recognized @@ -101,6 +101,6 @@ public abstract class FileTypeDetector { * * @see java.nio.file.Files#probeContentType */ - public abstract String probeContentType(FileRef file) + public abstract String probeContentType(Path path) throws IOException; } diff --git a/jdk/src/share/classes/java/util/Scanner.java b/jdk/src/share/classes/java/util/Scanner.java index 834af330ff1..4aa5c9fb8c5 100644 --- a/jdk/src/share/classes/java/util/Scanner.java +++ b/jdk/src/share/classes/java/util/Scanner.java @@ -25,7 +25,8 @@ package java.util; -import java.nio.file.FileRef; +import java.nio.file.Path; +import java.nio.file.Files; import java.util.regex.*; import java.io.*; import java.math.*; @@ -699,16 +700,16 @@ public final class Scanner implements Iterator, Closeable { * {@linkplain java.nio.charset.Charset#defaultCharset() default charset}. * * @param source - * A file to be scanned + * the path to the file to be scanned * @throws IOException * if an I/O error occurs opening source * * @since 1.7 */ - public Scanner(FileRef source) + public Scanner(Path source) throws IOException { - this(source.newInputStream()); + this(Files.newInputStream(source)); } /** @@ -717,7 +718,7 @@ public final class Scanner implements Iterator, Closeable { * characters using the specified charset. * * @param source - * A file to be scanned + * the path to the file to be scanned * @param charsetName * The encoding type used to convert bytes from the file * into characters to be scanned @@ -727,12 +728,12 @@ public final class Scanner implements Iterator, Closeable { * if the specified encoding is not found * @since 1.7 */ - public Scanner(FileRef source, String charsetName) throws IOException { + public Scanner(Path source, String charsetName) throws IOException { this(Objects.nonNull(source), toCharset(charsetName)); } - private Scanner(FileRef source, Charset charset) throws IOException { - this(makeReadable(source.newInputStream(), charset)); + private Scanner(Path source, Charset charset) throws IOException { + this(makeReadable(Files.newInputStream(source), charset)); } /** diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java b/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java index 65b965bb32b..cd1e6c26b8d 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractAclFileAttributeView.java @@ -44,15 +44,6 @@ abstract class AbstractAclFileAttributeView return "acl"; } - @Override - public final Object getAttribute(String attribute) throws IOException { - if (attribute.equals(OWNER_NAME)) - return getOwner(); - if (attribute.equals(ACL_NAME)) - return getAcl(); - return null; - } - @Override @SuppressWarnings("unchecked") public final void setAttribute(String attribute, Object value) @@ -71,7 +62,7 @@ abstract class AbstractAclFileAttributeView } @Override - public final Map readAttributes(String[] attributes) + public final Map readAttributes(String[] attributes) throws IOException { boolean acl = false; @@ -91,7 +82,7 @@ abstract class AbstractAclFileAttributeView continue; } } - Map result = new HashMap(2); + Map result = new HashMap<>(2); if (acl) result.put(ACL_NAME, getAcl()); if (owner) diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java b/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java index de84499cb78..6383c08edf1 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractBasicFileAttributeView.java @@ -53,30 +53,6 @@ abstract class AbstractBasicFileAttributeView return "basic"; } - @Override - public Object getAttribute(String attribute) throws IOException { - BasicFileAttributes attrs = readAttributes(); - if (attribute.equals(SIZE_NAME)) - return attrs.size(); - if (attribute.equals(CREATION_TIME_NAME)) - return attrs.creationTime(); - if (attribute.equals(LAST_ACCESS_TIME_NAME)) - return attrs.lastAccessTime(); - if (attribute.equals(LAST_MODIFIED_TIME_NAME)) - return attrs.lastModifiedTime(); - if (attribute.equals(FILE_KEY_NAME)) - return attrs.fileKey(); - if (attribute.equals(IS_DIRECTORY_NAME)) - return attrs.isDirectory(); - if (attribute.equals(IS_REGULAR_FILE_NAME)) - return attrs.isRegularFile(); - if (attribute.equals(IS_SYMBOLIC_LINK_NAME)) - return attrs.isSymbolicLink(); - if (attribute.equals(IS_OTHER_NAME)) - return attrs.isOther(); - return null; - } - @Override public void setAttribute(String attribute, Object value) throws IOException @@ -101,8 +77,8 @@ abstract class AbstractBasicFileAttributeView * Used to build a map of attribute name/values. */ static class AttributesBuilder { - private Set set = new HashSet(); - private Map map = new HashMap(); + private Set set = new HashSet<>(); + private Map map = new HashMap<>(); private boolean copyAll; private AttributesBuilder(String[] attributes) { @@ -172,7 +148,7 @@ abstract class AbstractBasicFileAttributeView } @Override - public Map readAttributes(String[] attributes) throws IOException { + public Map readAttributes(String[] attributes) throws IOException { AttributesBuilder builder = AttributesBuilder.create(attributes); addBasicAttributesToBuilder(readAttributes(), builder); return builder.unmodifiableMap(); diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java b/jdk/src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java new file mode 100644 index 00000000000..95d1cb30931 --- /dev/null +++ b/jdk/src/share/classes/sun/nio/fs/AbstractFileSystemProvider.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.nio.fs; + +import java.nio.file.*; +import java.nio.file.spi.FileSystemProvider; +import java.io.IOException; +import java.util.Map; +import java.util.Collections; + +/** + * Base implementation class of FileSystemProvider + */ + +abstract class AbstractFileSystemProvider extends FileSystemProvider { + protected AbstractFileSystemProvider() { } + + /** + * Splits the given attribute name into the name of an attribute view and + * the attribute. If the attribute view is not identified then it assumed + * to be "basic". + */ + private static String[] split(String attribute) { + String[] s = new String[2]; + int pos = attribute.indexOf(':'); + if (pos == -1) { + s[0] = "basic"; + s[1] = attribute; + } else { + s[0] = attribute.substring(0, pos++); + s[1] = (pos == attribute.length()) ? "" : attribute.substring(pos); + } + return s; + } + + /** + * Gets a DynamicFileAttributeView by name. Returns {@code null} if the + * view is not available. + */ + abstract DynamicFileAttributeView getFileAttributeView(Path file, + String name, + LinkOption... options); + + @Override + public final void setAttribute(Path file, + String attribute, + Object value, + LinkOption... options) + throws IOException + { + String[] s = split(attribute); + DynamicFileAttributeView view = getFileAttributeView(file, s[0], options); + if (view == null) + throw new UnsupportedOperationException("View '" + s[0] + "' not available"); + view.setAttribute(s[1], value); + } + + @Override + public final Map readAttributes(Path file, String attributes, LinkOption... options) + throws IOException + { + String[] s = split(attributes); + DynamicFileAttributeView view = getFileAttributeView(file, s[0], options); + if (view == null) + return Collections.emptyMap(); + return view.readAttributes(s[1].split(",")); + } + + /** + * Deletes a file. The {@code failIfNotExists} parameters determines if an + * {@code IOException} is thrown when the file does not exist. + */ + abstract boolean implDelete(Path file, boolean failIfNotExists) throws IOException; + + @Override + public final void delete(Path file) throws IOException { + implDelete(file, true); + } + + @Override + public final boolean deleteIfExists(Path file) throws IOException { + return implDelete(file, false); + } +} diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java b/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java index 612e8e36f59..2ab2961561c 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractFileTypeDetector.java @@ -25,7 +25,7 @@ package sun.nio.fs; -import java.nio.file.FileRef; +import java.nio.file.Path; import java.nio.file.spi.FileTypeDetector; import java.util.Locale; import java.io.IOException; @@ -46,7 +46,7 @@ public abstract class AbstractFileTypeDetector * and checks that the content type's syntax is valid. */ @Override - public final String probeContentType(FileRef file) throws IOException { + public final String probeContentType(Path file) throws IOException { if (file == null) throw new NullPointerException("'file' is null"); String result = implProbeContentType(file); @@ -56,7 +56,7 @@ public abstract class AbstractFileTypeDetector /** * Probes the given file to guess its content type. */ - protected abstract String implProbeContentType(FileRef file) + protected abstract String implProbeContentType(Path file) throws IOException; /** diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractPath.java b/jdk/src/share/classes/sun/nio/fs/AbstractPath.java index 17262b68c04..eae2ac96483 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractPath.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractPath.java @@ -26,391 +26,81 @@ package sun.nio.fs; import java.nio.file.*; -import static java.nio.file.StandardOpenOption.*; -import java.nio.file.attribute.*; -import java.nio.channels.*; -import java.nio.ByteBuffer; -import java.io.*; -import java.util.*; +import java.io.File; +import java.io.IOException; +import java.util.Iterator; +import java.util.NoSuchElementException; /** - * Base implementation class for a {@code Path}. + * Base implementation class of {@code Path}. */ -abstract class AbstractPath extends Path { +abstract class AbstractPath implements Path { protected AbstractPath() { } @Override - public final Path createFile(FileAttribute... attrs) - throws IOException - { - EnumSet options = EnumSet.of(CREATE_NEW, WRITE); - SeekableByteChannel sbc = newByteChannel(options, attrs); - try { - sbc.close(); - } catch (IOException x) { - // ignore - } - return this; - } - - /** - * Deletes a file. The {@code failIfNotExists} parameters determines if an - * {@code IOException} is thrown when the file does not exist. - */ - abstract void implDelete(boolean failIfNotExists) throws IOException; - - @Override - public final void delete() throws IOException { - implDelete(true); + public final boolean startsWith(String other) { + return startsWith(getFileSystem().getPath(other)); } @Override - public final void deleteIfExists() throws IOException { - implDelete(false); + public final boolean endsWith(String other) { + return endsWith(getFileSystem().getPath(other)); } @Override - public final InputStream newInputStream(OpenOption... options) - throws IOException - { - if (options.length > 0) { - for (OpenOption opt: options) { - if (opt != READ) - throw new UnsupportedOperationException("'" + opt + "' not allowed"); - } - } - return Channels.newInputStream(newByteChannel()); + public final Path resolve(String other) { + return resolve(getFileSystem().getPath(other)); } @Override - public final OutputStream newOutputStream(OpenOption... options) - throws IOException - { - int len = options.length; - Set opts = new HashSet(len + 3); - if (len == 0) { - opts.add(CREATE); - opts.add(TRUNCATE_EXISTING); - } else { - for (OpenOption opt: options) { - if (opt == READ) - throw new IllegalArgumentException("READ not allowed"); - opts.add(opt); - } - } - opts.add(WRITE); - return Channels.newOutputStream(newByteChannel(opts)); + public final Path resolveSibling(Path other) { + if (other == null) + throw new NullPointerException(); + Path parent = getParent(); + return (parent == null) ? other : parent.resolve(other); } @Override - public final SeekableByteChannel newByteChannel(OpenOption... options) - throws IOException - { - Set set = new HashSet(options.length); - Collections.addAll(set, options); - return newByteChannel(set); - } - - private static final DirectoryStream.Filter acceptAllFilter = - new DirectoryStream.Filter() { - @Override public boolean accept(Path entry) { return true; } - }; - - @Override - public final DirectoryStream newDirectoryStream() throws IOException { - return newDirectoryStream(acceptAllFilter); + public final Path resolveSibling(String other) { + return resolveSibling(getFileSystem().getPath(other)); } @Override - public final DirectoryStream newDirectoryStream(String glob) - throws IOException - { - // avoid creating a matcher if all entries are required. - if (glob.equals("*")) - return newDirectoryStream(); - - // create a matcher and return a filter that uses it. - final PathMatcher matcher = getFileSystem().getPathMatcher("glob:" + glob); - DirectoryStream.Filter filter = new DirectoryStream.Filter() { + public final Iterator iterator() { + return new Iterator() { + private int i = 0; @Override - public boolean accept(Path entry) { - return matcher.matches(entry.getName()); + public boolean hasNext() { + return (i < getNameCount()); + } + @Override + public Path next() { + if (i < getNameCount()) { + Path result = getName(i); + i++; + return result; + } else { + throw new NoSuchElementException(); + } + } + @Override + public void remove() { + throw new UnsupportedOperationException(); } }; - return newDirectoryStream(filter); } @Override - public final boolean exists() { - try { - checkAccess(); - return true; - } catch (IOException x) { - // unable to determine if file exists - } - return false; + public final File toFile() { + return new File(toString()); } - @Override - public final boolean notExists() { - try { - checkAccess(); - return false; - } catch (NoSuchFileException x) { - // file confirmed not to exist - return true; - } catch (IOException x) { - return false; - } - } - - private static final WatchEvent.Modifier[] NO_MODIFIERS = new WatchEvent.Modifier[0]; - @Override public final WatchKey register(WatchService watcher, WatchEvent.Kind... events) throws IOException { - return register(watcher, events, NO_MODIFIERS); - } - - abstract void implCopyTo(Path target, CopyOption... options) - throws IOException; - - @Override - public final Path copyTo(Path target, CopyOption... options) - throws IOException - { - if ((getFileSystem().provider() == target.getFileSystem().provider())) { - implCopyTo(target, options); - } else { - copyToForeignTarget(target, options); - } - return target; - } - - abstract void implMoveTo(Path target, CopyOption... options) - throws IOException; - - @Override - public final Path moveTo(Path target, CopyOption... options) - throws IOException - { - if ((getFileSystem().provider() == target.getFileSystem().provider())) { - implMoveTo(target, options); - } else { - // different providers so copy + delete - copyToForeignTarget(target, convertMoveToCopyOptions(options)); - delete(); - } - return target; - } - - /** - * Converts the given array of options for moving a file to options suitable - * for copying the file when a move is implemented as copy + delete. - */ - private static CopyOption[] convertMoveToCopyOptions(CopyOption... options) - throws AtomicMoveNotSupportedException - { - int len = options.length; - CopyOption[] newOptions = new CopyOption[len+2]; - for (int i=0; i 0; - buf.flip(); - while (buf.hasRemaining()) { - sbc.write(buf); - } - buf.rewind(); - } - - } finally { - sbc.close(); - } - } finally { - rbc.close(); - } - } - - /** - * Splits the given attribute name into the name of an attribute view and - * the attribute. If the attribute view is not identified then it assumed - * to be "basic". - */ - private static String[] split(String attribute) { - String[] s = new String[2]; - int pos = attribute.indexOf(':'); - if (pos == -1) { - s[0] = "basic"; - s[1] = attribute; - } else { - s[0] = attribute.substring(0, pos++); - s[1] = (pos == attribute.length()) ? "" : attribute.substring(pos); - } - return s; - } - - /** - * Gets a DynamicFileAttributeView by name. Returns {@code null} if the - * view is not available. - */ - abstract DynamicFileAttributeView getFileAttributeView(String name, - LinkOption... options); - - @Override - public final void setAttribute(String attribute, - Object value, - LinkOption... options) - throws IOException - { - String[] s = split(attribute); - DynamicFileAttributeView view = getFileAttributeView(s[0], options); - if (view == null) - throw new UnsupportedOperationException("View '" + s[0] + "' not available"); - view.setAttribute(s[1], value); - } - - @Override - public final Object getAttribute(String attribute, LinkOption... options) - throws IOException - { - String[] s = split(attribute); - DynamicFileAttributeView view = getFileAttributeView(s[0], options); - return (view == null) ? null : view.getAttribute(s[1]); - } - - @Override - public final Map readAttributes(String attributes, LinkOption... options) - throws IOException - { - String[] s = split(attributes); - DynamicFileAttributeView view = getFileAttributeView(s[0], options); - if (view == null) - return Collections.emptyMap(); - return view.readAttributes(s[1].split(",")); + return register(watcher, events, new WatchEvent.Modifier[0]); } } diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractPoller.java b/jdk/src/share/classes/sun/nio/fs/AbstractPoller.java index 25567f3ce30..4bc4ecc29df 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractPoller.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractPoller.java @@ -92,7 +92,7 @@ abstract class AbstractPoller implements Runnable { /** * Requests, and waits on, poller thread to register given file. */ - final WatchKey register(FileRef dir, + final WatchKey register(Path dir, WatchEvent.Kind[] events, WatchEvent.Modifier... modifiers) throws IOException @@ -102,7 +102,7 @@ abstract class AbstractPoller implements Runnable { throw new NullPointerException(); if (events.length == 0) throw new IllegalArgumentException("No events to register"); - Set> eventSet = new HashSet>(events.length); + Set> eventSet = new HashSet<>(events.length); for (WatchEvent.Kind event: events) { // standard events if (event == StandardWatchEventKind.ENTRY_CREATE || diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractUserDefinedFileAttributeView.java b/jdk/src/share/classes/sun/nio/fs/AbstractUserDefinedFileAttributeView.java index 2f60db3f547..cf36a09ff0a 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractUserDefinedFileAttributeView.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractUserDefinedFileAttributeView.java @@ -59,8 +59,7 @@ abstract class AbstractUserDefinedFileAttributeView return "user"; } - @Override - public final Object getAttribute(String attribute) throws IOException { + private Object getAttribute(String attribute) throws IOException { int size; try { size = size(attribute); @@ -90,11 +89,11 @@ abstract class AbstractUserDefinedFileAttributeView } @Override - public final Map readAttributes(String[] attributes) + public final Map readAttributes(String[] attributes) throws IOException { // names of attributes to return - List names = new ArrayList(); + List names = new ArrayList<>(); for (String name: attributes) { if (name.equals("*")) { @@ -106,7 +105,7 @@ abstract class AbstractUserDefinedFileAttributeView } // read each value and return in map - Map result = new HashMap(); + Map result = new HashMap<>(); for (String name: names) { Object value = getAttribute(name); if (value != null) diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java b/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java index c3970d86c05..55234ba6528 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractWatchKey.java @@ -32,7 +32,7 @@ import java.util.*; * Base implementation class for watch keys. */ -abstract class AbstractWatchKey extends WatchKey { +abstract class AbstractWatchKey implements WatchKey { /** * Maximum size of event list (in the future this may be tunable) @@ -53,6 +53,9 @@ abstract class AbstractWatchKey extends WatchKey { // reference to watcher private final AbstractWatchService watcher; + // reference to the original directory + private final Path dir; + // key state private State state; @@ -63,8 +66,9 @@ abstract class AbstractWatchKey extends WatchKey { // event for the context is an ENTRY_MODIFY event). private Map> lastModifyEvents; - protected AbstractWatchKey(AbstractWatchService watcher) { + protected AbstractWatchKey(Path dir, AbstractWatchService watcher) { this.watcher = watcher; + this.dir = dir; this.state = State.READY; this.events = new ArrayList>(); this.lastModifyEvents = new HashMap>(); @@ -74,6 +78,13 @@ abstract class AbstractWatchKey extends WatchKey { return watcher; } + /** + * Return the original watchable (Path) + */ + Path watchable() { + return dir; + } + /** * Enqueues this key to the watch service */ @@ -175,7 +186,7 @@ abstract class AbstractWatchKey extends WatchKey { /** * WatchEvent implementation */ - private static class Event extends WatchEvent { + private static class Event implements WatchEvent { private final WatchEvent.Kind kind; private final T context; diff --git a/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java b/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java index ffab46fd645..c35e15f4158 100644 --- a/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java +++ b/jdk/src/share/classes/sun/nio/fs/AbstractWatchService.java @@ -33,7 +33,7 @@ import java.io.IOException; * Base implementation class for watch services. */ -abstract class AbstractWatchService extends WatchService { +abstract class AbstractWatchService implements WatchService { // signaled keys waiting to be dequeued private final LinkedBlockingDeque pendingKeys = @@ -41,7 +41,7 @@ abstract class AbstractWatchService extends WatchService { // special key to indicate that watch service is closed private final WatchKey CLOSE_KEY = - new AbstractWatchKey(null) { + new AbstractWatchKey(null, null) { @Override public boolean isValid() { return true; @@ -54,7 +54,7 @@ abstract class AbstractWatchService extends WatchService { // used when closing watch service private volatile boolean closed; - private Object closeLock = new Object(); + private final Object closeLock = new Object(); protected AbstractWatchService() { } @@ -93,7 +93,7 @@ abstract class AbstractWatchService extends WatchService { } @Override - public final WatchKey poll() { + public final WatchKey poll() { checkOpen(); WatchKey key = pendingKeys.poll(); checkKey(key); diff --git a/jdk/src/share/classes/sun/nio/fs/DynamicFileAttributeView.java b/jdk/src/share/classes/sun/nio/fs/DynamicFileAttributeView.java index 963a741b525..f91b8539e9c 100644 --- a/jdk/src/share/classes/sun/nio/fs/DynamicFileAttributeView.java +++ b/jdk/src/share/classes/sun/nio/fs/DynamicFileAttributeView.java @@ -34,11 +34,6 @@ import java.io.IOException; */ interface DynamicFileAttributeView { - /** - * Reads the value of an attribute. - */ - Object getAttribute(String attribute) throws IOException; - /** * Sets/updates the value of an attribute. */ @@ -47,5 +42,5 @@ interface DynamicFileAttributeView { /** * Reads a set of file attributes as a bulk operation. */ - Map readAttributes(String[] attributes) throws IOException; + Map readAttributes(String[] attributes) throws IOException; } diff --git a/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java b/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java index 977b81f4cfa..aae9bd318c1 100644 --- a/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java +++ b/jdk/src/share/classes/sun/nio/fs/FileOwnerAttributeViewImpl.java @@ -57,13 +57,6 @@ final class FileOwnerAttributeViewImpl return "owner"; } - @Override - public Object getAttribute(String attribute) throws IOException { - if (attribute.equals(OWNER_NAME)) - return getOwner(); - return null; - } - @Override public void setAttribute(String attribute, Object value) throws IOException @@ -77,8 +70,8 @@ final class FileOwnerAttributeViewImpl } @Override - public Map readAttributes(String[] attributes) throws IOException { - Map result = new HashMap(); + public Map readAttributes(String[] attributes) throws IOException { + Map result = new HashMap<>(); for (String attribute: attributes) { if (attribute.equals("*") || attribute.equals(OWNER_NAME)) { result.put(OWNER_NAME, getOwner()); diff --git a/jdk/src/share/classes/sun/nio/fs/PollingWatchService.java b/jdk/src/share/classes/sun/nio/fs/PollingWatchService.java index e2b2078bd99..7cd923842b5 100644 --- a/jdk/src/share/classes/sun/nio/fs/PollingWatchService.java +++ b/jdk/src/share/classes/sun/nio/fs/PollingWatchService.java @@ -146,7 +146,7 @@ class PollingWatchService throws IOException { // check file is a directory and get its file key if possible - BasicFileAttributes attrs = Attributes.readBasicFileAttributes(path); + BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class); if (!attrs.isDirectory()) { throw new NotDirectoryException(path.toString()); } @@ -164,7 +164,7 @@ class PollingWatchService watchKey = map.get(fileKey); if (watchKey == null) { // new registration - watchKey = new PollingWatchKey(this, path, fileKey); + watchKey = new PollingWatchKey(path, this, fileKey); map.put(fileKey, watchKey); } else { // update to existing registration @@ -228,7 +228,6 @@ class PollingWatchService * directory and queue keys when entries are added, modified, or deleted. */ private class PollingWatchKey extends AbstractWatchKey { - private final Path dir; private final Object fileKey; // current event set @@ -246,44 +245,28 @@ class PollingWatchService // map of entries in directory private Map entries; - PollingWatchKey(PollingWatchService watcher, - Path dir, - Object fileKey) + PollingWatchKey(Path dir, PollingWatchService watcher, Object fileKey) throws IOException { - super(watcher); - this.dir = dir; + super(dir, watcher); this.fileKey = fileKey; this.valid = true; this.tickCount = 0; this.entries = new HashMap(); // get the initial entries in the directory - DirectoryStream stream = dir.newDirectoryStream(); - try { + try (DirectoryStream stream = Files.newDirectoryStream(dir)) { for (Path entry: stream) { // don't follow links - long lastModified = Attributes - .readBasicFileAttributes(entry, LinkOption.NOFOLLOW_LINKS) - .lastModifiedTime().toMillis(); - entries.put(entry.getName(), - new CacheEntry(lastModified, tickCount)); + long lastModified = + Files.getLastModifiedTime(entry, LinkOption.NOFOLLOW_LINKS).toMillis(); + entries.put(entry.getFileName(), new CacheEntry(lastModified, tickCount)); } - } catch (ConcurrentModificationException cme) { - // thrown if directory iteration fails - Throwable cause = cme.getCause(); - if (cause != null && cause instanceof IOException) - throw (IOException)cause; - throw new AssertionError(cme); - } finally { - stream.close(); + } catch (DirectoryIteratorException e) { + throw e.getCause(); } } - FileRef directory() { - return dir; - } - Object fileKey() { return fileKey; } @@ -342,7 +325,7 @@ class PollingWatchService // open directory DirectoryStream stream = null; try { - stream = dir.newDirectoryStream(); + stream = Files.newDirectoryStream(watchable()); } catch (IOException x) { // directory is no longer accessible so cancel key cancel(); @@ -355,9 +338,8 @@ class PollingWatchService for (Path entry: stream) { long lastModified = 0L; try { - lastModified = Attributes - .readBasicFileAttributes(entry, LinkOption.NOFOLLOW_LINKS) - .lastModifiedTime().toMillis(); + lastModified = + Files.getLastModifiedTime(entry, LinkOption.NOFOLLOW_LINKS).toMillis(); } catch (IOException x) { // unable to get attributes of entry. If file has just // been deleted then we'll report it as deleted on the @@ -366,15 +348,15 @@ class PollingWatchService } // lookup cache - CacheEntry e = entries.get(entry.getName()); + CacheEntry e = entries.get(entry.getFileName()); if (e == null) { // new file found - entries.put(entry.getName(), + entries.put(entry.getFileName(), new CacheEntry(lastModified, tickCount)); // queue ENTRY_CREATE if event enabled if (events.contains(StandardWatchEventKind.ENTRY_CREATE)) { - signalEvent(StandardWatchEventKind.ENTRY_CREATE, entry.getName()); + signalEvent(StandardWatchEventKind.ENTRY_CREATE, entry.getFileName()); continue; } else { // if ENTRY_CREATE is not enabled and ENTRY_MODIFY is @@ -382,7 +364,7 @@ class PollingWatchService // modifications to the file immediately after it is // created. if (events.contains(StandardWatchEventKind.ENTRY_MODIFY)) { - signalEvent(StandardWatchEventKind.ENTRY_MODIFY, entry.getName()); + signalEvent(StandardWatchEventKind.ENTRY_MODIFY, entry.getFileName()); } } continue; @@ -391,15 +373,17 @@ class PollingWatchService // check if file has changed if (e.lastModified != lastModified) { if (events.contains(StandardWatchEventKind.ENTRY_MODIFY)) { - signalEvent(StandardWatchEventKind.ENTRY_MODIFY, entry.getName()); + signalEvent(StandardWatchEventKind.ENTRY_MODIFY, + entry.getFileName()); } } // entry in cache so update poll time e.update(lastModified, tickCount); } - } catch (ConcurrentModificationException x) { - // FIXME - should handle this + } catch (DirectoryIteratorException e) { + // ignore for now; if the directory is no longer accessible + // then the key will be cancelled on the next poll } finally { // close directory stream diff --git a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java index d66181a6149..cb778055b35 100644 --- a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java +++ b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java @@ -63,13 +63,14 @@ package sun.security.provider; * @author Gadi Guy */ -import java.lang.reflect.Method; -import java.lang.reflect.InvocationTargetException; import java.security.*; import java.io.*; import java.util.Properties; import java.util.Enumeration; import java.net.*; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.Random; import sun.security.util.Debug; @@ -177,37 +178,21 @@ abstract class SeedGenerator { // The temporary dir File f = new File(p.getProperty("java.io.tmpdir")); - - // Go thru files in the tmp dir using NIO's - // DirectoryStream. Fallback to File.list() - // if NIO is not available. - if (NIODirectoryStream.isAvailable()) { - int count = 0; - Iterable stream = - NIODirectoryStream.newDirectoryStream(f); + int count = 0; + try (DirectoryStream stream = Files.newDirectoryStream(f.toPath())) { // We use a Random object to choose what file names // should be used. Otherwise on a machine with too // many files, the same first 1024 files always get // used. Any, We make sure the first 512 files are // always used. Random r = new Random(); - try { - for (Object entry: stream) { - if (count < 512 || r.nextBoolean()) { - md.update(NIODirectoryStream.getName( - entry).getBytes()); - } - if (count++ > 1024) { - break; - } + for (Path entry: stream) { + if (count < 512 || r.nextBoolean()) { + md.update(entry.getFileName().toString().getBytes()); + } + if (count++ > 1024) { + break; } - } finally { - ((Closeable)stream).close(); - } - } else { - String[] sa = f.list(); - for(int i = 0; i < sa.length; i++) { - md.update(sa[i].getBytes()); } } } catch (Exception ex) { @@ -553,77 +538,4 @@ abstract class SeedGenerator { } } - - /** - * A wrapper of NIO DirectoryStream using reflection. - */ - private static class NIODirectoryStream { - private static final Class pathClass = - getClass("java.nio.file.Path"); - - private static final Method toPathMethod = - (pathClass == null) ? null : getMethod(File.class, "toPath"); - private static final Method getNameMethod = - getMethod(pathClass, "getName"); - private static final Method newDirectoryStreamMethod = - getMethod(pathClass, "newDirectoryStream"); - - private static Class getClass(String name) { - try { - return Class.forName(name, true, null); - } catch (ClassNotFoundException e) { - return null; - } - } - - private static Method getMethod(Class clazz, - String name, - Class... paramTypes) { - if (clazz != null) { - try { - return clazz.getMethod(name, paramTypes); - } catch (NoSuchMethodException e) { - throw new AssertionError(e); - } - } else { - return null; - } - } - - static boolean isAvailable() { - return pathClass != null; - } - - static Iterable newDirectoryStream(File dir) throws IOException { - assert pathClass != null; - try { - Object path = toPathMethod.invoke(dir); - return (Iterable)newDirectoryStreamMethod.invoke(path); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - if (cause instanceof IOException) - throw (IOException)cause; - if (cause instanceof RuntimeException) - throw (RuntimeException)cause; - if (cause instanceof Error) - throw (Error)cause; - throw new AssertionError(e); - } catch (IllegalAccessException iae) { - throw new AssertionError(iae); - } - } - - static String getName(Object path) { - assert pathClass != null; - try { - Object name = getNameMethod.invoke(path); - return name.toString(); - } catch (InvocationTargetException e) { - throw new AssertionError(e); - } catch (IllegalAccessException iae) { - throw new AssertionError(iae); - } - } - } } - diff --git a/jdk/src/share/classes/sun/tools/jar/Main.java b/jdk/src/share/classes/sun/tools/jar/Main.java index 3b8ea5b95b8..59c758f6cfc 100644 --- a/jdk/src/share/classes/sun/tools/jar/Main.java +++ b/jdk/src/share/classes/sun/tools/jar/Main.java @@ -27,6 +27,7 @@ package sun.tools.jar; import java.io.*; import java.nio.file.Path; +import java.nio.file.Files; import java.util.*; import java.util.zip.*; import java.util.jar.*; @@ -1017,17 +1018,17 @@ class Main { Path jarPath = jarFile.toPath(); Path tmpPath = createTempFileInSameDirectoryAs(jarFile).toPath(); try { - if (update(jarPath.newInputStream(), - tmpPath.newOutputStream(), + if (update(Files.newInputStream(jarPath), + Files.newOutputStream(tmpPath), null, index)) { try { - tmpPath.moveTo(jarPath, REPLACE_EXISTING); + Files.move(tmpPath, jarPath, REPLACE_EXISTING); } catch (IOException e) { throw new IOException(getMsg("error.write.file"), e); } } } finally { - tmpPath.deleteIfExists(); + Files.deleteIfExists(tmpPath); } } diff --git a/jdk/src/share/sample/nio/file/AclEdit.java b/jdk/src/share/sample/nio/file/AclEdit.java index c0088ca0990..0910e888a70 100644 --- a/jdk/src/share/sample/nio/file/AclEdit.java +++ b/jdk/src/share/sample/nio/file/AclEdit.java @@ -239,7 +239,7 @@ public class AclEdit { // read file's ACL AclFileAttributeView view = - file.getFileAttributeView(AclFileAttributeView.class); + Files.getFileAttributeView(file, AclFileAttributeView.class); if (view == null) { System.err.println("ACLs not supported on this platform"); System.exit(-1); diff --git a/jdk/src/share/sample/nio/file/Chmod.java b/jdk/src/share/sample/nio/file/Chmod.java index ae8feeeae04..7c4d50e93ef 100644 --- a/jdk/src/share/sample/nio/file/Chmod.java +++ b/jdk/src/share/sample/nio/file/Chmod.java @@ -264,11 +264,10 @@ public class Chmod { /** * Changes the permissions of the file using the given Changer. */ - static void chmod(FileRef file, Changer changer) { + static void chmod(Path file, Changer changer) { try { - Set perms = Attributes - .readPosixFileAttributes(file).permissions(); - Attributes.setPosixFilePermissions(file, changer.change(perms)); + Set perms = Files.getPosixFilePermissions(file); + Files.setPosixFilePermissions(file, changer.change(perms)); } catch (IOException x) { System.err.println(x); } @@ -277,7 +276,7 @@ public class Chmod { /** * Changes the permission of each file and directory visited */ - static class TreeVisitor implements FileVisitor { + static class TreeVisitor implements FileVisitor { private final Changer changer; TreeVisitor(Changer changer) { @@ -285,26 +284,26 @@ public class Chmod { } @Override - public FileVisitResult preVisitDirectory(FileRef dir, BasicFileAttributes attrs) { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { chmod(dir, changer); return CONTINUE; } @Override - public FileVisitResult visitFile(FileRef file, BasicFileAttributes attrs) { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { chmod(file, changer); return CONTINUE; } @Override - public FileVisitResult postVisitDirectory(FileRef dir, IOException exc) { + public FileVisitResult postVisitDirectory(Path dir, IOException exc) { if (exc != null) System.err.println("WARNING: " + exc); return CONTINUE; } @Override - public FileVisitResult visitFileFailed(FileRef file, IOException exc) { + public FileVisitResult visitFileFailed(Path file, IOException exc) { System.err.println("WARNING: " + exc); return CONTINUE; } diff --git a/jdk/src/share/sample/nio/file/Copy.java b/jdk/src/share/sample/nio/file/Copy.java index eb3d5a06d03..38062c4b875 100644 --- a/jdk/src/share/sample/nio/file/Copy.java +++ b/jdk/src/share/sample/nio/file/Copy.java @@ -45,7 +45,7 @@ public class Copy { /** * Returns {@code true} if okay to overwrite a file ("cp -i") */ - static boolean okayToOverwrite(FileRef file) { + static boolean okayToOverwrite(Path file) { String answer = System.console().readLine("overwrite %s (yes/no)? ", file); return (answer.equalsIgnoreCase("y") || answer.equalsIgnoreCase("yes")); } @@ -59,9 +59,9 @@ public class Copy { CopyOption[] options = (preserve) ? new CopyOption[] { COPY_ATTRIBUTES, REPLACE_EXISTING } : new CopyOption[] { REPLACE_EXISTING }; - if (!prompt || target.notExists() || okayToOverwrite(target)) { + if (!prompt || Files.notExists(target) || okayToOverwrite(target)) { try { - source.copyTo(target, options); + Files.copy(source, target, options); } catch (IOException x) { System.err.format("Unable to copy: %s: %s%n", source, x); } @@ -93,7 +93,7 @@ public class Copy { Path newdir = target.resolve(source.relativize(dir)); try { - dir.copyTo(newdir, options); + Files.copy(dir, newdir, options); } catch (FileAlreadyExistsException x) { // ignore } catch (IOException x) { @@ -116,8 +116,8 @@ public class Copy { if (exc == null && preserve) { Path newdir = target.resolve(source.relativize(dir)); try { - BasicFileAttributes attrs = Attributes.readBasicFileAttributes(dir); - Attributes.setLastModifiedTime(newdir, attrs.lastModifiedTime()); + FileTime time = Files.getLastModifiedTime(dir); + Files.setLastModifiedTime(newdir, time); } catch (IOException x) { System.err.format("Unable to copy all attributes to: %s: %s%n", newdir, x); } @@ -180,16 +180,11 @@ public class Copy { Path target = Paths.get(args[argi]); // check if target is a directory - boolean isDir = false; - try { - isDir = Attributes.readBasicFileAttributes(target).isDirectory(); - } catch (IOException x) { - // ignore (probably target does not exist) - } + boolean isDir = Files.isDirectory(target); // copy each source file/directory to target for (i=0; i 20) { @@ -66,7 +64,7 @@ public class DiskUsage { } } else { for (String file: args) { - FileStore store = Paths.get(file).getFileStore(); + FileStore store = Files.getFileStore(Paths.get(file)); printFileStore(store); } } diff --git a/jdk/src/share/sample/nio/file/FileType.java b/jdk/src/share/sample/nio/file/FileType.java index c4713f1a532..71451614b07 100644 --- a/jdk/src/share/sample/nio/file/FileType.java +++ b/jdk/src/share/sample/nio/file/FileType.java @@ -30,7 +30,6 @@ */ import java.nio.file.*; -import java.nio.file.attribute.*; import java.io.IOException; public class FileType { @@ -41,10 +40,8 @@ public class FileType { } for (String arg: args) { Path file = Paths.get(arg); - BasicFileAttributes attrs = Attributes.readBasicFileAttributes(file); - String type; - if (attrs.isDirectory()) { + if (Files.isDirectory(file)) { type = "directory"; } else { type = Files.probeContentType(file); diff --git a/jdk/src/share/sample/nio/file/WatchDir.java b/jdk/src/share/sample/nio/file/WatchDir.java index f2017256e9e..33c15dd0c04 100644 --- a/jdk/src/share/sample/nio/file/WatchDir.java +++ b/jdk/src/share/sample/nio/file/WatchDir.java @@ -58,7 +58,7 @@ public class WatchDir { private void register(Path dir) throws IOException { WatchKey key = dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY); if (trace) { - FileRef prev = keys.get(key); + Path prev = keys.get(key); if (prev == null) { System.out.format("register: %s\n", dir); } else { @@ -147,7 +147,7 @@ public class WatchDir { // register it and its sub-directories if (recursive && (kind == ENTRY_CREATE)) { try { - if (Attributes.readBasicFileAttributes(child, NOFOLLOW_LINKS).isDirectory()) { + if (Files.isDirectory(child, NOFOLLOW_LINKS)) { registerAll(child); } } catch (IOException x) { diff --git a/jdk/src/share/sample/nio/file/Xdd.java b/jdk/src/share/sample/nio/file/Xdd.java index 8796a174049..7551121a924 100644 --- a/jdk/src/share/sample/nio/file/Xdd.java +++ b/jdk/src/share/sample/nio/file/Xdd.java @@ -58,14 +58,14 @@ public class Xdd { Paths.get(args[0]) : Paths.get(args[2]); // check that user defined attributes are supported by the file store - FileStore store = file.getFileStore(); + FileStore store = Files.getFileStore(file); if (!store.supportsFileAttributeView(UserDefinedFileAttributeView.class)) { System.err.format("UserDefinedFileAttributeView not supported on %s\n", store); System.exit(-1); } - UserDefinedFileAttributeView view = file. - getFileAttributeView(UserDefinedFileAttributeView.class); + UserDefinedFileAttributeView view = + Files.getFileAttributeView(file, UserDefinedFileAttributeView.class); // list user defined attributes if (args.length == 1) { diff --git a/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java b/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java index 3b1925b8697..8e06835570f 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java +++ b/jdk/src/solaris/classes/sun/nio/fs/GnomeFileTypeDetector.java @@ -25,7 +25,7 @@ package sun.nio.fs; -import java.nio.file.FileRef; +import java.nio.file.Path; import java.io.IOException; import java.security.AccessController; import java.security.PrivilegedAction; @@ -57,7 +57,7 @@ public class GnomeFileTypeDetector } @Override - public String implProbeContentType(FileRef obj) throws IOException { + public String implProbeContentType(Path obj) throws IOException { if (!gioAvailable && !gnomeVfsAvailable) return null; if (!(obj instanceof UnixPath)) diff --git a/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java index c51fe6b959d..4499a08924c 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java @@ -66,19 +66,6 @@ class LinuxDosFileAttributeView return "dos"; } - @Override - public Object getAttribute(String attribute) throws IOException { - if (attribute.equals(READONLY_NAME)) - return readAttributes().isReadOnly(); - if (attribute.equals(ARCHIVE_NAME)) - return readAttributes().isArchive(); - if (attribute.equals(SYSTEM_NAME)) - return readAttributes().isSystem(); - if (attribute.equals(HIDDEN_NAME)) - return readAttributes().isHidden(); - return super.getAttribute(attribute); - } - @Override public void setAttribute(String attribute, Object value) throws IOException @@ -103,7 +90,7 @@ class LinuxDosFileAttributeView } @Override - public Map readAttributes(String[] attributes) + public Map readAttributes(String[] attributes) throws IOException { AttributesBuilder builder = AttributesBuilder.create(attributes); diff --git a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java index 225c5abab35..b8b8c30f936 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java @@ -26,7 +26,6 @@ package sun.nio.fs; import java.nio.file.*; -import java.nio.file.attribute.*; import java.io.IOException; import java.util.*; import java.security.AccessController; @@ -76,39 +75,14 @@ class LinuxFileSystem extends UnixFileSystem { } } - @Override - @SuppressWarnings("unchecked") - public V newFileAttributeView(Class view, - UnixPath file, - LinkOption... options) - { - if (view == DosFileAttributeView.class) - return (V) new LinuxDosFileAttributeView(file, followLinks(options)); - if (view == UserDefinedFileAttributeView.class) - return (V) new LinuxUserDefinedFileAttributeView(file, followLinks(options)); - return super.newFileAttributeView(view, file, options); - } - - @Override - @SuppressWarnings("unchecked") - public DynamicFileAttributeView newFileAttributeView(String name, - UnixPath file, - LinkOption... options) - { - if (name.equals("dos")) - return new LinuxDosFileAttributeView(file, followLinks(options)); - if (name.equals("user")) - return new LinuxUserDefinedFileAttributeView(file, followLinks(options)); - return super.newFileAttributeView(name, file, options); - } // lazy initialization of the list of supported attribute views private static class SupportedFileFileAttributeViewsHolder { static final Set supportedFileAttributeViews = supportedFileAttributeViews(); private static Set supportedFileAttributeViews() { - Set result = new HashSet(); - result.addAll(UnixFileSystem.standardFileAttributeViews()); + Set result = new HashSet<>(); + result.addAll(standardFileAttributeViews()); // additional Linux-specific views result.add("dos"); result.add("user"); @@ -130,7 +104,7 @@ class LinuxFileSystem extends UnixFileSystem { * Returns object to iterate over the mount entries in the given fstab file. */ Iterable getMountEntries(String fstab) { - ArrayList entries = new ArrayList(); + ArrayList entries = new ArrayList<>(); try { long fp = setmntent(fstab.getBytes(), "r".getBytes()); try { @@ -159,10 +133,7 @@ class LinuxFileSystem extends UnixFileSystem { return getMountEntries("/etc/mtab"); } - @Override - FileStore getFileStore(UnixPath path) throws IOException { - return new LinuxFileStore(path); - } + @Override FileStore getFileStore(UnixMountEntry entry) throws IOException { diff --git a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java index 1cb2772be30..6659ff5ede4 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java @@ -25,6 +25,10 @@ package sun.nio.fs; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; + /** * Linux implementation of FileSystemProvider */ @@ -38,4 +42,58 @@ public class LinuxFileSystemProvider extends UnixFileSystemProvider { LinuxFileSystem newFileSystem(String dir) { return new LinuxFileSystem(this, dir); } + + @Override + LinuxFileStore getFileStore(UnixPath path) throws IOException { + return new LinuxFileStore(path); + } + + @Override + @SuppressWarnings("unchecked") + public V getFileAttributeView(Path obj, + Class type, + LinkOption... options) + { + if (type == DosFileAttributeView.class) { + return (V) new LinuxDosFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + if (type == UserDefinedFileAttributeView.class) { + return (V) new LinuxUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + return super.getFileAttributeView(obj, type, options); + } + + @Override + public DynamicFileAttributeView getFileAttributeView(Path obj, + String name, + LinkOption... options) + { + if (name.equals("dos")) { + return new LinuxDosFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + if (name.equals("user")) { + return new LinuxUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + return super.getFileAttributeView(obj, name, options); + } + + @Override + @SuppressWarnings("unchecked") + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + if (type == DosFileAttributes.class) { + DosFileAttributeView view = + getFileAttributeView(file, DosFileAttributeView.class, options); + return (A) view.readAttributes(); + } else { + return super.readAttributes(file, type, options); + } + } } diff --git a/jdk/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java index dfe19ea570e..14bfbcc2e1e 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxUserDefinedFileAttributeView.java @@ -63,7 +63,7 @@ class LinuxUserDefinedFileAttributeView // Parses buffer as array of NULL-terminated C strings. private List asList(long address, int size) { - final List list = new ArrayList(); + List list = new ArrayList<>(); int start = 0; int pos = 0; while (pos < size) { diff --git a/jdk/src/solaris/classes/sun/nio/fs/LinuxWatchService.java b/jdk/src/solaris/classes/sun/nio/fs/LinuxWatchService.java index 9127a372d43..bca96756325 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxWatchService.java +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxWatchService.java @@ -102,8 +102,8 @@ class LinuxWatchService // watch descriptor private volatile int wd; - LinuxWatchKey(LinuxWatchService watcher, int ifd, int wd) { - super(watcher); + LinuxWatchKey(UnixPath dir, LinuxWatchService watcher, int ifd, int wd) { + super(dir, watcher); this.ifd = ifd; this.wd = wd; } @@ -266,7 +266,7 @@ class LinuxWatchService // ensure watch descriptor is in map LinuxWatchKey key = wdToKey.get(wd); if (key == null) { - key = new LinuxWatchKey(watcher, ifd, wd); + key = new LinuxWatchKey(dir, watcher, ifd, wd); wdToKey.put(wd, key); } return key; diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java index 285aeca4619..5fa71242b81 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java @@ -198,7 +198,7 @@ class SolarisAclFileAttributeView * Decode the buffer, returning an ACL */ private static List decode(long address, int n) { - ArrayList acl = new ArrayList(n); + ArrayList acl = new ArrayList<>(n); for (int i=0; i aceMask = new HashSet(); + Set aceMask = EnumSet.noneOf(AclEntryPermission.class); if ((mask & ACE_READ_DATA) > 0) aceMask.add(AclEntryPermission.READ_DATA); if ((mask & ACE_WRITE_DATA) > 0) @@ -274,7 +274,7 @@ class SolarisAclFileAttributeView if ((mask & ACE_SYNCHRONIZE) > 0) aceMask.add(AclEntryPermission.SYNCHRONIZE); - HashSet aceFlags = new HashSet(); + Set aceFlags = EnumSet.noneOf(AclEntryFlag.class); if ((flags & ACE_FILE_INHERIT_ACE) > 0) aceFlags.add(AclEntryFlag.FILE_INHERIT); if ((flags & ACE_DIRECTORY_INHERIT_ACE) > 0) diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java index 9618e42812c..516d983c259 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java @@ -26,7 +26,6 @@ package sun.nio.fs; import java.nio.file.*; -import java.nio.file.attribute.*; import java.io.IOException; import java.util.*; import java.security.AccessController; @@ -71,38 +70,14 @@ class SolarisFileSystem extends UnixFileSystem { } } - @Override - @SuppressWarnings("unchecked") - public V newFileAttributeView(Class view, - UnixPath file, LinkOption... options) - { - if (view == AclFileAttributeView.class) - return (V) new SolarisAclFileAttributeView(file, followLinks(options)); - if (view == UserDefinedFileAttributeView.class) { - return(V) new SolarisUserDefinedFileAttributeView(file, followLinks(options)); - } - return super.newFileAttributeView(view, file, options); - } - - @Override - protected DynamicFileAttributeView newFileAttributeView(String name, - UnixPath file, - LinkOption... options) - { - if (name.equals("acl")) - return new SolarisAclFileAttributeView(file, followLinks(options)); - if (name.equals("user")) - return new SolarisUserDefinedFileAttributeView(file, followLinks(options)); - return super.newFileAttributeView(name, file, options); - } // lazy initialization of the list of supported attribute views private static class SupportedFileFileAttributeViewsHolder { static final Set supportedFileAttributeViews = supportedFileAttributeViews(); private static Set supportedFileAttributeViews() { - Set result = new HashSet(); - result.addAll(UnixFileSystem.standardFileAttributeViews()); + Set result = new HashSet<>(); + result.addAll(standardFileAttributeViews()); // additional Solaris-specific views result.add("acl"); result.add("user"); @@ -126,7 +101,7 @@ class SolarisFileSystem extends UnixFileSystem { */ @Override Iterable getMountEntries() { - ArrayList entries = new ArrayList(); + ArrayList entries = new ArrayList<>(); try { UnixPath mnttab = new UnixPath(this, "/etc/mnttab"); long fp = fopen(mnttab, "r"); @@ -147,11 +122,6 @@ class SolarisFileSystem extends UnixFileSystem { return entries; } - @Override - FileStore getFileStore(UnixPath path) throws IOException { - return new SolarisFileStore(path); - } - @Override FileStore getFileStore(UnixMountEntry entry) throws IOException { return new SolarisFileStore(this, entry); diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java index 70f5577fc8b..98c3ae8699c 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java @@ -25,6 +25,10 @@ package sun.nio.fs; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; + /** * Solaris implementation of FileSystemProvider */ @@ -38,4 +42,41 @@ public class SolarisFileSystemProvider extends UnixFileSystemProvider { SolarisFileSystem newFileSystem(String dir) { return new SolarisFileSystem(this, dir); } + + @Override + SolarisFileStore getFileStore(UnixPath path) throws IOException { + return new SolarisFileStore(path); + } + + + @Override + @SuppressWarnings("unchecked") + public V getFileAttributeView(Path obj, + Class type, + LinkOption... options) + { + if (type == AclFileAttributeView.class) { + return (V) new SolarisAclFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + if (type == UserDefinedFileAttributeView.class) { + return(V) new SolarisUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + return super.getFileAttributeView(obj, type, options); + } + + @Override + public DynamicFileAttributeView getFileAttributeView(Path obj, + String name, + LinkOption... options) + { + if (name.equals("acl")) + return new SolarisAclFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + if (name.equals("user")) + return new SolarisUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + return super.getFileAttributeView(obj, name, options); + } } diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java index 60c9da167dc..6148f4109f2 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisUserDefinedFileAttributeView.java @@ -83,7 +83,7 @@ class SolarisUserDefinedFileAttributeView } // read list of extended attributes - final List list = new ArrayList(); + List list = new ArrayList<>(); try { byte[] name; while ((name = readdir(dp)) != null) { diff --git a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java index 5b9f98134b6..68296bc34e5 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java +++ b/jdk/src/solaris/classes/sun/nio/fs/SolarisWatchService.java @@ -128,7 +128,6 @@ class SolarisWatchService private class SolarisWatchKey extends AbstractWatchKey implements DirectoryNode { - private final UnixPath dir; private final UnixFileKey fileKey; // pointer to native file_obj object @@ -147,15 +146,14 @@ class SolarisWatchService long object, Set> events) { - super(watcher); - this.dir = dir; + super(dir, watcher); this.fileKey = fileKey; this.object = object; this.events = events; } - UnixPath getFileRef() { - return dir; + UnixPath getDirectory() { + return (UnixPath)watchable(); } UnixFileKey getFileKey() { @@ -487,7 +485,7 @@ class SolarisWatchService */ void processDirectoryEvents(SolarisWatchKey key, int mask) { if ((mask & (FILE_MODIFIED | FILE_ATTRIB)) != 0) { - registerChildren(key.getFileRef(), key, + registerChildren(key.getDirectory(), key, key.events().contains(StandardWatchEventKind.ENTRY_CREATE)); } } @@ -524,7 +522,7 @@ class SolarisWatchService boolean removed = true; try { UnixFileAttributes - .get(key.getFileRef().resolve(node.name()), false); + .get(key.getDirectory().resolve(node.name()), false); removed = false; } catch (UnixException x) { } @@ -554,14 +552,14 @@ class SolarisWatchService DirectoryStream stream = null; try { - stream = dir.newDirectoryStream(); + stream = Files.newDirectoryStream(dir); } catch (IOException x) { // nothing we can do return; } try { for (Path entry: stream) { - Path name = entry.getName(); + Path name = entry.getFileName(); // skip entry if already registered if (parent.getChild(name) != null) @@ -582,9 +580,9 @@ class SolarisWatchService } // create node - EntryNode node = new EntryNode(object, entry.getName(), parent); + EntryNode node = new EntryNode(object, entry.getFileName(), parent); // tell the parent about it - parent.addChild(entry.getName(), node); + parent.addChild(entry.getFileName(), node); object2Node.put(object, node); } } catch (ConcurrentModificationException x) { diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixCopyFile.java b/jdk/src/solaris/classes/sun/nio/fs/UnixCopyFile.java index ecb7e189923..9a666c167ee 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixCopyFile.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixCopyFile.java @@ -237,7 +237,7 @@ class UnixCopyFile { fo = open(target, (O_WRONLY | O_CREAT | - O_TRUNC), + O_EXCL), attrs.mode()); } catch (UnixException x) { x.rethrowAsIOException(target); @@ -435,10 +435,8 @@ class UnixCopyFile { if (targetAttrs.isDirectory() && (x.errno() == EEXIST || x.errno() == ENOTEMPTY)) { - throw new FileAlreadyExistsException( - source.getPathForExecptionMessage(), - target.getPathForExecptionMessage(), - x.getMessage()); + throw new DirectoryNotEmptyException( + target.getPathForExecptionMessage()); } x.rethrowAsIOException(target); } @@ -556,10 +554,8 @@ class UnixCopyFile { if (targetAttrs.isDirectory() && (x.errno() == EEXIST || x.errno() == ENOTEMPTY)) { - throw new FileAlreadyExistsException( - source.getPathForExecptionMessage(), - target.getPathForExecptionMessage(), - x.getMessage()); + throw new DirectoryNotEmptyException( + target.getPathForExecptionMessage()); } x.rethrowAsIOException(target); } diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java index 69f3cc52d15..c21a17707a8 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributeViews.java @@ -148,17 +148,6 @@ class UnixFileAttributeViews { return "posix"; } - @Override - public Object getAttribute(String attribute) throws IOException { - if (attribute.equals(PERMISSIONS_NAME)) - return readAttributes().permissions(); - if (attribute.equals(OWNER_NAME)) - return readAttributes().owner(); - if (attribute.equals(GROUP_NAME)) - return readAttributes().group(); - return super.getAttribute(attribute); - } - @Override @SuppressWarnings("unchecked") public void setAttribute(String attribute, Object value) @@ -195,7 +184,7 @@ class UnixFileAttributeViews { } @Override - public Map readAttributes(String[] attributes) + public Map readAttributes(String[] attributes) throws IOException { AttributesBuilder builder = AttributesBuilder.create(attributes); @@ -307,27 +296,6 @@ class UnixFileAttributeViews { return "unix"; } - @Override - public Object getAttribute(String attribute) throws IOException { - if (attribute.equals(MODE_NAME)) - return readAttributes().mode(); - if (attribute.equals(INO_NAME)) - return readAttributes().ino(); - if (attribute.equals(DEV_NAME)) - return readAttributes().dev(); - if (attribute.equals(RDEV_NAME)) - return readAttributes().rdev(); - if (attribute.equals(NLINK_NAME)) - return readAttributes().nlink(); - if (attribute.equals(UID_NAME)) - return readAttributes().uid(); - if (attribute.equals(GID_NAME)) - return readAttributes().gid(); - if (attribute.equals(CTIME_NAME)) - return readAttributes().ctime(); - return super.getAttribute(attribute); - } - @Override public void setAttribute(String attribute, Object value) throws IOException @@ -348,7 +316,7 @@ class UnixFileAttributeViews { } @Override - public Map readAttributes(String[] attributes) + public Map readAttributes(String[] attributes) throws IOException { AttributesBuilder builder = AttributesBuilder.create(attributes); diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java index b9a81f0315e..966712e0cf1 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileAttributes.java @@ -124,7 +124,7 @@ class UnixFileAttributes @Override public FileTime creationTime() { - return null; + return lastModifiedTime(); } @Override @@ -194,7 +194,7 @@ class UnixFileAttributes @Override public Set permissions() { int bits = (st_mode & UnixConstants.S_IAMB); - HashSet perms = new HashSet(); + HashSet perms = new HashSet<>(); if ((bits & UnixConstants.S_IRUSR) > 0) perms.add(PosixFilePermission.OWNER_READ); diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java index 46e09c6d7b1..080c2c0c2fd 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileStore.java @@ -103,28 +103,50 @@ abstract class UnixFileStore return entry.isReadOnly(); } + // uses statvfs to read the file system information + private UnixFileStoreAttributes readAttributes() throws IOException { + try { + return UnixFileStoreAttributes.get(file); + } catch (UnixException x) { + x.rethrowAsIOException(file); + return null; // keep compile happy + } + } + + @Override + public long getTotalSpace() throws IOException { + UnixFileStoreAttributes attrs = readAttributes(); + return attrs.blockSize() * attrs.totalBlocks(); + } + + @Override + public long getUsableSpace() throws IOException { + UnixFileStoreAttributes attrs = readAttributes(); + return attrs.blockSize() * attrs.availableBlocks(); + } + + @Override + public long getUnallocatedSpace() throws IOException { + UnixFileStoreAttributes attrs = readAttributes(); + return attrs.blockSize() * attrs.freeBlocks(); + } + @Override - @SuppressWarnings("unchecked") public V getFileStoreAttributeView(Class view) { if (view == null) throw new NullPointerException(); - if (view == FileStoreSpaceAttributeView.class) - return (V) new UnixFileStoreSpaceAttributeView(this); return (V) null; } @Override public Object getAttribute(String attribute) throws IOException { - if (attribute.equals("space:totalSpace")) - return new UnixFileStoreSpaceAttributeView(this) - .readAttributes().totalSpace(); - if (attribute.equals("space:usableSpace")) - return new UnixFileStoreSpaceAttributeView(this) - .readAttributes().usableSpace(); - if (attribute.equals("space:unallocatedSpace")) - return new UnixFileStoreSpaceAttributeView(this) - .readAttributes().unallocatedSpace(); + if (attribute.equals("totalSpace")) + return getTotalSpace(); + if (attribute.equals("usableSpace")) + return getUsableSpace(); + if (attribute.equals("unallocatedSpace")) + return getUnallocatedSpace(); throw new UnsupportedOperationException("'" + attribute + "' not recognized"); } @@ -181,50 +203,6 @@ abstract class UnixFileStore return sb.toString(); } - private static class UnixFileStoreSpaceAttributeView - implements FileStoreSpaceAttributeView - { - private final UnixFileStore fs; - - UnixFileStoreSpaceAttributeView(UnixFileStore fs) { - this.fs = fs; - } - - @Override - public String name() { - return "space"; - } - - @Override - public FileStoreSpaceAttributes readAttributes() - throws IOException - { - UnixPath file = fs.file(); - final UnixFileStoreAttributes attrs; - try { - attrs = UnixFileStoreAttributes.get(file); - } catch (UnixException x) { - x.rethrowAsIOException(file); - return null; // keep compile happy - } - - return new FileStoreSpaceAttributes() { - @Override - public long totalSpace() { - return attrs.blockSize() * attrs.totalBlocks(); - } - @Override - public long usableSpace() { - return attrs.blockSize() * attrs.availableBlocks(); - } - @Override - public long unallocatedSpace() { - return attrs.blockSize() * attrs.freeBlocks(); - } - }; - } - } - // -- fstypes.properties -- private static final Object loadLock = new Object(); @@ -277,11 +255,8 @@ abstract class UnixFileStore String fstypes = System.getProperty("java.home") + "/lib/fstypes.properties"; Path file = Paths.get(fstypes); try { - ReadableByteChannel rbc = file.newByteChannel(); - try { + try (ReadableByteChannel rbc = Files.newByteChannel(file)) { result.load(Channels.newReader(rbc, "UTF-8")); - } finally { - rbc.close(); } } catch (IOException x) { } diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java index 7068a25fc83..96c6e4a4cce 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystem.java @@ -98,6 +98,10 @@ abstract class UnixFileSystem return false; } + static List standardFileAttributeViews() { + return Arrays.asList("basic", "posix", "unix", "owner"); + } + @Override public final FileSystemProvider provider() { return provider; @@ -168,12 +172,6 @@ abstract class UnixFileSystem */ abstract Iterable getMountEntries(); - /** - * Returns a FileStore to represent the file system where the given file - * reside. - */ - abstract FileStore getFileStore(UnixPath path) throws IOException; - /** * Returns a FileStore to represent the file system for the given mount * mount. @@ -264,7 +262,22 @@ abstract class UnixFileSystem } @Override - public final UnixPath getPath(String path) { + public final Path getPath(String first, String... more) { + String path; + if (more.length == 0) { + path = first; + } else { + StringBuilder sb = new StringBuilder(); + sb.append(first); + for (String segment: more) { + if (segment.length() > 0) { + if (sb.length() > 0) + sb.append('/'); + sb.append(segment); + } + } + path = sb.toString(); + } return new UnixPath(this, path); } @@ -300,77 +313,30 @@ abstract class UnixFileSystem private static final String GLOB_SYNTAX = "glob"; private static final String REGEX_SYNTAX = "regex"; - protected boolean followLinks(LinkOption... options) { - boolean followLinks = true; - for (LinkOption option: options) { - if (option == LinkOption.NOFOLLOW_LINKS) { - followLinks = false; - continue; - } - if (option == null) - throw new NullPointerException(); - throw new AssertionError("Should not get here"); - } - return followLinks; - } - @SuppressWarnings("unchecked") - protected V newFileAttributeView(Class view, - UnixPath file, - LinkOption... options) - { - if (view == null) - throw new NullPointerException(); - boolean followLinks = followLinks(options); - Class c = view; - if (c == BasicFileAttributeView.class) - return (V) UnixFileAttributeViews.createBasicView(file, followLinks); - if (c == PosixFileAttributeView.class) - return (V) UnixFileAttributeViews.createPosixView(file, followLinks); - if (c == FileOwnerAttributeView.class) - return (V) UnixFileAttributeViews.createOwnerView(file, followLinks); - return (V) null; - } - - static List standardFileAttributeViews() { - return Arrays.asList("basic", "posix", "unix", "owner"); - } - - protected DynamicFileAttributeView newFileAttributeView(String name, - UnixPath file, - LinkOption... options) - { - boolean followLinks = followLinks(options); - if (name.equals("basic")) - return UnixFileAttributeViews.createBasicView(file, followLinks); - if (name.equals("posix")) - return UnixFileAttributeViews.createPosixView(file, followLinks); - if (name.equals("unix")) - return UnixFileAttributeViews.createUnixView(file, followLinks); - if (name.equals("owner")) - return UnixFileAttributeViews.createOwnerView(file, followLinks); - return null; - } @Override public final UserPrincipalLookupService getUserPrincipalLookupService() { - return theLookupService; + return LookupService.instance; } - private static final UserPrincipalLookupService theLookupService = - new UserPrincipalLookupService() { - @Override - public UserPrincipal lookupPrincipalByName(String name) - throws IOException - { - return UnixUserPrincipals.lookupUser(name); - } + private static class LookupService { + static final UserPrincipalLookupService instance = + new UserPrincipalLookupService() { + @Override + public UserPrincipal lookupPrincipalByName(String name) + throws IOException + { + return UnixUserPrincipals.lookupUser(name); + } + + @Override + public GroupPrincipal lookupPrincipalByGroupName(String group) + throws IOException + { + return UnixUserPrincipals.lookupGroup(group); + } + }; + } - @Override - public GroupPrincipal lookupPrincipalByGroupName(String group) - throws IOException - { - return UnixUserPrincipals.lookupGroup(group); - } - }; } diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java index aae884aa340..8ec672a306b 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixFileSystemProvider.java @@ -27,21 +27,25 @@ package sun.nio.fs; import java.nio.file.*; import java.nio.file.attribute.*; -import java.nio.file.spi.FileSystemProvider; import java.nio.channels.*; import java.net.URI; import java.util.concurrent.ExecutorService; import java.io.IOException; +import java.io.FilePermission; import java.util.*; +import java.security.AccessController; import sun.nio.ch.ThreadPool; +import sun.security.util.SecurityConstants; +import static sun.nio.fs.UnixNativeDispatcher.*; +import static sun.nio.fs.UnixConstants.*; /** * Base implementation of FileSystemProvider */ public abstract class UnixFileSystemProvider - extends FileSystemProvider + extends AbstractFileSystemProvider { private static final String USER_DIR = "user.dir"; private final UnixFileSystem theFileSystem; @@ -93,7 +97,7 @@ public abstract class UnixFileSystemProvider return UnixUriUtils.fromUri(theFileSystem, uri); } - protected UnixPath checkPath(Path obj) { + UnixPath checkPath(Path obj) { if (obj == null) throw new NullPointerException(); if (!(obj instanceof UnixPath)) @@ -101,6 +105,76 @@ public abstract class UnixFileSystemProvider return (UnixPath)obj; } + boolean followLinks(LinkOption... options) { + boolean followLinks = true; + for (LinkOption option: options) { + if (option == LinkOption.NOFOLLOW_LINKS) { + followLinks = false; + continue; + } + if (option == null) + throw new NullPointerException(); + throw new AssertionError("Should not get here"); + } + return followLinks; + } + + @Override + @SuppressWarnings("unchecked") + public V getFileAttributeView(Path obj, + Class type, + LinkOption... options) + { + UnixPath file = UnixPath.toUnixPath(obj); + boolean followLinks = followLinks(options); + if (type == BasicFileAttributeView.class) + return (V) UnixFileAttributeViews.createBasicView(file, followLinks); + if (type == PosixFileAttributeView.class) + return (V) UnixFileAttributeViews.createPosixView(file, followLinks); + if (type == FileOwnerAttributeView.class) + return (V) UnixFileAttributeViews.createOwnerView(file, followLinks); + if (type == null) + throw new NullPointerException(); + return (V) null; + } + + @Override + @SuppressWarnings("unchecked") + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + Class view; + if (type == BasicFileAttributes.class) + view = BasicFileAttributeView.class; + else if (type == PosixFileAttributes.class) + view = PosixFileAttributeView.class; + else if (type == null) + throw new NullPointerException(); + else + throw new UnsupportedOperationException(); + return (A) getFileAttributeView(file, view, options).readAttributes(); + } + + @Override + protected DynamicFileAttributeView getFileAttributeView(Path obj, + String name, + LinkOption... options) + { + UnixPath file = UnixPath.toUnixPath(obj); + boolean followLinks = followLinks(options); + if (name.equals("basic")) + return UnixFileAttributeViews.createBasicView(file, followLinks); + if (name.equals("posix")) + return UnixFileAttributeViews.createPosixView(file, followLinks); + if (name.equals("unix")) + return UnixFileAttributeViews.createUnixView(file, followLinks); + if (name.equals("owner")) + return UnixFileAttributeViews.createOwnerView(file, followLinks); + return null; + } + @Override public FileChannel newFileChannel(Path obj, Set options, @@ -136,4 +210,303 @@ public abstract class UnixFileSystemProvider return null; } } + + + @Override + public SeekableByteChannel newByteChannel(Path obj, + Set options, + FileAttribute... attrs) + throws IOException + { + UnixPath file = UnixPath.toUnixPath(obj); + int mode = UnixFileModeAttribute + .toUnixMode(UnixFileModeAttribute.ALL_READWRITE, attrs); + try { + return UnixChannelFactory.newFileChannel(file, options, mode); + } catch (UnixException x) { + x.rethrowAsIOException(file); + return null; // keep compiler happy + } + } + + @Override + boolean implDelete(Path obj, boolean failIfNotExists) throws IOException { + UnixPath file = UnixPath.toUnixPath(obj); + file.checkDelete(); + + // need file attributes to know if file is directory + UnixFileAttributes attrs = null; + try { + attrs = UnixFileAttributes.get(file, false); + if (attrs.isDirectory()) { + rmdir(file); + } else { + unlink(file); + } + return true; + } catch (UnixException x) { + // no-op if file does not exist + if (!failIfNotExists && x.errno() == ENOENT) + return false; + + // DirectoryNotEmptyException if not empty + if (attrs != null && attrs.isDirectory() && + (x.errno() == EEXIST || x.errno() == ENOTEMPTY)) + throw new DirectoryNotEmptyException(file.getPathForExecptionMessage()); + + x.rethrowAsIOException(file); + return false; + } + } + + @Override + public void copy(Path source, Path target, CopyOption... options) + throws IOException + { + UnixCopyFile.copy(UnixPath.toUnixPath(source), + UnixPath.toUnixPath(target), + options); + } + + @Override + public void move(Path source, Path target, CopyOption... options) + throws IOException + { + UnixCopyFile.move(UnixPath.toUnixPath(source), + UnixPath.toUnixPath(target), + options); + } + + @Override + public void checkAccess(Path obj, AccessMode... modes) throws IOException { + UnixPath file = UnixPath.toUnixPath(obj); + boolean e = false; + boolean r = false; + boolean w = false; + boolean x = false; + + if (modes.length == 0) { + e = true; + } else { + for (AccessMode mode: modes) { + switch (mode) { + case READ : r = true; break; + case WRITE : w = true; break; + case EXECUTE : x = true; break; + default: throw new AssertionError("Should not get here"); + } + } + } + + int mode = 0; + if (e || r) { + file.checkRead(); + mode |= (r) ? R_OK : F_OK; + } + if (w) { + file.checkWrite(); + mode |= W_OK; + } + if (x) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + // not cached + sm.checkExec(file.getPathForPermissionCheck()); + } + mode |= X_OK; + } + try { + access(file, mode); + } catch (UnixException exc) { + exc.rethrowAsIOException(file); + } + } + + @Override + public boolean isSameFile(Path obj1, Path obj2) throws IOException { + UnixPath file1 = UnixPath.toUnixPath(obj1); + if (file1.equals(obj2)) + return true; + if (obj2 == null) + throw new NullPointerException(); + if (!(obj2 instanceof UnixPath)) + return false; + UnixPath file2 = (UnixPath)obj2; + + // check security manager access to both files + file1.checkRead(); + file2.checkRead(); + + UnixFileAttributes attrs1; + UnixFileAttributes attrs2; + try { + attrs1 = UnixFileAttributes.get(file1, true); + } catch (UnixException x) { + x.rethrowAsIOException(file1); + return false; // keep compiler happy + } + try { + attrs2 = UnixFileAttributes.get(file2, true); + } catch (UnixException x) { + x.rethrowAsIOException(file2); + return false; // keep compiler happy + } + return attrs1.isSameFile(attrs2); + } + + @Override + public boolean isHidden(Path obj) { + UnixPath file = UnixPath.toUnixPath(obj); + file.checkRead(); + UnixPath name = file.getFileName(); + if (name == null) + return false; + return (name.asByteArray()[0] == '.'); + } + + /** + * Returns a FileStore to represent the file system where the given file + * reside. + */ + abstract FileStore getFileStore(UnixPath path) throws IOException; + + @Override + public FileStore getFileStore(Path obj) throws IOException { + UnixPath file = UnixPath.toUnixPath(obj); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new RuntimePermission("getFileStoreAttributes")); + file.checkRead(); + } + return getFileStore(file); + } + + @Override + public void createDirectory(Path obj, FileAttribute... attrs) + throws IOException + { + UnixPath dir = UnixPath.toUnixPath(obj); + dir.checkWrite(); + + int mode = UnixFileModeAttribute + .toUnixMode(UnixFileModeAttribute.ALL_PERMISSIONS, attrs); + try { + mkdir(dir, mode); + } catch (UnixException x) { + x.rethrowAsIOException(dir); + } + } + + + @Override + public DirectoryStream newDirectoryStream(Path obj, DirectoryStream.Filter filter) + throws IOException + { + UnixPath dir = UnixPath.toUnixPath(obj); + dir.checkRead(); + if (filter == null) + throw new NullPointerException(); + + // can't return SecureDirectoryStream on kernels that don't support + // openat, etc. + if (!supportsAtSysCalls()) { + try { + long ptr = opendir(dir); + return new UnixDirectoryStream(dir, ptr, filter); + } catch (UnixException x) { + if (x.errno() == ENOTDIR) + throw new NotDirectoryException(dir.getPathForExecptionMessage()); + x.rethrowAsIOException(dir); + } + } + + // open directory and dup file descriptor for use by + // opendir/readdir/closedir + int dfd1 = -1; + int dfd2 = -1; + long dp = 0L; + try { + dfd1 = open(dir, O_RDONLY, 0); + dfd2 = dup(dfd1); + dp = fdopendir(dfd1); + } catch (UnixException x) { + if (dfd1 != -1) + UnixNativeDispatcher.close(dfd1); + if (dfd2 != -1) + UnixNativeDispatcher.close(dfd2); + if (x.errno() == UnixConstants.ENOTDIR) + throw new NotDirectoryException(dir.getPathForExecptionMessage()); + x.rethrowAsIOException(dir); + } + return new UnixSecureDirectoryStream(dir, dp, dfd2, filter); + } + + @Override + public void createSymbolicLink(Path obj1, Path obj2, FileAttribute... attrs) + throws IOException + { + UnixPath link = UnixPath.toUnixPath(obj1); + UnixPath target = UnixPath.toUnixPath(obj2); + + // no attributes supported when creating links + if (attrs.length > 0) { + UnixFileModeAttribute.toUnixMode(0, attrs); // may throw NPE or UOE + throw new UnsupportedOperationException("Initial file attributes" + + "not supported when creating symbolic link"); + } + + // permission check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new LinkPermission("symbolic")); + link.checkWrite(); + } + + // create link + try { + symlink(target.asByteArray(), link); + } catch (UnixException x) { + x.rethrowAsIOException(link); + } + } + + @Override + public void createLink(Path obj1, Path obj2) throws IOException { + UnixPath link = UnixPath.toUnixPath(obj1); + UnixPath existing = UnixPath.toUnixPath(obj2); + + // permission check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new LinkPermission("hard")); + link.checkWrite(); + existing.checkWrite(); + } + try { + link(existing, link); + } catch (UnixException x) { + x.rethrowAsIOException(link, existing); + } + } + + @Override + public Path readSymbolicLink(Path obj1) throws IOException { + UnixPath link = UnixPath.toUnixPath(obj1); + // permission check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + FilePermission perm = new FilePermission(link.getPathForPermissionCheck(), + SecurityConstants.FILE_READLINK_ACTION); + AccessController.checkPermission(perm); + } + try { + byte[] target = readlink(link); + return new UnixPath(link.getFileSystem(), target); + } catch (UnixException x) { + if (x.errno() == UnixConstants.EINVAL) + throw new NotLinkException(link.getPathForExecptionMessage()); + x.rethrowAsIOException(link); + return null; // keep compiler happy + } + } } diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java index 1667263c222..9ec49b8d37a 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixPath.java @@ -27,15 +27,11 @@ package sun.nio.fs; import java.nio.*; import java.nio.file.*; -import java.nio.file.attribute.*; import java.nio.charset.*; -import java.nio.channels.*; -import java.security.AccessController; import java.io.*; import java.net.URI; import java.util.*; import java.lang.ref.SoftReference; -import sun.security.util.SecurityConstants; import static sun.nio.fs.UnixNativeDispatcher.*; import static sun.nio.fs.UnixConstants.*; @@ -79,8 +75,6 @@ class UnixPath // removes redundant slashes and check input for invalid characters static String normalizeAndCheck(String input) { int n = input.length(); - if (n == 0) - throw new InvalidPathException(input, "Path is empty"); char prevChar = 0; for (int i=0; i < n; i++) { char c = input.charAt(i); @@ -174,7 +168,13 @@ class UnixPath if (getFileSystem().needToResolveAgainstDefaultDirectory()) { return resolve(getFileSystem().defaultDirectory(), path); } else { - return path; + if (!isEmpty()) { + return path; + } else { + // empty path case will access current directory + byte[] here = { '.' }; + return here; + } } } @@ -193,7 +193,7 @@ class UnixPath } // Checks that the given file is a UnixPath - private UnixPath checkPath(FileRef obj) { + static UnixPath toUnixPath(Path obj) { if (obj == null) throw new NullPointerException(); if (!(obj instanceof UnixPath)) @@ -209,12 +209,17 @@ class UnixPath // count names count = 0; index = 0; - while (index < path.length) { - byte c = path[index++]; - if (c != '/') { - count++; - while (index < path.length && path[index] != '/') - index++; + if (isEmpty()) { + // empty path has one name + count = 1; + } else { + while (index < path.length) { + byte c = path[index++]; + if (c != '/') { + count++; + while (index < path.length && path[index] != '/') + index++; + } } } @@ -239,6 +244,16 @@ class UnixPath } } + // returns {@code true} if this path is an empty path + private boolean isEmpty() { + return path.length == 0; + } + + // returns an empty path + private UnixPath emptyPath() { + return new UnixPath(getFileSystem(), new byte[0]); + } + @Override public UnixFileSystem getFileSystem() { return fs; @@ -246,7 +261,7 @@ class UnixPath @Override public UnixPath getRoot() { - if (path[0] == '/') { + if (path.length > 0 && path[0] == '/') { return getFileSystem().rootDirectory(); } else { return null; @@ -254,14 +269,17 @@ class UnixPath } @Override - public UnixPath getName() { + public UnixPath getFileName() { initOffsets(); int count = offsets.length; - if (count == 0) - return null; // no elements so no name - if (count == 1 && path[0] != '/') + // no elements so no name + if (count == 0) + return null; + + // one name element and no root component + if (count == 1 && path.length > 0 && path[0] != '/') return this; int lastOffset = offsets[count-1]; @@ -349,57 +367,58 @@ class UnixPath @Override public boolean isAbsolute() { - return (path[0] == '/'); + return (path.length > 0 && path[0] == '/'); } // Resolve child against given base private static byte[] resolve(byte[] base, byte[] child) { - if (child[0] == '/') + int baseLength = base.length; + int childLength = child.length; + if (childLength == 0) + return base; + if (baseLength == 0 || child[0] == '/') return child; byte[] result; - if (base.length == 1 && base[0] == '/') { - result = new byte[child.length + 1]; + if (baseLength == 1 && base[0] == '/') { + result = new byte[childLength + 1]; result[0] = '/'; - System.arraycopy(child, 0, result, 1, child.length); + System.arraycopy(child, 0, result, 1, childLength); } else { - result = new byte[base.length + 1 + child.length]; - System.arraycopy(base, 0, result, 0, base.length); + result = new byte[baseLength + 1 + childLength]; + System.arraycopy(base, 0, result, 0, baseLength); result[base.length] = '/'; - System.arraycopy(child, 0, result, base.length+1, child.length); + System.arraycopy(child, 0, result, baseLength+1, childLength); } return result; } @Override public UnixPath resolve(Path obj) { - if (obj == null) - return this; - byte[] other = checkPath(obj).path; - if (other[0] == '/') + byte[] other = toUnixPath(obj).path; + if (other.length > 0 && other[0] == '/') return ((UnixPath)obj); byte[] result = resolve(path, other); return new UnixPath(getFileSystem(), result); } - @Override - public UnixPath resolve(String other) { - return resolve(new UnixPath(getFileSystem(), other)); - } - UnixPath resolve(byte[] other) { return resolve(new UnixPath(getFileSystem(), other)); } @Override public UnixPath relativize(Path obj) { - UnixPath other = checkPath(obj); + UnixPath other = toUnixPath(obj); if (other.equals(this)) - return null; + return emptyPath(); // can only relativize paths of the same type if (this.isAbsolute() != other.isAbsolute()) throw new IllegalArgumentException("'other' is different type of Path"); + // this path is the empty path + if (this.isEmpty()) + return other; + int bn = this.getNameCount(); int cn = other.getNameCount(); @@ -419,14 +438,27 @@ class UnixPath if (dotdots == 0) return remainder; + // other is the empty path + boolean isOtherEmpty = other.isEmpty(); + // result is a "../" for each remaining name in base - // followed by the remaining names in other - byte[] result = new byte[dotdots*3 + remainder.path.length]; + // followed by the remaining names in other. If the remainder is + // the empty path then we don't add the final trailing slash. + int len = dotdots*3 + remainder.path.length; + if (isOtherEmpty) { + assert remainder.isEmpty(); + len--; + } + byte[] result = new byte[len]; int pos = 0; while (dotdots > 0) { result[pos++] = (byte)'.'; result[pos++] = (byte)'.'; - result[pos++] = (byte)'/'; + if (isOtherEmpty) { + if (dotdots > 1) result[pos++] = (byte)'/'; + } else { + result[pos++] = (byte)'/'; + } dotdots--; } System.arraycopy(remainder.path, 0, result, pos, remainder.path.length); @@ -457,7 +489,7 @@ class UnixPath int[] size = new int[count]; // length of name int remaining = count; // number of names remaining boolean hasDotDot = false; // has at least one .. - boolean isAbsolute = path[0] == '/'; + boolean isAbsolute = isAbsolute(); // first pass: // 1. compute length of names @@ -542,7 +574,7 @@ class UnixPath // corner case - all names removed if (remaining == 0) { - return isAbsolute ? getFileSystem().rootDirectory() : null; + return isAbsolute ? getFileSystem().rootDirectory() : emptyPath(); } // compute length of result @@ -574,7 +606,7 @@ class UnixPath @Override public boolean startsWith(Path other) { - UnixPath that = checkPath(other); + UnixPath that = toUnixPath(other); // other path is longer if (that.path.length > path.length) @@ -584,8 +616,9 @@ class UnixPath int thatOffsetCount = that.getNameCount(); // other path has no name elements - if (thatOffsetCount == 0 && this.isAbsolute()) - return true; + if (thatOffsetCount == 0 && this.isAbsolute()) { + return that.isEmpty() ? false : true; + } // given path has more elements that this path if (thatOffsetCount > thisOffsetCount) @@ -622,7 +655,7 @@ class UnixPath @Override public boolean endsWith(Path other) { - UnixPath that = checkPath(other); + UnixPath that = toUnixPath(other); int thisLen = path.length; int thatLen = that.path.length; @@ -631,6 +664,10 @@ class UnixPath if (thatLen > thisLen) return false; + // other path is the empty path + if (thisLen > 0 && thatLen == 0) + return false; + // other path is absolute so this path must be absolute if (that.isAbsolute() && !this.isAbsolute()) return false; @@ -721,32 +758,6 @@ class UnixPath return stringValue; } - @Override - public Iterator iterator() { - initOffsets(); - return new Iterator() { - int i = 0; - @Override - public boolean hasNext() { - return (i < offsets.length); - } - @Override - public Path next() { - if (i < offsets.length) { - Path result = getName(i); - i++; - return result; - } else { - throw new NoSuchElementException(); - } - } - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - // -- file operations -- // package-private @@ -770,7 +781,6 @@ class UnixPath } } - void checkRead() { SecurityManager sm = System.getSecurityManager(); if (sm != null) @@ -789,296 +799,6 @@ class UnixPath sm.checkDelete(getPathForPermissionCheck()); } - @Override - public FileStore getFileStore() - throws IOException - { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new RuntimePermission("getFileStoreAttributes")); - checkRead(); - } - return getFileSystem().getFileStore(this); - } - - @Override - public void checkAccess(AccessMode... modes) throws IOException { - boolean e = false; - boolean r = false; - boolean w = false; - boolean x = false; - - if (modes.length == 0) { - e = true; - } else { - for (AccessMode mode: modes) { - switch (mode) { - case READ : r = true; break; - case WRITE : w = true; break; - case EXECUTE : x = true; break; - default: throw new AssertionError("Should not get here"); - } - } - } - - int mode = 0; - if (e || r) { - checkRead(); - mode |= (r) ? R_OK : F_OK; - } - if (w) { - checkWrite(); - mode |= W_OK; - } - if (x) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - // not cached - sm.checkExec(getPathForPermissionCheck()); - } - mode |= X_OK; - } - try { - access(this, mode); - } catch (UnixException exc) { - exc.rethrowAsIOException(this); - } - } - - @Override - void implDelete(boolean failIfNotExists) throws IOException { - checkDelete(); - - // need file attributes to know if file is directory - UnixFileAttributes attrs = null; - try { - attrs = UnixFileAttributes.get(this, false); - if (attrs.isDirectory()) { - rmdir(this); - } else { - unlink(this); - } - } catch (UnixException x) { - // no-op if file does not exist - if (!failIfNotExists && x.errno() == ENOENT) - return; - - // DirectoryNotEmptyException if not empty - if (attrs != null && attrs.isDirectory() && - (x.errno() == EEXIST || x.errno() == ENOTEMPTY)) - throw new DirectoryNotEmptyException(getPathForExecptionMessage()); - - x.rethrowAsIOException(this); - } - } - - @Override - public DirectoryStream newDirectoryStream(DirectoryStream.Filter filter) - throws IOException - { - if (filter == null) - throw new NullPointerException(); - checkRead(); - - // can't return SecureDirectoryStream on kernels that don't support - // openat, etc. - if (!supportsAtSysCalls()) { - try { - long ptr = opendir(this); - return new UnixDirectoryStream(this, ptr, filter); - } catch (UnixException x) { - if (x.errno() == ENOTDIR) - throw new NotDirectoryException(getPathForExecptionMessage()); - x.rethrowAsIOException(this); - } - } - - // open directory and dup file descriptor for use by - // opendir/readdir/closedir - int dfd1 = -1; - int dfd2 = -1; - long dp = 0L; - try { - dfd1 = open(this, O_RDONLY, 0); - dfd2 = dup(dfd1); - dp = fdopendir(dfd1); - } catch (UnixException x) { - if (dfd1 != -1) - close(dfd1); - if (dfd2 != -1) - close(dfd2); - if (x.errno() == UnixConstants.ENOTDIR) - throw new NotDirectoryException(getPathForExecptionMessage()); - x.rethrowAsIOException(this); - } - return new UnixSecureDirectoryStream(this, dp, dfd2, filter); - } - - // invoked by AbstractPath#copyTo - @Override - public void implCopyTo(Path obj, CopyOption... options) - throws IOException - { - UnixPath target = (UnixPath)obj; - UnixCopyFile.copy(this, target, options); - } - - @Override - public void implMoveTo(Path obj, CopyOption... options) - throws IOException - { - UnixPath target = (UnixPath)obj; - UnixCopyFile.move(this, target, options); - } - - @Override - @SuppressWarnings("unchecked") - public V - getFileAttributeView(Class type, LinkOption... options) - { - FileAttributeView view = getFileSystem() - .newFileAttributeView(type, this, options); - if (view == null) - return null; - return (V) view; - } - - @Override - public DynamicFileAttributeView getFileAttributeView(String name, - LinkOption... options) - { - return getFileSystem().newFileAttributeView(name, this, options); - } - - @Override - public Path createDirectory(FileAttribute... attrs) - throws IOException - { - checkWrite(); - - int mode = UnixFileModeAttribute - .toUnixMode(UnixFileModeAttribute.ALL_PERMISSIONS, attrs); - try { - mkdir(this, mode); - } catch (UnixException x) { - x.rethrowAsIOException(this); - } - return this; - } - - @Override - public SeekableByteChannel newByteChannel(Set options, - FileAttribute... attrs) - throws IOException - { - int mode = UnixFileModeAttribute - .toUnixMode(UnixFileModeAttribute.ALL_READWRITE, attrs); - try { - return UnixChannelFactory.newFileChannel(this, options, mode); - } catch (UnixException x) { - x.rethrowAsIOException(this); - return null; // keep compiler happy - } - } - - @Override - public boolean isSameFile(Path obj) throws IOException { - if (this.equals(obj)) - return true; - if (!(obj instanceof UnixPath)) // includes null check - return false; - UnixPath other = (UnixPath)obj; - - // check security manager access to both files - this.checkRead(); - other.checkRead(); - - UnixFileAttributes thisAttrs; - UnixFileAttributes otherAttrs; - try { - thisAttrs = UnixFileAttributes.get(this, true); - } catch (UnixException x) { - x.rethrowAsIOException(this); - return false; // keep compiler happy - } - try { - otherAttrs = UnixFileAttributes.get(other, true); - } catch (UnixException x) { - x.rethrowAsIOException(other); - return false; // keep compiler happy - } - return thisAttrs.isSameFile(otherAttrs); - } - - @Override - public Path createSymbolicLink(Path obj, FileAttribute... attrs) - throws IOException - { - UnixPath target = checkPath(obj); - - // no attributes supported when creating links - if (attrs.length > 0) { - UnixFileModeAttribute.toUnixMode(0, attrs); // may throw NPE or UOE - throw new UnsupportedOperationException("Initial file attributes" + - "not supported when creating symbolic link"); - } - - // permission check - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new LinkPermission("symbolic")); - checkWrite(); - } - - // create link - try { - symlink(target.asByteArray(), this); - } catch (UnixException x) { - x.rethrowAsIOException(this); - } - - return this; - } - - @Override - public Path createLink(Path obj) throws IOException { - UnixPath existing = checkPath(obj); - - // permission check - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new LinkPermission("hard")); - this.checkWrite(); - existing.checkWrite(); - } - try { - link(existing, this); - } catch (UnixException x) { - x.rethrowAsIOException(this, existing); - } - return this; - } - - @Override - public Path readSymbolicLink() throws IOException { - // permission check - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - FilePermission perm = new FilePermission(getPathForPermissionCheck(), - SecurityConstants.FILE_READLINK_ACTION); - AccessController.checkPermission(perm); - } - try { - byte[] target = readlink(this); - return new UnixPath(getFileSystem(), target); - } catch (UnixException x) { - if (x.errno() == UnixConstants.EINVAL) - throw new NotLinkException(getPathForExecptionMessage()); - x.rethrowAsIOException(this); - return null; // keep compiler happy - } - } - @Override public UnixPath toAbsolutePath() { if (isAbsolute()) { @@ -1095,7 +815,7 @@ class UnixPath } @Override - public UnixPath toRealPath(boolean resolveLinks) throws IOException { + public Path toRealPath(boolean resolveLinks) throws IOException { checkRead(); UnixPath absolute = toAbsolutePath(); @@ -1112,8 +832,7 @@ class UnixPath // if resolveLinks is false then eliminate "." and also ".." // where the previous element is not a link. - UnixPath root = getFileSystem().rootDirectory(); - UnixPath result = root; + UnixPath result = fs.rootDirectory(); for (int i=0; i + implements SecureDirectoryStream { private final UnixDirectoryStream ds; private final int dfd; @@ -81,6 +81,20 @@ class UnixSecureDirectoryStream return (UnixPath)obj; } + private boolean followLinks(LinkOption... options) { + boolean followLinks = true; + for (LinkOption option: options) { + if (option == LinkOption.NOFOLLOW_LINKS) { + followLinks = false; + continue; + } + if (option == null) + throw new NullPointerException(); + throw new AssertionError("Should not get here"); + } + return followLinks; + } + /** * Opens sub-directory in this directory */ @@ -91,7 +105,7 @@ class UnixSecureDirectoryStream { UnixPath file = getName(obj); UnixPath child = ds.directory().resolve(file); - boolean followLinks = file.getFileSystem().followLinks(options); + boolean followLinks = followLinks(options); // permission check using name resolved against original path of directory SecurityManager sm = System.getSecurityManager(); @@ -302,7 +316,7 @@ class UnixSecureDirectoryStream LinkOption... options) { UnixPath file = getName(obj); - boolean followLinks = file.getFileSystem().followLinks(options); + boolean followLinks = followLinks(options); return getFileAttributeViewImpl(file, type, followLinks); } @@ -336,7 +350,11 @@ class UnixSecureDirectoryStream private void checkWriteAccess() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { - ds.directory().resolve(file).checkWrite(); + if (file == null) { + ds.directory().checkWrite(); + } else { + ds.directory().resolve(file).checkWrite(); + } } } diff --git a/jdk/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java b/jdk/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java index 9d0beb50a13..8c846c1c219 100644 --- a/jdk/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java +++ b/jdk/src/windows/classes/sun/nio/fs/RegistryFileTypeDetector.java @@ -42,12 +42,12 @@ public class RegistryFileTypeDetector } @Override - public String implProbeContentType(FileRef file) throws IOException { + public String implProbeContentType(Path file) throws IOException { if (!(file instanceof Path)) return null; // get file extension - Path name = ((Path)file).getName(); + Path name = file.getFileName(); if (name == null) return null; String filename = name.toString(); diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java index 20beff15474..8a81b87a0ab 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileAttributeViews.java @@ -166,22 +166,6 @@ class WindowsFileAttributeViews { return "dos"; } - @Override - public Object getAttribute(String attribute) throws IOException { - if (attribute.equals(READONLY_NAME)) - return readAttributes().isReadOnly(); - if (attribute.equals(ARCHIVE_NAME)) - return readAttributes().isArchive(); - if (attribute.equals(SYSTEM_NAME)) - return readAttributes().isSystem(); - if (attribute.equals(HIDDEN_NAME)) - return readAttributes().isHidden(); - // implementation specific - if (attribute.equals(ATTRIBUTES_NAME)) - return readAttributes().attributes(); - return super.getAttribute(attribute); - } - @Override public void setAttribute(String attribute, Object value) throws IOException @@ -206,7 +190,7 @@ class WindowsFileAttributeViews { } @Override - public Map readAttributes(String[] attributes) + public Map readAttributes(String[] attributes) throws IOException { AttributesBuilder builder = AttributesBuilder.create(attributes); diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileCopy.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileCopy.java index d35752b8ee1..ed3421fb90e 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileCopy.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileCopy.java @@ -158,7 +158,7 @@ class WindowsFileCopy { if (x.lastError() == ERROR_DIR_NOT_EMPTY || x.lastError() == ERROR_ALREADY_EXISTS) { - throw new FileAlreadyExistsException( + throw new DirectoryNotEmptyException( target.getPathForExceptionMessage()); } } @@ -369,7 +369,7 @@ class WindowsFileCopy { if (x.lastError() == ERROR_DIR_NOT_EMPTY || x.lastError() == ERROR_ALREADY_EXISTS) { - throw new FileAlreadyExistsException( + throw new DirectoryNotEmptyException( target.getPathForExceptionMessage()); } } diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java index 30446bb4ae9..8b3c2fb4b19 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileStore.java @@ -117,28 +117,47 @@ class WindowsFileStore return ((volInfo.flags() & FILE_READ_ONLY_VOLUME) != 0); } + // read the free space info + private DiskFreeSpace readDiskFreeSpace() throws IOException { + try { + return GetDiskFreeSpaceEx(root); + } catch (WindowsException x) { + x.rethrowAsIOException(root); + return null; + } + } + + @Override + public long getTotalSpace() throws IOException { + return readDiskFreeSpace().totalNumberOfBytes(); + } + + @Override + public long getUsableSpace() throws IOException { + return readDiskFreeSpace().freeBytesAvailable(); + } + + @Override + public long getUnallocatedSpace() throws IOException { + return readDiskFreeSpace().freeBytesAvailable(); + } + @Override - @SuppressWarnings("unchecked") public V getFileStoreAttributeView(Class type) { if (type == null) throw new NullPointerException(); - if (type == FileStoreSpaceAttributeView.class) - return (V) new WindowsFileStoreAttributeView(this); return (V) null; } @Override public Object getAttribute(String attribute) throws IOException { // standard - if (attribute.equals("space:totalSpace")) - return new WindowsFileStoreAttributeView(this) - .readAttributes().totalSpace(); - if (attribute.equals("space:usableSpace")) - return new WindowsFileStoreAttributeView(this) - .readAttributes().usableSpace(); - if (attribute.equals("space:unallocatedSpace")) - return new WindowsFileStoreAttributeView(this) - .readAttributes().unallocatedSpace(); + if (attribute.equals("totalSpace")) + return getTotalSpace(); + if (attribute.equals("usableSpace")) + return getUsableSpace(); + if (attribute.equals("unallocatedSpace")) + return getUnallocatedSpace(); // windows specific for testing purposes if (attribute.equals("volume:vsn")) return volInfo.volumeSerialNumber(); @@ -202,48 +221,4 @@ class WindowsFileStore sb.append(")"); return sb.toString(); } - - static class WindowsFileStoreAttributeView - implements FileStoreSpaceAttributeView - { - private final WindowsFileStore fs; - - WindowsFileStoreAttributeView(WindowsFileStore fs) { - this.fs = fs; - } - - @Override - public String name() { - return "space"; - } - - @Override - public FileStoreSpaceAttributes readAttributes() - throws IOException - { - // read the free space info - DiskFreeSpace info = null; - try { - info = GetDiskFreeSpaceEx(fs.root); - } catch (WindowsException x) { - x.rethrowAsIOException(fs.root); - } - - final DiskFreeSpace result = info; - return new FileStoreSpaceAttributes() { - @Override - public long totalSpace() { - return result.totalNumberOfBytes(); - } - @Override - public long usableSpace() { - return result.freeBytesAvailable(); - } - @Override - public long unallocatedSpace() { - return result.totalNumberOfFreeBytes(); - } - }; - } - } } diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystem.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystem.java index a543623ee4a..59891ec51d5 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystem.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystem.java @@ -127,7 +127,7 @@ class WindowsFileSystem } // iterate over roots, ignoring those that the security manager denies - ArrayList result = new ArrayList(); + ArrayList result = new ArrayList<>(); SecurityManager sm = System.getSecurityManager(); for (int i = 0; i <= 25; i++) { // 0->A, 1->B, 2->C... if ((drives & (1 << i)) != 0) { @@ -235,33 +235,50 @@ class WindowsFileSystem } @Override - public Path getPath(String path) { + public final Path getPath(String first, String... more) { + String path; + if (more.length == 0) { + path = first; + } else { + StringBuilder sb = new StringBuilder(); + sb.append(first); + for (String segment: more) { + if (segment.length() > 0) { + if (sb.length() > 0) + sb.append('\\'); + sb.append(segment); + } + } + path = sb.toString(); + } return WindowsPath.parse(this, path); } @Override public UserPrincipalLookupService getUserPrincipalLookupService() { - return theLookupService; + return LookupService.instance; } - private static final UserPrincipalLookupService theLookupService = - new UserPrincipalLookupService() { - @Override - public UserPrincipal lookupPrincipalByName(String name) - throws IOException - { - return WindowsUserPrincipals.lookup(name); - } - @Override - public GroupPrincipal lookupPrincipalByGroupName(String group) - throws IOException - { - UserPrincipal user = WindowsUserPrincipals.lookup(group); - if (!(user instanceof GroupPrincipal)) - throw new UserPrincipalNotFoundException(group); - return (GroupPrincipal)user; - } - }; + private static class LookupService { + static final UserPrincipalLookupService instance = + new UserPrincipalLookupService() { + @Override + public UserPrincipal lookupPrincipalByName(String name) + throws IOException + { + return WindowsUserPrincipals.lookup(name); + } + @Override + public GroupPrincipal lookupPrincipalByGroupName(String group) + throws IOException + { + UserPrincipal user = WindowsUserPrincipals.lookup(group); + if (!(user instanceof GroupPrincipal)) + throw new UserPrincipalNotFoundException(group); + return (GroupPrincipal)user; + } + }; + } @Override public PathMatcher getPathMatcher(String syntaxAndInput) { diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java index 81193d25b9a..6d6a4db89b2 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java @@ -26,19 +26,25 @@ package sun.nio.fs; import java.nio.file.*; -import java.nio.file.spi.*; import java.nio.file.attribute.*; import java.nio.channels.*; import java.net.URI; import java.util.concurrent.ExecutorService; -import java.io.IOException; +import java.io.*; import java.util.*; - +import java.security.AccessController; +import sun.misc.Unsafe; import sun.nio.ch.ThreadPool; +import sun.security.util.SecurityConstants; + +import static sun.nio.fs.WindowsNativeDispatcher.*; +import static sun.nio.fs.WindowsConstants.*; public class WindowsFileSystemProvider - extends FileSystemProvider + extends AbstractFileSystemProvider { + private static final Unsafe unsafe = Unsafe.getUnsafe(); + private static final String USER_DIR = "user.dir"; private final WindowsFileSystem theFileSystem; @@ -143,4 +149,505 @@ public class WindowsFileSystemProvider sd.release(); } } + + private boolean followLinks(LinkOption... options) { + boolean followLinks = true; + for (LinkOption option: options) { + if (option == LinkOption.NOFOLLOW_LINKS) { + followLinks = false; + continue; + } + if (option == null) + throw new NullPointerException(); + throw new AssertionError("Should not get here"); + } + return followLinks; + } + + @Override + @SuppressWarnings("unchecked") + public V + getFileAttributeView(Path obj, Class view, LinkOption... options) + { + WindowsPath file = WindowsPath.toWindowsPath(obj); + if (view == null) + throw new NullPointerException(); + boolean followLinks = followLinks(options); + if (view == BasicFileAttributeView.class) + return (V) WindowsFileAttributeViews.createBasicView(file, followLinks); + if (view == DosFileAttributeView.class) + return (V) WindowsFileAttributeViews.createDosView(file, followLinks); + if (view == AclFileAttributeView.class) + return (V) new WindowsAclFileAttributeView(file, followLinks); + if (view == FileOwnerAttributeView.class) + return (V) new FileOwnerAttributeViewImpl( + new WindowsAclFileAttributeView(file, followLinks)); + if (view == UserDefinedFileAttributeView.class) + return (V) new WindowsUserDefinedFileAttributeView(file, followLinks); + return (V) null; + } + + @Override + @SuppressWarnings("unchecked") + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + Class view; + if (type == BasicFileAttributes.class) + view = BasicFileAttributeView.class; + else if (type == DosFileAttributes.class) + view = DosFileAttributeView.class; + else if (type == null) + throw new NullPointerException(); + else + throw new UnsupportedOperationException(); + return (A) getFileAttributeView(file, view, options).readAttributes(); + } + + @Override + public DynamicFileAttributeView getFileAttributeView(Path obj, String name, LinkOption... options) { + WindowsPath file = WindowsPath.toWindowsPath(obj); + boolean followLinks = followLinks(options); + if (name.equals("basic")) + return WindowsFileAttributeViews.createBasicView(file, followLinks); + if (name.equals("dos")) + return WindowsFileAttributeViews.createDosView(file, followLinks); + if (name.equals("acl")) + return new WindowsAclFileAttributeView(file, followLinks); + if (name.equals("owner")) + return new FileOwnerAttributeViewImpl( + new WindowsAclFileAttributeView(file, followLinks)); + if (name.equals("user")) + return new WindowsUserDefinedFileAttributeView(file, followLinks); + return null; + } + + @Override + public SeekableByteChannel newByteChannel(Path obj, + Set options, + FileAttribute... attrs) + throws IOException + { + WindowsPath file = WindowsPath.toWindowsPath(obj); + WindowsSecurityDescriptor sd = + WindowsSecurityDescriptor.fromAttribute(attrs); + try { + return WindowsChannelFactory + .newFileChannel(file.getPathForWin32Calls(), + file.getPathForPermissionCheck(), + options, + sd.address()); + } catch (WindowsException x) { + x.rethrowAsIOException(file); + return null; // keep compiler happy + } finally { + sd.release(); + } + } + + @Override + boolean implDelete(Path obj, boolean failIfNotExists) throws IOException { + WindowsPath file = WindowsPath.toWindowsPath(obj); + file.checkDelete(); + + WindowsFileAttributes attrs = null; + try { + // need to know if file is a directory or junction + attrs = WindowsFileAttributes.get(file, false); + if (attrs.isDirectory() || attrs.isDirectoryLink()) { + RemoveDirectory(file.getPathForWin32Calls()); + } else { + DeleteFile(file.getPathForWin32Calls()); + } + return true; + } catch (WindowsException x) { + + // no-op if file does not exist + if (!failIfNotExists && + (x.lastError() == ERROR_FILE_NOT_FOUND || + x.lastError() == ERROR_PATH_NOT_FOUND)) return false; + + if (attrs != null && attrs.isDirectory()) { + // ERROR_ALREADY_EXISTS is returned when attempting to delete + // non-empty directory on SAMBA servers. + if (x.lastError() == ERROR_DIR_NOT_EMPTY || + x.lastError() == ERROR_ALREADY_EXISTS) + { + throw new DirectoryNotEmptyException( + file.getPathForExceptionMessage()); + } + } + x.rethrowAsIOException(file); + return false; + } + } + + @Override + public void copy(Path source, Path target, CopyOption... options) + throws IOException + { + WindowsFileCopy.copy(WindowsPath.toWindowsPath(source), + WindowsPath.toWindowsPath(target), + options); + } + + @Override + public void move(Path source, Path target, CopyOption... options) + throws IOException + { + WindowsFileCopy.move(WindowsPath.toWindowsPath(source), + WindowsPath.toWindowsPath(target), + options); + } + + /** + * Returns buffer with SID_AND_ATTRIBUTES structure representing the user + * associated with the current thread access token. + * FIXME - this should be cached. + */ + private static NativeBuffer getUserInfo(WindowsPath file) throws IOException { + try { + long hToken = WindowsSecurity.processTokenWithQueryAccess; + int size = GetTokenInformation(hToken, TokenUser, 0L, 0); + assert size > 0; + + NativeBuffer buffer = NativeBuffers.getNativeBuffer(size); + try { + int newsize = GetTokenInformation(hToken, TokenUser, + buffer.address(), size); + if (newsize != size) + throw new AssertionError(); + return buffer; + } catch (WindowsException x) { + buffer.release(); + throw x; + } + } catch (WindowsException x) { + throw new IOException(x.getMessage()); + } + } + + /** + * Reads the file ACL and return the effective access as ACCESS_MASK + */ + private static int getEffectiveAccess(WindowsPath file) throws IOException { + // read security descriptor continaing ACL (symlinks are followed) + String target = WindowsLinkSupport.getFinalPath(file, true); + NativeBuffer aclBuffer = WindowsAclFileAttributeView + .getFileSecurity(target, DACL_SECURITY_INFORMATION); + + // retrieves DACL from security descriptor + long pAcl = GetSecurityDescriptorDacl(aclBuffer.address()); + + // Use GetEffectiveRightsFromAcl to get effective access to file + try { + NativeBuffer userBuffer = getUserInfo(file); + try { + try { + // SID_AND_ATTRIBUTES->pSid + long pSid = unsafe.getAddress(userBuffer.address()); + long pTrustee = BuildTrusteeWithSid(pSid); + try { + return GetEffectiveRightsFromAcl(pAcl, pTrustee); + } finally { + LocalFree(pTrustee); + } + } catch (WindowsException x) { + throw new IOException("Unable to get effective rights from ACL: " + + x.getMessage()); + } + } finally { + userBuffer.release(); + } + } finally { + aclBuffer.release(); + } + } + + @Override + public void checkAccess(Path obj, AccessMode... modes) throws IOException { + WindowsPath file = WindowsPath.toWindowsPath(obj); + // if no access modes then simply file attributes + if (modes.length == 0) { + file.checkRead(); + try { + WindowsFileAttributes.get(file, true); + } catch (WindowsException exc) { + exc.rethrowAsIOException(file); + } + return; + } + + boolean r = false; + boolean w = false; + boolean x = false; + for (AccessMode mode: modes) { + switch (mode) { + case READ : r = true; break; + case WRITE : w = true; break; + case EXECUTE : x = true; break; + default: throw new AssertionError("Should not get here"); + } + } + + int mask = 0; + if (r) { + file.checkRead(); + mask |= FILE_READ_DATA; + } + if (w) { + file.checkWrite(); + mask |= FILE_WRITE_DATA; + } + if (x) { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkExec(file.getPathForPermissionCheck()); + mask |= FILE_EXECUTE; + } + + if ((getEffectiveAccess(file) & mask) == 0) + throw new AccessDeniedException( + file.getPathForExceptionMessage(), null, + "Effective permissions does not allow requested access"); + + // for write access we neeed to check if the DOS readonly attribute + // and if the volume is read-only + if (w) { + try { + WindowsFileAttributes attrs = WindowsFileAttributes.get(file, true); + if (!attrs.isDirectory() && attrs.isReadOnly()) + throw new AccessDeniedException( + file.getPathForExceptionMessage(), null, + "DOS readonly attribute is set"); + } catch (WindowsException exc) { + exc.rethrowAsIOException(file); + } + + if (WindowsFileStore.create(file).isReadOnly()) { + throw new AccessDeniedException( + file.getPathForExceptionMessage(), null, "Read-only file system"); + } + return; + } + } + + @Override + public boolean isSameFile(Path obj1, Path obj2) throws IOException { + WindowsPath file1 = WindowsPath.toWindowsPath(obj1); + if (file1.equals(obj2)) + return true; + if (obj2 == null) + throw new NullPointerException(); + if (!(obj2 instanceof WindowsPath)) + return false; + WindowsPath file2 = (WindowsPath)obj2; + + // check security manager access to both files + file1.checkRead(); + file2.checkRead(); + + // open both files and see if they are the same + long h1 = 0L; + try { + h1 = file1.openForReadAttributeAccess(true); + } catch (WindowsException x) { + x.rethrowAsIOException(file1); + } + try { + WindowsFileAttributes attrs1 = null; + try { + attrs1 = WindowsFileAttributes.readAttributes(h1); + } catch (WindowsException x) { + x.rethrowAsIOException(file1); + } + long h2 = 0L; + try { + h2 = file2.openForReadAttributeAccess(true); + } catch (WindowsException x) { + x.rethrowAsIOException(file2); + } + try { + WindowsFileAttributes attrs2 = null; + try { + attrs2 = WindowsFileAttributes.readAttributes(h2); + } catch (WindowsException x) { + x.rethrowAsIOException(file2); + } + return WindowsFileAttributes.isSameFile(attrs1, attrs2); + } finally { + CloseHandle(h2); + } + } finally { + CloseHandle(h1); + } + } + + @Override + public boolean isHidden(Path obj) throws IOException { + WindowsPath file = WindowsPath.toWindowsPath(obj); + file.checkRead(); + WindowsFileAttributes attrs = null; + try { + attrs = WindowsFileAttributes.get(file, true); + } catch (WindowsException x) { + x.rethrowAsIOException(file); + } + // DOS hidden attribute not meaningful when set on directories + if (attrs.isDirectory()) + return false; + return attrs.isHidden(); + } + + @Override + public FileStore getFileStore(Path obj) throws IOException { + WindowsPath file = WindowsPath.toWindowsPath(obj); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new RuntimePermission("getFileStoreAttributes")); + file.checkRead(); + } + return WindowsFileStore.create(file); + } + + + @Override + public void createDirectory(Path obj, FileAttribute... attrs) + throws IOException + { + WindowsPath dir = WindowsPath.toWindowsPath(obj); + dir.checkWrite(); + WindowsSecurityDescriptor sd = WindowsSecurityDescriptor.fromAttribute(attrs); + try { + CreateDirectory(dir.getPathForWin32Calls(), sd.address()); + } catch (WindowsException x) { + x.rethrowAsIOException(dir); + } finally { + sd.release(); + } + } + + @Override + public DirectoryStream newDirectoryStream(Path obj, DirectoryStream.Filter filter) + throws IOException + { + WindowsPath dir = WindowsPath.toWindowsPath(obj); + dir.checkRead(); + if (filter == null) + throw new NullPointerException(); + return new WindowsDirectoryStream(dir, filter); + } + + @Override + public void createSymbolicLink(Path obj1, Path obj2, FileAttribute... attrs) + throws IOException + { + WindowsPath link = WindowsPath.toWindowsPath(obj1); + WindowsPath target = WindowsPath.toWindowsPath(obj2); + + if (!link.getFileSystem().supportsLinks()) { + throw new UnsupportedOperationException("Symbolic links not supported " + + "on this operating system"); + } + + // no attributes allowed + if (attrs.length > 0) { + WindowsSecurityDescriptor.fromAttribute(attrs); // may throw NPE or UOE + throw new UnsupportedOperationException("Initial file attributes" + + "not supported when creating symbolic link"); + } + + // permission check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new LinkPermission("symbolic")); + link.checkWrite(); + } + + /** + * Throw I/O exception for the drive-relative case because Windows + * creates a link with the resolved target for this case. + */ + if (target.type() == WindowsPathType.DRIVE_RELATIVE) { + throw new IOException("Cannot create symbolic link to working directory relative target"); + } + + /* + * Windows treates symbolic links to directories differently than it + * does to other file types. For that reason we need to check if the + * target is a directory (or a directory junction). + */ + WindowsPath resolvedTarget; + if (target.type() == WindowsPathType.RELATIVE) { + WindowsPath parent = link.getParent(); + resolvedTarget = (parent == null) ? target : parent.resolve(target); + } else { + resolvedTarget = link.resolve(target); + } + int flags = 0; + try { + WindowsFileAttributes wattrs = WindowsFileAttributes.get(resolvedTarget, false); + if (wattrs.isDirectory() || wattrs.isDirectoryLink()) + flags |= SYMBOLIC_LINK_FLAG_DIRECTORY; + } catch (WindowsException x) { + // unable to access target so assume target is not a directory + } + + // create the link + try { + CreateSymbolicLink(link.getPathForWin32Calls(), + WindowsPath.addPrefixIfNeeded(target.toString()), + flags); + } catch (WindowsException x) { + if (x.lastError() == ERROR_INVALID_REPARSE_DATA) { + x.rethrowAsIOException(link, target); + } else { + x.rethrowAsIOException(link); + } + } + } + + @Override + public void createLink(Path obj1, Path obj2) throws IOException { + WindowsPath link = WindowsPath.toWindowsPath(obj1); + WindowsPath existing = WindowsPath.toWindowsPath(obj2); + + // permission check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPermission(new LinkPermission("hard")); + link.checkWrite(); + existing.checkWrite(); + } + + // create hard link + try { + CreateHardLink(link.getPathForWin32Calls(), + existing.getPathForWin32Calls()); + } catch (WindowsException x) { + x.rethrowAsIOException(link, existing); + } + } + + @Override + public Path readSymbolicLink(Path obj1) throws IOException { + WindowsPath link = WindowsPath.toWindowsPath(obj1); + WindowsFileSystem fs = link.getFileSystem(); + if (!fs.supportsLinks()) { + throw new UnsupportedOperationException("symbolic links not supported"); + } + + // permission check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + FilePermission perm = new FilePermission(link.getPathForPermissionCheck(), + SecurityConstants.FILE_READLINK_ACTION); + AccessController.checkPermission(perm); + } + + String target = WindowsLinkSupport.readLink(link); + return WindowsPath.createFromNormalizedPath(fs, target); + } } diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java index 3e79ab43ab6..26c2b26ce8e 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPath.java @@ -27,18 +27,13 @@ package sun.nio.fs; import java.nio.file.*; import java.nio.file.attribute.*; -import java.nio.channels.*; import java.io.*; import java.net.URI; -import java.security.AccessController; import java.util.*; import java.lang.ref.WeakReference; import com.sun.nio.file.ExtendedWatchEventModifier; -import sun.security.util.SecurityConstants; -import sun.misc.Unsafe; - import static sun.nio.fs.WindowsNativeDispatcher.*; import static sun.nio.fs.WindowsConstants.*; @@ -47,7 +42,6 @@ import static sun.nio.fs.WindowsConstants.*; */ class WindowsPath extends AbstractPath { - private static final Unsafe unsafe = Unsafe.getUnsafe(); // The maximum path that does not require long path prefix. On Windows // the maximum path is 260 minus 1 (NUL) but for directories it is 260 @@ -229,6 +223,8 @@ class WindowsPath extends AbstractPath { // Relative path ("foo" for example) if (type == WindowsPathType.RELATIVE) { String defaultDirectory = getFileSystem().defaultDirectory(); + if (isEmpty()) + return defaultDirectory; if (defaultDirectory.endsWith("\\")) { return defaultDirectory + path; } else { @@ -286,7 +282,7 @@ class WindowsPath extends AbstractPath { } // Add long path prefix to path if required - private static String addPrefixIfNeeded(String path) { + static String addPrefixIfNeeded(String path) { if (path.length() > 248) { if (path.startsWith("\\\\")) { path = "\\\\?\\UNC" + path.substring(1, path.length()); @@ -304,10 +300,22 @@ class WindowsPath extends AbstractPath { // -- Path operations -- + private boolean isEmpty() { + return path.length() == 0; + } + + private WindowsPath emptyPath() { + return new WindowsPath(getFileSystem(), WindowsPathType.RELATIVE, "", ""); + } + @Override - public Path getName() { + public Path getFileName() { + int len = path.length(); + // represents empty path + if (len == 0) + return this; // represents root component only - if (root.length() == path.length()) + if (root.length() == len) return null; int off = path.lastIndexOf('\\'); if (off < root.length()) @@ -339,6 +347,11 @@ class WindowsPath extends AbstractPath { return new WindowsPath(getFileSystem(), type, root, root); } + // package-private + WindowsPathType type() { + return type; + } + // package-private boolean isUnc() { return type == WindowsPathType.UNC; @@ -355,7 +368,7 @@ class WindowsPath extends AbstractPath { return type == WindowsPathType.ABSOLUTE || type == WindowsPathType.UNC; } - private WindowsPath checkPath(FileRef path) { + static WindowsPath toWindowsPath(Path path) { if (path == null) throw new NullPointerException(); if (!(path instanceof WindowsPath)) { @@ -366,9 +379,9 @@ class WindowsPath extends AbstractPath { @Override public WindowsPath relativize(Path obj) { - WindowsPath other = checkPath(obj); + WindowsPath other = toWindowsPath(obj); if (this.equals(other)) - return null; + return emptyPath(); // can only relativize paths of the same type if (this.type != other.type) @@ -410,7 +423,7 @@ class WindowsPath extends AbstractPath { @Override public Path normalize() { final int count = getNameCount(); - if (count == 0) + if (count == 0 || isEmpty()) return this; boolean[] ignore = new boolean[count]; // true => ignore name @@ -488,7 +501,7 @@ class WindowsPath extends AbstractPath { // corner case - all names removed if (remaining == 0) { - return getRoot(); + return (root.length() == 0) ? emptyPath() : getRoot(); } // re-constitute the path from the remaining names. @@ -497,7 +510,7 @@ class WindowsPath extends AbstractPath { result.append(root); for (int i=0; i list = new ArrayList(); - int start = root.length(); - int off = root.length(); - while (off < path.length()) { - if (path.charAt(off) != '\\') { - off++; - } else { - list.add(start); - start = ++off; + ArrayList list = new ArrayList<>(); + if (isEmpty()) { + // empty path considered to have one name element + list.add(0); + } else { + int start = root.length(); + int off = root.length(); + while (off < path.length()) { + if (path.charAt(off) != '\\') { + off++; + } else { + list.add(start); + start = ++off; + } } + if (start != off) + list.add(start); } - if (start != off) - list.add(start); synchronized (this) { if (offsets == null) offsets = list.toArray(new Integer[list.size()]); @@ -633,11 +646,16 @@ class WindowsPath extends AbstractPath { @Override public boolean startsWith(Path obj) { - WindowsPath other = checkPath(obj); + WindowsPath other = toWindowsPath(obj); // if this path has a root component the given path's root must match - if (!this.root.equalsIgnoreCase(other.root)) + if (!this.root.equalsIgnoreCase(other.root)) { return false; + } + + // empty path starts with itself + if (other.isEmpty()) + return this.isEmpty(); // roots match so compare elements int thisCount = getNameCount(); @@ -657,13 +675,18 @@ class WindowsPath extends AbstractPath { @Override public boolean endsWith(Path obj) { - WindowsPath other = checkPath(obj); + WindowsPath other = toWindowsPath(obj); // other path is longer - if (other.path.length() > path.length()) { + if (other.path.length() > this.path.length()) { return false; } + // empty path ends in itself + if (other.isEmpty()) { + return this.isEmpty(); + } + int thisCount = this.getNameCount(); int otherCount = other.getNameCount(); @@ -742,31 +765,6 @@ class WindowsPath extends AbstractPath { return path; } - @Override - public Iterator iterator() { - return new Iterator() { - private int i = 0; - @Override - public boolean hasNext() { - return (i < getNameCount()); - } - @Override - public Path next() { - if (i < getNameCount()) { - Path result = getName(i); - i++; - return result; - } else { - throw new NoSuchElementException(); - } - } - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - }; - } - // -- file operations -- // package-private @@ -805,453 +803,6 @@ class WindowsPath extends AbstractPath { } } - @Override - public FileStore getFileStore() - throws IOException - { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new RuntimePermission("getFileStoreAttributes")); - checkRead(); - } - return WindowsFileStore.create(this); - } - - /** - * Returns buffer with SID_AND_ATTRIBUTES structure representing the user - * associated with the current thread access token. - * FIXME - this should be cached. - */ - private NativeBuffer getUserInfo() throws IOException { - try { - long hToken = WindowsSecurity.processTokenWithQueryAccess; - int size = GetTokenInformation(hToken, TokenUser, 0L, 0); - assert size > 0; - - NativeBuffer buffer = NativeBuffers.getNativeBuffer(size); - try { - int newsize = GetTokenInformation(hToken, TokenUser, - buffer.address(), size); - if (newsize != size) - throw new AssertionError(); - return buffer; - } catch (WindowsException x) { - buffer.release(); - throw x; - } - } catch (WindowsException x) { - throw new IOException(x.getMessage()); - } - } - - /** - * Reads the file ACL and return the effective access as ACCESS_MASK - */ - private int getEffectiveAccess() throws IOException { - // read security descriptor continaing ACL (symlinks are followed) - String target = WindowsLinkSupport.getFinalPath(this, true); - NativeBuffer aclBuffer = WindowsAclFileAttributeView - .getFileSecurity(target, DACL_SECURITY_INFORMATION); - - // retrieves DACL from security descriptor - long pAcl = GetSecurityDescriptorDacl(aclBuffer.address()); - - // Use GetEffectiveRightsFromAcl to get effective access to file - try { - NativeBuffer userBuffer = getUserInfo(); - try { - try { - // SID_AND_ATTRIBUTES->pSid - long pSid = unsafe.getAddress(userBuffer.address()); - long pTrustee = BuildTrusteeWithSid(pSid); - try { - return GetEffectiveRightsFromAcl(pAcl, pTrustee); - } finally { - LocalFree(pTrustee); - } - } catch (WindowsException x) { - throw new IOException("Unable to get effective rights from ACL: " + - x.getMessage()); - } - } finally { - userBuffer.release(); - } - } finally { - aclBuffer.release(); - } - } - - @Override - public void checkAccess(AccessMode... modes) throws IOException { - // if no access modes then simply file attributes - if (modes.length == 0) { - checkRead(); - try { - WindowsFileAttributes.get(this, true); - } catch (WindowsException exc) { - exc.rethrowAsIOException(this); - } - return; - } - - boolean r = false; - boolean w = false; - boolean x = false; - for (AccessMode mode: modes) { - switch (mode) { - case READ : r = true; break; - case WRITE : w = true; break; - case EXECUTE : x = true; break; - default: throw new AssertionError("Should not get here"); - } - } - - int mask = 0; - if (r) { - checkRead(); - mask |= FILE_READ_DATA; - } - if (w) { - checkWrite(); - mask |= FILE_WRITE_DATA; - } - if (x) { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) - sm.checkExec(getPathForPermissionCheck()); - mask |= FILE_EXECUTE; - } - - if ((getEffectiveAccess() & mask) == 0) - throw new AccessDeniedException( - this.getPathForExceptionMessage(), null, - "Effective permissions does not allow requested access"); - - // for write access we neeed to check if the DOS readonly attribute - // and if the volume is read-only - if (w) { - try { - WindowsFileAttributes attrs = WindowsFileAttributes.get(this, true); - if (!attrs.isDirectory() && attrs.isReadOnly()) - throw new AccessDeniedException( - this.getPathForExceptionMessage(), null, - "DOS readonly attribute is set"); - } catch (WindowsException exc) { - exc.rethrowAsIOException(this); - } - - if (WindowsFileStore.create(this).isReadOnly()) { - throw new AccessDeniedException( - this.getPathForExceptionMessage(), null, "Read-only file system"); - } - return; - } - } - - @Override - void implDelete(boolean failIfNotExists) throws IOException { - checkDelete(); - - WindowsFileAttributes attrs = null; - try { - // need to know if file is a directory or junction - attrs = WindowsFileAttributes.get(this, false); - if (attrs.isDirectory() || attrs.isDirectoryLink()) { - RemoveDirectory(getPathForWin32Calls()); - } else { - DeleteFile(getPathForWin32Calls()); - } - } catch (WindowsException x) { - - // no-op if file does not exist - if (!failIfNotExists && - (x.lastError() == ERROR_FILE_NOT_FOUND || - x.lastError() == ERROR_PATH_NOT_FOUND)) return; - - if (attrs != null && attrs.isDirectory()) { - // ERROR_ALREADY_EXISTS is returned when attempting to delete - // non-empty directory on SAMBA servers. - if (x.lastError() == ERROR_DIR_NOT_EMPTY || - x.lastError() == ERROR_ALREADY_EXISTS) - { - throw new DirectoryNotEmptyException( - getPathForExceptionMessage()); - } - } - x.rethrowAsIOException(this); - } - } - - @Override - public DirectoryStream newDirectoryStream(DirectoryStream.Filter filter) - throws IOException - { - checkRead(); - if (filter == null) - throw new NullPointerException(); - return new WindowsDirectoryStream(this, filter); - } - - @Override - public void implCopyTo(Path obj, CopyOption... options) throws IOException { - WindowsPath target = (WindowsPath)obj; - WindowsFileCopy.copy(this, target, options); - } - - @Override - public void implMoveTo(Path obj, CopyOption... options) throws IOException { - WindowsPath target = (WindowsPath)obj; - WindowsFileCopy.move(this, target, options); - } - - private boolean followLinks(LinkOption... options) { - boolean followLinks = true; - for (LinkOption option: options) { - if (option == LinkOption.NOFOLLOW_LINKS) { - followLinks = false; - continue; - } - if (option == null) - throw new NullPointerException(); - throw new AssertionError("Should not get here"); - } - return followLinks; - } - - @Override - @SuppressWarnings("unchecked") - public V - getFileAttributeView(Class view, LinkOption... options) - { - if (view == null) - throw new NullPointerException(); - boolean followLinks = followLinks(options); - if (view == BasicFileAttributeView.class) - return (V) WindowsFileAttributeViews.createBasicView(this, followLinks); - if (view == DosFileAttributeView.class) - return (V) WindowsFileAttributeViews.createDosView(this, followLinks); - if (view == AclFileAttributeView.class) - return (V) new WindowsAclFileAttributeView(this, followLinks); - if (view == FileOwnerAttributeView.class) - return (V) new FileOwnerAttributeViewImpl( - new WindowsAclFileAttributeView(this, followLinks)); - if (view == UserDefinedFileAttributeView.class) - return (V) new WindowsUserDefinedFileAttributeView(this, followLinks); - return (V) null; - } - - @Override - public DynamicFileAttributeView getFileAttributeView(String name, LinkOption... options) { - boolean followLinks = followLinks(options); - if (name.equals("basic")) - return WindowsFileAttributeViews.createBasicView(this, followLinks); - if (name.equals("dos")) - return WindowsFileAttributeViews.createDosView(this, followLinks); - if (name.equals("acl")) - return new WindowsAclFileAttributeView(this, followLinks); - if (name.equals("owner")) - return new FileOwnerAttributeViewImpl( - new WindowsAclFileAttributeView(this, followLinks)); - if (name.equals("user")) - return new WindowsUserDefinedFileAttributeView(this, followLinks); - return null; - } - - @Override - public WindowsPath createDirectory(FileAttribute... attrs) - throws IOException - { - checkWrite(); - WindowsSecurityDescriptor sd = WindowsSecurityDescriptor.fromAttribute(attrs); - try { - CreateDirectory(getPathForWin32Calls(), sd.address()); - } catch (WindowsException x) { - x.rethrowAsIOException(this); - } finally { - sd.release(); - } - return this; - } - - @Override - public SeekableByteChannel newByteChannel(Set options, - FileAttribute... attrs) - throws IOException - { - WindowsSecurityDescriptor sd = - WindowsSecurityDescriptor.fromAttribute(attrs); - try { - return WindowsChannelFactory - .newFileChannel(getPathForWin32Calls(), - getPathForPermissionCheck(), - options, - sd.address()); - } catch (WindowsException x) { - x.rethrowAsIOException(this); - return null; // keep compiler happy - } finally { - sd.release(); - } - } - - @Override - public boolean isSameFile(Path obj) throws IOException { - if (this.equals(obj)) - return true; - if (!(obj instanceof WindowsPath)) // includes null check - return false; - WindowsPath other = (WindowsPath)obj; - - // check security manager access to both files - this.checkRead(); - other.checkRead(); - - // open both files and see if they are the same - long h1 = 0L; - try { - h1 = this.openForReadAttributeAccess(true); - } catch (WindowsException x) { - x.rethrowAsIOException(this); - } - try { - WindowsFileAttributes attrs1 = null; - try { - attrs1 = WindowsFileAttributes.readAttributes(h1); - } catch (WindowsException x) { - x.rethrowAsIOException(this); - } - long h2 = 0L; - try { - h2 = other.openForReadAttributeAccess(true); - } catch (WindowsException x) { - x.rethrowAsIOException(other); - } - try { - WindowsFileAttributes attrs2 = null; - try { - attrs2 = WindowsFileAttributes.readAttributes(h2); - } catch (WindowsException x) { - x.rethrowAsIOException(other); - } - return WindowsFileAttributes.isSameFile(attrs1, attrs2); - } finally { - CloseHandle(h2); - } - } finally { - CloseHandle(h1); - } - } - - @Override - public WindowsPath createSymbolicLink(Path obj, FileAttribute... attrs) - throws IOException - { - if (!getFileSystem().supportsLinks()) { - throw new UnsupportedOperationException("Symbolic links not supported " - + "on this operating system"); - } - - WindowsPath target = checkPath(obj); - - // no attributes allowed - if (attrs.length > 0) { - WindowsSecurityDescriptor.fromAttribute(attrs); // may throw NPE or UOE - throw new UnsupportedOperationException("Initial file attributes" + - "not supported when creating symbolic link"); - } - - // permission check - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new LinkPermission("symbolic")); - this.checkWrite(); - } - - /** - * Throw I/O exception for the drive-relative case because Windows - * creates a link with the resolved target for this case. - */ - if (target.type == WindowsPathType.DRIVE_RELATIVE) { - throw new IOException("Cannot create symbolic link to working directory relative target"); - } - - /* - * Windows treates symbolic links to directories differently than it - * does to other file types. For that reason we need to check if the - * target is a directory (or a directory junction). - */ - WindowsPath resolvedTarget; - if (target.type == WindowsPathType.RELATIVE) { - WindowsPath parent = getParent(); - resolvedTarget = (parent == null) ? target : parent.resolve(target); - } else { - resolvedTarget = resolve(target); - } - int flags = 0; - try { - WindowsFileAttributes wattrs = WindowsFileAttributes.get(resolvedTarget, false); - if (wattrs.isDirectory() || wattrs.isDirectoryLink()) - flags |= SYMBOLIC_LINK_FLAG_DIRECTORY; - } catch (WindowsException x) { - // unable to access target so assume target is not a directory - } - - // create the link - try { - CreateSymbolicLink(getPathForWin32Calls(), - addPrefixIfNeeded(target.toString()), - flags); - } catch (WindowsException x) { - if (x.lastError() == ERROR_INVALID_REPARSE_DATA) { - x.rethrowAsIOException(this, target); - } else { - x.rethrowAsIOException(this); - } - } - return this; - } - - @Override - public Path createLink(Path obj) throws IOException { - WindowsPath existing = checkPath(obj); - - // permission check - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new LinkPermission("hard")); - this.checkWrite(); - existing.checkWrite(); - } - - // create hard link - try { - CreateHardLink(this.getPathForWin32Calls(), - existing.getPathForWin32Calls()); - } catch (WindowsException x) { - x.rethrowAsIOException(this, existing); - } - - return this; - } - - @Override - public WindowsPath readSymbolicLink() throws IOException { - if (!getFileSystem().supportsLinks()) { - throw new UnsupportedOperationException("symbolic links not supported"); - } - - // permission check - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - FilePermission perm = new FilePermission(getPathForPermissionCheck(), - SecurityConstants.FILE_READLINK_ACTION); - AccessController.checkPermission(perm); - } - - String target = WindowsLinkSupport.readLink(this); - return createFromNormalizedPath(getFileSystem(), target); - } - @Override public URI toUri() { return WindowsUriSupport.toUri(this); @@ -1282,21 +833,6 @@ class WindowsPath extends AbstractPath { return createFromNormalizedPath(getFileSystem(), rp); } - @Override - public boolean isHidden() throws IOException { - checkRead(); - WindowsFileAttributes attrs = null; - try { - attrs = WindowsFileAttributes.get(this, true); - } catch (WindowsException x) { - x.rethrowAsIOException(this); - } - // DOS hidden attribute not meaningful when set on directories - if (attrs.isDirectory()) - return false; - return attrs.isHidden(); - } - @Override public WatchKey register(WatchService watcher, WatchEvent.Kind[] events, diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsPathParser.java b/jdk/src/windows/classes/sun/nio/fs/WindowsPathParser.java index b985d136f71..e898fd55fd2 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsPathParser.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsPathParser.java @@ -74,8 +74,6 @@ class WindowsPathParser { * Parses the given input as a Windows path */ static Result parse(String input) { - if (input == null || input.length() == 0) - throw new InvalidPathException(input, "Empty or null path"); return parse(input, true); } @@ -135,7 +133,7 @@ class WindowsPathParser { } } if (off == 0) { - if (isSlash(input.charAt(0))) { + if (len > 0 && isSlash(input.charAt(0))) { type = WindowsPathType.DIRECTORY_RELATIVE; root = "\\"; } else { diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java b/jdk/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java index f0c458761ac..7d9464e0ce4 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsSecurityDescriptor.java @@ -214,7 +214,7 @@ class WindowsSecurityDescriptor { // map flags byte aceFlags = unsafe.getByte(aceAddress + OFFSETOF_FLAGS); - Set flags = new HashSet(); + Set flags = EnumSet.noneOf(AclEntryFlag.class); if ((aceFlags & OBJECT_INHERIT_ACE) != 0) flags.add(AclEntryFlag.FILE_INHERIT); if ((aceFlags & CONTAINER_INHERIT_ACE) != 0) @@ -226,7 +226,7 @@ class WindowsSecurityDescriptor { // map access mask int mask = unsafe.getInt(aceAddress + OFFSETOF_ACCESS_MASK); - Set perms = new HashSet(); + Set perms = EnumSet.noneOf(AclEntryPermission.class); if ((mask & FILE_READ_DATA) > 0) perms.add(AclEntryPermission.READ_DATA); if ((mask & FILE_WRITE_DATA) > 0) @@ -378,7 +378,7 @@ class WindowsSecurityDescriptor { AclInformation aclInfo = GetAclInformation(aclAddress); aceCount = aclInfo.aceCount(); } - ArrayList result = new ArrayList(aceCount); + ArrayList result = new ArrayList<>(aceCount); // decode each of the ACEs to AclEntry objects for (int i=0; i listUsingStreamEnumeration() throws IOException { - List list = new ArrayList(); + List list = new ArrayList<>(); try { FirstStream first = FindFirstStream(file.getPathForWin32Calls()); if (first != null) { @@ -114,7 +114,7 @@ class WindowsUserDefinedFileAttributeView NativeBuffer buffer = null; // result with names of alternative data streams - final List list = new ArrayList(); + final List list = new ArrayList<>(); try { buffer = NativeBuffers.getNativeBuffer(BUFFER_SIZE); @@ -216,7 +216,7 @@ class WindowsUserDefinedFileAttributeView // wrap with channel FileChannel fc = null; try { - Set opts = new HashSet(); + Set opts = new HashSet<>(); opts.add(READ); if (!followLinks) opts.add(WindowsChannelFactory.OPEN_REPARSE_POINT); @@ -243,7 +243,7 @@ class WindowsUserDefinedFileAttributeView // wrap with channel FileChannel fc = null; try { - Set opts = new HashSet(); + Set opts = new HashSet<>(); opts.add(READ); if (!followLinks) opts.add(WindowsChannelFactory.OPEN_REPARSE_POINT); @@ -298,7 +298,7 @@ class WindowsUserDefinedFileAttributeView x.rethrowAsIOException(file); } try { - Set opts = new HashSet(); + Set opts = new HashSet<>(); if (!followLinks) opts.add(WindowsChannelFactory.OPEN_REPARSE_POINT); opts.add(CREATE); diff --git a/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java b/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java index d86673cf134..53f2fa2af56 100644 --- a/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java +++ b/jdk/src/windows/classes/sun/nio/fs/WindowsWatchService.java @@ -106,8 +106,11 @@ class WindowsWatchService // completion key (used to map I/O completion to WatchKey) private int completionKey; - WindowsWatchKey(AbstractWatchService watcher, FileKey fileKey) { - super(watcher); + WindowsWatchKey(Path dir, + AbstractWatchService watcher, + FileKey fileKey) + { + super(dir, watcher); this.fileKey = fileKey; } @@ -405,7 +408,7 @@ class WindowsWatchService WindowsWatchKey watchKey; if (existing == null) { // not registered so create new watch key - watchKey = new WindowsWatchKey(watcher, fk) + watchKey = new WindowsWatchKey(dir, watcher, fk) .init(handle, events, watchSubtree, buffer, countAddress, overlappedAddress, completionKey); // map file key to watch key diff --git a/jdk/test/demo/zipfs/basic.sh b/jdk/test/demo/zipfs/basic.sh index c6cfb77caf3..45d2d74ac42 100644 --- a/jdk/test/demo/zipfs/basic.sh +++ b/jdk/test/demo/zipfs/basic.sh @@ -22,6 +22,7 @@ # # @test # @bug 6990846 +# @ignore Until zipfs updated (7015391) # @summary Test ZipFileSystem demo # @build Basic PathOps ZipFSTester # @run shell basic.sh diff --git a/jdk/test/java/io/File/IsHidden.java b/jdk/test/java/io/File/IsHidden.java index 9e062fe61e3..d2b43c5b641 100644 --- a/jdk/test/java/io/File/IsHidden.java +++ b/jdk/test/java/io/File/IsHidden.java @@ -27,6 +27,7 @@ */ import java.io.*; +import java.nio.file.Files; import java.nio.file.attribute.DosFileAttributeView; public class IsHidden { @@ -42,7 +43,7 @@ public class IsHidden { } private static void setHidden(File f, boolean value) throws IOException { - f.toPath().getFileAttributeView(DosFileAttributeView.class).setHidden(value); + Files.getFileAttributeView(f.toPath(), DosFileAttributeView.class).setHidden(value); } private static void testWin32() throws Exception { diff --git a/jdk/test/java/io/File/SetAccess.java b/jdk/test/java/io/File/SetAccess.java index bb88ec46258..745deab1f7b 100644 --- a/jdk/test/java/io/File/SetAccess.java +++ b/jdk/test/java/io/File/SetAccess.java @@ -27,6 +27,7 @@ */ import java.io.*; +import java.nio.file.*; import java.nio.file.attribute.*; public class SetAccess { @@ -178,7 +179,7 @@ public class SetAccess { } private static String permission(File f) throws Exception { - PosixFileAttributes attrs = Attributes.readPosixFileAttributes(f.toPath()); + PosixFileAttributes attrs = Files.readAttributes(f.toPath(), PosixFileAttributes.class); String type = attrs.isDirectory() ? "d" : " "; return type + PosixFilePermissions.toString(attrs.permissions()); } diff --git a/jdk/test/java/io/File/SymLinks.java b/jdk/test/java/io/File/SymLinks.java index 36306f98d7a..355b28875d4 100644 --- a/jdk/test/java/io/File/SymLinks.java +++ b/jdk/test/java/io/File/SymLinks.java @@ -27,7 +27,7 @@ */ import java.io.*; -import java.nio.file.Path; +import java.nio.file.*; import java.nio.file.attribute.*; import static java.nio.file.LinkOption.*; @@ -80,39 +80,33 @@ public class SymLinks { if (file != null) file.delete(); if (link2file != null) - link2file.toPath().deleteIfExists(); + Files.deleteIfExists(link2file.toPath()); if (link2link2file != null) - link2link2file.toPath().deleteIfExists(); + Files.deleteIfExists(link2link2file.toPath()); if (dir != null) dir.delete(); if (link2dir != null) - link2dir.toPath().deleteIfExists(); + Files.deleteIfExists(link2dir.toPath()); if (link2link2dir != null) - link2link2dir.toPath().deleteIfExists(); + Files.deleteIfExists(link2link2dir.toPath()); if (link2nobody != null) - link2nobody.toPath().deleteIfExists(); + Files.deleteIfExists(link2nobody.toPath()); if (link2link2nobody != null) - link2link2nobody.toPath().deleteIfExists(); + Files.deleteIfExists(link2link2nobody.toPath()); } /** * Creates a sym link source->target */ static void mklink(File source, File target) throws IOException { - source.toPath().createSymbolicLink(target.toPath()); + Files.createSymbolicLink(source.toPath(), target.toPath()); } /** * Returns true if the "link" exists and is a sym link. */ static boolean isSymLink(File link) { - try { - BasicFileAttributes attrs = - Attributes.readBasicFileAttributes(link.toPath(), NOFOLLOW_LINKS); - return attrs.isSymbolicLink(); - } catch (IOException x) { - return false; - } + return Files.isSymbolicLink(link.toPath()); } /** @@ -120,7 +114,7 @@ public class SymLinks { */ static long lastModifiedOfSymLink(File link) throws IOException { BasicFileAttributes attrs = - Attributes.readBasicFileAttributes(link.toPath(), NOFOLLOW_LINKS); + Files.readAttributes(link.toPath(), BasicFileAttributes.class, NOFOLLOW_LINKS); assertTrue(attrs.isSymbolicLink()); return attrs.lastModifiedTime().toMillis(); } @@ -133,8 +127,8 @@ public class SymLinks { Path link = dir.toPath().resolve("link"); Path target = dir.toPath().resolve("target"); try { - link.createSymbolicLink(target); - link.delete(); + Files.createSymbolicLink(link, target); + Files.delete(link); return true; } catch (UnsupportedOperationException x) { return false; @@ -224,7 +218,7 @@ public class SymLinks { assertTrue(isSymLink(link2nobody)); } finally { - link.toPath().deleteIfExists(); + Files.deleteIfExists(link.toPath()); } header("renameTo"); @@ -287,8 +281,8 @@ public class SymLinks { // on Windows we test with the DOS hidden attribute set if (System.getProperty("os.name").startsWith("Windows")) { - DosFileAttributeView view = file.toPath() - .getFileAttributeView(DosFileAttributeView.class); + DosFileAttributeView view = Files + .getFileAttributeView(file.toPath(), DosFileAttributeView.class); view.setHidden(true); try { assertTrue(file.isHidden()); diff --git a/jdk/test/java/io/FileInputStream/LargeFileAvailable.java b/jdk/test/java/io/FileInputStream/LargeFileAvailable.java index 35c9ce47483..0e33d9a969f 100644 --- a/jdk/test/java/io/FileInputStream/LargeFileAvailable.java +++ b/jdk/test/java/io/FileInputStream/LargeFileAvailable.java @@ -31,6 +31,7 @@ import java.io.*; import java.nio.ByteBuffer; import java.nio.channels.*; +import java.nio.file.Files; import static java.nio.file.StandardOpenOption.*; public class LargeFileAvailable { @@ -85,7 +86,7 @@ public class LargeFileAvailable { // Create a large file as a sparse file if possible File largefile = File.createTempFile("largefile", null); // re-create as a sparse file - largefile.toPath().delete(); + Files.delete(largefile.toPath()); try (FileChannel fc = FileChannel.open(largefile.toPath(), CREATE_NEW, WRITE, SPARSE)) { diff --git a/jdk/test/java/nio/channels/FileChannel/AtomicAppend.java b/jdk/test/java/nio/channels/FileChannel/AtomicAppend.java index 1420318d5d7..60bd746f123 100644 --- a/jdk/test/java/nio/channels/FileChannel/AtomicAppend.java +++ b/jdk/test/java/nio/channels/FileChannel/AtomicAppend.java @@ -36,6 +36,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; +import java.nio.file.Files; import static java.nio.file.StandardOpenOption.*; public class AtomicAppend { @@ -55,7 +56,7 @@ public class AtomicAppend { if (rand.nextBoolean()) { return new FileOutputStream(file, true); } else { - return file.toPath().newOutputStream(APPEND); + return Files.newOutputStream(file.toPath(), APPEND); } } diff --git a/jdk/test/java/nio/channels/FileChannel/Transfer.java b/jdk/test/java/nio/channels/FileChannel/Transfer.java index f0507b5249f..565f8ff1007 100644 --- a/jdk/test/java/nio/channels/FileChannel/Transfer.java +++ b/jdk/test/java/nio/channels/FileChannel/Transfer.java @@ -276,7 +276,7 @@ public class Transfer { while (fc == null) { sink = File.createTempFile("sink", null); // re-create as a sparse file - sink.toPath().delete(); + sink.delete(); try { fc = FileChannel.open(sink.toPath(), StandardOpenOption.CREATE_NEW, diff --git a/jdk/test/java/nio/file/DirectoryStream/Basic.java b/jdk/test/java/nio/file/DirectoryStream/Basic.java index 75d66280147..69f5d18f656 100644 --- a/jdk/test/java/nio/file/DirectoryStream/Basic.java +++ b/jdk/test/java/nio/file/DirectoryStream/Basic.java @@ -28,6 +28,7 @@ */ import java.nio.file.*; +import static java.nio.file.Files.*; import java.util.*; import java.io.IOException; @@ -38,29 +39,26 @@ public class Basic { DirectoryStream stream; // test that directory is empty - stream = dir.newDirectoryStream(); - try { - if (stream.iterator().hasNext()) + try (DirectoryStream ds = newDirectoryStream(dir)) { + if (ds.iterator().hasNext()) throw new RuntimeException("directory not empty"); - } finally { - stream.close(); } // create file in directory final Path foo = Paths.get("foo"); - dir.resolve(foo).createFile(); + createFile(dir.resolve(foo)); // iterate over directory and check there is one entry - stream = dir.newDirectoryStream(); + stream = newDirectoryStream(dir); found = false; try { for (Path entry: stream) { - if (entry.getName().equals(foo)) { + if (entry.getFileName().equals(foo)) { if (found) throw new RuntimeException("entry already found"); found = true; } else { - throw new RuntimeException("entry " + entry.getName() + + throw new RuntimeException("entry " + entry.getFileName() + " not expected"); } } @@ -71,21 +69,18 @@ public class Basic { throw new RuntimeException("entry not found"); // check filtering: f* should match foo - DirectoryStream.Filter filter = new DirectoryStream.Filter() { + DirectoryStream.Filter filter = new DirectoryStream.Filter<>() { private PathMatcher matcher = dir.getFileSystem().getPathMatcher("glob:f*"); public boolean accept(Path file) { return matcher.matches(file); } }; - stream = dir.newDirectoryStream(filter); - try { - for (Path entry: stream) { - if (!entry.getName().equals(foo)) + try (DirectoryStream ds = newDirectoryStream(dir, filter)) { + for (Path entry: ds) { + if (!entry.getFileName().equals(foo)) throw new RuntimeException("entry not expected"); } - } finally { - stream.close(); } // check filtering: z* should not match any files @@ -96,12 +91,9 @@ public class Basic { return matcher.matches(file); } }; - stream = dir.newDirectoryStream(filter); - try { - if (stream.iterator().hasNext()) + try (DirectoryStream ds = newDirectoryStream(dir, filter)) { + if (ds.iterator().hasNext()) throw new RuntimeException("no matching entries expected"); - } finally { - stream.close(); } // check that an IOException thrown by a filter is propagated @@ -110,7 +102,7 @@ public class Basic { throw new java.util.zip.ZipException(); } }; - stream = dir.newDirectoryStream(filter); + stream = newDirectoryStream(dir, filter); try { stream.iterator().hasNext(); throw new RuntimeException("DirectoryIteratorException expected"); @@ -124,7 +116,7 @@ public class Basic { // check that exception or error thrown by filter is not thrown // by newDirectoryStream or iterator method. - stream = dir.newDirectoryStream(new DirectoryStream.Filter() { + stream = newDirectoryStream(dir, new DirectoryStream.Filter() { public boolean accept(Path file) { throw new RuntimeException("Should not be visible"); } @@ -137,13 +129,13 @@ public class Basic { // test NotDirectoryException try { - dir.resolve(foo).newDirectoryStream(); + newDirectoryStream(dir.resolve(foo)); throw new RuntimeException("NotDirectoryException not thrown"); } catch (NotDirectoryException x) { } // test UnsupportedOperationException - stream = dir.newDirectoryStream(); + stream = newDirectoryStream(dir); Iterator i = stream.iterator(); i.next(); try { @@ -153,7 +145,7 @@ public class Basic { } // test IllegalStateException - stream = dir.newDirectoryStream(); + stream = newDirectoryStream(dir); stream.iterator(); try { // attempt to obtain second iterator @@ -163,7 +155,7 @@ public class Basic { } stream.close(); - stream = dir.newDirectoryStream(); + stream = newDirectoryStream(dir); stream.close(); try { // attempt to obtain iterator after stream is closed @@ -173,13 +165,13 @@ public class Basic { } // test that iterator reads to end of stream when closed - stream = dir.newDirectoryStream(); + stream = newDirectoryStream(dir); i = stream.iterator(); stream.close(); while (i.hasNext()) i.next(); - stream = dir.newDirectoryStream(); + stream = newDirectoryStream(dir); i = stream.iterator(); stream.close(); try { diff --git a/jdk/test/java/nio/file/DirectoryStream/DriveLetter.java b/jdk/test/java/nio/file/DirectoryStream/DriveLetter.java index e692a7ec55f..a629a027d39 100644 --- a/jdk/test/java/nio/file/DirectoryStream/DriveLetter.java +++ b/jdk/test/java/nio/file/DirectoryStream/DriveLetter.java @@ -52,16 +52,14 @@ public class DriveLetter { Path expected = Paths.get(drive).resolve(tempFile.getName()); boolean found = false; - DirectoryStream stream = Paths.get(drive).newDirectoryStream(); - try { + Path dir = Paths.get(drive); + try (DirectoryStream stream = Files.newDirectoryStream(dir)) { for (Path file : stream) { if (file.equals(expected)) { found = true; break; } } - } finally { - stream.close(); } if (!found) throw new RuntimeException("Temporary file not found???"); diff --git a/jdk/test/java/nio/file/DirectoryStream/SecureDS.java b/jdk/test/java/nio/file/DirectoryStream/SecureDS.java index e776c8b31ad..fdfcfd9fdfe 100644 --- a/jdk/test/java/nio/file/DirectoryStream/SecureDS.java +++ b/jdk/test/java/nio/file/DirectoryStream/SecureDS.java @@ -28,6 +28,7 @@ */ import java.nio.file.*; +import static java.nio.file.Files.*; import static java.nio.file.StandardOpenOption.*; import static java.nio.file.LinkOption.*; import java.nio.file.attribute.*; @@ -41,7 +42,7 @@ public class SecureDS { public static void main(String[] args) throws IOException { Path dir = TestUtil.createTemporaryDirectory(); try { - DirectoryStream stream = dir.newDirectoryStream(); + DirectoryStream stream = newDirectoryStream(dir); stream.close(); if (!(stream instanceof SecureDirectoryStream)) { System.out.println("SecureDirectoryStream not supported."); @@ -62,28 +63,28 @@ public class SecureDS { // Exercise each of SecureDirectoryStream's method (except move) static void doBasicTests(Path dir) throws IOException { - Path dir1 = dir.resolve("dir1").createDirectory(); + Path dir1 = createDirectory(dir.resolve("dir1")); Path dir2 = dir.resolve("dir2"); // create a file, directory, and two sym links in the directory Path fileEntry = Paths.get("myfile"); - dir1.resolve(fileEntry).createFile(); + createFile(dir1.resolve(fileEntry)); Path dirEntry = Paths.get("mydir"); - dir1.resolve(dirEntry).createDirectory(); + createDirectory(dir1.resolve(dirEntry)); // myfilelink -> myfile Path link1Entry = Paths.get("myfilelink"); if (supportsLinks) - dir1.resolve(link1Entry).createSymbolicLink(fileEntry); + createSymbolicLink(dir1.resolve(link1Entry), fileEntry); // mydirlink -> mydir Path link2Entry = Paths.get("mydirlink"); if (supportsLinks) - dir1.resolve(link2Entry).createSymbolicLink(dirEntry); + createSymbolicLink(dir1.resolve(link2Entry), dirEntry); // open directory and then move it so that it is no longer accessible // via its original path. SecureDirectoryStream stream = - (SecureDirectoryStream)dir1.newDirectoryStream(); - dir1.moveTo(dir2); + (SecureDirectoryStream)newDirectoryStream(dir1); + move(dir1, dir2); // Test: iterate over all entries int count = 0; @@ -138,7 +139,7 @@ public class SecureDS { if (supportsLinks) { stream.newByteChannel(link1Entry, opts).close(); try { - Set mixed = new HashSet(); + Set mixed = new HashSet<>(); mixed.add(READ); mixed.add(NOFOLLOW_LINKS); stream.newByteChannel(link1Entry, mixed).close(); @@ -168,51 +169,48 @@ public class SecureDS { // clean-up stream.close(); - dir2.delete(); + delete(dir2); } // Exercise SecureDirectoryStream's move method static void doMoveTests(Path dir) throws IOException { - Path dir1 = dir.resolve("dir1").createDirectory(); - Path dir2 = dir.resolve("dir2").createDirectory(); + Path dir1 = createDirectory(dir.resolve("dir1")); + Path dir2 = createDirectory(dir.resolve("dir2")); // create dir1/myfile, dir1/mydir, dir1/mylink Path fileEntry = Paths.get("myfile"); - dir1.resolve(fileEntry).createFile(); + createFile(dir1.resolve(fileEntry)); Path dirEntry = Paths.get("mydir"); - dir1.resolve(dirEntry).createDirectory(); + createDirectory(dir1.resolve(dirEntry)); Path linkEntry = Paths.get("mylink"); if (supportsLinks) - dir1.resolve(linkEntry).createSymbolicLink(Paths.get("missing")); + createSymbolicLink(dir1.resolve(linkEntry), Paths.get("missing")); // target name Path target = Paths.get("newfile"); // open stream to both directories SecureDirectoryStream stream1 = - (SecureDirectoryStream)dir1.newDirectoryStream(); + (SecureDirectoryStream)newDirectoryStream(dir1); SecureDirectoryStream stream2 = - (SecureDirectoryStream)dir2.newDirectoryStream(); + (SecureDirectoryStream)newDirectoryStream(dir2); // Test: move dir1/myfile -> dir2/newfile stream1.move(fileEntry, stream2, target); - assertTrue(dir1.resolve(fileEntry).notExists()); - assertTrue(dir2.resolve(target).exists()); + assertTrue(notExists(dir1.resolve(fileEntry))); + assertTrue(exists(dir2.resolve(target))); stream2.deleteFile(target); // Test: move dir1/mydir -> dir2/newfile stream1.move(dirEntry, stream2, target); - assertTrue(dir1.resolve(dirEntry).notExists()); - assertTrue(dir2.resolve(target).exists()); + assertTrue(notExists(dir1.resolve(dirEntry))); + assertTrue(exists(dir2.resolve(target))); stream2.deleteDirectory(target); // Test: move dir1/mylink -> dir2/newfile if (supportsLinks) { stream1.move(linkEntry, stream2, target); - assertTrue(dir2.resolve(target) - .getFileAttributeView(BasicFileAttributeView.class, NOFOLLOW_LINKS) - .readAttributes() - .isSymbolicLink()); + assertTrue(isSymbolicLink(dir2.resolve(target))); stream2.deleteFile(target); } @@ -220,10 +218,10 @@ public class SecureDS { String testDirAsString = System.getProperty("test.dir"); if (testDirAsString != null) { Path testDir = Paths.get(testDirAsString); - if (!dir1.getFileStore().equals(testDir.getFileStore())) { + if (!getFileStore(dir1).equals(getFileStore(testDir))) { SecureDirectoryStream ts = - (SecureDirectoryStream)testDir.newDirectoryStream(); - dir1.resolve(fileEntry).createFile(); + (SecureDirectoryStream)newDirectoryStream(testDir); + createFile(dir1.resolve(fileEntry)); try { stream1.move(fileEntry, ts, target); shouldNotGetHere(); @@ -234,17 +232,17 @@ public class SecureDS { } // clean-up - dir1.delete(); - dir2.delete(); + delete(dir1); + delete(dir2); } // null and ClosedDirectoryStreamException static void miscTests(Path dir) throws IOException { Path file = Paths.get("file"); - dir.resolve(file).createFile(); + createFile(dir.resolve(file)); SecureDirectoryStream stream = - (SecureDirectoryStream)dir.newDirectoryStream(); + (SecureDirectoryStream)newDirectoryStream(dir); // NullPointerException try { @@ -319,7 +317,7 @@ public class SecureDS { } catch (ClosedDirectoryStreamException x) { } // clean-up - dir.resolve(file).delete(); + delete(dir.resolve(file)); } static void assertTrue(boolean b) { diff --git a/jdk/test/java/nio/file/FileStore/Basic.java b/jdk/test/java/nio/file/FileStore/Basic.java index 0b43109d3a0..f49bc6552bb 100644 --- a/jdk/test/java/nio/file/FileStore/Basic.java +++ b/jdk/test/java/nio/file/FileStore/Basic.java @@ -22,18 +22,21 @@ */ /* @test - * @bug 4313887 6873621 6979526 + * @bug 4313887 6873621 6979526 7006126 * @summary Unit test for java.nio.file.FileStore * @library .. */ import java.nio.file.*; import java.nio.file.attribute.*; +import java.io.File; import java.io.IOException; import java.util.*; public class Basic { + static final long G = 1024L * 1024L * 1024L; + public static void main(String[] args) throws IOException { Path dir = TestUtil.createTemporaryDirectory(); try { @@ -48,17 +51,25 @@ public class Basic { throw new RuntimeException("Assertion failed"); } + static void checkWithin1GB(long value1, long value2) { + long diff = Math.abs(value1 - value2); + if (diff > G) + throw new RuntimeException("values differ by more than 1GB"); + } + static void doTests(Path dir) throws IOException { /** * Test: Directory should be on FileStore that is writable */ - assertTrue(!dir.getFileStore().isReadOnly()); + assertTrue(!Files.getFileStore(dir).isReadOnly()); /** * Test: Two files should have the same FileStore */ - FileStore store1 = dir.resolve("foo").createFile().getFileStore(); - FileStore store2 = dir.resolve("bar").createFile().getFileStore(); + Path file1 = Files.createFile(dir.resolve("foo")); + Path file2 = Files.createFile(dir.resolve("bar")); + FileStore store1 = Files.getFileStore(file1); + FileStore store2 = Files.getFileStore(file2); assertTrue(store1.equals(store2)); assertTrue(store2.equals(store1)); assertTrue(store1.hashCode() == store2.hashCode()); @@ -77,6 +88,24 @@ public class Basic { assertTrue(store1.supportsFileAttributeView("user") == store1.supportsFileAttributeView(UserDefinedFileAttributeView.class)); + /** + * Test: Space atributes + */ + File f = file1.toFile(); + long total = f.getTotalSpace(); + long free = f.getFreeSpace(); + long usable = f.getUsableSpace(); + + // check values are "close" + checkWithin1GB(total, store1.getTotalSpace()); + checkWithin1GB(free, store1.getUnallocatedSpace()); + checkWithin1GB(usable, store1.getUsableSpace()); + + // get values by name + checkWithin1GB(total, (Long)store1.getAttribute("totalSpace")); + checkWithin1GB(free, (Long)store1.getAttribute("unallocatedSpace")); + checkWithin1GB(usable, (Long)store1.getAttribute("usableSpace")); + /** * Test: Enumerate all FileStores */ @@ -85,8 +114,10 @@ public class Basic { System.out.format("%s (name=%s type=%s)\n", store, store.name(), store.type()); - // check space attributes - Attributes.readFileStoreSpaceAttributes(store); + // check space attributes are accessible + store.getTotalSpace(); + store.getUnallocatedSpace(); + store.getUsableSpace(); // two distinct FileStores should not be equal assertTrue(!store.equals(prev)); diff --git a/jdk/test/java/nio/file/Files/BytesAndLines.java b/jdk/test/java/nio/file/Files/BytesAndLines.java new file mode 100644 index 00000000000..2833c99cb73 --- /dev/null +++ b/jdk/test/java/nio/file/Files/BytesAndLines.java @@ -0,0 +1,252 @@ +/* + * 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 7006126 + * @summary Unit test for methods for Files readAllBytes, readAllLines and + * and write methods. + */ + +import java.nio.file.*; +import static java.nio.file.Files.*; +import java.io.*; +import java.util.*; +import java.nio.charset.*; + +public class BytesAndLines { + static final Random rand = new Random(); + + static final Charset US_ASCII = Charset.forName("US-ASCII"); + + public static void main(String[] args) throws IOException { + testReadAndWriteBytes(); + testReadLines(); + testWriteLines(); + } + + /** + * Test readAllBytes(Path) and write(Path, byte[], OpenOption...) + */ + static void testReadAndWriteBytes() throws IOException { + // exercise methods with various sizes + testReadAndWriteBytes(0); + for (int i=0; i<100; i++) { + testReadAndWriteBytes(rand.nextInt(32000)); + } + + // NullPointerException + Path file = Paths.get("foo"); + List lines = Collections.emptyList(); + try { + readAllBytes(null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(null, lines, Charset.defaultCharset()); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(file, null, Charset.defaultCharset()); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(file, lines, null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(file, lines, Charset.defaultCharset(), (OpenOption[])null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + OpenOption[] opts = { null }; + write(file, lines, Charset.defaultCharset(), opts); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + } + + + static void testReadAndWriteBytes(int size) throws IOException { + Path path = createTempFile("blah", null); + try { + boolean append = rand.nextBoolean(); + + byte[] b1 = new byte[size]; + rand.nextBytes(b1); + + byte[] b2 = (append) ? new byte[size] : new byte[0]; + rand.nextBytes(b2); + + // write method should create file if it doesn't exist + if (rand.nextBoolean()) + delete(path); + + // write bytes to file + Path target = write(path, b1); + assertTrue(target==path, "Unexpected path"); + assertTrue(size(path) == b1.length, "Unexpected file size"); + + // append bytes to file (might be 0 bytes) + write(path, b2, StandardOpenOption.APPEND); + assertTrue(size(path) == b1.length + b2.length, "Unexpected file size"); + + // read entire file + byte[] read = readAllBytes(path); + + // check bytes are correct + byte[] expected; + if (append) { + expected = new byte[b1.length + b2.length]; + System.arraycopy(b1, 0, expected, 0, b1.length); + System.arraycopy(b2, 0, expected, b1.length, b2.length); + } else { + expected = b1; + } + assertTrue(Arrays.equals(read, expected), + "Bytes read not the same as bytes written"); + } finally { + deleteIfExists(path); + } + } + + /** + * Test readAllLines(Path,Charset) + */ + static void testReadLines() throws IOException { + Path tmpfile = createTempFile("blah", "txt"); + try { + List lines; + + // zero lines + assertTrue(size(tmpfile) == 0, "File should be empty"); + lines = readAllLines(tmpfile, US_ASCII); + assertTrue(lines.isEmpty(), "No line expected"); + + // one line + byte[] hi = { (byte)'h', (byte)'i' }; + write(tmpfile, hi); + lines = readAllLines(tmpfile, US_ASCII); + assertTrue(lines.size() == 1, "One line expected"); + assertTrue(lines.get(0).equals("hi"), "'Hi' expected"); + + // two lines using platform's line separator + List expected = Arrays.asList("hi", "there"); + write(tmpfile, expected, US_ASCII); + assertTrue(size(tmpfile) > 0, "File is empty"); + lines = readAllLines(tmpfile, US_ASCII); + assertTrue(lines.equals(expected), "Unexpected lines"); + + // MalformedInputException + byte[] bad = { (byte)0xff, (byte)0xff }; + write(tmpfile, bad); + try { + readAllLines(tmpfile, US_ASCII); + throw new RuntimeException("MalformedInputException expected"); + } catch (MalformedInputException ignore) { } + + + // NullPointerException + try { + readAllLines(null, US_ASCII); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + readAllLines(tmpfile, null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + + } finally { + delete(tmpfile); + } + } + + /** + * Test write(Path,Iterable,Charset,OpenOption...) + */ + static void testWriteLines() throws IOException { + Path tmpfile = createTempFile("blah", "txt"); + try { + // write method should create file if it doesn't exist + if (rand.nextBoolean()) + delete(tmpfile); + + // zero lines + Path result = write(tmpfile, Collections.emptyList(), US_ASCII); + assert(size(tmpfile) == 0); + assert(result == tmpfile); + + // two lines + List lines = Arrays.asList("hi", "there"); + write(tmpfile, lines, US_ASCII); + List actual = readAllLines(tmpfile, US_ASCII); + assertTrue(actual.equals(lines), "Unexpected lines"); + + // append two lines + write(tmpfile, lines, US_ASCII, StandardOpenOption.APPEND); + List expected = new ArrayList(); + expected.addAll(lines); + expected.addAll(lines); + assertTrue(expected.size() == 4, "List should have 4 elements"); + actual = readAllLines(tmpfile, US_ASCII); + assertTrue(actual.equals(expected), "Unexpected lines"); + + // UnmappableCharacterException + try { + String s = "\u00A0\u00A1"; + write(tmpfile, Arrays.asList(s), US_ASCII); + throw new RuntimeException("UnmappableCharacterException expected"); + } catch (UnmappableCharacterException ignore) { } + + // NullPointerException + try { + write(null, lines, US_ASCII); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(tmpfile, null, US_ASCII); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(tmpfile, lines, null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + write(tmpfile, lines, US_ASCII, (OpenOption[])null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + OpenOption[] opts = { (OpenOption)null }; + write(tmpfile, lines, US_ASCII, opts); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + + } finally { + delete(tmpfile); + } + + } + + static void assertTrue(boolean expr, String errmsg) { + if (!expr) + throw new RuntimeException(errmsg); + } +} diff --git a/jdk/test/java/nio/file/Path/CheckPermissions.java b/jdk/test/java/nio/file/Files/CheckPermissions.java similarity index 70% rename from jdk/test/java/nio/file/Path/CheckPermissions.java rename to jdk/test/java/nio/file/Files/CheckPermissions.java index 9996ac7490f..8137a358d42 100644 --- a/jdk/test/java/nio/file/Path/CheckPermissions.java +++ b/jdk/test/java/nio/file/Files/CheckPermissions.java @@ -22,8 +22,8 @@ */ /* @test - * @bug 6866804 - * @summary Unit test for java.nio.file.Path + * @bug 6866804 7006126 + * @summary Unit test for java.nio.file.Files * @library .. * @build CheckPermissions * @run main/othervm CheckPermissions @@ -31,6 +31,8 @@ import java.nio.ByteBuffer; import java.nio.file.*; +import static java.nio.file.Files.*; +import static java.nio.file.StandardOpenOption.*; import java.nio.file.attribute.*; import java.nio.channels.SeekableByteChannel; import java.security.Permission; @@ -45,12 +47,12 @@ import java.util.*; public class CheckPermissions { static class Checks { - private List permissionsChecked = new ArrayList(); - private Set propertiesChecked = new HashSet(); - private List readsChecked = new ArrayList(); - private List writesChecked = new ArrayList(); - private List deletesChecked = new ArrayList(); - private List execsChecked = new ArrayList(); + private List permissionsChecked = new ArrayList<>(); + private Set propertiesChecked = new HashSet<>(); + private List readsChecked = new ArrayList<>(); + private List writesChecked = new ArrayList<>(); + private List deletesChecked = new ArrayList<>(); + private List execsChecked = new ArrayList<>(); List permissionsChecked() { return permissionsChecked; } Set propertiesChecked() { return propertiesChecked; } @@ -78,7 +80,7 @@ public class CheckPermissions { if (type.isInstance(perm) && perm.getName().equals(name)) return; } - throw new RuntimeException(type.getName() + "\"" + name + "\") not checked"); + throw new RuntimeException(type.getName() + "(\"" + name + "\") not checked"); } static void assertCheckPropertyAccess(String key) { @@ -103,6 +105,17 @@ public class CheckPermissions { assertChecked(file, myChecks.get().writesChecked()); } + static void assertCheckWriteToDirectory(Path dir) { + String s = dir.toString(); + List list = myChecks.get().writesChecked(); + for (String f: list) { + if (f.startsWith(s)) { + return; + } + } + throw new RuntimeException("Access not checked"); + } + static void assertCheckDelete(Path file) { assertChecked(file, myChecks.get().deletesChecked()); } @@ -197,215 +210,240 @@ public class CheckPermissions { } public static void main(String[] args) throws IOException { - Path dir = Paths.get(System.getProperty("test.dir", ".")); - Path file = dir.resolve("file1234").createFile(); + final Path testdir = Paths.get(System.getProperty("test.dir", ".")).toAbsolutePath(); + final Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir")); + + Path file = createFile(testdir.resolve("file1234")); try { LoggingSecurityManager.install(); - // -- checkAccess -- + // -- check access -- prepare(); - file.checkAccess(); + exists(file); assertCheckRead(file); prepare(); - file.checkAccess(AccessMode.READ); + isReadable(file); assertCheckRead(file); prepare(); - file.checkAccess(AccessMode.WRITE); + isWritable(file); assertCheckWrite(file); prepare(); - try { - file.checkAccess(AccessMode.EXECUTE); - } catch (AccessDeniedException x) { } + isExecutable(file); assertCheckExec(file); - prepare(); - try { - file.checkAccess(AccessMode.READ, AccessMode.WRITE, AccessMode.EXECUTE); - } catch (AccessDeniedException x) { } - assertCheckRead(file); - assertCheckWrite(file); - assertCheckExec(file); + // -- copy -- - // -- copyTo -- - - Path target = dir.resolve("target1234"); + Path target = testdir.resolve("target1234"); prepare(); - file.copyTo(target); + copy(file, target); try { assertCheckRead(file); assertCheckWrite(target); } finally { - target.delete(); + delete(target); } - if (TestUtil.supportsLinks(dir)) { - Path link = dir.resolve("link1234").createSymbolicLink(file); + if (TestUtil.supportsLinks(testdir)) { + Path link = testdir.resolve("link1234"); + createSymbolicLink(link, file); try { prepare(); - link.copyTo(target, LinkOption.NOFOLLOW_LINKS); + copy(link, target, LinkOption.NOFOLLOW_LINKS); try { assertCheckRead(link); assertCheckWrite(target); assertCheckPermission(LinkPermission.class, "symbolic"); } finally { - target.delete(); + delete(target); } } finally { - link.delete(); + delete(link); } } // -- createDirectory -- - Path subdir = dir.resolve("subdir1234"); + Path subdir = testdir.resolve("subdir1234"); prepare(); - subdir.createDirectory(); + createDirectory(subdir); try { assertCheckWrite(subdir); } finally { - subdir.delete(); + delete(subdir); } // -- createFile -- - Path fileToCreate = dir.resolve("file7890"); + Path fileToCreate = testdir.resolve("file7890"); prepare(); + createFile(fileToCreate); try { - fileToCreate.createFile(); assertCheckWrite(fileToCreate); } finally { - fileToCreate.delete(); + delete(fileToCreate); } // -- createSymbolicLink -- - if (TestUtil.supportsLinks(dir)) { + if (TestUtil.supportsLinks(testdir)) { prepare(); - Path link = dir.resolve("link1234").createSymbolicLink(file); + Path link = testdir.resolve("link1234"); + createSymbolicLink(link, file); try { assertCheckWrite(link); assertCheckPermission(LinkPermission.class, "symbolic"); } finally { - link.delete(); + delete(link); } } + // -- createLink -- + + if (TestUtil.supportsLinks(testdir)) { + prepare(); + Path link = testdir.resolve("entry234"); + createLink(link, file); + try { + assertCheckWrite(link); + assertCheckPermission(LinkPermission.class, "hard"); + } finally { + delete(link); + } + } + + // -- createTempFile -- + + prepare(); + Path tmpfile1 = createTempFile("foo", null); + try { + assertCheckWriteToDirectory(tmpdir); + } finally { + delete(tmpfile1); + } + prepare(); + Path tmpfile2 = createTempFile(testdir, "foo", ".tmp"); + try { + assertCheckWriteToDirectory(testdir); + } finally { + delete(tmpfile2); + } + + // -- createTempDirectory -- + + prepare(); + Path tmpdir1 = createTempDirectory("foo"); + try { + assertCheckWriteToDirectory(tmpdir); + } finally { + delete(tmpdir1); + } + prepare(); + Path tmpdir2 = createTempDirectory(testdir, "foo"); + try { + assertCheckWriteToDirectory(testdir); + } finally { + delete(tmpdir2); + } + // -- delete/deleteIfExists -- - Path fileToDelete = dir.resolve("file7890"); + Path fileToDelete = testdir.resolve("file7890"); - fileToDelete.createFile(); + createFile(fileToDelete); prepare(); - fileToDelete.delete(); + delete(fileToDelete); assertCheckDelete(fileToDelete); - fileToDelete.createFile(); + createFile(fileToDelete); prepare(); - fileToDelete.deleteIfExists(); + deleteIfExists(fileToDelete); // file exists + assertCheckDelete(fileToDelete); + + prepare(); + deleteIfExists(fileToDelete); // file does not exist assertCheckDelete(fileToDelete); // -- exists/notExists -- prepare(); - file.exists(); + exists(file); assertCheckRead(file); prepare(); - file.notExists(); + notExists(file); assertCheckRead(file); // -- getFileStore -- prepare(); - file.getFileStore(); + getFileStore(file); assertCheckRead(file); assertCheckPermission(RuntimePermission.class, "getFileStoreAttributes"); // -- isSameFile -- prepare(); - file.isSameFile(dir); + isSameFile(file, testdir); assertCheckRead(file); - assertCheckRead(dir); + assertCheckRead(testdir); - // -- moveTo -- + // -- move -- - Path target2 = dir.resolve("target1234"); + Path target2 = testdir.resolve("target1234"); prepare(); - file.moveTo(target2); + move(file, target2); try { assertCheckWrite(file); assertCheckWrite(target2); } finally { // restore file - target2.moveTo(file); + move(target2, file); } // -- newByteChannel -- - SeekableByteChannel sbc; - prepare(); - sbc = file.newByteChannel(); - try { + try (SeekableByteChannel sbc = newByteChannel(file)) { assertCheckRead(file); - } finally { - sbc.close(); } prepare(); - sbc = file.newByteChannel(StandardOpenOption.WRITE); - try { + try (SeekableByteChannel sbc = newByteChannel(file, WRITE)) { assertCheckWrite(file); - } finally { - sbc.close(); } prepare(); - sbc = file.newByteChannel(StandardOpenOption.READ, StandardOpenOption.WRITE); - try { + try (SeekableByteChannel sbc = newByteChannel(file, READ, WRITE)) { assertCheckRead(file); assertCheckWrite(file); - } finally { - sbc.close(); } prepare(); - sbc = file.newByteChannel(StandardOpenOption.DELETE_ON_CLOSE); - try { + try (SeekableByteChannel sbc = newByteChannel(file, DELETE_ON_CLOSE)) { assertCheckRead(file); assertCheckDelete(file); - } finally { - sbc.close(); } - file.createFile(); // restore file + createFile(file); // restore file // -- newInputStream/newOutptuStream -- prepare(); - InputStream in = file.newInputStream(); - try { + try (InputStream in = newInputStream(file)) { assertCheckRead(file); - } finally { - in.close(); } prepare(); - OutputStream out = file.newOutputStream(); - try { + try (OutputStream out = newOutputStream(file)) { assertCheckWrite(file); - } finally { - out.close(); } // -- newDirectoryStream -- prepare(); - DirectoryStream stream = dir.newDirectoryStream(); - try { - assertCheckRead(dir); + try (DirectoryStream stream = newDirectoryStream(testdir)) { + assertCheckRead(testdir); if (stream instanceof SecureDirectoryStream) { Path entry; @@ -413,63 +451,57 @@ public class CheckPermissions { (SecureDirectoryStream)stream; // newByteChannel - entry = file.getName(); + entry = file.getFileName(); prepare(); - sbc = sds.newByteChannel(entry, EnumSet.of(StandardOpenOption.READ)); - try { + try (SeekableByteChannel sbc = sds.newByteChannel(entry, EnumSet.of(READ))) { assertCheckRead(file); - } finally { - sbc.close(); } prepare(); - sbc = sds.newByteChannel(entry, EnumSet.of(StandardOpenOption.WRITE)); - try { + try (SeekableByteChannel sbc = sds.newByteChannel(entry, EnumSet.of(WRITE))) { assertCheckWrite(file); - } finally { - sbc.close(); } // deleteFile - entry = file.getName(); + entry = file.getFileName(); prepare(); sds.deleteFile(entry); assertCheckDelete(file); - dir.resolve(entry).createFile(); // restore file + createFile(testdir.resolve(entry)); // restore file // deleteDirectory entry = Paths.get("subdir1234"); - dir.resolve(entry).createDirectory(); + createDirectory(testdir.resolve(entry)); prepare(); sds.deleteDirectory(entry); - assertCheckDelete(dir.resolve(entry)); + assertCheckDelete(testdir.resolve(entry)); // move entry = Paths.get("tempname1234"); prepare(); - sds.move(file.getName(), sds, entry); + sds.move(file.getFileName(), sds, entry); assertCheckWrite(file); - assertCheckWrite(dir.resolve(entry)); - sds.move(entry, sds, file.getName()); // restore file + assertCheckWrite(testdir.resolve(entry)); + sds.move(entry, sds, file.getFileName()); // restore file // newDirectoryStream entry = Paths.get("subdir1234"); - dir.resolve(entry).createDirectory(); + createDirectory(testdir.resolve(entry)); try { prepare(); sds.newDirectoryStream(entry).close(); - assertCheckRead(dir.resolve(entry)); + assertCheckRead(testdir.resolve(entry)); } finally { - dir.resolve(entry).delete(); + delete(testdir.resolve(entry)); } // getFileAttributeView to access attributes of directory testBasicFileAttributeView(sds - .getFileAttributeView(BasicFileAttributeView.class), dir); + .getFileAttributeView(BasicFileAttributeView.class), testdir); testPosixFileAttributeView(sds - .getFileAttributeView(PosixFileAttributeView.class), dir); + .getFileAttributeView(PosixFileAttributeView.class), testdir); // getFileAttributeView to access attributes of entry - entry = file.getName(); + entry = file.getFileName(); testBasicFileAttributeView(sds .getFileAttributeView(entry, BasicFileAttributeView.class), file); testPosixFileAttributeView(sds @@ -478,15 +510,12 @@ public class CheckPermissions { } else { System.out.println("SecureDirectoryStream not tested"); } - - } finally { - stream.close(); } // -- toAbsolutePath -- prepare(); - file.getName().toAbsolutePath(); + file.getFileName().toAbsolutePath(); assertCheckPropertyAccess("user.dir"); // -- toRealPath -- @@ -509,41 +538,38 @@ public class CheckPermissions { // -- register -- - WatchService watcher = FileSystems.getDefault().newWatchService(); - try { + try (WatchService watcher = FileSystems.getDefault().newWatchService()) { prepare(); - dir.register(watcher, StandardWatchEventKind.ENTRY_DELETE); - assertCheckRead(dir); - } finally { - watcher.close(); + testdir.register(watcher, StandardWatchEventKind.ENTRY_DELETE); + assertCheckRead(testdir); } // -- getAttribute/setAttribute/readAttributes -- prepare(); - file.getAttribute("size"); + getAttribute(file, "size"); assertCheckRead(file); prepare(); - file.setAttribute("lastModifiedTime", + setAttribute(file, "lastModifiedTime", FileTime.fromMillis(System.currentTimeMillis())); assertCheckWrite(file); prepare(); - file.readAttributes("*"); + readAttributes(file, "*"); assertCheckRead(file); // -- BasicFileAttributeView -- - testBasicFileAttributeView(file - .getFileAttributeView(BasicFileAttributeView.class), file); + testBasicFileAttributeView( + getFileAttributeView(file, BasicFileAttributeView.class), file); // -- PosixFileAttributeView -- { PosixFileAttributeView view = - file.getFileAttributeView(PosixFileAttributeView.class); + getFileAttributeView(file, PosixFileAttributeView.class); if (view != null && - file.getFileStore().supportsFileAttributeView(PosixFileAttributeView.class)) + getFileStore(file).supportsFileAttributeView(PosixFileAttributeView.class)) { testPosixFileAttributeView(view, file); } else { @@ -555,9 +581,9 @@ public class CheckPermissions { { DosFileAttributeView view = - file.getFileAttributeView(DosFileAttributeView.class); + getFileAttributeView(file, DosFileAttributeView.class); if (view != null && - file.getFileStore().supportsFileAttributeView(DosFileAttributeView.class)) + getFileStore(file).supportsFileAttributeView(DosFileAttributeView.class)) { prepare(); view.readAttributes(); @@ -587,9 +613,9 @@ public class CheckPermissions { { FileOwnerAttributeView view = - file.getFileAttributeView(FileOwnerAttributeView.class); + getFileAttributeView(file, FileOwnerAttributeView.class); if (view != null && - file.getFileStore().supportsFileAttributeView(FileOwnerAttributeView.class)) + getFileStore(file).supportsFileAttributeView(FileOwnerAttributeView.class)) { prepare(); UserPrincipal owner = view.getOwner(); @@ -610,9 +636,9 @@ public class CheckPermissions { { UserDefinedFileAttributeView view = - file.getFileAttributeView(UserDefinedFileAttributeView.class); + getFileAttributeView(file, UserDefinedFileAttributeView.class); if (view != null && - file.getFileStore().supportsFileAttributeView(UserDefinedFileAttributeView.class)) + getFileStore(file).supportsFileAttributeView(UserDefinedFileAttributeView.class)) { prepare(); view.write("test", ByteBuffer.wrap(new byte[100])); @@ -651,9 +677,9 @@ public class CheckPermissions { // -- AclFileAttributeView -- { AclFileAttributeView view = - file.getFileAttributeView(AclFileAttributeView.class); + getFileAttributeView(file, AclFileAttributeView.class); if (view != null && - file.getFileStore().supportsFileAttributeView(AclFileAttributeView.class)) + getFileStore(file).supportsFileAttributeView(AclFileAttributeView.class)) { prepare(); List acl = view.getAcl(); @@ -672,7 +698,7 @@ public class CheckPermissions { UserPrincipalLookupService lookupService = FileSystems.getDefault().getUserPrincipalLookupService(); - UserPrincipal owner = Attributes.getOwner(file); + UserPrincipal owner = getOwner(file); prepare(); lookupService.lookupPrincipalByName(owner.getName()); @@ -680,7 +706,7 @@ public class CheckPermissions { "lookupUserInformation"); try { - UserPrincipal group = Attributes.readPosixFileAttributes(file).group(); + UserPrincipal group = readAttributes(file, PosixFileAttributes.class).group(); prepare(); lookupService.lookupPrincipalByGroupName(group.getName()); assertCheckPermission(RuntimePermission.class, @@ -691,7 +717,7 @@ public class CheckPermissions { } finally { - file.deleteIfExists(); + deleteIfExists(file); } } } diff --git a/jdk/test/java/nio/file/Path/CopyAndMove.java b/jdk/test/java/nio/file/Files/CopyAndMove.java similarity index 63% rename from jdk/test/java/nio/file/Path/CopyAndMove.java rename to jdk/test/java/nio/file/Files/CopyAndMove.java index 17e3cab38e0..c0d2ba6dd8f 100644 --- a/jdk/test/java/nio/file/Path/CopyAndMove.java +++ b/jdk/test/java/nio/file/Files/CopyAndMove.java @@ -22,8 +22,8 @@ */ /* @test - * @bug 4313887 6838333 6917021 - * @summary Unit test for java.nio.file.Path copyTo/moveTo methods + * @bug 4313887 6838333 6917021 7006126 + * @summary Unit test for java.nio.file.Files copy and move methods * @library .. * @build CopyAndMove PassThroughFileSystem * @run main/othervm CopyAndMove @@ -31,6 +31,7 @@ import java.nio.ByteBuffer; import java.nio.file.*; +import static java.nio.file.Files.*; import static java.nio.file.StandardCopyOption.*; import static java.nio.file.LinkOption.*; import java.nio.file.attribute.*; @@ -44,9 +45,10 @@ public class CopyAndMove { public static void main(String[] args) throws Exception { Path dir1 = TestUtil.createTemporaryDirectory(); try { + // Same directory - doCopyTests(dir1, dir1, TestUtil.supportsLinks(dir1)); - doMoveTests(dir1, dir1, TestUtil.supportsLinks(dir1)); + testCopyFileToFile(dir1, dir1, TestUtil.supportsLinks(dir1)); + testMove(dir1, dir1, TestUtil.supportsLinks(dir1)); // Different directories. Use test.dir if possible as it might be // a different volume/file system and so improve test coverage. @@ -55,16 +57,20 @@ public class CopyAndMove { try { boolean testSymbolicLinks = TestUtil.supportsLinks(dir1) && TestUtil.supportsLinks(dir2); - doCopyTests(dir1, dir2, testSymbolicLinks); - doMoveTests(dir1, dir2, testSymbolicLinks); + testCopyFileToFile(dir1, dir2, testSymbolicLinks); + testMove(dir1, dir2, testSymbolicLinks); } finally { TestUtil.removeAll(dir2); } // Target is location associated with custom provider Path dir3 = PassThroughFileSystem.create().getPath(dir1.toString()); - doCopyTests(dir1, dir3, false); - doMoveTests(dir1, dir3, false); + testCopyFileToFile(dir1, dir3, false); + testMove(dir1, dir3, false); + + // Test copy(InputStream,Path) and copy(Path,OutputStream) + testCopyInputStreamToFile(); + testCopyFileToOuputStream(); } finally { TestUtil.removeAll(dir1); @@ -121,9 +127,9 @@ public class CopyAndMove { static Map readUserDefinedFileAttributes(Path file) throws IOException { - UserDefinedFileAttributeView view = file - .getFileAttributeView(UserDefinedFileAttributeView.class); - Map result = new HashMap(); + UserDefinedFileAttributeView view = + getFileAttributeView(file, UserDefinedFileAttributeView.class); + Map result = new HashMap<>(); for (String name: view.list()) { int size = view.size(name); ByteBuffer bb = ByteBuffer.allocate(size); @@ -148,15 +154,15 @@ public class CopyAndMove { // get file attributes of source file String os = System.getProperty("os.name"); if (os.equals("SunOS") || os.equals("Linux")) { - posixAttributes = Attributes.readPosixFileAttributes(source, NOFOLLOW_LINKS); + posixAttributes = readAttributes(source, PosixFileAttributes.class, NOFOLLOW_LINKS); basicAttributes = posixAttributes; } if (os.startsWith("Windows")) { - dosAttributes = Attributes.readDosFileAttributes(source, NOFOLLOW_LINKS); + dosAttributes = readAttributes(source, DosFileAttributes.class, NOFOLLOW_LINKS); basicAttributes = dosAttributes; } if (basicAttributes == null) - basicAttributes = Attributes.readBasicFileAttributes(source, NOFOLLOW_LINKS); + basicAttributes = readAttributes(source, BasicFileAttributes.class, NOFOLLOW_LINKS); // hash file contents if regular file int hash = (basicAttributes.isRegularFile()) ? computeHash(source) : 0; @@ -164,20 +170,21 @@ public class CopyAndMove { // record link target if symbolic link Path linkTarget = null; if (basicAttributes.isSymbolicLink()) - linkTarget = source.readSymbolicLink(); + linkTarget = readSymbolicLink(source); // read named attributes if available (and file is not a sym link) if (!basicAttributes.isSymbolicLink() && - source.getFileStore().supportsFileAttributeView("xattr")) + getFileStore(source).supportsFileAttributeView("xattr")) { namedAttributes = readUserDefinedFileAttributes(source); } // move file - source.moveTo(target, options); + Path result = move(source, target, options); + assertTrue(result == target); // verify source does not exist - assertTrue(source.notExists()); + assertTrue(notExists(source)); // verify file contents if (basicAttributes.isRegularFile()) { @@ -187,13 +194,13 @@ public class CopyAndMove { // verify link target if (basicAttributes.isSymbolicLink()) { - if (!target.readSymbolicLink().equals(linkTarget)) + if (!readSymbolicLink(target).equals(linkTarget)) throw new RuntimeException("Failed to verify move of symbolic link"); } // verify basic attributes checkBasicAttributes(basicAttributes, - Attributes.readBasicFileAttributes(target, NOFOLLOW_LINKS)); + readAttributes(target, BasicFileAttributes.class, NOFOLLOW_LINKS)); // verify other attributes when same provider if (source.getFileSystem().provider() == target.getFileSystem().provider()) { @@ -201,18 +208,19 @@ public class CopyAndMove { // verify POSIX attributes if (posixAttributes != null && !basicAttributes.isSymbolicLink()) { checkPosixAttributes(posixAttributes, - Attributes.readPosixFileAttributes(target, NOFOLLOW_LINKS)); + readAttributes(target, PosixFileAttributes.class, NOFOLLOW_LINKS)); } // verify DOS attributes if (dosAttributes != null && !basicAttributes.isSymbolicLink()) { - checkDosAttributes(dosAttributes, - Attributes.readDosFileAttributes(target, NOFOLLOW_LINKS)); + DosFileAttributes attrs = + readAttributes(target, DosFileAttributes.class, NOFOLLOW_LINKS); + checkDosAttributes(dosAttributes, attrs); } // verify named attributes if (namedAttributes != null && - target.getFileStore().supportsFileAttributeView("xattr")) + getFileStore(target).supportsFileAttributeView("xattr")) { checkUserDefinedFileAttributes(namedAttributes, readUserDefinedFileAttributes(target)); @@ -221,14 +229,14 @@ public class CopyAndMove { } /** - * Tests all possible ways to invoke moveTo + * Tests all possible ways to invoke move */ - static void doMoveTests(Path dir1, Path dir2, boolean supportsLinks) + static void testMove(Path dir1, Path dir2, boolean supportsLinks) throws IOException { Path source, target, entry; - boolean sameDevice = dir1.getFileStore().equals(dir2.getFileStore()); + boolean sameDevice = getFileStore(dir1).equals(getFileStore(dir2)); // -- regular file -- @@ -238,27 +246,28 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); moveAndVerify(source, target); - target.delete(); + delete(target); /** * Test: move regular file, target exists */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - target.delete(); - target.createDirectory(); + delete(target); + createDirectory(target); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: move regular file, target does not exist @@ -266,38 +275,42 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); /** * Test: move regular file, target exists */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); /** * Test: move regular file, target exists and is empty directory */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createDirectory(); + target = getTargetFile(dir2); + createDirectory(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); /** * Test: move regular file, target exists and is non-empty directory */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createDirectory(); - entry = target.resolve("foo").createFile(); + target = getTargetFile(dir2); + createDirectory(target); + entry = target.resolve("foo"); + createFile(entry); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - entry.delete(); - source.delete(); - target.delete(); + delete(entry); + delete(source); + delete(target); /** * Test atomic move of regular file (same file store) @@ -305,7 +318,7 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir1); moveAndVerify(source, target, ATOMIC_MOVE); - target.delete(); + delete(target); /** * Test atomic move of regular file (different file store) @@ -318,7 +331,7 @@ public class CopyAndMove { throw new RuntimeException("AtomicMoveNotSupportedException expected"); } catch (AtomicMoveNotSupportedException x) { } - source.delete(); + delete(source); } // -- directories -- @@ -329,27 +342,28 @@ public class CopyAndMove { source = createSourceDirectory(dir1); target = getTargetFile(dir2); moveAndVerify(source, target); - target.delete(); + delete(target); /** * Test: move empty directory, target exists */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - target.delete(); - target.createDirectory(); + delete(target); + createDirectory(target); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: move empty directory, target does not exist @@ -357,74 +371,78 @@ public class CopyAndMove { source = createSourceDirectory(dir1); target = getTargetFile(dir2); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); /** * Test: move empty directory, target exists */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); /** * Test: move empty, target exists and is empty directory */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createDirectory(); + target = getTargetFile(dir2); + createDirectory(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); /** * Test: move empty directory, target exists and is non-empty directory */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createDirectory(); - entry = target.resolve("foo").createFile(); + target = getTargetFile(dir2); + createDirectory(target); + entry = target.resolve("foo"); + createFile(entry); try { moveAndVerify(source, target, REPLACE_EXISTING); - throw new RuntimeException("FileAlreadyExistsException expected"); - } catch (FileAlreadyExistsException x) { + throw new RuntimeException("DirectoryNotEmptyException expected"); + } catch (DirectoryNotEmptyException x) { } - entry.delete(); - source.delete(); - target.delete(); + delete(entry); + delete(source); + delete(target); /** * Test: move non-empty directory (same file system) */ source = createSourceDirectory(dir1); - source.resolve("foo").createFile(); + createFile(source.resolve("foo")); target = getTargetFile(dir1); moveAndVerify(source, target); - target.resolve("foo").delete(); - target.delete(); + delete(target.resolve("foo")); + delete(target); /** * Test: move non-empty directory (different file store) */ if (!sameDevice) { source = createSourceDirectory(dir1); - source.resolve("foo").createFile(); + createFile(source.resolve("foo")); target = getTargetFile(dir2); try { moveAndVerify(source, target); throw new RuntimeException("IOException expected"); } catch (IOException x) { } - source.resolve("foo").delete(); - source.delete(); + delete(source.resolve("foo")); + delete(source); } /** * Test atomic move of directory (same file store) */ source = createSourceDirectory(dir1); - source.resolve("foo").createFile(); + createFile(source.resolve("foo")); target = getTargetFile(dir1); moveAndVerify(source, target, ATOMIC_MOVE); - target.resolve("foo").delete(); - target.delete(); + delete(target.resolve("foo")); + delete(target); // -- symbolic links -- @@ -433,21 +451,23 @@ public class CopyAndMove { */ if (supportsLinks) { Path tmp = createSourceFile(dir1); - source = dir1.resolve("link").createSymbolicLink(tmp); + source = dir1.resolve("link"); + createSymbolicLink(source, tmp); target = getTargetFile(dir2); moveAndVerify(source, target); - target.delete(); - tmp.delete(); + delete(target); + delete(tmp); } /** * Test: Move symbolic link to directory, target does not exist */ if (supportsLinks) { - source = dir1.resolve("link").createSymbolicLink(dir2); + source = dir1.resolve("link"); + createSymbolicLink(source, dir2); target = getTargetFile(dir2); moveAndVerify(source, target); - target.delete(); + delete(target); } /** @@ -455,72 +475,84 @@ public class CopyAndMove { */ if (supportsLinks) { Path tmp = Paths.get("doesnotexist"); - source = dir1.resolve("link").createSymbolicLink(tmp); + source = dir1.resolve("link"); + createSymbolicLink(source, tmp); target = getTargetFile(dir2); moveAndVerify(source, target); - target.delete(); + delete(target); } /** * Test: Move symbolic link, target exists */ if (supportsLinks) { - source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir2).createFile(); + source = dir1.resolve("link"); + createSymbolicLink(source, dir2); + target = getTargetFile(dir2); + createFile(target); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - source.delete(); - target.delete(); + delete(source); + delete(target); } /** * Test: Move regular file, target exists */ if (supportsLinks) { - source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir2).createFile(); + source = dir1.resolve("link"); + createSymbolicLink(source, dir2); + target = getTargetFile(dir2); + createFile(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); } /** * Test: move symbolic link, target exists and is empty directory */ if (supportsLinks) { - source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir2).createDirectory(); + source = dir1.resolve("link"); + createSymbolicLink(source, dir2); + target = getTargetFile(dir2); + createDirectory(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); } /** * Test: symbolic link, target exists and is non-empty directory */ if (supportsLinks) { - source = dir1.resolve("link").createSymbolicLink(dir2); - target = getTargetFile(dir2).createDirectory(); - entry = target.resolve("foo").createFile(); + source = dir1.resolve("link"); + createSymbolicLink(source, dir2); + target = getTargetFile(dir2); + createDirectory(target); + entry = target.resolve("foo"); + createFile(entry); try { moveAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - entry.delete(); - source.delete(); - target.delete(); + delete(entry); + delete(source); + delete(target); } /** * Test atomic move of symbolic link (same file store) */ if (supportsLinks) { - source = dir1.resolve("link").createSymbolicLink(dir1); - target = getTargetFile(dir2).createFile(); + source = dir1.resolve("link"); + createSymbolicLink(source, dir1); + target = getTargetFile(dir2); + createFile(target); moveAndVerify(source, target, REPLACE_EXISTING); - target.delete(); + delete(target); } // -- misc. tests -- @@ -531,19 +563,23 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); try { - source.moveTo(null); + move(null, target); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { - source.moveTo(target, (CopyOption[])null); + move(source, null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException x) { } + try { + move(source, target, (CopyOption[])null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { CopyOption[] opts = { REPLACE_EXISTING, null }; - source.moveTo(target, opts); + move(source, target, opts); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } - source.delete(); + delete(source); /** * Test UOE @@ -551,19 +587,20 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); try { - source.moveTo(target, new CopyOption() { }); + move(source, target, new CopyOption() { }); } catch (UnsupportedOperationException x) { } try { - source.moveTo(target, REPLACE_EXISTING, new CopyOption() { }); + move(source, target, REPLACE_EXISTING, new CopyOption() { }); } catch (UnsupportedOperationException x) { } - source.delete(); + delete(source); } // copy source to target with verification static void copyAndVerify(Path source, Path target, CopyOption... options) throws IOException { - source.copyTo(target, options); + Path result = copy(source, target, options); + assertTrue(result == target); // get attributes of source and target file to verify copy boolean followLinks = true; @@ -577,8 +614,8 @@ public class CopyAndMove { if (opt == COPY_ATTRIBUTES) copyAttributes = true; } - BasicFileAttributes basicAttributes = Attributes - .readBasicFileAttributes(source, linkOptions); + BasicFileAttributes basicAttributes = + readAttributes(source, BasicFileAttributes.class, linkOptions); // check hash if regular file if (basicAttributes.isRegularFile()) @@ -586,12 +623,12 @@ public class CopyAndMove { // check link target if symbolic link if (basicAttributes.isSymbolicLink()) - assert( source.readSymbolicLink().equals(target.readSymbolicLink())); + assert(readSymbolicLink(source).equals(readSymbolicLink(target))); // check that attributes are copied if (copyAttributes && followLinks) { checkBasicAttributes(basicAttributes, - Attributes.readBasicFileAttributes(source, linkOptions)); + readAttributes(source, BasicFileAttributes.class, linkOptions)); // verify other attributes when same provider if (source.getFileSystem().provider() == target.getFileSystem().provider()) { @@ -600,21 +637,21 @@ public class CopyAndMove { String os = System.getProperty("os.name"); if (os.equals("SunOS") || os.equals("Linux")) { checkPosixAttributes( - Attributes.readPosixFileAttributes(source, linkOptions), - Attributes.readPosixFileAttributes(target, linkOptions)); + readAttributes(source, PosixFileAttributes.class, linkOptions), + readAttributes(target, PosixFileAttributes.class, linkOptions)); } // check DOS attributes are copied if (os.startsWith("Windows")) { checkDosAttributes( - Attributes.readDosFileAttributes(source, linkOptions), - Attributes.readDosFileAttributes(target, linkOptions)); + readAttributes(source, DosFileAttributes.class, linkOptions), + readAttributes(target, DosFileAttributes.class, linkOptions)); } // check named attributes are copied if (followLinks && - source.getFileStore().supportsFileAttributeView("xattr") && - target.getFileStore().supportsFileAttributeView("xattr")) + getFileStore(source).supportsFileAttributeView("xattr") && + getFileStore(target).supportsFileAttributeView("xattr")) { checkUserDefinedFileAttributes(readUserDefinedFileAttributes(source), readUserDefinedFileAttributes(target)); @@ -624,9 +661,9 @@ public class CopyAndMove { } /** - * Tests all possible ways to invoke copyTo + * Tests all possible ways to invoke copy to copy a file to a file */ - static void doCopyTests(Path dir1, Path dir2, boolean supportsLinks) + static void testCopyFileToFile(Path dir1, Path dir2, boolean supportsLinks) throws IOException { Path source, target, link, entry; @@ -639,28 +676,29 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); copyAndVerify(source, target); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy regular file, target exists */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - target.delete(); - target.createDirectory(); + delete(target); + createDirectory(target); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy regular file, target does not exist @@ -668,41 +706,45 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); copyAndVerify(source, target, REPLACE_EXISTING); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy regular file, target exists */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); copyAndVerify(source, target, REPLACE_EXISTING); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy regular file, target exists and is empty directory */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createDirectory(); + target = getTargetFile(dir2); + createDirectory(target); copyAndVerify(source, target, REPLACE_EXISTING); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy regular file, target exists and is non-empty directory */ source = createSourceFile(dir1); - target = getTargetFile(dir2).createDirectory(); - entry = target.resolve("foo").createFile(); + target = getTargetFile(dir2); + createDirectory(target); + entry = target.resolve("foo"); + createFile(entry); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - entry.delete(); - source.delete(); - target.delete(); + delete(entry); + delete(source); + delete(target); /** * Test: copy regular file + attributes @@ -710,8 +752,8 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); copyAndVerify(source, target, COPY_ATTRIBUTES); - source.delete(); - target.delete(); + delete(source); + delete(target); // -- directory -- @@ -722,28 +764,29 @@ public class CopyAndMove { source = createSourceDirectory(dir1); target = getTargetFile(dir2); copyAndVerify(source, target); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy directory, target exists */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - target.delete(); - target.createDirectory(); + delete(target); + createDirectory(target); try { copyAndVerify(source, target); throw new RuntimeException("FileAlreadyExistsException expected"); } catch (FileAlreadyExistsException x) { } - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy directory, target does not exist @@ -751,41 +794,45 @@ public class CopyAndMove { source = createSourceDirectory(dir1); target = getTargetFile(dir2); copyAndVerify(source, target, REPLACE_EXISTING); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy directory, target exists */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createFile(); + target = getTargetFile(dir2); + createFile(target); copyAndVerify(source, target, REPLACE_EXISTING); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy directory, target exists and is empty directory */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createDirectory(); + target = getTargetFile(dir2); + createDirectory(target); copyAndVerify(source, target, REPLACE_EXISTING); - source.delete(); - target.delete(); + delete(source); + delete(target); /** * Test: copy directory, target exists and is non-empty directory */ source = createSourceDirectory(dir1); - target = getTargetFile(dir2).createDirectory(); - entry = target.resolve("foo").createFile(); + target = getTargetFile(dir2); + createDirectory(target); + entry = target.resolve("foo"); + createFile(entry); try { copyAndVerify(source, target, REPLACE_EXISTING); - throw new RuntimeException("FileAlreadyExistsException expected"); - } catch (FileAlreadyExistsException x) { + throw new RuntimeException("DirectoryNotEmptyException expected"); + } catch (DirectoryNotEmptyException x) { } - entry.delete(); - source.delete(); - target.delete(); + delete(entry); + delete(source); + delete(target); /* * Test: copy directory + attributes @@ -793,8 +840,8 @@ public class CopyAndMove { source = createSourceDirectory(dir1); target = getTargetFile(dir2); copyAndVerify(source, target, COPY_ATTRIBUTES); - source.delete(); - target.delete(); + delete(source); + delete(target); // -- symbolic links -- @@ -803,11 +850,12 @@ public class CopyAndMove { */ if (supportsLinks) { source = createSourceFile(dir1); - link = dir1.resolve("link").createSymbolicLink(source); + link = dir1.resolve("link"); + createSymbolicLink(link, source); target = getTargetFile(dir2); copyAndVerify(link, target); - link.delete(); - source.delete(); + delete(link); + delete(source); } /** @@ -815,34 +863,38 @@ public class CopyAndMove { */ if (supportsLinks) { source = createSourceFile(dir1); - link = dir1.resolve("link").createSymbolicLink(source); + link = dir1.resolve("link"); + createSymbolicLink(link, source); target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); - link.delete(); - source.delete(); + delete(link); + delete(source); } /** * Test: Copy link (to directory) */ if (supportsLinks) { - source = dir1.resolve("mydir").createDirectory(); - link = dir1.resolve("link").createSymbolicLink(source); + source = dir1.resolve("mydir"); + createDirectory(source); + link = dir1.resolve("link"); + createSymbolicLink(link, source); target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); - link.delete(); - source.delete(); + delete(link); + delete(source); } /** * Test: Copy broken link */ if (supportsLinks) { - assertTrue(source.notExists()); - link = dir1.resolve("link").createSymbolicLink(source); + assertTrue(notExists(source)); + link = dir1.resolve("link"); + createSymbolicLink(link, source); target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); - link.delete(); + delete(link); } /** @@ -852,10 +904,11 @@ public class CopyAndMove { System.getProperty("os.name").startsWith("Windows")) { Path unc = Paths.get("\\\\rialto\\share\\file"); - link = dir1.resolve("link").createSymbolicLink(unc); + link = dir1.resolve("link"); + createSymbolicLink(link, unc); target = getTargetFile(dir2); copyAndVerify(link, target, NOFOLLOW_LINKS); - link.delete(); + delete(link); } // -- misc. tests -- @@ -866,19 +919,19 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); try { - source.copyTo(null); + copy(source, null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { - source.copyTo(target, (CopyOption[])null); + copy(source, target, (CopyOption[])null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { CopyOption[] opts = { REPLACE_EXISTING, null }; - source.copyTo(target, opts); + copy(source, target, opts); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } - source.delete(); + delete(source); /** * Test UOE @@ -886,14 +939,154 @@ public class CopyAndMove { source = createSourceFile(dir1); target = getTargetFile(dir2); try { - source.copyTo(target, new CopyOption() { }); + copy(source, target, new CopyOption() { }); } catch (UnsupportedOperationException x) { } try { - source.copyTo(target, REPLACE_EXISTING, new CopyOption() { }); + copy(source, target, REPLACE_EXISTING, new CopyOption() { }); } catch (UnsupportedOperationException x) { } - source.delete(); + delete(source); } + /** + * Test copy from an input stream to a file + */ + static void testCopyInputStreamToFile() throws IOException { + testCopyInputStreamToFile(0); + for (int i=0; i<100; i++) { + testCopyInputStreamToFile(rand.nextInt(32000)); + } + + // FileAlreadyExistsException + Path target = createTempFile("blah", null); + try { + InputStream in = new ByteArrayInputStream(new byte[0]); + try { + copy(in, target); + throw new RuntimeException("FileAlreadyExistsException expected"); + } catch (FileAlreadyExistsException ignore) { } + } finally { + delete(target); + } + Path tmpdir = createTempDirectory("blah"); + try { + if (TestUtil.supportsLinks(tmpdir)) { + Path link = createSymbolicLink(tmpdir.resolve("link"), + tmpdir.resolve("target")); + try { + InputStream in = new ByteArrayInputStream(new byte[0]); + try { + copy(in, link); + throw new RuntimeException("FileAlreadyExistsException expected"); + } catch (FileAlreadyExistsException ignore) { } + } finally { + delete(link); + } + } + } finally { + delete(tmpdir); + } + + + // nulls + try { + copy((InputStream)null, target); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + copy(new ByteArrayInputStream(new byte[0]), (Path)null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + } + + static void testCopyInputStreamToFile(int size) throws IOException { + Path tmpdir = createTempDirectory("blah"); + Path source = tmpdir.resolve("source"); + Path target = tmpdir.resolve("target"); + try { + boolean testReplaceExisting = rand.nextBoolean(); + + // create source file + byte[] b = new byte[size]; + rand.nextBytes(b); + write(source, b); + + // target file might already exist + if (testReplaceExisting && rand.nextBoolean()) { + write(target, new byte[rand.nextInt(512)]); + } + + // copy from stream to file + InputStream in = new FileInputStream(source.toFile()); + try { + long n; + if (testReplaceExisting) { + n = copy(in, target, StandardCopyOption.REPLACE_EXISTING); + } else { + n = copy(in, target); + } + assertTrue(in.read() == -1); // EOF + assertTrue(n == size); + assertTrue(size(target) == size); + } finally { + in.close(); + } + + // check file + byte[] read = readAllBytes(target); + assertTrue(Arrays.equals(read, b)); + + } finally { + deleteIfExists(source); + deleteIfExists(target); + delete(tmpdir); + } + } + + /** + * Test copy from file to output stream + */ + static void testCopyFileToOuputStream() throws IOException { + testCopyFileToOuputStream(0); + for (int i=0; i<100; i++) { + testCopyFileToOuputStream(rand.nextInt(32000)); + } + + // nulls + try { + copy((Path)null, new ByteArrayOutputStream()); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + Path source = createTempFile("blah", null); + delete(source); + copy(source, (OutputStream)null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + } + + static void testCopyFileToOuputStream(int size) throws IOException { + Path source = createTempFile("blah", null); + try { + byte[] b = new byte[size]; + rand.nextBytes(b); + write(source, b); + + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + long n = copy(source, out); + assertTrue(n == size); + assertTrue(out.size() == size); + + byte[] read = out.toByteArray(); + assertTrue(Arrays.equals(read, b)); + + // check output stream is open + out.write(0); + assertTrue(out.size() == size+1); + } finally { + delete(source); + } + } static void assertTrue(boolean value) { if (!value) @@ -904,8 +1097,7 @@ public class CopyAndMove { static int computeHash(Path file) throws IOException { int h = 0; - InputStream in = file.newInputStream(); - try { + try (InputStream in = newInputStream(file)) { byte[] buf = new byte[1024]; int n; do { @@ -914,8 +1106,6 @@ public class CopyAndMove { h = 31*h + (buf[i] & 0xff); } } while (n > 0); - } finally { - in.close(); } return h; } @@ -923,14 +1113,12 @@ public class CopyAndMove { // create file of random size in given directory static Path createSourceFile(Path dir) throws IOException { String name = "source" + Integer.toString(rand.nextInt()); - Path file = dir.resolve(name).createFile(); + Path file = dir.resolve(name); + createFile(file); byte[] bytes = new byte[rand.nextInt(128*1024)]; rand.nextBytes(bytes); - OutputStream out = file.newOutputStream(); - try { + try (OutputStream out = newOutputStream(file)) { out.write(bytes); - } finally { - out.close(); } randomizeAttributes(file); return file; @@ -939,7 +1127,8 @@ public class CopyAndMove { // create directory in the given directory static Path createSourceDirectory(Path dir) throws IOException { String name = "sourcedir" + Integer.toString(rand.nextInt()); - Path subdir = dir.resolve(name).createDirectory(); + Path subdir = dir.resolve(name); + createDirectory(subdir); randomizeAttributes(subdir); return subdir; } @@ -949,12 +1138,11 @@ public class CopyAndMove { String os = System.getProperty("os.name"); boolean isWindows = os.startsWith("Windows"); boolean isUnix = os.equals("SunOS") || os.equals("Linux"); - boolean isDirectory = Attributes.readBasicFileAttributes(file, NOFOLLOW_LINKS) - .isDirectory(); + boolean isDirectory = isDirectory(file, NOFOLLOW_LINKS); if (isUnix) { - Set perms = Attributes - .readPosixFileAttributes(file, NOFOLLOW_LINKS).permissions(); + Set perms = + getPosixFilePermissions(file, NOFOLLOW_LINKS); PosixFilePermission[] toChange = { PosixFilePermission.GROUP_READ, PosixFilePermission.GROUP_WRITE, @@ -970,25 +1158,25 @@ public class CopyAndMove { perms.remove(perm); } } - Attributes.setPosixFilePermissions(file, perms); + setPosixFilePermissions(file, perms); } if (isWindows) { - DosFileAttributeView view = file - .getFileAttributeView(DosFileAttributeView.class, NOFOLLOW_LINKS); + DosFileAttributeView view = + getFileAttributeView(file, DosFileAttributeView.class, NOFOLLOW_LINKS); // only set or unset the hidden attribute view.setHidden(heads()); } boolean addUserDefinedFileAttributes = heads() && - file.getFileStore().supportsFileAttributeView("xattr"); + getFileStore(file).supportsFileAttributeView("xattr"); // remove this when copying a direcory copies its named streams if (isWindows && isDirectory) addUserDefinedFileAttributes = false; if (addUserDefinedFileAttributes) { - UserDefinedFileAttributeView view = file - .getFileAttributeView(UserDefinedFileAttributeView.class); + UserDefinedFileAttributeView view = + getFileAttributeView(file, UserDefinedFileAttributeView.class); int n = rand.nextInt(16); while (n > 0) { byte[] value = new byte[1 + rand.nextInt(100)]; diff --git a/jdk/test/java/nio/file/Path/DeleteOnClose.java b/jdk/test/java/nio/file/Files/DeleteOnClose.java similarity index 73% rename from jdk/test/java/nio/file/Path/DeleteOnClose.java rename to jdk/test/java/nio/file/Files/DeleteOnClose.java index 506c848f627..9b50a30b0be 100644 --- a/jdk/test/java/nio/file/Path/DeleteOnClose.java +++ b/jdk/test/java/nio/file/Files/DeleteOnClose.java @@ -31,44 +31,43 @@ public class DeleteOnClose { public static void main(String[] args) throws IOException { // open file but do not close it. Its existance will be checked by // the calling script. - Paths.get(args[0]).newByteChannel(READ, WRITE, DELETE_ON_CLOSE); + Files.newByteChannel(Paths.get(args[0]), READ, WRITE, DELETE_ON_CLOSE); // check temporary file has been deleted after closing it - Path file = File.createTempFile("blah", "tmp").toPath(); - file.newByteChannel(READ, WRITE, DELETE_ON_CLOSE).close(); - if (file.exists()) + Path file = Files.createTempFile("blah", "tmp"); + Files.newByteChannel(file, READ, WRITE, DELETE_ON_CLOSE).close(); + if (Files.exists(file)) throw new RuntimeException("Temporary file was not deleted"); - Path dir = TestUtil.createTemporaryDirectory(); + Path dir = Files.createTempDirectory("blah"); try { // check that DELETE_ON_CLOSE fails when file is a sym link if (TestUtil.supportsLinks(dir)) { - file = dir.resolve("foo").createFile(); - Path link = dir.resolve("link").createSymbolicLink(file); + file = dir.resolve("foo"); + Files.createFile(file); + Path link = dir.resolve("link"); + Files.createSymbolicLink(link, file); try { - link.newByteChannel(READ, WRITE, DELETE_ON_CLOSE); + Files.newByteChannel(link, READ, WRITE, DELETE_ON_CLOSE); throw new RuntimeException("IOException expected"); } catch (IOException ignore) { } } // check that DELETE_ON_CLOSE works with files created via open // directories - DirectoryStream stream = dir.newDirectoryStream(); - try { + try (DirectoryStream stream = Files.newDirectoryStream(dir)) { if (stream instanceof SecureDirectoryStream) { - SecureDirectoryStream secure = (SecureDirectoryStream)stream; + SecureDirectoryStream secure = (SecureDirectoryStream)stream; file = Paths.get("foo"); - Set opts = new HashSet(); + Set opts = new HashSet<>(); opts.add(WRITE); opts.add(DELETE_ON_CLOSE); secure.newByteChannel(file, opts).close(); - if (dir.resolve(file).exists()) + if (Files.exists(dir.resolve(file))) throw new RuntimeException("File not deleted"); } - } finally { - stream.close(); } } finally { TestUtil.removeAll(dir); diff --git a/jdk/test/java/nio/file/Path/FileAttributes.java b/jdk/test/java/nio/file/Files/FileAttributes.java similarity index 51% rename from jdk/test/java/nio/file/Path/FileAttributes.java rename to jdk/test/java/nio/file/Files/FileAttributes.java index 5300beb77f5..bd799dc6b1e 100644 --- a/jdk/test/java/nio/file/Path/FileAttributes.java +++ b/jdk/test/java/nio/file/Files/FileAttributes.java @@ -23,7 +23,7 @@ /* @test * @bug 4313887 6838333 - * @summary Unit test for java.nio.file.Path + * @summary Unit test for java.nio.file.Files * @library .. */ @@ -59,43 +59,43 @@ public class FileAttributes { } // Exercise getAttribute/setAttribute/readAttributes on basic attributes - static void checkBasicAttributes(FileRef file, BasicFileAttributes attrs) + static void checkBasicAttributes(Path file, BasicFileAttributes attrs) throws IOException { // getAttribute - checkEqual(attrs.size(), file.getAttribute("size")); - checkEqual(attrs.lastModifiedTime(), file.getAttribute("basic:lastModifiedTime")); - checkEqual(attrs.lastAccessTime(), file.getAttribute("lastAccessTime")); - checkEqual(attrs.creationTime(), file.getAttribute("basic:creationTime")); - assertTrue((Boolean)file.getAttribute("isRegularFile")); - assertTrue(!(Boolean)file.getAttribute("basic:isDirectory")); - assertTrue(!(Boolean)file.getAttribute("isSymbolicLink")); - assertTrue(!(Boolean)file.getAttribute("basic:isOther")); - checkEqual(attrs.fileKey(), file.getAttribute("basic:fileKey")); + checkEqual(attrs.size(), Files.getAttribute(file, "size")); + checkEqual(attrs.lastModifiedTime(), Files.getAttribute(file, "basic:lastModifiedTime")); + checkEqual(attrs.lastAccessTime(), Files.getAttribute(file, "lastAccessTime")); + checkEqual(attrs.creationTime(), Files.getAttribute(file, "basic:creationTime")); + assertTrue((Boolean)Files.getAttribute(file, "isRegularFile")); + assertTrue(!(Boolean)Files.getAttribute(file, "basic:isDirectory")); + assertTrue(!(Boolean)Files.getAttribute(file, "isSymbolicLink")); + assertTrue(!(Boolean)Files.getAttribute(file, "basic:isOther")); + checkEqual(attrs.fileKey(), Files.getAttribute(file, "basic:fileKey")); // setAttribute FileTime modTime = attrs.lastModifiedTime(); - file.setAttribute("basic:lastModifiedTime", FileTime.fromMillis(0L)); - checkEqual(Attributes.readBasicFileAttributes(file).lastModifiedTime(), + Files.setAttribute(file, "basic:lastModifiedTime", FileTime.fromMillis(0L)); + checkEqual(Files.getLastModifiedTime(file), FileTime.fromMillis(0L)); - file.setAttribute("lastModifiedTime", modTime); - checkEqual(Attributes.readBasicFileAttributes(file).lastModifiedTime(), modTime); + Files.setAttribute(file, "lastModifiedTime", modTime); + checkEqual(Files.getLastModifiedTime(file), modTime); - Map map; - map = file.readAttributes("*"); + Map map; + map = Files.readAttributes(file, "*"); assertTrue(map.size() >= 9); checkEqual(attrs.isRegularFile(), map.get("isRegularFile")); // check one - map = file.readAttributes("basic:*"); + map = Files.readAttributes(file, "basic:*"); assertTrue(map.size() >= 9); checkEqual(attrs.lastAccessTime(), map.get("lastAccessTime")); // check one - map = file.readAttributes("size,lastModifiedTime"); + map = Files.readAttributes(file, "size,lastModifiedTime"); assertTrue(map.size() == 2); checkEqual(attrs.size(), map.get("size")); checkEqual(attrs.lastModifiedTime(), map.get("lastModifiedTime")); - map = file.readAttributes( + map = Files.readAttributes(file, "basic:lastModifiedTime,lastAccessTime,ShouldNotExist"); assertTrue(map.size() == 2); checkEqual(attrs.lastModifiedTime(), map.get("lastModifiedTime")); @@ -103,110 +103,110 @@ public class FileAttributes { } // Exercise getAttribute/setAttribute/readAttributes on posix attributes - static void checkPosixAttributes(FileRef file, PosixFileAttributes attrs) + static void checkPosixAttributes(Path file, PosixFileAttributes attrs) throws IOException { checkBasicAttributes(file, attrs); // getAttribute - checkEqual(attrs.permissions(), file.getAttribute("posix:permissions")); - checkEqual(attrs.owner(), file.getAttribute("posix:owner")); - checkEqual(attrs.group(), file.getAttribute("posix:group")); + checkEqual(attrs.permissions(), Files.getAttribute(file, "posix:permissions")); + checkEqual(attrs.owner(), Files.getAttribute(file, "posix:owner")); + checkEqual(attrs.group(), Files.getAttribute(file, "posix:group")); // setAttribute Set orig = attrs.permissions(); - Set newPerms = new HashSet(orig); + Set newPerms = new HashSet<>(orig); newPerms.remove(PosixFilePermission.OTHERS_READ); newPerms.remove(PosixFilePermission.OTHERS_WRITE); newPerms.remove(PosixFilePermission.OTHERS_EXECUTE); - file.setAttribute("posix:permissions", newPerms); - checkEqual(Attributes.readPosixFileAttributes(file).permissions(), newPerms); - file.setAttribute("posix:permissions", orig); - checkEqual(Attributes.readPosixFileAttributes(file).permissions(), orig); - file.setAttribute("posix:owner", attrs.owner()); - file.setAttribute("posix:group", attrs.group()); + Files.setAttribute(file, "posix:permissions", newPerms); + checkEqual(Files.getPosixFilePermissions(file), newPerms); + Files.setAttribute(file, "posix:permissions", orig); + checkEqual(Files.getPosixFilePermissions(file), orig); + Files.setAttribute(file, "posix:owner", attrs.owner()); + Files.setAttribute(file, "posix:group", attrs.group()); // readAttributes - Map map; - map = file.readAttributes("posix:*"); + Map map; + map = Files.readAttributes(file, "posix:*"); assertTrue(map.size() >= 12); checkEqual(attrs.permissions(), map.get("permissions")); // check one - map = file.readAttributes("posix:size,owner,ShouldNotExist"); + map = Files.readAttributes(file, "posix:size,owner,ShouldNotExist"); assertTrue(map.size() == 2); checkEqual(attrs.size(), map.get("size")); checkEqual(attrs.owner(), map.get("owner")); } // Exercise getAttribute/readAttributes on unix attributes - static void checkUnixAttributes(FileRef file) throws IOException { + static void checkUnixAttributes(Path file) throws IOException { // getAttribute - int mode = (Integer)file.getAttribute("unix:mode"); - long ino = (Long)file.getAttribute("unix:ino"); - long dev = (Long)file.getAttribute("unix:dev"); - long rdev = (Long)file.getAttribute("unix:rdev"); - int nlink = (Integer)file.getAttribute("unix:nlink"); - int uid = (Integer)file.getAttribute("unix:uid"); - int gid = (Integer)file.getAttribute("unix:gid"); - FileTime ctime = (FileTime)file.getAttribute("unix:ctime"); + int mode = (Integer)Files.getAttribute(file, "unix:mode"); + long ino = (Long)Files.getAttribute(file, "unix:ino"); + long dev = (Long)Files.getAttribute(file, "unix:dev"); + long rdev = (Long)Files.getAttribute(file, "unix:rdev"); + int nlink = (Integer)Files.getAttribute(file, "unix:nlink"); + int uid = (Integer)Files.getAttribute(file, "unix:uid"); + int gid = (Integer)Files.getAttribute(file, "unix:gid"); + FileTime ctime = (FileTime)Files.getAttribute(file, "unix:ctime"); // readAttributes - Map map; - map = file.readAttributes("unix:*"); + Map map; + map = Files.readAttributes(file, "unix:*"); assertTrue(map.size() >= 20); - map = file.readAttributes("unix:size,uid,gid,ShouldNotExist"); + map = Files.readAttributes(file, "unix:size,uid,gid,ShouldNotExist"); assertTrue(map.size() == 3); checkEqual(map.get("size"), - Attributes.readBasicFileAttributes(file).size()); + Files.readAttributes(file, BasicFileAttributes.class).size()); } // Exercise getAttribute/setAttribute on dos attributes - static void checkDosAttributes(FileRef file, DosFileAttributes attrs) + static void checkDosAttributes(Path file, DosFileAttributes attrs) throws IOException { checkBasicAttributes(file, attrs); // getAttribute - checkEqual(attrs.isReadOnly(), file.getAttribute("dos:readonly")); - checkEqual(attrs.isHidden(), file.getAttribute("dos:hidden")); - checkEqual(attrs.isSystem(), file.getAttribute("dos:system")); - checkEqual(attrs.isArchive(), file.getAttribute("dos:archive")); + checkEqual(attrs.isReadOnly(), Files.getAttribute(file, "dos:readonly")); + checkEqual(attrs.isHidden(), Files.getAttribute(file, "dos:hidden")); + checkEqual(attrs.isSystem(), Files.getAttribute(file, "dos:system")); + checkEqual(attrs.isArchive(), Files.getAttribute(file, "dos:archive")); // setAttribute boolean value; value = attrs.isReadOnly(); - file.setAttribute("dos:readonly", !value); - checkEqual(Attributes.readDosFileAttributes(file).isReadOnly(), !value); - file.setAttribute("dos:readonly", value); - checkEqual(Attributes.readDosFileAttributes(file).isReadOnly(), value); + Files.setAttribute(file, "dos:readonly", !value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isReadOnly(), !value); + Files.setAttribute(file, "dos:readonly", value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isReadOnly(), value); value = attrs.isHidden(); - file.setAttribute("dos:hidden", !value); - checkEqual(Attributes.readDosFileAttributes(file).isHidden(), !value); - file.setAttribute("dos:hidden", value); - checkEqual(Attributes.readDosFileAttributes(file).isHidden(), value); + Files.setAttribute(file, "dos:hidden", !value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isHidden(), !value); + Files.setAttribute(file, "dos:hidden", value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isHidden(), value); value = attrs.isSystem(); - file.setAttribute("dos:system", !value); - checkEqual(Attributes.readDosFileAttributes(file).isSystem(), !value); - file.setAttribute("dos:system", value); - checkEqual(Attributes.readDosFileAttributes(file).isSystem(), value); + Files.setAttribute(file, "dos:system", !value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isSystem(), !value); + Files.setAttribute(file, "dos:system", value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isSystem(), value); value = attrs.isArchive(); - file.setAttribute("dos:archive", !value); - checkEqual(Attributes.readDosFileAttributes(file).isArchive(), !value); - file.setAttribute("dos:archive", value); - checkEqual(Attributes.readDosFileAttributes(file).isArchive(), value); + Files.setAttribute(file, "dos:archive", !value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isArchive(), !value); + Files.setAttribute(file, "dos:archive", value); + checkEqual(Files.readAttributes(file, DosFileAttributes.class).isArchive(), value); // readAttributes - Map map; - map = file.readAttributes("dos:*"); + Map map; + map = Files.readAttributes(file, "dos:*"); assertTrue(map.size() >= 13); checkEqual(attrs.isReadOnly(), map.get("readonly")); // check one - map = file.readAttributes("dos:size,hidden,ShouldNotExist"); + map = Files.readAttributes(file, "dos:size,hidden,ShouldNotExist"); assertTrue(map.size() == 2); checkEqual(attrs.size(), map.get("size")); checkEqual(attrs.isHidden(), map.get("hidden")); @@ -215,40 +215,41 @@ public class FileAttributes { static void miscTests(Path file) throws IOException { // NPE tests try { - file.getAttribute(null); + Files.getAttribute(file, null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException npe) { } try { - file.getAttribute("isRegularFile", (LinkOption[])null); + Files.getAttribute(file, "isRegularFile", (LinkOption[])null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException npe) { } try { - file.setAttribute(null, 0L); + Files.setAttribute(file, null, 0L); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException npe) { } } static void doTests(Path dir) throws IOException { - Path file = dir.resolve("foo").createFile(); - FileStore store = file.getFileStore(); + Path file = dir.resolve("foo"); + Files.createFile(file); + FileStore store = Files.getFileStore(file); try { checkBasicAttributes(file, - Attributes.readBasicFileAttributes(file)); + Files.readAttributes(file, BasicFileAttributes.class)); if (store.supportsFileAttributeView("posix")) checkPosixAttributes(file, - Attributes.readPosixFileAttributes(file)); + Files.readAttributes(file, PosixFileAttributes.class)); if (store.supportsFileAttributeView("unix")) checkUnixAttributes(file); if (store.supportsFileAttributeView("dos")) checkDosAttributes(file, - Attributes.readDosFileAttributes(file)); + Files.readAttributes(file, DosFileAttributes.class)); miscTests(file); } finally { - file.delete(); + Files.delete(file); } } diff --git a/jdk/test/java/nio/file/Path/InterruptCopy.java b/jdk/test/java/nio/file/Files/InterruptCopy.java similarity index 90% rename from jdk/test/java/nio/file/Path/InterruptCopy.java rename to jdk/test/java/nio/file/Files/InterruptCopy.java index 11be5a2e198..1502d9e824e 100644 --- a/jdk/test/java/nio/file/Path/InterruptCopy.java +++ b/jdk/test/java/nio/file/Files/InterruptCopy.java @@ -29,7 +29,6 @@ */ import java.nio.file.*; -import java.nio.file.attribute.Attributes; import java.io.*; import java.util.concurrent.*; import com.sun.nio.file.ExtendedCopyOption; @@ -43,10 +42,9 @@ public class InterruptCopy { public static void main(String[] args) throws Exception { Path dir = TestUtil.createTemporaryDirectory(); try { - FileStore store = dir.getFileStore(); + FileStore store = Files.getFileStore(dir); System.out.format("Checking space (%s)\n", store); - long usableSpace = Attributes - .readFileStoreSpaceAttributes(store).usableSpace(); + long usableSpace = store.getUsableSpace(); if (usableSpace < 2*FILE_SIZE_TO_COPY) { System.out.println("Insufficient disk space to run test."); return; @@ -66,14 +64,11 @@ public class InterruptCopy { System.out.println("Creating source file..."); byte[] buf = new byte[32*1024]; long total = 0; - OutputStream out = source.newOutputStream(); - try { + try (OutputStream out = Files.newOutputStream(source)) { do { out.write(buf); total += buf.length; } while (total < FILE_SIZE_TO_COPY); - } finally { - out.close(); } System.out.println("Source file created."); @@ -89,7 +84,7 @@ public class InterruptCopy { System.out.println("Copying file..."); try { long start = System.currentTimeMillis(); - source.copyTo(target, ExtendedCopyOption.INTERRUPTIBLE); + Files.copy(source, target, ExtendedCopyOption.INTERRUPTIBLE); long duration = System.currentTimeMillis() - start; if (duration > DURATION_MAX_IN_MS) throw new RuntimeException("Copy was not interrupted"); @@ -109,7 +104,7 @@ public class InterruptCopy { Future result = pool.submit(new Callable() { public Void call() throws IOException { System.out.println("Copying file..."); - source.copyTo(target, ExtendedCopyOption.INTERRUPTIBLE, + Files.copy(source, target, ExtendedCopyOption.INTERRUPTIBLE, StandardCopyOption.REPLACE_EXISTING); return null; } diff --git a/jdk/test/java/nio/file/Path/Links.java b/jdk/test/java/nio/file/Files/Links.java similarity index 72% rename from jdk/test/java/nio/file/Path/Links.java rename to jdk/test/java/nio/file/Files/Links.java index ced18e1cd28..0c19a0c92b5 100644 --- a/jdk/test/java/nio/file/Path/Links.java +++ b/jdk/test/java/nio/file/Files/Links.java @@ -23,7 +23,7 @@ /* @test * @bug 4313887 6838333 6863864 - * @summary Unit test for java.nio.file.Path createSymbolicLink, + * @summary Unit test for java.nio.file.Files createSymbolicLink, * readSymbolicLink, and createLink methods * @library .. * @build Links @@ -52,8 +52,8 @@ public class Links { // Check if sym links are supported try { - link.createSymbolicLink(Paths.get("foo")); - link.delete(); + Files.createSymbolicLink(link, Paths.get("foo")); + Files.delete(link); } catch (UnsupportedOperationException x) { // sym links not supported return; @@ -70,11 +70,11 @@ public class Links { String[] targets = (isWindows) ? windowsTargets : otherTargets; for (String s: targets) { Path target = Paths.get(s); - link.createSymbolicLink(target); + Files.createSymbolicLink(link, target); try { - assertTrue(link.readSymbolicLink().equals(target)); + assertTrue(Files.readSymbolicLink(link).equals(target)); } finally { - link.delete(); + Files.delete(link); } } @@ -82,57 +82,54 @@ public class Links { Path mydir = dir.resolve("mydir"); Path myfile = mydir.resolve("myfile"); try { - mydir.createDirectory(); - myfile.createFile(); + Files.createDirectory(mydir); + Files.createFile(myfile); // link -> "mydir" - link.createSymbolicLink(mydir.getName()); - assertTrue(link.readSymbolicLink().equals(mydir.getName())); + Files.createSymbolicLink(link, mydir.getFileName()); + assertTrue(Files.readSymbolicLink(link).equals(mydir.getFileName())); // Test access to directory via link - DirectoryStream stream = link.newDirectoryStream(); - try { + try (DirectoryStream stream = Files.newDirectoryStream(link)) { boolean found = false; for (Path entry: stream) { - if (entry.getName().equals(myfile.getName())) { + if (entry.getFileName().equals(myfile.getFileName())) { found = true; break; } } assertTrue(found); - } finally { - stream.close(); } // Test link2 -> link -> mydir final Path link2 = dir.resolve("link2"); - Path target2 = link.getName(); - link2.createSymbolicLink(target2); + Path target2 = link.getFileName(); + Files.createSymbolicLink(link2, target2); try { - assertTrue(link2.readSymbolicLink().equals(target2)); - link2.newDirectoryStream().close(); + assertTrue(Files.readSymbolicLink(link2).equals(target2)); + Files.newDirectoryStream(link2).close(); } finally { - link2.delete(); + Files.delete(link2); } // Remove mydir and re-create link2 before re-creating mydir // (This is a useful test on Windows to ensure that creating a // sym link to a directory sym link creates the right type of link). - myfile.delete(); - mydir.delete(); - link2.createSymbolicLink(target2); + Files.delete(myfile); + Files.delete(mydir); + Files.createSymbolicLink(link2, target2); try { - assertTrue(link2.readSymbolicLink().equals(target2)); - mydir.createDirectory(); - link2.newDirectoryStream().close(); + assertTrue(Files.readSymbolicLink(link2).equals(target2)); + Files.createDirectory(mydir); + Files.newDirectoryStream(link2).close(); } finally { - link2.delete(); + Files.delete(link2); } } finally { - myfile.deleteIfExists(); - mydir.deleteIfExists(); - link.deleteIfExists(); + Files.deleteIfExists(myfile); + Files.deleteIfExists(mydir); + Files.deleteIfExists(link); } } @@ -140,11 +137,12 @@ public class Links { * Exercise createLink method */ static void testHardLinks(Path dir) throws IOException { - Path foo = dir.resolve("foo").createFile(); + Path foo = dir.resolve("foo"); + Files.createFile(foo); try { - Path bar; + Path bar = dir.resolve("bar"); try { - bar = dir.resolve("bar").createLink(foo); + Files.createLink(bar, foo); } catch (UnsupportedOperationException x) { return; } catch (IOException x) { @@ -152,18 +150,16 @@ public class Links { return; } try { - Object key1 = Attributes - .readBasicFileAttributes(foo).fileKey(); - Object key2 = Attributes - .readBasicFileAttributes(bar).fileKey(); + Object key1 = Files.readAttributes(foo, BasicFileAttributes.class).fileKey(); + Object key2 = Files.readAttributes(bar, BasicFileAttributes.class).fileKey(); assertTrue((key1 == null) || (key1.equals(key2))); } finally { - bar.delete(); + Files.delete(bar); } } finally { - foo.delete(); + Files.delete(foo); } } diff --git a/jdk/test/java/nio/file/Files/Misc.java b/jdk/test/java/nio/file/Files/Misc.java index 621b95981ff..1ff9d0af190 100644 --- a/jdk/test/java/nio/file/Files/Misc.java +++ b/jdk/test/java/nio/file/Files/Misc.java @@ -22,122 +22,335 @@ */ /* @test - * @bug 4313887 6838333 6865748 - * @summary Unit test for java.nio.file.Files for miscellenous cases not - * covered by other tests + * @bug 4313887 6838333 + * @summary Unit test for miscellenous methods in java.nio.file.Files * @library .. */ import java.nio.file.*; -import java.nio.file.attribute.Attributes; -import java.nio.file.attribute.BasicFileAttributes; +import static java.nio.file.Files.*; +import static java.nio.file.LinkOption.*; +import java.nio.file.attribute.*; import java.io.IOException; import java.util.*; public class Misc { - static void npeExpected() { - throw new RuntimeException("NullPointerException expected"); - } - public static void main(String[] args) throws IOException { - - // -- Files.createDirectories -- - Path dir = TestUtil.createTemporaryDirectory(); try { - // no-op - Files.createDirectories(dir); + testCreateDirectories(dir); + testIsHidden(dir); + testIsSameFile(dir); + testFileTypeMethods(dir); + testAccessMethods(dir); + } finally { + TestUtil.removeAll(dir); + } + } - // create one directory - Path subdir = dir.resolve("a"); - Files.createDirectories(subdir); - if (!subdir.exists()) - throw new RuntimeException("directory not created"); + /** + * Tests createDirectories + */ + static void testCreateDirectories(Path tmpdir) throws IOException { + // a no-op + createDirectories(tmpdir); - // create parents - subdir = subdir.resolve("b/c/d"); - Files.createDirectories(subdir); - if (!subdir.exists()) - throw new RuntimeException("directory not created"); + // create one directory + Path subdir = tmpdir.resolve("a"); + createDirectories(subdir); + assertTrue(exists(subdir)); - // existing file is not a directory - Path file = dir.resolve("x").createFile(); + // create parents + subdir = subdir.resolve("b/c/d"); + createDirectories(subdir); + assertTrue(exists(subdir)); + + // existing file is not a directory + Path file = createFile(tmpdir.resolve("x")); + try { + createDirectories(file); + throw new RuntimeException("failure expected"); + } catch (FileAlreadyExistsException x) { } + try { + createDirectories(file.resolve("y")); + throw new RuntimeException("failure expected"); + } catch (IOException x) { } + } + + /** + * Tests isHidden + */ + static void testIsHidden(Path tmpdir) throws IOException { + assertTrue(!isHidden(tmpdir)); + + Path file = tmpdir.resolve(".foo"); + if (System.getProperty("os.name").startsWith("Windows")) { + createFile(file); try { - Files.createDirectories(file); - throw new RuntimeException("failure expected"); - } catch (FileAlreadyExistsException x) { } + setAttribute(file, "dos:hidden", true); + try { + assertTrue(isHidden(file)); + } finally { + setAttribute(file, "dos:hidden", false); + } + } finally { + delete(file); + } + } else { + assertTrue(isHidden(file)); + } + } + + /** + * Tests isSameFile + */ + static void testIsSameFile(Path tmpdir) throws IOException { + Path thisFile = tmpdir.resolve("thisFile"); + Path thatFile = tmpdir.resolve("thatFile"); + + /** + * Test: isSameFile for self + */ + assertTrue(isSameFile(thisFile, thisFile)); + + /** + * Test: Neither files exist + */ + try { + isSameFile(thisFile, thatFile); + throw new RuntimeException("IOException not thrown"); + } catch (IOException x) { + } + try { + isSameFile(thatFile, thisFile); + throw new RuntimeException("IOException not thrown"); + } catch (IOException x) { + } + + createFile(thisFile); + try { + /** + * Test: One file exists + */ try { - Files.createDirectories(file.resolve("y")); - throw new RuntimeException("failure expected"); - } catch (IOException x) { } + isSameFile(thisFile, thatFile); + throw new RuntimeException("IOException not thrown"); + } catch (IOException x) { + } + try { + isSameFile(thatFile, thisFile); + throw new RuntimeException("IOException not thrown"); + } catch (IOException x) { + } + + /** + * Test: Both file exists + */ + createFile(thatFile); + try { + assertTrue(!isSameFile(thisFile, thatFile)); + assertTrue(!isSameFile(thatFile, thisFile)); + } finally { + delete(thatFile); + } + + /** + * Test: Symbolic links + */ + if (TestUtil.supportsLinks(tmpdir)) { + createSymbolicLink(thatFile, thisFile); + try { + assertTrue(isSameFile(thisFile, thatFile)); + assertTrue(isSameFile(thatFile, thisFile)); + } finally { + TestUtil.deleteUnchecked(thatFile); + } + } + } finally { + delete(thisFile); + } + + // nulls + try { + isSameFile(thisFile, null); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + try { + isSameFile(null, thatFile); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException ignore) { } + } + + /** + * Exercise isRegularFile, isDirectory, isSymbolicLink + */ + static void testFileTypeMethods(Path tmpdir) throws IOException { + assertTrue(!isRegularFile(tmpdir)); + assertTrue(!isRegularFile(tmpdir, NOFOLLOW_LINKS)); + assertTrue(isDirectory(tmpdir)); + assertTrue(isDirectory(tmpdir, NOFOLLOW_LINKS)); + assertTrue(!isSymbolicLink(tmpdir)); + + Path file = createFile(tmpdir.resolve("foo")); + try { + assertTrue(isRegularFile(file)); + assertTrue(isRegularFile(file, NOFOLLOW_LINKS)); + assertTrue(!isDirectory(file)); + assertTrue(!isDirectory(file, NOFOLLOW_LINKS)); + assertTrue(!isSymbolicLink(file)); + + if (TestUtil.supportsLinks(tmpdir)) { + Path link = tmpdir.resolve("link"); + + createSymbolicLink(link, tmpdir); + try { + assertTrue(!isRegularFile(link)); + assertTrue(!isRegularFile(link, NOFOLLOW_LINKS)); + assertTrue(isDirectory(link)); + assertTrue(!isDirectory(link, NOFOLLOW_LINKS)); + assertTrue(isSymbolicLink(link)); + } finally { + delete(link); + } + + createSymbolicLink(link, file); + try { + assertTrue(isRegularFile(link)); + assertTrue(!isRegularFile(link, NOFOLLOW_LINKS)); + assertTrue(!isDirectory(link)); + assertTrue(!isDirectory(link, NOFOLLOW_LINKS)); + assertTrue(isSymbolicLink(link)); + } finally { + delete(link); + } + + createLink(link, file); + try { + assertTrue(isRegularFile(link)); + assertTrue(isRegularFile(link, NOFOLLOW_LINKS)); + assertTrue(!isDirectory(link)); + assertTrue(!isDirectory(link, NOFOLLOW_LINKS)); + assertTrue(!isSymbolicLink(link)); + } finally { + delete(link); + } + } } finally { - TestUtil.removeAll(dir); + delete(file); } + } - // --- NullPointerException -- + /** + * Exercise isReadbale, isWritable, isExecutable, exists, notExists + */ + static void testAccessMethods(Path tmpdir) throws IOException { + // should return false when file does not exist + Path doesNotExist = tmpdir.resolve("doesNotExist"); + assertTrue(!isReadable(doesNotExist)); + assertTrue(!isWritable(doesNotExist)); + assertTrue(!isExecutable(doesNotExist)); + assertTrue(!exists(doesNotExist)); + assertTrue(notExists(doesNotExist)); + Path file = createFile(tmpdir.resolve("foo")); try { - Files.probeContentType(null); - npeExpected(); - } catch (NullPointerException e) { - } - try { - Files.walkFileTree(null, EnumSet.noneOf(FileVisitOption.class), - Integer.MAX_VALUE, new SimpleFileVisitor(){}); - npeExpected(); - } catch (NullPointerException e) { - } - try { - Files.walkFileTree(Paths.get("."), null, Integer.MAX_VALUE, - new SimpleFileVisitor(){}); - npeExpected(); - } catch (NullPointerException e) { - } - try { - Files.walkFileTree(Paths.get("."), EnumSet.noneOf(FileVisitOption.class), - -1, new SimpleFileVisitor(){}); - throw new RuntimeException("IllegalArgumentExpected expected"); - } catch (IllegalArgumentException e) { - } - try { - Set opts = new HashSet(1); - opts.add(null); - Files.walkFileTree(Paths.get("."), opts, Integer.MAX_VALUE, - new SimpleFileVisitor(){}); - npeExpected(); - } catch (NullPointerException e) { - } - try { - Files.walkFileTree(Paths.get("."), EnumSet.noneOf(FileVisitOption.class), - Integer.MAX_VALUE, null); - npeExpected(); - } catch (NullPointerException e) { - } + // files exist + assertTrue(isReadable(file)); + assertTrue(isWritable(file)); + assertTrue(exists(file)); + assertTrue(!notExists(file)); + assertTrue(isReadable(tmpdir)); + assertTrue(isWritable(tmpdir)); + assertTrue(exists(tmpdir)); + assertTrue(!notExists(tmpdir)); - SimpleFileVisitor visitor = new SimpleFileVisitor() { }; - boolean ranTheGauntlet = false; - BasicFileAttributes attrs = Attributes.readBasicFileAttributes(Paths.get(".")); - try { visitor.preVisitDirectory(null, attrs); - } catch (NullPointerException x0) { - try { visitor.preVisitDirectory(dir, null); - } catch (NullPointerException x1) { - try { visitor.visitFile(null, attrs); - } catch (NullPointerException x2) { - try { visitor.visitFile(dir, null); - } catch (NullPointerException x3) { - try { visitor.visitFileFailed(null, new IOException()); - } catch (NullPointerException x4) { - try { visitor.visitFileFailed(dir, null); - } catch (NullPointerException x5) { - try { visitor.postVisitDirectory(null, new IOException()); - } catch (NullPointerException x6) { - // if we get here then all visit* methods threw NPE as expected - ranTheGauntlet = true; - }}}}}}} - if (!ranTheGauntlet) - throw new RuntimeException("A visit method did not throw NPE"); + // sym link exists + if (TestUtil.supportsLinks(tmpdir)) { + Path link = tmpdir.resolve("link"); + + createSymbolicLink(link, file); + try { + assertTrue(isReadable(link)); + assertTrue(isWritable(link)); + assertTrue(exists(link)); + assertTrue(!notExists(link)); + } finally { + delete(link); + } + + createSymbolicLink(link, doesNotExist); + try { + assertTrue(!isReadable(link)); + assertTrue(!isWritable(link)); + assertTrue(!exists(link)); + assertTrue(exists(link, NOFOLLOW_LINKS)); + assertTrue(notExists(link)); + assertTrue(!notExists(link, NOFOLLOW_LINKS)); + } finally { + delete(link); + } + } + + /** + * Test: Edit ACL to deny WRITE and EXECUTE + */ + if (getFileStore(file).supportsFileAttributeView("acl")) { + AclFileAttributeView view = + getFileAttributeView(file, AclFileAttributeView.class); + UserPrincipal owner = view.getOwner(); + List acl = view.getAcl(); + + // Insert entry to deny WRITE and EXECUTE + AclEntry entry = AclEntry.newBuilder() + .setType(AclEntryType.DENY) + .setPrincipal(owner) + .setPermissions(AclEntryPermission.WRITE_DATA, + AclEntryPermission.EXECUTE) + .build(); + acl.add(0, entry); + view.setAcl(acl); + try { + assertTrue(!isWritable(file)); + assertTrue(!isExecutable(file)); + } finally { + // Restore ACL + acl.remove(0); + view.setAcl(acl); + } + } + + /** + * Test: Windows DOS read-only attribute + */ + if (System.getProperty("os.name").startsWith("Windows")) { + setAttribute(file, "dos:readonly", true); + try { + assertTrue(!isWritable(file)); + } finally { + setAttribute(file, "dos:readonly", false); + } + + // Read-only attribute does not make direcory read-only + DosFileAttributeView view = + getFileAttributeView(tmpdir, DosFileAttributeView.class); + boolean save = view.readAttributes().isReadOnly(); + view.setReadOnly(true); + try { + assertTrue(isWritable(file)); + } finally { + view.setReadOnly(save); + } + } + } finally { + delete(file); + } + } + + static void assertTrue(boolean okay) { + if (!okay) + throw new RuntimeException("Assertion Failed"); } } diff --git a/jdk/test/java/nio/file/Path/PassThroughFileSystem.java b/jdk/test/java/nio/file/Files/PassThroughFileSystem.java similarity index 74% rename from jdk/test/java/nio/file/Path/PassThroughFileSystem.java rename to jdk/test/java/nio/file/Files/PassThroughFileSystem.java index 4e77d12aba3..31345a8bf36 100644 --- a/jdk/test/java/nio/file/Path/PassThroughFileSystem.java +++ b/jdk/test/java/nio/file/Files/PassThroughFileSystem.java @@ -54,6 +54,14 @@ class PassThroughFileSystem extends FileSystem { return provider.newFileSystem(uri, env); } + static Path unwrap(Path wrapper) { + if (wrapper == null) + throw new NullPointerException(); + if (!(wrapper instanceof PassThroughPath)) + throw new ProviderMismatchException(); + return ((PassThroughPath)wrapper).delegate; + } + @Override public FileSystemProvider provider() { return provider; @@ -117,8 +125,8 @@ class PassThroughFileSystem extends FileSystem { } @Override - public Path getPath(String path) { - return new PassThroughPath(this, delegate.getPath(path)); + public Path getPath(String first, String... more) { + return new PassThroughPath(this, delegate.getPath(first, more)); } @Override @@ -127,7 +135,7 @@ class PassThroughFileSystem extends FileSystem { return new PathMatcher() { @Override public boolean matches(Path path) { - return matcher.matches(PassThroughPath.unwrap(path)); + return matcher.matches(unwrap(path)); } }; } @@ -199,9 +207,154 @@ class PassThroughFileSystem extends FileSystem { uri.getSchemeSpecificPart()); return new PassThroughPath(delegate, delegate.provider().getPath(uri)); } + + @Override + public void setAttribute(Path file, String attribute, Object value, LinkOption... options) + throws IOException + { + Files.setAttribute(unwrap(file), attribute, value, options); + } + + @Override + public Map readAttributes(Path file, String attributes, LinkOption... options) + throws IOException + { + return Files.readAttributes(unwrap(file), attributes, options); + } + + @Override + public V getFileAttributeView(Path file, + Class type, + LinkOption... options) + { + return Files.getFileAttributeView(unwrap(file), type, options); + } + + @Override + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + return Files.readAttributes(unwrap(file), type, options); + } + + @Override + public void delete(Path file) throws IOException { + Files.delete(unwrap(file)); + } + + @Override + public void createSymbolicLink(Path link, Path target, FileAttribute... attrs) + throws IOException + { + Files.createSymbolicLink(unwrap(link), unwrap(target), attrs); + } + + @Override + public void createLink(Path link, Path existing) throws IOException { + Files.createLink(unwrap(link), unwrap(existing)); + } + + @Override + public Path readSymbolicLink(Path link) throws IOException { + Path target = Files.readSymbolicLink(unwrap(link)); + return new PassThroughPath(delegate, target); + } + + + @Override + public void copy(Path source, Path target, CopyOption... options) throws IOException { + Files.copy(unwrap(source), unwrap(target), options); + } + + @Override + public void move(Path source, Path target, CopyOption... options) throws IOException { + Files.move(unwrap(source), unwrap(target), options); + } + + private DirectoryStream wrap(final DirectoryStream stream) { + return new DirectoryStream() { + @Override + public Iterator iterator() { + final Iterator itr = stream.iterator(); + return new Iterator() { + @Override + public boolean hasNext() { + return itr.hasNext(); + } + @Override + public Path next() { + return new PassThroughPath(delegate, itr.next()); + } + @Override + public void remove() { + itr.remove(); + } + }; + } + @Override + public void close() throws IOException { + stream.close(); + } + }; + } + + @Override + public DirectoryStream newDirectoryStream(Path dir, DirectoryStream.Filter filter) + throws IOException + { + return wrap(Files.newDirectoryStream(dir, filter)); + } + + @Override + public void createDirectory(Path dir, FileAttribute... attrs) + throws IOException + { + Files.createDirectory(unwrap(dir), attrs); + } + + @Override + public SeekableByteChannel newByteChannel(Path file, + Set options, + FileAttribute... attrs) + throws IOException + { + return Files.newByteChannel(unwrap(file), options, attrs); + } + + + @Override + public boolean isHidden(Path file) throws IOException { + return Files.isHidden(unwrap(file)); + } + + @Override + public FileStore getFileStore(Path file) throws IOException { + return Files.getFileStore(unwrap(file)); + } + + @Override + public boolean isSameFile(Path file, Path other) throws IOException { + return Files.isSameFile(unwrap(file), unwrap(other)); + } + + @Override + public void checkAccess(Path file, AccessMode... modes) + throws IOException + { + // hack + if (modes.length == 0) { + if (Files.exists(unwrap(file))) + return; + else + throw new NoSuchFileException(file.toString()); + } + throw new RuntimeException("not implemented yet"); + } } - static class PassThroughPath extends Path { + static class PassThroughPath implements Path { private final FileSystem fs; private final Path delegate; @@ -214,12 +367,6 @@ class PassThroughFileSystem extends FileSystem { return (path != null) ? new PassThroughPath(fs, path) : null; } - static Path unwrap(Path wrapper) { - if (!(wrapper instanceof PassThroughPath)) - throw new ProviderMismatchException(); - return ((PassThroughPath)wrapper).delegate; - } - @Override public FileSystem getFileSystem() { return fs; @@ -235,12 +382,6 @@ class PassThroughFileSystem extends FileSystem { return wrap(delegate.getRoot()); } - - @Override - public Path getName() { - return wrap(delegate.getName()); - } - @Override public Path getParent() { return wrap(delegate.getParent()); @@ -251,6 +392,11 @@ class PassThroughFileSystem extends FileSystem { return delegate.getNameCount(); } + @Override + public Path getFileName() { + return wrap(delegate.getFileName()); + } + @Override public Path getName(int index) { return wrap(delegate.getName(index)); @@ -266,11 +412,21 @@ class PassThroughFileSystem extends FileSystem { return delegate.startsWith(unwrap(other)); } + @Override + public boolean startsWith(String other) { + return delegate.startsWith(other); + } + @Override public boolean endsWith(Path other) { return delegate.endsWith(unwrap(other)); } + @Override + public boolean endsWith(String other) { + return delegate.endsWith(other); + } + @Override public Path normalize() { return wrap(delegate.normalize()); @@ -286,68 +442,36 @@ class PassThroughFileSystem extends FileSystem { return wrap(delegate.resolve(other)); } + @Override + public Path resolveSibling(Path other) { + return wrap(delegate.resolveSibling(unwrap(other))); + } + + @Override + public Path resolveSibling(String other) { + return wrap(delegate.resolveSibling(other)); + } + @Override public Path relativize(Path other) { return wrap(delegate.relativize(unwrap(other))); } @Override - public void setAttribute(String attribute, Object value, LinkOption... options) - throws IOException - { - delegate.setAttribute(attribute, value, options); + public boolean equals(Object other) { + if (!(other instanceof PassThroughPath)) + return false; + return delegate.equals(unwrap((PassThroughPath)other)); } @Override - public Object getAttribute(String attribute, LinkOption... options) - throws IOException - { - // assume that unwrapped objects aren't exposed - return delegate.getAttribute(attribute, options); + public int hashCode() { + return delegate.hashCode(); } @Override - public Map readAttributes(String attributes, LinkOption... options) - throws IOException - { - // assume that unwrapped objects aren't exposed - return delegate.readAttributes(attributes, options); - } - - @Override - public V getFileAttributeView(Class type, - LinkOption... options) - { - return delegate.getFileAttributeView(type, options); - } - - @Override - public void delete() throws IOException { - delegate.delete(); - } - - @Override - public void deleteIfExists() throws IOException { - delegate.deleteIfExists(); - } - - @Override - public Path createSymbolicLink(Path target, FileAttribute... attrs) - throws IOException - { - delegate.createSymbolicLink(unwrap(target), attrs); - return this; - } - - @Override - public Path createLink(Path existing) throws IOException { - delegate.createLink(unwrap(existing)); - return this; - } - - @Override - public Path readSymbolicLink() throws IOException { - return wrap(delegate.readSymbolicLink()); + public String toString() { + return delegate.toString(); } @Override @@ -367,143 +491,10 @@ class PassThroughFileSystem extends FileSystem { } @Override - public Path copyTo(Path target, CopyOption... options) throws IOException { - return wrap(delegate.copyTo(unwrap(target), options)); + public File toFile() { + return delegate.toFile(); } - @Override - public Path moveTo(Path target, CopyOption... options) throws IOException { - return wrap(delegate.copyTo(unwrap(target), options)); - } - - private DirectoryStream wrap(final DirectoryStream stream) { - return new DirectoryStream() { - @Override - public Iterator iterator() { - final Iterator itr = stream.iterator(); - return new Iterator() { - @Override - public boolean hasNext() { - return itr.hasNext(); - } - @Override - public Path next() { - return wrap(itr.next()); - } - @Override - public void remove() { - itr.remove(); - } - }; - } - @Override - public void close() throws IOException { - stream.close(); - } - }; - } - - @Override - public DirectoryStream newDirectoryStream() throws IOException { - return wrap(delegate.newDirectoryStream()); - } - - @Override - public DirectoryStream newDirectoryStream(String glob) - throws IOException - { - return wrap(delegate.newDirectoryStream(glob)); - } - - @Override - public DirectoryStream newDirectoryStream(DirectoryStream.Filter filter) - throws IOException - { - return wrap(delegate.newDirectoryStream(filter)); - } - - @Override - public Path createFile(FileAttribute... attrs) throws IOException { - delegate.createFile(attrs); - return this; - } - - @Override - public Path createDirectory(FileAttribute... attrs) - throws IOException - { - delegate.createDirectory(attrs); - return this; - } - - @Override - public SeekableByteChannel newByteChannel(Set options, - FileAttribute... attrs) - throws IOException - { - return delegate.newByteChannel(options, attrs); - } - - @Override - public SeekableByteChannel newByteChannel(OpenOption... options) - throws IOException - { - return delegate.newByteChannel(options); - } - - @Override - public InputStream newInputStream(OpenOption... options) throws IOException { - return delegate.newInputStream(); - } - - @Override - public OutputStream newOutputStream(OpenOption... options) - throws IOException - { - return delegate.newOutputStream(options); - } - - @Override - public boolean isHidden() throws IOException { - return delegate.isHidden(); - } - - @Override - public void checkAccess(AccessMode... modes) throws IOException { - delegate.checkAccess(modes); - } - - @Override - public boolean exists() { - return delegate.exists(); - } - - @Override - public boolean notExists() { - return delegate.notExists(); - } - - @Override - public FileStore getFileStore() throws IOException { - return delegate.getFileStore(); - } - - @Override - public WatchKey register(WatchService watcher, - WatchEvent.Kind[] events, - WatchEvent.Modifier... modifiers) - { - throw new UnsupportedOperationException(); - } - - @Override - public WatchKey register(WatchService watcher, - WatchEvent.Kind... events) - { - throw new UnsupportedOperationException(); - } - - @Override public Iterator iterator() { final Iterator itr = delegate.iterator(); @@ -529,26 +520,18 @@ class PassThroughFileSystem extends FileSystem { } @Override - public boolean isSameFile(Path other) throws IOException { - return delegate.isSameFile(unwrap(other)); - } - - - @Override - public boolean equals(Object other) { - if (!(other instanceof PassThroughPath)) - return false; - return delegate.equals(unwrap((PassThroughPath)other)); + public WatchKey register(WatchService watcher, + WatchEvent.Kind[] events, + WatchEvent.Modifier... modifiers) + { + throw new UnsupportedOperationException(); } @Override - public int hashCode() { - return delegate.hashCode(); - } - - @Override - public String toString() { - return delegate.toString(); + public WatchKey register(WatchService watcher, + WatchEvent.Kind... events) + { + throw new UnsupportedOperationException(); } } } diff --git a/jdk/test/java/nio/file/Path/SBC.java b/jdk/test/java/nio/file/Files/SBC.java similarity index 74% rename from jdk/test/java/nio/file/Path/SBC.java rename to jdk/test/java/nio/file/Files/SBC.java index 8a5501b3549..6dcf1a92fc0 100644 --- a/jdk/test/java/nio/file/Path/SBC.java +++ b/jdk/test/java/nio/file/Files/SBC.java @@ -23,7 +23,7 @@ /* @test * @bug 4313887 - * @summary Unit test for java.nio.file.Path.newByteChannel + * @summary Unit test for java.nio.file.Files.newByteChannel * @library .. */ @@ -75,24 +75,24 @@ public class SBC { // CREATE try { // create file (no existing file) - file.newByteChannel(CREATE, WRITE).close(); - if (file.notExists()) + Files.newByteChannel(file, CREATE, WRITE).close(); + if (Files.notExists(file)) throw new RuntimeException("File not created"); // create file (existing file) - file.newByteChannel(CREATE, WRITE).close(); + Files.newByteChannel(file, CREATE, WRITE).close(); // create file where existing file is a sym link if (supportsLinks) { - Path link = dir.resolve("link").createSymbolicLink(file); + Path link = Files.createSymbolicLink(dir.resolve("link"), file); try { // file already exists - link.newByteChannel(CREATE, WRITE).close(); + Files.newByteChannel(link, CREATE, WRITE).close(); // file does not exist - file.delete(); - link.newByteChannel(CREATE, WRITE).close(); - if (file.notExists()) + Files.delete(file); + Files.newByteChannel(link, CREATE, WRITE).close(); + if (Files.notExists(file)) throw new RuntimeException("File not created"); } finally { @@ -107,14 +107,14 @@ public class SBC { // CREATE_NEW try { // create file - file.newByteChannel(CREATE_NEW, WRITE).close(); - if (file.notExists()) + Files.newByteChannel(file, CREATE_NEW, WRITE).close(); + if (Files.notExists(file)) throw new RuntimeException("File not created"); // create should fail try { SeekableByteChannel sbc = - file.newByteChannel(CREATE_NEW, WRITE); + Files.newByteChannel(file, CREATE_NEW, WRITE); sbc.close(); throw new RuntimeException("FileAlreadyExistsException not thrown"); } catch (FileAlreadyExistsException x) { } @@ -123,12 +123,12 @@ public class SBC { if (supportsLinks) { Path link = dir.resolve("link"); Path target = dir.resolve("thisDoesNotExist"); - link.createSymbolicLink(target); + Files.createSymbolicLink(link, target); try { try { SeekableByteChannel sbc = - file.newByteChannel(CREATE_NEW, WRITE); + Files.newByteChannel(file, CREATE_NEW, WRITE); sbc.close(); throw new RuntimeException("FileAlreadyExistsException not thrown"); } catch (FileAlreadyExistsException x) { } @@ -145,17 +145,13 @@ public class SBC { // CREATE_NEW + SPARSE try { - SeekableByteChannel sbc = file - .newByteChannel(CREATE_NEW, WRITE, SPARSE); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, CREATE_NEW, WRITE, SPARSE)) { final long hole = 2L * 1024L * 1024L * 1024L; sbc.position(hole); write(sbc, "hello"); long size = sbc.size(); if (size != (hole + 5)) throw new RuntimeException("Unexpected size"); - } finally { - sbc.close(); } } finally { TestUtil.deleteUnchecked(file); @@ -167,33 +163,23 @@ public class SBC { Path file = dir.resolve("foo"); try { // "hello there" should be written to file - SeekableByteChannel sbc = file - .newByteChannel(CREATE_NEW, WRITE, APPEND); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, CREATE_NEW, WRITE, APPEND)) { write(sbc, "hello "); sbc.position(0L); write(sbc, "there"); - } finally { - sbc.close(); } // check file - Scanner s = new Scanner(file); - try { + try (Scanner s = new Scanner(file)) { String line = s.nextLine(); if (!line.equals("hello there")) throw new RuntimeException("Unexpected file contents"); - } finally { - s.close(); } // check that read is not allowed - sbc = file.newByteChannel(APPEND); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, APPEND)) { sbc.read(ByteBuffer.allocate(100)); } catch (NonReadableChannelException x) { - } finally { - sbc.close(); } } finally { // clean-up @@ -205,40 +191,27 @@ public class SBC { static void truncateExistingTests(Path dir) throws Exception { Path file = dir.resolve("foo"); try { - SeekableByteChannel sbc = - file.newByteChannel(CREATE_NEW, WRITE); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, CREATE_NEW, WRITE)) { write(sbc, "Have a nice day!"); - } finally { - sbc.close(); } // re-open with truncate option // write short message and check - sbc = file.newByteChannel(WRITE, TRUNCATE_EXISTING); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, WRITE, TRUNCATE_EXISTING)) { write(sbc, "Hello there!"); - } finally { - sbc.close(); } - Scanner s = new Scanner(file); - try { + try (Scanner s = new Scanner(file)) { String line = s.nextLine(); if (!line.equals("Hello there!")) throw new RuntimeException("Unexpected file contents"); - } finally { - s.close(); } // re-open with create + truncate option // check file is of size 0L - sbc = file.newByteChannel(WRITE, CREATE, TRUNCATE_EXISTING); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, WRITE, CREATE, TRUNCATE_EXISTING)) { long size = ((FileChannel)sbc).size(); if (size != 0L) throw new RuntimeException("File not truncated"); - } finally { - sbc.close(); } } finally { @@ -252,14 +225,15 @@ public class SBC { static void noFollowLinksTests(Path dir) throws Exception { if (!supportsLinks) return; - Path file = dir.resolve("foo").createFile(); + Path file = Files.createFile(dir.resolve("foo")); try { // ln -s foo link - Path link = dir.resolve("link").createSymbolicLink(file); + Path link = dir.resolve("link"); + Files.createSymbolicLink(link, file); // open with NOFOLLOW_LINKS option try { - link.newByteChannel(READ, LinkOption.NOFOLLOW_LINKS); + Files.newByteChannel(link, READ, LinkOption.NOFOLLOW_LINKS); throw new RuntimeException(); } catch (IOException x) { } finally { @@ -276,9 +250,7 @@ public class SBC { static void sizeTruncatePositionTests(Path dir) throws Exception { Path file = dir.resolve("foo"); try { - SeekableByteChannel sbc = file - .newByteChannel(CREATE_NEW, READ, WRITE); - try { + try (SeekableByteChannel sbc = Files.newByteChannel(file, CREATE_NEW, READ, WRITE)) { if (sbc.size() != 0L) throw new RuntimeException("Unexpected size"); @@ -300,8 +272,6 @@ public class SBC { throw new RuntimeException("Unexpected size"); if (sbc.position() != 2L) throw new RuntimeException("Unexpected position"); - } finally { - sbc.close(); } } finally { TestUtil.deleteUnchecked(file); @@ -311,76 +281,63 @@ public class SBC { // Windows specific options for the use by applications that really want // to use legacy DOS sharing options static void dosSharingOptionTests(Path dir) throws Exception { - Path file = dir.resolve("foo").createFile(); + Path file = Files.createFile(dir.resolve("foo")); try { - SeekableByteChannel ch; - // no sharing - ch = file.newByteChannel(READ, - NOSHARE_READ, NOSHARE_WRITE, NOSHARE_DELETE); - try { + try (SeekableByteChannel ch = Files.newByteChannel(file, READ, NOSHARE_READ, + NOSHARE_WRITE, NOSHARE_DELETE)) + { try { - file.newByteChannel(READ); + Files.newByteChannel(file, READ); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } try { - file.newByteChannel(WRITE); + Files.newByteChannel(file, WRITE); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } try { - file.delete(); + Files.delete(file); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } - } finally { - ch.close(); } // read allowed - ch = file.newByteChannel(READ, NOSHARE_WRITE, NOSHARE_DELETE); - try { - file.newByteChannel(READ).close(); + try (SeekableByteChannel ch = Files.newByteChannel(file, READ, NOSHARE_WRITE, NOSHARE_DELETE)) { + Files.newByteChannel(file, READ).close(); try { - file.newByteChannel(WRITE); + Files.newByteChannel(file, WRITE); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } try { - file.delete(); + Files.delete(file); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } - } finally { - ch.close(); } // write allowed - ch = file.newByteChannel(READ, NOSHARE_READ, NOSHARE_DELETE); - try { + try (SeekableByteChannel ch = Files.newByteChannel(file, READ, NOSHARE_READ, NOSHARE_DELETE)) { try { - file.newByteChannel(READ); + Files.newByteChannel(file, READ); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } - file.newByteChannel(WRITE).close(); + Files.newByteChannel(file, WRITE).close(); try { - file.delete(); + Files.delete(file); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } - } finally { - ch.close(); } // delete allowed - ch = file.newByteChannel(READ, NOSHARE_READ, NOSHARE_WRITE); - try { + try (SeekableByteChannel ch = Files.newByteChannel(file, READ, NOSHARE_READ, NOSHARE_WRITE)) { try { - file.newByteChannel(READ); + Files.newByteChannel(file, READ); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } try { - file.newByteChannel(WRITE); + Files.newByteChannel(file, WRITE); throw new RuntimeException("Sharing violation expected"); } catch (IOException ignore) { } - file.delete(); - } finally { - ch.close(); + Files.delete(file); } } finally { @@ -393,12 +350,12 @@ public class SBC { Path file = dir.resolve("bad"); try { - file.newByteChannel(READ, APPEND); + Files.newByteChannel(file, READ, APPEND); throw new RuntimeException("IllegalArgumentException expected"); } catch (IllegalArgumentException x) { } try { - file.newByteChannel(WRITE, APPEND, TRUNCATE_EXISTING); + Files.newByteChannel(file, WRITE, APPEND, TRUNCATE_EXISTING); throw new RuntimeException("IllegalArgumentException expected"); } catch (IllegalArgumentException x) { } } @@ -409,11 +366,11 @@ public class SBC { OpenOption badOption = new OpenOption() { }; try { - file.newByteChannel(badOption); + Files.newByteChannel(file, badOption); throw new RuntimeException("UnsupportedOperationException expected"); } catch (UnsupportedOperationException e) { } try { - file.newByteChannel(READ, WRITE, badOption); + Files.newByteChannel(file, READ, WRITE, badOption); throw new RuntimeException("UnsupportedOperationException expected"); } catch (UnsupportedOperationException e) { } } @@ -423,39 +380,45 @@ public class SBC { Path file = dir.resolve("foo"); try { - file.newByteChannel((OpenOption[])null); + OpenOption[] opts = { READ, null }; + Files.newByteChannel((Path)null, opts); + throw new RuntimeException("NullPointerException expected"); + } catch (NullPointerException x) { } + + try { + Files.newByteChannel(file, (OpenOption[])null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { OpenOption[] opts = { READ, null }; - file.newByteChannel(opts); + Files.newByteChannel(file, opts); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { - file.newByteChannel((Set)null); + Files.newByteChannel(file, (Set)null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { - Set opts = new HashSet(); + Set opts = new HashSet<>(); opts.add(READ); opts.add(null); - file.newByteChannel(opts); + Files.newByteChannel(file, opts); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { EnumSet opts = EnumSet.of(READ); - file.newByteChannel(opts, (FileAttribute[])null); + Files.newByteChannel(file, opts, (FileAttribute[])null); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } try { EnumSet opts = EnumSet.of(READ); FileAttribute[] attrs = { null }; - file.newByteChannel(opts, attrs); + Files.newByteChannel(file, opts, attrs); throw new RuntimeException("NullPointerException expected"); } catch (NullPointerException x) { } } diff --git a/jdk/test/java/nio/file/Files/TemporaryFiles.java b/jdk/test/java/nio/file/Files/TemporaryFiles.java new file mode 100644 index 00000000000..3c1087e4e53 --- /dev/null +++ b/jdk/test/java/nio/file/Files/TemporaryFiles.java @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2008, 2009, 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 4313887 6838333 7006126 + * @summary Unit test for Files.createTempXXX + * @library .. + */ + +import java.nio.file.*; +import static java.nio.file.StandardOpenOption.*; +import java.nio.file.attribute.*; +import java.io.IOException; +import java.util.Set; + +public class TemporaryFiles { + + static void checkInDirectory(Path file, Path dir) { + if (dir == null) + dir = Paths.get(System.getProperty("java.io.tmpdir")); + if (!file.getParent().equals(dir)) + throw new RuntimeException("Not in expected directory"); + } + + static void testTempFile(String prefix, String suffix, Path dir) + throws IOException + { + Path file = (dir == null) ? + Files.createTempFile(prefix, suffix) : + Files.createTempFile(dir, prefix, suffix); + try { + // check file name + String name = file.getFileName().toString(); + if (prefix != null && !name.startsWith(prefix)) + throw new RuntimeException("Should start with " + prefix); + if (suffix == null && !name.endsWith(".tmp")) + throw new RuntimeException("Should end with .tmp"); + if (suffix != null && !name.endsWith(suffix)) + throw new RuntimeException("Should end with " + suffix); + + // check file is in expected directory + checkInDirectory(file, dir); + + // check that file can be opened for reading and writing + Files.newByteChannel(file, READ).close(); + Files.newByteChannel(file, WRITE).close(); + Files.newByteChannel(file, READ,WRITE).close(); + + // check file permissions are 0600 or more secure + if (Files.getFileStore(file).supportsFileAttributeView("posix")) { + Set perms = Files.getPosixFilePermissions(file); + perms.remove(PosixFilePermission.OWNER_READ); + perms.remove(PosixFilePermission.OWNER_WRITE); + if (!perms.isEmpty()) + throw new RuntimeException("Temporary file is not secure"); + } + } finally { + Files.delete(file); + } + } + + static void testTempFile(String prefix, String suffix) + throws IOException + { + testTempFile(prefix, suffix, null); + } + + static void testTempDirectory(String prefix, Path dir) throws IOException { + Path subdir = (dir == null) ? + Files.createTempDirectory(prefix) : + Files.createTempDirectory(dir, prefix); + try { + // check file name + String name = subdir.getFileName().toString(); + if (prefix != null && !name.startsWith(prefix)) + throw new RuntimeException("Should start with " + prefix); + + // check directory is in expected directory + checkInDirectory(subdir, dir); + + // check directory is empty + DirectoryStream stream = Files.newDirectoryStream(subdir); + try { + if (stream.iterator().hasNext()) + throw new RuntimeException("Tempory directory not empty"); + } finally { + stream.close(); + } + + // check that we can create file in directory + Path file = Files.createFile(subdir.resolve("foo")); + try { + Files.newByteChannel(file, READ,WRITE).close(); + } finally { + Files.delete(file); + } + + // check file permissions are 0700 or more secure + if (Files.getFileStore(subdir).supportsFileAttributeView("posix")) { + Set perms = Files.getPosixFilePermissions(subdir); + perms.remove(PosixFilePermission.OWNER_READ); + perms.remove(PosixFilePermission.OWNER_WRITE); + perms.remove(PosixFilePermission.OWNER_EXECUTE); + if (!perms.isEmpty()) + throw new RuntimeException("Temporary directory is not secure"); + } + } finally { + Files.delete(subdir); + } + } + + static void testTempDirectory(String prefix) throws IOException { + testTempDirectory(prefix, null); + } + + static void testInvalidFileTemp(String prefix, String suffix) throws IOException { + try { + Path file = Files.createTempFile(prefix, suffix); + Files.delete(file); + throw new RuntimeException("IllegalArgumentException expected"); + } catch (IllegalArgumentException expected) { } + } + + public static void main(String[] args) throws IOException { + // temporary-file directory + testTempFile("blah", ".dat"); + testTempFile("blah", null); + testTempFile(null, ".dat"); + testTempFile(null, null); + testTempDirectory("blah"); + testTempDirectory(null); + + // a given directory + Path dir = Files.createTempDirectory("tmpdir"); + try { + testTempFile("blah", ".dat", dir); + testTempFile("blah", null, dir); + testTempFile(null, ".dat", dir); + testTempFile(null, null, dir); + testTempDirectory("blah", dir); + testTempDirectory(null, dir); + } finally { + Files.delete(dir); + } + + // invalid prefix and suffix + testInvalidFileTemp("../blah", null); + testInvalidFileTemp("dir/blah", null); + testInvalidFileTemp("blah", ".dat/foo"); + } +} diff --git a/jdk/test/java/nio/file/Path/delete_on_close.sh b/jdk/test/java/nio/file/Files/delete_on_close.sh similarity index 100% rename from jdk/test/java/nio/file/Path/delete_on_close.sh rename to jdk/test/java/nio/file/Files/delete_on_close.sh diff --git a/jdk/test/java/nio/file/Files/ContentType.java b/jdk/test/java/nio/file/Files/probeContentType/Basic.java similarity index 85% rename from jdk/test/java/nio/file/Files/ContentType.java rename to jdk/test/java/nio/file/Files/probeContentType/Basic.java index 33a0aeb6e14..ce692121d1c 100644 --- a/jdk/test/java/nio/file/Files/ContentType.java +++ b/jdk/test/java/nio/file/Files/probeContentType/Basic.java @@ -24,9 +24,9 @@ /* @test * @bug 4313887 * @summary Unit test for probeContentType method - * @library .. - * @build ContentType SimpleFileTypeDetector - * @run main/othervm ContentType + * @library ../.. + * @build Basic SimpleFileTypeDetector + * @run main/othervm Basic */ import java.nio.file.*; @@ -36,22 +36,19 @@ import java.io.*; * Uses Files.probeContentType to probe html file and custom file type. */ -public class ContentType { +public class Basic { static Path createHtmlFile() throws IOException { - Path file = File.createTempFile("foo", ".html").toPath(); - OutputStream out = file.newOutputStream(); - try { + Path file = Files.createTempFile("foo", ".html"); + try (OutputStream out = Files.newOutputStream(file)) { out.write("foo".getBytes()); - } finally { - out.close(); } return file; } static Path createGrapeFile() throws IOException { - return File.createTempFile("red", ".grape").toPath(); + return Files.createTempFile("red", ".grape"); } public static void main(String[] args) throws IOException { @@ -67,7 +64,7 @@ public class ContentType { throw new RuntimeException("Unexpected type: " + type); } } finally { - file.delete(); + Files.delete(file); } // exercise custom file type detector @@ -79,7 +76,7 @@ public class ContentType { if (!type.equals("grape/unknown")) throw new RuntimeException("Unexpected type: " + type); } finally { - file.delete(); + Files.delete(file); } } diff --git a/jdk/test/java/nio/file/Files/ForceLoad.java b/jdk/test/java/nio/file/Files/probeContentType/ForceLoad.java similarity index 100% rename from jdk/test/java/nio/file/Files/ForceLoad.java rename to jdk/test/java/nio/file/Files/probeContentType/ForceLoad.java diff --git a/jdk/test/java/nio/file/Files/META-INF/services/java.nio.file.spi.FileTypeDetector b/jdk/test/java/nio/file/Files/probeContentType/META-INF/services/java.nio.file.spi.FileTypeDetector similarity index 100% rename from jdk/test/java/nio/file/Files/META-INF/services/java.nio.file.spi.FileTypeDetector rename to jdk/test/java/nio/file/Files/probeContentType/META-INF/services/java.nio.file.spi.FileTypeDetector diff --git a/jdk/test/java/nio/file/Files/SimpleFileTypeDetector.java b/jdk/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.java similarity index 81% rename from jdk/test/java/nio/file/Files/SimpleFileTypeDetector.java rename to jdk/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.java index 590d9a474c1..a6b0e76ecd8 100644 --- a/jdk/test/java/nio/file/Files/SimpleFileTypeDetector.java +++ b/jdk/test/java/nio/file/Files/probeContentType/SimpleFileTypeDetector.java @@ -30,18 +30,9 @@ public class SimpleFileTypeDetector extends FileTypeDetector { public SimpleFileTypeDetector() { } - public String probeContentType(FileRef file) throws IOException { - + public String probeContentType(Path file) throws IOException { System.out.println("probe " + file + "..."); - - if (file instanceof Path) { - String name = ((Path)file).toString(); - if (name.endsWith(".grape")) { - return "grape/unknown"; - } - } - - // unknown - return null; + String name = file.toString(); + return name.endsWith(".grape") ? "grape/unknown" : null; } } diff --git a/jdk/test/java/nio/file/Files/CreateFileTree.java b/jdk/test/java/nio/file/Files/walkFileTree/CreateFileTree.java similarity index 81% rename from jdk/test/java/nio/file/Files/CreateFileTree.java rename to jdk/test/java/nio/file/Files/walkFileTree/CreateFileTree.java index 1ff7aa6e91b..c00f058152d 100644 --- a/jdk/test/java/nio/file/Files/CreateFileTree.java +++ b/jdk/test/java/nio/file/Files/walkFileTree/CreateFileTree.java @@ -34,21 +34,8 @@ public class CreateFileTree { static final Random rand = new Random(); - public static Path createTemporaryDirectory() throws IOException { - Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir")); - Path dir; - do { - dir = tmpdir.resolve("name" + rand.nextInt()); - } while (dir.exists()); - dir.createDirectory(); - return dir; - } - public static void main(String[] args) throws IOException { - Path top = createTemporaryDirectory(); - if (!top.isAbsolute()) - top = top.toAbsolutePath(); - + Path top = Files.createTempDirectory("tree"); List dirs = new ArrayList(); // create tree @@ -61,7 +48,7 @@ public class CreateFileTree { int r = Math.min((total-n), (1+rand.nextInt(3))); for (int i=0; i(){}); + npeExpected(); + } catch (NullPointerException e) { + } + try { + Files.walkFileTree(Paths.get("."), null, Integer.MAX_VALUE, + new SimpleFileVisitor(){}); + npeExpected(); + } catch (NullPointerException e) { + } + try { + Files.walkFileTree(Paths.get("."), EnumSet.noneOf(FileVisitOption.class), + -1, new SimpleFileVisitor(){}); + throw new RuntimeException("IllegalArgumentExpected expected"); + } catch (IllegalArgumentException e) { + } + try { + Set opts = new HashSet<>(1); + opts.add(null); + Files.walkFileTree(Paths.get("."), opts, Integer.MAX_VALUE, + new SimpleFileVisitor(){}); + npeExpected(); + } catch (NullPointerException e) { + } + try { + Files.walkFileTree(Paths.get("."), EnumSet.noneOf(FileVisitOption.class), + Integer.MAX_VALUE, null); + npeExpected(); + } catch (NullPointerException e) { + } + + SimpleFileVisitor visitor = new SimpleFileVisitor() { }; + boolean ranTheGauntlet = false; + Path dir = Paths.get("."); + BasicFileAttributes attrs = Files.readAttributes(dir, BasicFileAttributes.class); + + try { visitor.preVisitDirectory(null, attrs); + } catch (NullPointerException x0) { + try { visitor.preVisitDirectory(dir, null); + } catch (NullPointerException x1) { + try { visitor.visitFile(null, attrs); + } catch (NullPointerException x2) { + try { visitor.visitFile(dir, null); + } catch (NullPointerException x3) { + try { visitor.visitFileFailed(null, new IOException()); + } catch (NullPointerException x4) { + try { visitor.visitFileFailed(dir, null); + } catch (NullPointerException x5) { + try { visitor.postVisitDirectory(null, new IOException()); + } catch (NullPointerException x6) { + // if we get here then all visit* methods threw NPE as expected + ranTheGauntlet = true; + }}}}}}} + if (!ranTheGauntlet) + throw new RuntimeException("A visit method did not throw NPE"); + } +} diff --git a/jdk/test/java/nio/file/Files/PrintFileTree.java b/jdk/test/java/nio/file/Files/walkFileTree/PrintFileTree.java similarity index 89% rename from jdk/test/java/nio/file/Files/PrintFileTree.java rename to jdk/test/java/nio/file/Files/walkFileTree/PrintFileTree.java index 41ddb95a317..83d554dc689 100644 --- a/jdk/test/java/nio/file/Files/PrintFileTree.java +++ b/jdk/test/java/nio/file/Files/walkFileTree/PrintFileTree.java @@ -55,20 +55,20 @@ public class PrintFileTree { options.add(FileVisitOption.FOLLOW_LINKS); final boolean reportCycles = printCycles; - Files.walkFileTree(dir, options, Integer.MAX_VALUE, new FileVisitor() { + Files.walkFileTree(dir, options, Integer.MAX_VALUE, new FileVisitor() { @Override - public FileVisitResult preVisitDirectory(FileRef dir, BasicFileAttributes attrs) { + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { System.out.println(dir); return FileVisitResult.CONTINUE; } @Override - public FileVisitResult visitFile(FileRef file, BasicFileAttributes attrs) { + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { if (!attrs.isDirectory() || reportCycles) System.out.println(file); return FileVisitResult.CONTINUE; } @Override - public FileVisitResult postVisitDirectory(FileRef dir, IOException exc) + public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { if (exc != null) @@ -76,7 +76,7 @@ public class PrintFileTree { return FileVisitResult.CONTINUE; } @Override - public FileVisitResult visitFileFailed(FileRef file, IOException exc) + public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException { if (reportCycles && (exc instanceof FileSystemLoopException)) { diff --git a/jdk/test/java/nio/file/Files/SkipSiblings.java b/jdk/test/java/nio/file/Files/walkFileTree/SkipSiblings.java similarity index 100% rename from jdk/test/java/nio/file/Files/SkipSiblings.java rename to jdk/test/java/nio/file/Files/walkFileTree/SkipSiblings.java diff --git a/jdk/test/java/nio/file/Files/TerminateWalk.java b/jdk/test/java/nio/file/Files/walkFileTree/TerminateWalk.java similarity index 100% rename from jdk/test/java/nio/file/Files/TerminateWalk.java rename to jdk/test/java/nio/file/Files/walkFileTree/TerminateWalk.java diff --git a/jdk/test/java/nio/file/Files/WalkWithSecurity.java b/jdk/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.java similarity index 94% rename from jdk/test/java/nio/file/Files/WalkWithSecurity.java rename to jdk/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.java index 2a1f67f492e..91e61c476be 100644 --- a/jdk/test/java/nio/file/Files/WalkWithSecurity.java +++ b/jdk/test/java/nio/file/Files/walkFileTree/WalkWithSecurity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,14 +47,11 @@ public class WalkWithSecurity { Path dir = Paths.get(testSrc); // Sanity check the environment - if (Paths.get(here).isSameFile(dir)) + if (Files.isSameFile(Paths.get(here), dir)) throw new RuntimeException("Working directory cannot be " + dir); - DirectoryStream stream = dir.newDirectoryStream(); - try { + try (DirectoryStream stream = Files.newDirectoryStream(dir)) { if (!stream.iterator().hasNext()) throw new RuntimeException(testSrc + " is empty"); - } finally { - stream.close(); } // Install security manager with the given policy file diff --git a/jdk/test/java/nio/file/Files/denyAll.policy b/jdk/test/java/nio/file/Files/walkFileTree/denyAll.policy similarity index 100% rename from jdk/test/java/nio/file/Files/denyAll.policy rename to jdk/test/java/nio/file/Files/walkFileTree/denyAll.policy diff --git a/jdk/test/java/nio/file/Files/grantAll.policy b/jdk/test/java/nio/file/Files/walkFileTree/grantAll.policy similarity index 100% rename from jdk/test/java/nio/file/Files/grantAll.policy rename to jdk/test/java/nio/file/Files/walkFileTree/grantAll.policy diff --git a/jdk/test/java/nio/file/Files/grantTopOnly.policy b/jdk/test/java/nio/file/Files/walkFileTree/grantTopOnly.policy similarity index 100% rename from jdk/test/java/nio/file/Files/grantTopOnly.policy rename to jdk/test/java/nio/file/Files/walkFileTree/grantTopOnly.policy diff --git a/jdk/test/java/nio/file/Files/walk_file_tree.sh b/jdk/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh similarity index 100% rename from jdk/test/java/nio/file/Files/walk_file_tree.sh rename to jdk/test/java/nio/file/Files/walkFileTree/walk_file_tree.sh diff --git a/jdk/test/java/nio/file/Path/Misc.java b/jdk/test/java/nio/file/Path/Misc.java index dba06f1dd06..b2bf03e3510 100644 --- a/jdk/test/java/nio/file/Path/Misc.java +++ b/jdk/test/java/nio/file/Path/Misc.java @@ -22,17 +22,13 @@ */ /* @test - * @bug 4313887 6838333 6867101 - * @summary Unit test for java.nio.file.Path for miscellenous methods not - * covered by other tests + * @bug 4313887 6838333 + * @summary Unit test for miscellenous java.nio.file.Path methods * @library .. */ import java.nio.file.*; -import static java.nio.file.LinkOption.*; -import java.nio.file.attribute.*; import java.io.*; -import java.util.*; public class Misc { static final boolean isWindows = @@ -45,22 +41,14 @@ public class Misc { supportsLinks = TestUtil.supportsLinks(dir); // equals and hashCode methods - equalsAndHashCode(); + testEqualsAndHashCode(); - // checkAccess method - checkAccessTests(dir); - - // getFileAttributeView methods - getFileAttributeViewTests(dir); + // toFile method + testToFile(dir); // toRealPath method - toRealPathTests(dir); + testToRealPath(dir); - // isSameFile method - isSameFileTests(dir); - - // isHidden method - isHiddenTests(dir); } finally { TestUtil.removeAll(dir); @@ -70,8 +58,7 @@ public class Misc { /** * Exercise equals and hashCode methods */ - static void equalsAndHashCode() { - + static void testEqualsAndHashCode() { Path thisFile = Paths.get("this"); Path thatFile = Paths.get("that"); @@ -93,172 +80,25 @@ public class Misc { } /** - * Exercise checkAccess method + * Exercise toFile method */ - static void checkAccessTests(Path dir) throws IOException { - final Path file = dir.resolve("foo").createFile(); - - /** - * Test: This directory should readable and writable - */ - dir.checkAccess(); - dir.checkAccess(AccessMode.READ); - dir.checkAccess(AccessMode.WRITE); - dir.checkAccess(AccessMode.READ, AccessMode.WRITE); - - /** - * Test: Check access to all files in all root directories. - * (A useful test on Windows for special files such as pagefile.sys) - */ - for (Path root: FileSystems.getDefault().getRootDirectories()) { - DirectoryStream stream; - try { - stream = root.newDirectoryStream(); - } catch (IOException x) { - continue; // skip root directories that aren't accessible - } - try { - for (Path entry: stream) { - try { - entry.checkAccess(); - } catch (AccessDeniedException ignore) { } - } - } finally { - stream.close(); - } - } - - /** - * Test: File does not exist - */ - Path doesNotExist = dir.resolve("thisDoesNotExists"); - try { - doesNotExist.checkAccess(); - throw new RuntimeException("NoSuchFileException expected"); - } catch (NoSuchFileException x) { - } - try { - doesNotExist.checkAccess(AccessMode.READ); - throw new RuntimeException("NoSuchFileException expected"); - } catch (NoSuchFileException x) { - } - try { - doesNotExist.checkAccess(AccessMode.WRITE); - throw new RuntimeException("NoSuchFileException expected"); - } catch (NoSuchFileException x) { - } - try { - doesNotExist.checkAccess(AccessMode.EXECUTE); - throw new RuntimeException("NoSuchFileException expected"); - } catch (NoSuchFileException x) { - } - - /** - * Test: Edit ACL to deny WRITE and EXECUTE - */ - AclFileAttributeView view = file - .getFileAttributeView(AclFileAttributeView.class); - if (view != null && - file.getFileStore().supportsFileAttributeView("acl")) - { - UserPrincipal owner = view.getOwner(); - List acl = view.getAcl(); - - // Insert entry to deny WRITE and EXECUTE - AclEntry entry = AclEntry.newBuilder() - .setType(AclEntryType.DENY) - .setPrincipal(owner) - .setPermissions(AclEntryPermission.WRITE_DATA, - AclEntryPermission.EXECUTE) - .build(); - acl.add(0, entry); - view.setAcl(acl); - - try { - file.checkAccess(AccessMode.WRITE); - throw new RuntimeException("AccessDeniedException expected"); - } catch (AccessDeniedException x) { - } - - try { - file.checkAccess(AccessMode.EXECUTE); - throw new RuntimeException("AccessDeniedException expected"); - } catch (AccessDeniedException x) { - } - - - // Restore ACL - acl.remove(0); - view.setAcl(acl); - } - - /** - * Test: Windows DOS read-only attribute - */ - if (isWindows) { - DosFileAttributeView dview = - file.getFileAttributeView(DosFileAttributeView.class); - dview.setReadOnly(true); - try { - file.checkAccess(AccessMode.WRITE); - throw new RuntimeException("AccessDeniedException expected"); - } catch (AccessDeniedException x) { - } - dview.setReadOnly(false); - - // Read-only attribute does not make direcory read-only - dview = dir.getFileAttributeView(DosFileAttributeView.class); - boolean save = dview.readAttributes().isReadOnly(); - dview.setReadOnly(true); - dir.checkAccess(AccessMode.WRITE); - dview.setReadOnly(save); - } - - /** - * Test: null - */ - try { - file.checkAccess((AccessMode)null); - throw new RuntimeException("NullPointerException expected"); - } catch (NullPointerException ignore) { } - - // clean-up - file.delete(); + static void testToFile(Path dir) throws IOException { + File d = dir.toFile(); + assertTrue(d.toString().equals(dir.toString())); + assertTrue(d.toPath().equals(dir)); } - /** - * Exercise getFileAttributeFile methods - */ - static void getFileAttributeViewTests(Path dir) { - assertTrue(dir.getFileAttributeView(BasicFileAttributeView.class) - instanceof BasicFileAttributeView); - assertTrue(dir.getFileAttributeView(BasicFileAttributeView.class, NOFOLLOW_LINKS) - instanceof BasicFileAttributeView); - assertTrue(dir.getFileAttributeView(BogusFileAttributeView.class) == null); - try { - dir.getFileAttributeView((Class)null); - } catch (NullPointerException ignore) { } - try { - dir.getFileAttributeView(BasicFileAttributeView.class, (LinkOption[])null); - } catch (NullPointerException ignore) { } - try { - dir.getFileAttributeView(BasicFileAttributeView.class, (LinkOption)null); - } catch (NullPointerException ignore) { } - - } - interface BogusFileAttributeView extends FileAttributeView { } - /** * Exercise toRealPath method */ - static void toRealPathTests(Path dir) throws IOException { - final Path file = dir.resolve("foo").createFile(); + static void testToRealPath(Path dir) throws IOException { + final Path file = Files.createFile(dir.resolve("foo")); final Path link = dir.resolve("link"); /** - * Test: toRealPath(true) will access same file as toRealPath(false) + * Test: totRealPath(true) will access same file as toRealPath(false) */ - assertTrue(file.toRealPath(true).isSameFile(file.toRealPath(false))); + assertTrue(Files.isSameFile(file.toRealPath(true), file.toRealPath(false))); /** * Test: toRealPath should fail if file does not exist @@ -279,29 +119,27 @@ public class Misc { * Test: toRealPath(true) should resolve links */ if (supportsLinks) { - link.createSymbolicLink(file.toAbsolutePath()); + Files.createSymbolicLink(link, file.toAbsolutePath()); assertTrue(link.toRealPath(true).equals(file.toRealPath(true))); - link.delete(); + Files.delete(link); } - /** * Test: toRealPath(false) should not resolve links */ if (supportsLinks) { - link.createSymbolicLink(file.toAbsolutePath()); - assertTrue(link.toRealPath(false).getName().equals(link.getName())); - link.delete(); + Files.createSymbolicLink(link, file.toAbsolutePath()); + assertTrue(link.toRealPath(false).getFileName().equals(link.getFileName())); + Files.delete(link); } /** * Test: toRealPath(false) with broken link */ if (supportsLinks) { - Path broken = dir.resolve("doesNotExist"); - link.createSymbolicLink(broken); - assertTrue(link.toRealPath(false).getName().equals(link.getName())); - link.delete(); + Path broken = Files.createSymbolicLink(link, doesNotExist); + assertTrue(link.toRealPath(false).getFileName().equals(link.getFileName())); + Files.delete(link); } /** @@ -314,105 +152,13 @@ public class Misc { * Test: toRealPath should eliminate ".." when it doesn't follow a * symbolic link */ - Path subdir = dir.resolve("subdir").createDirectory(); + Path subdir = Files.createDirectory(dir.resolve("subdir")); assertTrue(subdir.resolve("..").toRealPath(true).equals(dir.toRealPath(true))); assertTrue(subdir.resolve("..").toRealPath(false).equals(dir.toRealPath(false))); - subdir.delete(); + Files.delete(subdir); // clean-up - file.delete(); - } - - /** - * Exercise isSameFile method - */ - static void isSameFileTests(Path dir) throws IOException { - Path thisFile = dir.resolve("thisFile"); - Path thatFile = dir.resolve("thatFile"); - - /** - * Test: isSameFile for self and null - */ - assertTrue(thisFile.isSameFile(thisFile)); - assertTrue(!thisFile.isSameFile(null)); - - /** - * Test: Neither files exist - */ - try { - thisFile.isSameFile(thatFile); - throw new RuntimeException("IOException not thrown"); - } catch (IOException x) { - } - try { - thatFile.isSameFile(thisFile); - throw new RuntimeException("IOException not thrown"); - } catch (IOException x) { - } - - thisFile.createFile(); - try { - /** - * Test: One file exists - */ - try { - thisFile.isSameFile(thatFile); - throw new RuntimeException("IOException not thrown"); - } catch (IOException x) { - } - try { - thatFile.isSameFile(thisFile); - throw new RuntimeException("IOException not thrown"); - } catch (IOException x) { - } - - thatFile.createFile(); - - /** - * Test: Both file exists - */ - try { - assertTrue(!thisFile.isSameFile(thatFile)); - assertTrue(!thatFile.isSameFile(thisFile)); - } finally { - TestUtil.deleteUnchecked(thatFile); - } - - /** - * Test: Symbolic links - */ - if (supportsLinks) { - thatFile.createSymbolicLink(thisFile); - try { - assertTrue(thisFile.isSameFile(thatFile)); - assertTrue(thatFile.isSameFile(thisFile)); - } finally { - TestUtil.deleteUnchecked(thatFile); - } - } - } finally { - thisFile.delete(); - } - } - - /** - * Exercise isHidden method - */ - static void isHiddenTests(Path dir) throws IOException { - assertTrue(!dir.isHidden()); - - Path file = dir.resolve(".foo"); - if (isWindows) { - file.createFile(); - try { - file.setAttribute("dos:hidden", true); - assertTrue(file.isHidden()); - } finally { - file.delete(); - } - } else { - assertTrue(file.isHidden()); - } + Files.delete(file); } static void assertTrue(boolean okay) { diff --git a/jdk/test/java/nio/file/Path/PathOps.java b/jdk/test/java/nio/file/Path/PathOps.java index fcc02e61a44..00264201201 100644 --- a/jdk/test/java/nio/file/Path/PathOps.java +++ b/jdk/test/java/nio/file/Path/PathOps.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 6838333 6925932 + * @bug 4313887 6838333 6925932 7006126 * @summary Unit test for java.nio.file.Path path operations */ @@ -36,15 +36,15 @@ public class PathOps { private Path path; private Exception exc; - private PathOps(String s) { + private PathOps(String first, String... more) { out.println(); - input = s; + input = first; try { - path = FileSystems.getDefault().getPath(s); - out.format("%s -> %s", s, path); + path = FileSystems.getDefault().getPath(first, more); + out.format("%s -> %s", first, path); } catch (Exception x) { exc = x; - out.format("%s -> %s", s, x); + out.format("%s -> %s", first, x); } out.println(); } @@ -97,7 +97,7 @@ public class PathOps { PathOps name(String expected) { out.println("check name"); checkPath(); - check(path.getName(), expected); + check(path.getFileName(), expected); return this; } @@ -168,6 +168,13 @@ public class PathOps { return this; } + PathOps resolveSibling(String other, String expected) { + out.format("test resolveSibling %s\n", other); + checkPath(); + check(path.resolveSibling(other), expected); + return this; + } + PathOps relativize(String other, String expected) { out.format("test relativize %s\n", other); checkPath(); @@ -198,8 +205,8 @@ public class PathOps { return this; } - static PathOps test(String s) { - return new PathOps(s); + static PathOps test(String first, String... more) { + return new PathOps(first, more); } // -- PathOpss -- @@ -213,6 +220,26 @@ public class PathOps { static void doWindowsTests() { header("Windows specific tests"); + // construction + test("C:\\") + .string("C:\\"); + test("C:\\", "") + .string("C:\\"); + test("C:\\", "foo") + .string("C:\\foo"); + test("C:\\", "\\foo") + .string("C:\\foo"); + test("C:\\", "foo\\") + .string("C:\\foo"); + test("foo", "bar", "gus") + .string("foo\\bar\\gus"); + test("") + .string(""); + test("", "C:\\") + .string("C:\\"); + test("", "foo", "", "bar", "", "\\gus") + .string("foo\\bar\\gus"); + // all components present test("C:\\a\\b\\c") .root("C:\\") @@ -252,17 +279,23 @@ public class PathOps { .root(null) .parent(null) .name("foo"); + test("") + .root(null) + .parent(null) + .name(""); // startsWith test("C:\\") .starts("C:\\") .starts("c:\\") .notStarts("C") - .notStarts("C:"); + .notStarts("C:") + .notStarts(""); test("C:") .starts("C:") .starts("c:") - .notStarts("C"); + .notStarts("C") + .notStarts(""); test("\\") .starts("\\"); test("C:\\foo\\bar") @@ -273,7 +306,8 @@ public class PathOps { .starts("C:\\Foo\\Bar") .notStarts("C:") .notStarts("C") - .notStarts("C:foo"); + .notStarts("C:foo") + .notStarts(""); test("\\foo\\bar") .starts("\\") .starts("\\foo") @@ -281,26 +315,35 @@ public class PathOps { .starts("\\foo\\bar") .starts("\\fOo\\BaR") .notStarts("foo") - .notStarts("foo\\bar"); + .notStarts("foo\\bar") + .notStarts(""); test("foo\\bar") .starts("foo") .starts("foo\\bar") - .notStarts("\\"); + .notStarts("\\") + .notStarts(""); test("\\\\server\\share") .starts("\\\\server\\share") .starts("\\\\server\\share\\") + .notStarts("\\") + .notStarts(""); + test("") + .starts("") .notStarts("\\"); // endsWith test("C:\\") .ends("C:\\") .ends("c:\\") - .notEnds("\\"); + .notEnds("\\") + .notEnds(""); test("C:") .ends("C:") - .ends("c:"); + .ends("c:") + .notEnds(""); test("\\") - .ends("\\"); + .ends("\\") + .notEnds(""); test("C:\\foo\\bar") .ends("bar") .ends("BAR") @@ -309,7 +352,8 @@ public class PathOps { .ends("C:\\foo\\bar") .ends("c:\\foO\\baR") .notEnds("r") - .notEnds("\\foo\\bar"); + .notEnds("\\foo\\bar") + .notEnds(""); test("\\foo\\bar") .ends("bar") .ends("BaR") @@ -317,17 +361,23 @@ public class PathOps { .ends("foO\\baR") .ends("\\foo\\bar") .ends("\\Foo\\Bar") - .notEnds("oo\\bar"); + .notEnds("oo\\bar") + .notEnds(""); test("foo\\bar") .ends("bar") .ends("BAR") .ends("foo\\bar") .ends("Foo\\Bar") - .notEnds("ar"); + .notEnds("ar") + .notEnds(""); test("\\\\server\\share") .ends("\\\\server\\share") .ends("\\\\server\\share\\") .notEnds("shared") + .notEnds("\\") + .notEnds(""); + test("") + .ends("") .notEnds("\\"); // elements @@ -338,6 +388,8 @@ public class PathOps { test("foo.bar\\gus.alice") .element(0, "foo.bar") .element(1, "gus.alice"); + test("") + .element(0, ""); // subpath test("C:\\foo") @@ -355,6 +407,8 @@ public class PathOps { .subpath(2, 3, "gus"); test("\\\\server\\share\\foo") .subpath(0, 1, "foo"); + test("") + .subpath(0, 1, ""); // isAbsolute test("foo").notAbsolute(); @@ -362,6 +416,7 @@ public class PathOps { test("C:\\").absolute(); test("C:\\abc").absolute(); test("\\\\server\\share\\").absolute(); + test("").notAbsolute(); // resolve test("C:\\") @@ -369,42 +424,99 @@ public class PathOps { .resolve("D:\\bar", "D:\\bar") .resolve("\\\\server\\share\\bar", "\\\\server\\share\\bar") .resolve("C:foo", "C:\\foo") - .resolve("D:foo", "D:foo"); + .resolve("D:foo", "D:foo") + .resolve("", "C:\\"); test("\\") .resolve("foo", "\\foo") .resolve("D:bar", "D:bar") .resolve("C:\\bar", "C:\\bar") .resolve("\\\\server\\share\\bar", "\\\\server\\share\\bar") - .resolve("\\foo", "\\foo"); + .resolve("\\foo", "\\foo") + .resolve("", "\\"); test("\\foo") .resolve("bar", "\\foo\\bar") .resolve("D:bar", "D:bar") .resolve("C:\\bar", "C:\\bar") .resolve("\\\\server\\share\\bar", "\\\\server\\share\\bar") - .resolve("\\bar", "\\bar"); + .resolve("\\bar", "\\bar") + .resolve("", "\\foo"); test("foo") .resolve("bar", "foo\\bar") .resolve("D:\\bar", "D:\\bar") .resolve("\\\\server\\share\\bar", "\\\\server\\share\\bar") .resolve("C:bar", "C:bar") - .resolve("D:foo", "D:foo"); + .resolve("D:foo", "D:foo") + .resolve("", "foo"); test("C:") - .resolve("foo", "C:foo"); + .resolve("foo", "C:foo") + .resolve("", "C:"); test("\\\\server\\share\\foo") .resolve("bar", "\\\\server\\share\\foo\\bar") .resolve("\\bar", "\\\\server\\share\\bar") .resolve("D:\\bar", "D:\\bar") .resolve("\\\\other\\share\\bar", "\\\\other\\share\\bar") - .resolve("D:bar", "D:bar"); + .resolve("D:bar", "D:bar") + .resolve("", "\\\\server\\share\\foo"); + test("") + .resolve("", "") + .resolve("foo", "foo") + .resolve("C:\\", "C:\\") + .resolve("C:foo", "C:foo") + .resolve("\\\\server\\share\\bar", "\\\\server\\share\\bar"); + + // resolveSibling + test("foo") + .resolveSibling("bar", "bar") + .resolveSibling("D:\\bar", "D:\\bar") + .resolveSibling("\\\\server\\share\\bar", "\\\\server\\share\\bar") + .resolveSibling("C:bar", "C:bar") + .resolveSibling("D:foo", "D:foo") + .resolveSibling("", ""); + test("foo\\bar") + .resolveSibling("gus", "foo\\gus") + .resolveSibling("D:\\bar", "D:\\bar") + .resolveSibling("\\\\server\\share\\bar", "\\\\server\\share\\bar") + .resolveSibling("C:bar", "C:bar") + .resolveSibling("D:foo", "D:foo") + .resolveSibling("", "foo"); + test("C:\\foo") + .resolveSibling("gus", "C:\\gus") + .resolveSibling("D:\\bar", "D:\\bar") + .resolveSibling("\\\\server\\share\\bar", "\\\\server\\share\\bar") + .resolveSibling("C:bar", "C:\\bar") + .resolveSibling("D:foo", "D:foo") + .resolveSibling("", "C:\\"); + test("C:\\foo\\bar") + .resolveSibling("gus", "C:\\foo\\gus") + .resolveSibling("D:\\bar", "D:\\bar") + .resolveSibling("\\\\server\\share\\bar", "\\\\server\\share\\bar") + .resolveSibling("C:bar", "C:\\foo\\bar") + .resolveSibling("D:foo", "D:foo") + .resolveSibling("", "C:\\foo"); + test("\\\\server\\share\\foo") + .resolveSibling("bar", "\\\\server\\share\\bar") + .resolveSibling("\\bar", "\\\\server\\share\\bar") + .resolveSibling("D:\\bar", "D:\\bar") + .resolveSibling("\\\\other\\share\\bar", "\\\\other\\share\\bar") + .resolveSibling("D:bar", "D:bar") + .resolveSibling("", "\\\\server\\share\\"); + test("") + .resolveSibling("", "") + .resolveSibling("foo", "foo") + .resolveSibling("C:\\", "C:\\"); // relativize test("foo\\bar") - .relativize("foo\\bar", null) + .relativize("foo\\bar", "") .relativize("foo", ".."); test("C:\\a\\b\\c") - .relativize("C:\\a", "..\\.."); + .relativize("C:\\a", "..\\..") + .relativize("C:\\a\\b\\c", ""); test("\\\\server\\share\\foo") - .relativize("\\\\server\\share\\bar", "..\\bar"); + .relativize("\\\\server\\share\\bar", "..\\bar") + .relativize("\\\\server\\share\\foo", ""); + test("") + .relativize("", ""); // normalize test("C:\\") @@ -436,7 +548,7 @@ public class PathOps { test("foo\\.") .normalize("foo"); test("foo\\..") - .normalize(null); + .normalize(""); test("C:\\foo") .normalize("C:\\foo"); test("C:\\foo\\.") @@ -478,7 +590,7 @@ public class PathOps { test("\\..\\foo") .normalize("\\foo"); test(".") - .normalize(null); + .normalize(""); test("..") .normalize(".."); test("\\..\\..") @@ -493,6 +605,8 @@ public class PathOps { .normalize("foo"); test(".\\foo\\.\\bar\\.\\gus\\..\\.\\..") .normalize("foo"); + test("") + .normalize(""); // UNC corner cases test("\\\\server\\share\\") @@ -557,6 +671,26 @@ public class PathOps { static void doUnixTests() { header("Unix specific tests"); + // construction + test("/") + .string("/"); + test("/", "") + .string("/"); + test("/", "foo") + .string("/foo"); + test("/", "/foo") + .string("/foo"); + test("/", "foo/") + .string("/foo"); + test("foo", "bar", "gus") + .string("foo/bar/gus"); + test("") + .string(""); + test("", "/") + .string("/"); + test("", "foo", "", "bar", "", "/gus") + .string("foo/bar/gus"); + // all components test("/a/b/c") .root("/") @@ -580,10 +714,15 @@ public class PathOps { .root(null) .parent(null) .name("foo"); + test("") + .root(null) + .parent(null) + .name(""); // startsWith test("/") .starts("/") + .notStarts("") .notStarts("/foo"); test("/foo") .starts("/") @@ -598,6 +737,7 @@ public class PathOps { .notStarts("foo/bar"); test("foo") .starts("foo") + .notStarts("") .notStarts("f"); test("foo/bar") .starts("foo") @@ -605,10 +745,14 @@ public class PathOps { .notStarts("f") .notStarts("/foo") .notStarts("/foo/bar"); + test("") + .starts("") + .notStarts("/"); // endsWith test("/") .ends("/") + .notEnds("") .notEnds("foo") .notEnds("/foo"); test("/foo") @@ -625,6 +769,7 @@ public class PathOps { .notEnds("o/bar"); test("foo") .ends("foo") + .notEnds("") .notEnds("oo") .notEnds("oola"); test("foo/bar") @@ -642,12 +787,47 @@ public class PathOps { .notEnds("r/gus") .notEnds("barack/gus") .notEnds("bar/gust"); + test("") + .ends("") + .notEnds("/"); // elements test("a/b/c") - .element(0,"a") - .element(1,"b") - .element(2,"c"); + .element(0, "a") + .element(1, "b") + .element(2, "c"); + test("") + .element(0, ""); + + // subpath + test("/foo") + .subpath(0, 1, "foo"); + test("foo") + .subpath(0, 1, "foo"); + test("/foo/bar") + .subpath(0, 1, "foo") + .subpath(1, 2, "bar") + .subpath(0, 2, "foo/bar"); + test("foo/bar") + .subpath(0, 1, "foo") + .subpath(1, 2, "bar") + .subpath(0, 2, "foo/bar"); + test("/foo/bar/gus") + .subpath(0, 1, "foo") + .subpath(1, 2, "bar") + .subpath(2, 3, "gus") + .subpath(0, 2, "foo/bar") + .subpath(1, 3, "bar/gus") + .subpath(0, 3, "foo/bar/gus"); + test("foo/bar/gus") + .subpath(0, 1, "foo") + .subpath(1, 2, "bar") + .subpath(2, 3, "gus") + .subpath(0, 2, "foo/bar") + .subpath(1, 3, "bar/gus") + .subpath(0, 3, "foo/bar/gus"); + test("") + .subpath(0, 1, ""); // isAbsolute test("/") @@ -656,20 +836,61 @@ public class PathOps { .absolute(); test("tmp") .notAbsolute(); + test("") + .notAbsolute(); + // resolve test("/tmp") .resolve("foo", "/tmp/foo") - .resolve("/foo", "/foo"); + .resolve("/foo", "/foo") + .resolve("", "/tmp"); test("tmp") .resolve("foo", "tmp/foo") + .resolve("/foo", "/foo") + .resolve("", "tmp"); + test("") + .resolve("", "") + .resolve("foo", "foo") .resolve("/foo", "/foo"); + // resolveSibling + test("foo") + .resolveSibling("bar", "bar") + .resolveSibling("/bar", "/bar") + .resolveSibling("", ""); + test("foo/bar") + .resolveSibling("gus", "foo/gus") + .resolveSibling("/gus", "/gus") + .resolveSibling("", "foo"); + test("/foo") + .resolveSibling("gus", "/gus") + .resolveSibling("/gus", "/gus") + .resolveSibling("", "/"); + test("/foo/bar") + .resolveSibling("gus", "/foo/gus") + .resolveSibling("/gus", "/gus") + .resolveSibling("", "/foo"); + test("") + .resolveSibling("foo", "foo") + .resolveSibling("/foo", "/foo") + .resolve("", ""); + // relativize test("/a/b/c") - .relativize("/a/b/c", null) + .relativize("/a/b/c", "") .relativize("/a/b/c/d/e", "d/e") - .relativize("/a/x", "../../x"); + .relativize("/a/x", "../../x") + .relativize("/x", "../../../x"); + test("a/b/c") + .relativize("a/b/c/d", "d") + .relativize("a/x", "../../x") + .relativize("x", "../../../x") + .relativize("", "../../.."); + test("") + .relativize("a", "a") + .relativize("a/b/c", "a/b/c") + .relativize("", ""); // normalize test("/") @@ -679,7 +900,7 @@ public class PathOps { test("/foo") .normalize("/foo"); test(".") - .normalize(null); + .normalize(""); test("..") .normalize(".."); test("/..") @@ -691,7 +912,7 @@ public class PathOps { test("./foo") .normalize("foo"); test("foo/..") - .normalize(null); + .normalize(""); test("../foo") .normalize("../foo"); test("../../foo") @@ -717,7 +938,7 @@ public class PathOps { test("//bar\u0000") .invalid(); - // normalization + // normalization of input test("//foo//bar") .string("/foo/bar") .root("/") @@ -749,13 +970,13 @@ public class PathOps { } try { - path.startsWith(null); + path.startsWith((Path)null); throw new RuntimeException("NullPointerException not thrown"); } catch (NullPointerException npe) { } try { - path.endsWith(null); + path.endsWith((Path)null); throw new RuntimeException("NullPointerException not thrown"); } catch (NullPointerException npe) { } diff --git a/jdk/test/java/nio/file/Path/TemporaryFiles.java b/jdk/test/java/nio/file/Path/TemporaryFiles.java deleted file mode 100644 index e7603bf630e..00000000000 --- a/jdk/test/java/nio/file/Path/TemporaryFiles.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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 4313887 6838333 - * @summary Unit test for File.createTemporaryXXX (to be be moved to test/java/io/File) - * @library .. - */ - -import java.nio.file.*; -import static java.nio.file.StandardOpenOption.*; -import java.nio.file.attribute.*; -import java.io.File; -import java.io.IOException; -import java.util.Set; - -public class TemporaryFiles { - - static void checkInTempDirectory(Path file) { - Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir")); - if (!file.getParent().equals(tmpdir)) - throw new RuntimeException("Not in temporary directory"); - } - - static void checkFile(Path file) throws IOException { - // check file is in temporary directory - checkInTempDirectory(file); - - // check that file can be opened for reading and writing - file.newByteChannel(READ).close(); - file.newByteChannel(WRITE).close(); - file.newByteChannel(READ,WRITE).close(); - - // check file permissions are 0600 or more secure - if (file.getFileStore().supportsFileAttributeView("posix")) { - Set perms = Attributes - .readPosixFileAttributes(file).permissions(); - perms.remove(PosixFilePermission.OWNER_READ); - perms.remove(PosixFilePermission.OWNER_WRITE); - if (!perms.isEmpty()) - throw new RuntimeException("Temporary file is not secure"); - } - } - - static void checkDirectory(Path dir) throws IOException { - // check directory is in temporary directory - checkInTempDirectory(dir); - - // check directory is empty - DirectoryStream stream = dir.newDirectoryStream(); - try { - if (stream.iterator().hasNext()) - throw new RuntimeException("Tempory directory not empty"); - } finally { - stream.close(); - } - - // check file permissions are 0700 or more secure - if (dir.getFileStore().supportsFileAttributeView("posix")) { - Set perms = Attributes - .readPosixFileAttributes(dir).permissions(); - perms.remove(PosixFilePermission.OWNER_READ); - perms.remove(PosixFilePermission.OWNER_WRITE); - perms.remove(PosixFilePermission.OWNER_EXECUTE); - if (!perms.isEmpty()) - throw new RuntimeException("Temporary directory is not secure"); - } - } - - public static void main(String[] args) throws IOException { - Path file = File.createTemporaryFile("blah", null).toPath(); - try { - checkFile(file); - } finally { - TestUtil.deleteUnchecked(file); - } - } -} diff --git a/jdk/test/java/nio/file/TestUtil.java b/jdk/test/java/nio/file/TestUtil.java index b0fdd2a1f9d..f77d8f1adb3 100644 --- a/jdk/test/java/nio/file/TestUtil.java +++ b/jdk/test/java/nio/file/TestUtil.java @@ -31,17 +31,12 @@ public class TestUtil { } static Path createTemporaryDirectory(String where) throws IOException { - Path top = FileSystems.getDefault().getPath(where); - Random r = new Random(); - Path dir; - do { - dir = top.resolve("name" + r.nextInt()); - } while (dir.exists()); - return dir.createDirectory(); + Path dir = FileSystems.getDefault().getPath(where); + return Files.createTempDirectory(dir, "name"); } static Path createTemporaryDirectory() throws IOException { - return createTemporaryDirectory(System.getProperty("java.io.tmpdir")); + return Files.createTempDirectory("name"); } static void removeAll(Path dir) throws IOException { @@ -53,7 +48,7 @@ public class TestUtil { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { try { - file.delete(); + Files.delete(file); } catch (IOException x) { System.err.format("Unable to delete %s: %s\n", file, x); } @@ -62,7 +57,7 @@ public class TestUtil { @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) { try { - dir.delete(); + Files.delete(dir); } catch (IOException x) { System.err.format("Unable to delete %s: %s\n", dir, x); } @@ -78,7 +73,7 @@ public class TestUtil { static void deleteUnchecked(Path file) { try { - file.delete(); + Files.delete(file); } catch (IOException exc) { System.err.format("Unable to delete %s: %s\n", file, exc); } @@ -99,7 +94,7 @@ public class TestUtil { String name = sb.toString(); do { dir = dir.resolve(name).resolve("."); - dir.createDirectory(); + Files.createDirectory(dir); } while (dir.toString().length() < 2048); return dir; } @@ -111,8 +106,8 @@ public class TestUtil { Path link = dir.resolve("testlink"); Path target = dir.resolve("testtarget"); try { - link.createSymbolicLink(target); - link.delete(); + Files.createSymbolicLink(link, target); + Files.delete(link); return true; } catch (UnsupportedOperationException x) { return false; diff --git a/jdk/test/java/nio/file/WatchService/Basic.java b/jdk/test/java/nio/file/WatchService/Basic.java index 104781410ae..2869a519f37 100644 --- a/jdk/test/java/nio/file/WatchService/Basic.java +++ b/jdk/test/java/nio/file/WatchService/Basic.java @@ -41,8 +41,9 @@ import java.util.concurrent.TimeUnit; public class Basic { - static void createFile(Path file) throws IOException { - file.newOutputStream().close(); + static void checkKey(WatchKey key, Path dir) { + if (!key.isValid()) + throw new RuntimeException("Key is not valid"); } static void takeExpectedKey(WatchService watcher, WatchKey expected) { @@ -80,19 +81,19 @@ public class Basic { FileSystem fs = FileSystems.getDefault(); Path name = fs.getPath("foo"); - WatchService watcher = fs.newWatchService(); - try { + try (WatchService watcher = fs.newWatchService()) { // --- ENTRY_CREATE --- // register for event System.out.format("register %s for ENTRY_CREATE\n", dir); WatchKey myKey = dir.register(watcher, new WatchEvent.Kind[]{ ENTRY_CREATE }); + checkKey(myKey, dir); // create file Path file = dir.resolve("foo"); System.out.format("create %s\n", file); - createFile(file); + Files.createFile(file); // remove key and check that we got the ENTRY_CREATE event takeExpectedKey(watcher, myKey); @@ -112,9 +113,10 @@ public class Basic { new WatchEvent.Kind[]{ ENTRY_DELETE }); if (deleteKey != myKey) throw new RuntimeException("register did not return existing key"); + checkKey(deleteKey, dir); System.out.format("delete %s\n", file); - file.delete(); + Files.delete(file); takeExpectedKey(watcher, myKey); checkExpectedEvent(myKey.pollEvents(), StandardWatchEventKind.ENTRY_DELETE, name); @@ -126,7 +128,7 @@ public class Basic { System.out.println("OKAY"); // create the file for the next test - createFile(file); + Files.createFile(file); // --- ENTRY_MODIFY --- @@ -135,13 +137,11 @@ public class Basic { new WatchEvent.Kind[]{ ENTRY_MODIFY }); if (newKey != myKey) throw new RuntimeException("register did not return existing key"); + checkKey(newKey, dir); System.out.format("update: %s\n", file); - OutputStream out = file.newOutputStream(StandardOpenOption.APPEND); - try { + try (OutputStream out = Files.newOutputStream(file, StandardOpenOption.APPEND)) { out.write("I am a small file".getBytes("UTF-8")); - } finally { - out.close(); } // remove key and check that we got the ENTRY_MODIFY event @@ -151,10 +151,7 @@ public class Basic { System.out.println("OKAY"); // done - file.delete(); - - } finally { - watcher.close(); + Files.delete(file); } } @@ -164,12 +161,12 @@ public class Basic { static void testCancel(Path dir) throws IOException { System.out.println("-- Cancel --"); - WatchService watcher = FileSystems.getDefault().newWatchService(); - try { + try (WatchService watcher = FileSystems.getDefault().newWatchService()) { System.out.format("register %s for events\n", dir); WatchKey myKey = dir.register(watcher, new WatchEvent.Kind[]{ ENTRY_CREATE }); + checkKey(myKey, dir); System.out.println("cancel key"); myKey.cancel(); @@ -177,7 +174,7 @@ public class Basic { // create a file in the directory Path file = dir.resolve("mars"); System.out.format("create: %s\n", file); - createFile(file); + Files.createFile(file); // poll for keys - there will be none System.out.println("poll..."); @@ -190,12 +187,9 @@ public class Basic { } // done - file.delete(); + Files.delete(file); System.out.println("OKAY"); - - } finally { - watcher.close(); } } @@ -206,17 +200,16 @@ public class Basic { static void testAutomaticCancel(Path dir) throws IOException { System.out.println("-- Automatic Cancel --"); - Path subdir = dir.resolve("bar").createDirectory(); + Path subdir = Files.createDirectory(dir.resolve("bar")); - WatchService watcher = FileSystems.getDefault().newWatchService(); - try { + try (WatchService watcher = FileSystems.getDefault().newWatchService()) { System.out.format("register %s for events\n", subdir); WatchKey myKey = subdir.register(watcher, new WatchEvent.Kind[]{ ENTRY_CREATE, ENTRY_DELETE, ENTRY_MODIFY }); System.out.format("delete: %s\n", subdir); - subdir.delete(); + Files.delete(subdir); takeExpectedKey(watcher, myKey); System.out.println("reset key"); @@ -227,8 +220,6 @@ public class Basic { System.out.println("OKAY"); - } finally { - watcher.close(); } } @@ -411,7 +402,7 @@ public class Basic { // create gus1 Path file1 = dir.resolve(name1); System.out.format("create %s\n", file1); - createFile(file1); + Files.createFile(file1); // register with both watch services (different events) System.out.println("register for different events"); @@ -426,7 +417,7 @@ public class Basic { // create gus2 Path file2 = dir.resolve(name2); System.out.format("create %s\n", file2); - createFile(file2); + Files.createFile(file2); // check that key1 got ENTRY_CREATE takeExpectedKey(watcher1, key1); @@ -439,7 +430,7 @@ public class Basic { throw new RuntimeException("key not expected"); // delete gus1 - file1.delete(); + Files.delete(file1); // check that key2 got ENTRY_DELETE takeExpectedKey(watcher2, key2); @@ -462,7 +453,7 @@ public class Basic { // create file and key2 should be queued System.out.format("create %s\n", file1); - createFile(file1); + Files.createFile(file1); takeExpectedKey(watcher2, key2); checkExpectedEvent(key2.pollEvents(), StandardWatchEventKind.ENTRY_CREATE, name1); diff --git a/jdk/test/java/nio/file/WatchService/FileTreeModifier.java b/jdk/test/java/nio/file/WatchService/FileTreeModifier.java index 01db8b97a40..cde17db1124 100644 --- a/jdk/test/java/nio/file/WatchService/FileTreeModifier.java +++ b/jdk/test/java/nio/file/WatchService/FileTreeModifier.java @@ -62,10 +62,7 @@ public class FileTreeModifier { WatchService watcher = fs.newWatchService(); // create directories - Path subdir = top - .resolve("a").createDirectory() - .resolve("b").createDirectory() - .resolve("c").createDirectory(); + Path subdir = Files.createDirectories(top.resolve("a").resolve("b").resolve("c")); // Test ENTRY_CREATE with FILE_TREE modifier. @@ -73,7 +70,7 @@ public class FileTreeModifier { new WatchEvent.Kind[]{ ENTRY_CREATE }, FILE_TREE); // create file in a/b/c and check we get create event - Path file = subdir.resolve("foo").createFile(); + Path file = Files.createFile(subdir.resolve("foo")); checkExpectedEvent(watcher, ENTRY_CREATE, top.relativize(file)); key.reset(); @@ -85,7 +82,7 @@ public class FileTreeModifier { throw new RuntimeException("Existing key not returned"); // delete a/b/c/foo and check we get delete event - file.delete(); + Files.delete(file); checkExpectedEvent(watcher, ENTRY_DELETE, top.relativize(file)); key.reset(); @@ -96,19 +93,20 @@ public class FileTreeModifier { throw new RuntimeException("Existing key not returned"); // create a/b/c/foo - file.createFile(); + Files.createFile(file); // check that key is not queued + WatchKey nextKey; try { - k = watcher.poll(3, TimeUnit.SECONDS); + nextKey = watcher.poll(3, TimeUnit.SECONDS); } catch (InterruptedException e) { throw new RuntimeException(); } - if (k != null) + if (nextKey != null) throw new RuntimeException("WatchKey not expected to be polled"); // create bar and check we get create event - file = top.resolve("bar").createFile(); + file = Files.createFile(top.resolve("bar")); checkExpectedEvent(watcher, ENTRY_CREATE, top.relativize(file)); key.reset(); @@ -121,11 +119,8 @@ public class FileTreeModifier { throw new RuntimeException("Existing key not returned"); // modify bar and check we get modify event - OutputStream out = file.newOutputStream(); - try { + try (OutputStream out = Files.newOutputStream(file)) { out.write("Double shot expresso please".getBytes("UTF-8")); - } finally { - out.close(); } checkExpectedEvent(watcher, ENTRY_MODIFY, top.relativize(file)); key.reset(); diff --git a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java index c19e7d50a0a..96fb4d81783 100644 --- a/jdk/test/java/nio/file/WatchService/LotsOfEvents.java +++ b/jdk/test/java/nio/file/WatchService/LotsOfEvents.java @@ -55,15 +55,14 @@ public class LotsOfEvents { static void testOverflowEvent(Path dir) throws IOException, InterruptedException { - WatchService watcher = dir.getFileSystem().newWatchService(); - try { + try (WatchService watcher = dir.getFileSystem().newWatchService()) { dir.register(watcher, ENTRY_CREATE, ENTRY_DELETE); // create a lot of files int n = 1024; Path[] files = new Path[n]; for (int i=0; i modified = new HashSet(); + Set modified = new HashSet<>(); for (WatchEvent event: key.pollEvents()) { WatchEvent.Kind kind = event.kind(); Path file = (kind == OVERFLOW) ? null : (Path)event.context(); @@ -188,9 +184,6 @@ public class LotsOfEvents { key = watcher.poll(2, TimeUnit.SECONDS); } } - - } finally { - watcher.close(); } } @@ -200,20 +193,17 @@ public class LotsOfEvents { this.file = file; } void create() throws IOException { - if (file.notExists()) - file.createFile(); + if (Files.notExists(file)) + Files.createFile(file); } void deleteIfExists() throws IOException { - file.deleteIfExists(); + Files.deleteIfExists(file); } void modifyIfExists() throws IOException { - if (file.exists()) { - OutputStream out = file.newOutputStream(StandardOpenOption.APPEND); - try { + if (Files.exists(file)) { + try (OutputStream out = Files.newOutputStream(file, StandardOpenOption.APPEND)) { out.write("message".getBytes()); - } finally { - out.close(); } } } diff --git a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java index 63b26f9d51f..47ff2b69bcf 100644 --- a/jdk/test/java/nio/file/WatchService/SensitivityModifier.java +++ b/jdk/test/java/nio/file/WatchService/SensitivityModifier.java @@ -51,6 +51,7 @@ public class SensitivityModifier { } } + @SuppressWarnings("unchecked") static void doTest(Path top) throws Exception { FileSystem fs = top.getFileSystem(); WatchService watcher = fs.newWatchService(); @@ -61,11 +62,11 @@ public class SensitivityModifier { Path[] dirs = new Path[nDirs]; Path[] files = new Path[nFiles]; for (int i=0; i)event).context(); - if (!name.equals(file.getName())) + if (!name.equals(file.getFileName())) throw new RuntimeException("Unexpected context: " + name); System.out.println("Event OK"); diff --git a/jdk/test/java/nio/file/attribute/AclFileAttributeView/Basic.java b/jdk/test/java/nio/file/attribute/AclFileAttributeView/Basic.java index 03a0e48e783..bc32699cbfa 100644 --- a/jdk/test/java/nio/file/attribute/AclFileAttributeView/Basic.java +++ b/jdk/test/java/nio/file/attribute/AclFileAttributeView/Basic.java @@ -47,11 +47,11 @@ public class Basic { // sanity check read and writing ACL static void testReadWrite(Path dir) throws IOException { Path file = dir.resolve("foo"); - if (file.notExists()) - file.createFile(); + if (Files.notExists(file)) + Files.createFile(file); - AclFileAttributeView view = file - .getFileAttributeView(AclFileAttributeView.class); + AclFileAttributeView view = + Files.getFileAttributeView(file, AclFileAttributeView.class); // print existing ACL List acl = view.getAcl(); @@ -79,7 +79,7 @@ public class Basic { } // if PosixFileAttributeView then repeat test with OWNER@ - if (file.getFileStore().supportsFileAttributeView("posix")) { + if (Files.getFileStore(file).supportsFileAttributeView("posix")) { owner = file.getFileSystem().getUserPrincipalLookupService() .lookupPrincipalByName("OWNER@"); entry = AclEntry.newBuilder(entry).setPrincipal(owner).build(); @@ -115,7 +115,8 @@ public class Basic { // sanity check create a file or directory with initial ACL static void testCreateFile(Path dir) throws IOException { - UserPrincipal user = Attributes.getOwner(dir); + UserPrincipal user = Files.getOwner(dir); + AclFileAttributeView view; // create file with initial ACL System.out.println("-- create file with initial ACL --"); @@ -127,8 +128,9 @@ public class Basic { .setPermissions(SYNCHRONIZE, READ_DATA, WRITE_DATA, READ_ATTRIBUTES, READ_ACL, WRITE_ATTRIBUTES, DELETE) .build()); - file.createFile(asAclAttribute(fileAcl)); - assertEquals(Attributes.getAcl(file), fileAcl); + Files.createFile(file, asAclAttribute(fileAcl)); + view = Files.getFileAttributeView(file, AclFileAttributeView.class); + assertEquals(view.getAcl(), fileAcl); // create directory with initial ACL System.out.println("-- create directory with initial ACL --"); @@ -142,17 +144,18 @@ public class Basic { AclEntry.newBuilder(fileAcl.get(0)) .setFlags(FILE_INHERIT) .build()); - subdir.createDirectory(asAclAttribute(dirAcl)); - assertEquals(Attributes.getAcl(subdir), dirAcl); + Files.createDirectory(subdir, asAclAttribute(dirAcl)); + view = Files.getFileAttributeView(subdir, AclFileAttributeView.class); + assertEquals(view.getAcl(), dirAcl); } public static void main(String[] args) throws IOException { // use work directory rather than system temporary directory to // improve chances that ACLs are supported - Path dir = Paths.get("./work" + new Random().nextInt()) - .createDirectory(); + Path dir = Paths.get("./work" + new Random().nextInt()); + Files.createDirectory(dir); try { - if (!dir.getFileStore().supportsFileAttributeView("acl")) { + if (!Files.getFileStore(dir).supportsFileAttributeView("acl")) { System.out.println("ACLs not supported - test skipped!"); return; } diff --git a/jdk/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java b/jdk/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java index c2cb23a4ff6..794a42c1c46 100644 --- a/jdk/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java +++ b/jdk/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java @@ -43,7 +43,7 @@ public class Basic { static void checkAttributesOfDirectory(Path dir) throws IOException { - BasicFileAttributes attrs = Attributes.readBasicFileAttributes(dir); + BasicFileAttributes attrs = Files.readAttributes(dir, BasicFileAttributes.class); check(attrs.isDirectory(), "is a directory"); check(!attrs.isRegularFile(), "is not a regular file"); check(!attrs.isSymbolicLink(), "is not a link"); @@ -58,7 +58,7 @@ public class Basic { static void checkAttributesOfFile(Path dir, Path file) throws IOException { - BasicFileAttributes attrs = Attributes.readBasicFileAttributes(file); + BasicFileAttributes attrs = Files.readAttributes(file, BasicFileAttributes.class); check(attrs.isRegularFile(), "is a regular file"); check(!attrs.isDirectory(), "is not a directory"); check(!attrs.isSymbolicLink(), "is not a link"); @@ -73,8 +73,8 @@ public class Basic { // copy last-modified time and file create time from directory to file, // re-read attribtues, and check they match BasicFileAttributeView view = - file.getFileAttributeView(BasicFileAttributeView.class); - BasicFileAttributes dirAttrs = Attributes.readBasicFileAttributes(dir); + Files.getFileAttributeView(file, BasicFileAttributeView.class); + BasicFileAttributes dirAttrs = Files.readAttributes(dir, BasicFileAttributes.class); view.setTimes(dirAttrs.lastModifiedTime(), null, null); if (dirAttrs.creationTime() != null) { view.setTimes(null, null, dirAttrs.creationTime()); @@ -95,8 +95,8 @@ public class Basic { static void checkAttributesOfLink(Path link) throws IOException { - BasicFileAttributes attrs = Attributes - .readBasicFileAttributes(link, LinkOption.NOFOLLOW_LINKS); + BasicFileAttributes attrs = + Files.readAttributes(link, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); check(attrs.isSymbolicLink(), "is a link"); check(!attrs.isDirectory(), "is a directory"); check(!attrs.isRegularFile(), "is not a regular file"); @@ -108,11 +108,8 @@ public class Basic { { // create file Path file = dir.resolve("foo"); - OutputStream out = file.newOutputStream(); - try { + try (OutputStream out = Files.newOutputStream(file)) { out.write("this is not an empty file".getBytes("UTF-8")); - } finally { - out.close(); } // check attributes of directory and file @@ -122,7 +119,7 @@ public class Basic { // symbolic links may be supported Path link = dir.resolve("link"); try { - link.createSymbolicLink( file ); + Files.createSymbolicLink(link, file); } catch (UnsupportedOperationException x) { return; } catch (IOException x) { diff --git a/jdk/test/java/nio/file/attribute/DosFileAttributeView/Basic.java b/jdk/test/java/nio/file/attribute/DosFileAttributeView/Basic.java index bac02d22dfc..702c95050cc 100644 --- a/jdk/test/java/nio/file/attribute/DosFileAttributeView/Basic.java +++ b/jdk/test/java/nio/file/attribute/DosFileAttributeView/Basic.java @@ -74,27 +74,25 @@ public class Basic { static void readWriteTests(Path dir) throws IOException { // create "foo" and test that we can read/write each FAT attribute - Path file = dir.resolve("foo"); - file.createFile(); + Path file = Files.createFile(dir.resolve("foo")); try { - testAttributes(file - .getFileAttributeView(DosFileAttributeView.class)); + testAttributes(Files.getFileAttributeView(file, DosFileAttributeView.class)); // Following tests use a symbolic link so skip if not supported if (!TestUtil.supportsLinks(dir)) return; - Path link = dir.resolve("link").createSymbolicLink(file); + Path link = dir.resolve("link"); + Files.createSymbolicLink(link, file); // test following links - testAttributes(link - .getFileAttributeView(DosFileAttributeView.class)); + testAttributes(Files.getFileAttributeView(link, DosFileAttributeView.class)); // test not following links try { try { - testAttributes(link - .getFileAttributeView(DosFileAttributeView.class, NOFOLLOW_LINKS)); + testAttributes(Files + .getFileAttributeView(link, DosFileAttributeView.class, NOFOLLOW_LINKS)); } catch (IOException x) { // access to link attributes not supported return; @@ -103,32 +101,32 @@ public class Basic { // set all attributes on link // run test on target of link (which leaves them all un-set) // check that attributes of link remain all set - setAll(link - .getFileAttributeView(DosFileAttributeView.class, NOFOLLOW_LINKS), true); - testAttributes(link - .getFileAttributeView(DosFileAttributeView.class)); - DosFileAttributes attrs = Attributes.readDosFileAttributes(link, NOFOLLOW_LINKS); + setAll(Files + .getFileAttributeView(link, DosFileAttributeView.class, NOFOLLOW_LINKS), true); + testAttributes(Files + .getFileAttributeView(link, DosFileAttributeView.class)); + DosFileAttributes attrs = + Files.getFileAttributeView(link, DosFileAttributeView.class, NOFOLLOW_LINKS) + .readAttributes(); check(attrs.isReadOnly()); check(attrs.isHidden()); check(attrs.isArchive()); check(attrs.isSystem()); - setAll(link - .getFileAttributeView(DosFileAttributeView.class, NOFOLLOW_LINKS), false); + setAll(Files + .getFileAttributeView(link, DosFileAttributeView.class, NOFOLLOW_LINKS), false); // set all attributes on target // run test on link (which leaves them all un-set) // check that attributes of target remain all set - setAll(link - .getFileAttributeView(DosFileAttributeView.class), true); - testAttributes(link - .getFileAttributeView(DosFileAttributeView.class, NOFOLLOW_LINKS)); - attrs = Attributes.readDosFileAttributes(link); + setAll(Files.getFileAttributeView(link, DosFileAttributeView.class), true); + testAttributes(Files + .getFileAttributeView(link, DosFileAttributeView.class, NOFOLLOW_LINKS)); + attrs = Files.getFileAttributeView(link, DosFileAttributeView.class).readAttributes(); check(attrs.isReadOnly()); check(attrs.isHidden()); check(attrs.isArchive()); check(attrs.isSystem()); - setAll(link - .getFileAttributeView(DosFileAttributeView.class), false); + setAll(Files.getFileAttributeView(link, DosFileAttributeView.class), false); } finally { TestUtil.deleteUnchecked(link); } @@ -143,7 +141,7 @@ public class Basic { try { // skip test if DOS file attributes not supported - if (!dir.getFileStore().supportsFileAttributeView("dos")) { + if (!Files.getFileStore(dir).supportsFileAttributeView("dos")) { System.out.println("DOS file attribute not supported."); return; } diff --git a/jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java b/jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java deleted file mode 100644 index 8307bac54bb..00000000000 --- a/jdk/test/java/nio/file/attribute/FileStoreAttributeView/Basic.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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 4313887 6838333 - * @summary Unit test for java.nio.file.attribute.FileStoreAttributeView - * @library ../.. - */ - -import java.nio.file.*; -import java.nio.file.attribute.*; -import java.io.File; -import java.io.IOException; -import java.util.*; - -/** - * Simple unit test for FileStoreAttributeView that checks that the disk space - * attribtues are "close" to the equivalent values reported by java.io.File. - */ - -public class Basic { - - static final long K = 1024L; - static final long G = 1024L * 1024L * 1024L; - - /** - * Print out the disk space information for the given file system - */ - static void printFileStore(FileStore fs) throws IOException { - FileStoreSpaceAttributeView view = - fs.getFileStoreAttributeView(FileStoreSpaceAttributeView.class); - FileStoreSpaceAttributes attrs = view.readAttributes(); - - long total = attrs.totalSpace() / K; - long used = (attrs.totalSpace() - attrs.unallocatedSpace()) / K; - long avail = attrs.usableSpace() / K; - - String s = fs.toString(); - if (s.length() > 20) { - System.out.println(s); - s = ""; - } - System.out.format("%-20s %12d %12d %12d\n", s, total, used, avail); - } - - /** - * Check that two values are within 1GB of each other - */ - static void checkWithin1GB(long value1, long value2) { - long diff = Math.abs(value1 - value2); - if (diff > G) - throw new RuntimeException("values differ by more than 1GB"); - } - - /** - * Check disk space on the file system of the given file - */ - static void checkSpace(Path file) throws IOException { - System.out.println(" -- check space -- "); - System.out.println(file); - - FileStore fs = file.getFileStore(); - System.out.format("Filesystem: %s\n", fs); - - // get values reported by java.io.File - File f = new File(file.toString()); - long total = f.getTotalSpace(); - long free = f.getFreeSpace(); - long usable = f.getUsableSpace(); - System.out.println("java.io.File"); - System.out.format(" Total: %d\n", total); - System.out.format(" Free: %d\n", free); - System.out.format(" Usable: %d\n", usable); - - // get values reported by the FileStoreSpaceAttributeView - FileStoreSpaceAttributes attrs = fs - .getFileStoreAttributeView(FileStoreSpaceAttributeView.class) - .readAttributes(); - System.out.println("java.nio.file.FileStoreSpaceAttributeView:"); - System.out.format(" Total: %d\n", attrs.totalSpace()); - System.out.format(" Free: %d\n", attrs.unallocatedSpace()); - System.out.format(" Usable: %d\n", attrs.usableSpace()); - - // check values are "close" - checkWithin1GB(total, attrs.totalSpace()); - checkWithin1GB(free, attrs.unallocatedSpace()); - checkWithin1GB(usable, attrs.usableSpace()); - - // get values by name - checkWithin1GB(total, (Long)fs.getAttribute("space:totalSpace")); - checkWithin1GB(free, (Long)fs.getAttribute("space:unallocatedSpace")); - checkWithin1GB(usable, (Long)fs.getAttribute("space:usableSpace")); - } - - public static void main(String[] args) throws IOException { - // print out the disk space information for all file systems - FileSystem fs = FileSystems.getDefault(); - for (FileStore store: fs.getFileStores()) { - printFileStore(store); - } - - Path dir = TestUtil.createTemporaryDirectory(); - try { - // check space using directory - checkSpace(dir); - - // check space using file - Path file = dir.resolve("foo").createFile(); - checkSpace(file); - - } finally { - TestUtil.removeAll(dir); - } - } -} diff --git a/jdk/test/java/nio/file/attribute/FileTime/Basic.java b/jdk/test/java/nio/file/attribute/FileTime/Basic.java index 2a79a1a6d7e..f907c00f871 100644 --- a/jdk/test/java/nio/file/attribute/FileTime/Basic.java +++ b/jdk/test/java/nio/file/attribute/FileTime/Basic.java @@ -29,13 +29,16 @@ import java.nio.file.attribute.FileTime; import java.util.concurrent.TimeUnit; import static java.util.concurrent.TimeUnit.*; -import java.io.IOException; +import java.util.Random; public class Basic { - public static void main(String[] args) throws IOException { + static final Random rand = new Random(); + + public static void main(String[] args) { long now = System.currentTimeMillis(); long tomorrowInDays = TimeUnit.DAYS.convert(now, MILLISECONDS) + 1; + long yesterdayInDays = TimeUnit.DAYS.convert(now, MILLISECONDS) - 1; // equals eq(now, MILLISECONDS, now, MILLISECONDS); @@ -50,6 +53,29 @@ public class Basic { cmp(now, MILLISECONDS, now+1234, MILLISECONDS, -1); cmp(tomorrowInDays, DAYS, now, MILLISECONDS, 1); cmp(now, MILLISECONDS, tomorrowInDays, DAYS, -1); + cmp(yesterdayInDays, DAYS, now, MILLISECONDS, -1); + cmp(now, MILLISECONDS, yesterdayInDays, DAYS, 1); + cmp(yesterdayInDays, DAYS, now, MILLISECONDS, -1); + cmp(Long.MAX_VALUE, DAYS, Long.MAX_VALUE, NANOSECONDS, 1); + cmp(Long.MAX_VALUE, DAYS, Long.MIN_VALUE, NANOSECONDS, 1); + cmp(Long.MIN_VALUE, DAYS, Long.MIN_VALUE, NANOSECONDS, -1); + cmp(Long.MIN_VALUE, DAYS, Long.MAX_VALUE, NANOSECONDS, -1); + + // to(TimeUnit) + to(MILLISECONDS.convert(1, DAYS) - 1, MILLISECONDS); + to(MILLISECONDS.convert(1, DAYS) + 0, MILLISECONDS); + to(MILLISECONDS.convert(1, DAYS) + 1, MILLISECONDS); + to(1, MILLISECONDS); + to(0, MILLISECONDS); + to(1, MILLISECONDS); + to(MILLISECONDS.convert(-1, DAYS) - 1, MILLISECONDS); + to(MILLISECONDS.convert(-1, DAYS) + 0, MILLISECONDS); + to(MILLISECONDS.convert(-1, DAYS) + 1, MILLISECONDS); + for (TimeUnit unit: TimeUnit.values()) { + for (int i=0; i<100; i++) { to(rand.nextLong(), unit); } + to(Long.MIN_VALUE, unit); + to(Long.MAX_VALUE, unit); + } // toString ts(1L, DAYS, "1970-01-02T00:00:00Z"); @@ -59,6 +85,8 @@ public class Basic { ts(1L, MILLISECONDS, "1970-01-01T00:00:00.001Z"); ts(1L, MICROSECONDS, "1970-01-01T00:00:00.000001Z"); ts(1L, NANOSECONDS, "1970-01-01T00:00:00.000000001Z"); + ts(999999999L, NANOSECONDS, "1970-01-01T00:00:00.999999999Z"); + ts(9999999999L, NANOSECONDS, "1970-01-01T00:00:09.999999999Z"); ts(-1L, DAYS, "1969-12-31T00:00:00Z"); ts(-1L, HOURS, "1969-12-31T23:00:00Z"); @@ -67,6 +95,8 @@ public class Basic { ts(-1L, MILLISECONDS, "1969-12-31T23:59:59.999Z"); ts(-1L, MICROSECONDS, "1969-12-31T23:59:59.999999Z"); ts(-1L, NANOSECONDS, "1969-12-31T23:59:59.999999999Z"); + ts(-999999999L, NANOSECONDS, "1969-12-31T23:59:59.000000001Z"); + ts(-9999999999L, NANOSECONDS, "1969-12-31T23:59:50.000000001Z"); ts(-62135596799999L, MILLISECONDS, "0001-01-01T00:00:00.001Z"); ts(-62135596800000L, MILLISECONDS, "0001-01-01T00:00:00Z"); @@ -114,9 +144,24 @@ public class Basic { throw new RuntimeException("should not be equal"); } - static void ts(long v, TimeUnit y, String expected) { - String s = FileTime.from(v, y).toString(); - if (!s.equals(expected)) - throw new RuntimeException("unexpected format"); + static void to(long v, TimeUnit unit) { + FileTime t = FileTime.from(v, unit); + for (TimeUnit u: TimeUnit.values()) { + long result = t.to(u); + long expected = u.convert(v, unit); + if (result != expected) { + throw new RuntimeException("unexpected result"); + } + } + } + + static void ts(long v, TimeUnit unit, String expected) { + String result = FileTime.from(v, unit).toString(); + if (!result.equals(expected)) { + System.err.format("FileTime.from(%d, %s).toString() failed\n", v, unit); + System.err.format("Expected: %s\n", expected); + System.err.format(" Got: %s\n", result); + throw new RuntimeException(); + } } } diff --git a/jdk/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java b/jdk/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java index f3ff3584964..7d948b9bd3e 100644 --- a/jdk/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java +++ b/jdk/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java @@ -49,9 +49,8 @@ public class Basic { Set perms = PosixFilePermissions.fromString(mode); // change permissions and re-read them. - Attributes.setPosixFilePermissions(file, perms); - Set current = Attributes - .readPosixFileAttributes(file).permissions(); + Files.setPosixFilePermissions(file, perms); + Set current = Files.getPosixFilePermissions(file); if (!current.equals(perms)) { throw new RuntimeException("Actual permissions: " + PosixFilePermissions.toString(current) + ", expected: " + @@ -59,8 +58,8 @@ public class Basic { } // repeat test using setAttribute/getAttribute - file.setAttribute("posix:permissions", perms); - current = (Set)file.getAttribute("posix:permissions"); + Files.setAttribute(file, "posix:permissions", perms); + current = (Set)Files.getAttribute(file, "posix:permissions"); if (!current.equals(perms)) { throw new RuntimeException("Actual permissions: " + PosixFilePermissions.toString(current) + ", expected: " + @@ -97,25 +96,25 @@ public class Basic { FileAttribute> attr = PosixFilePermissions.asFileAttribute(requested); System.out.format("create file with mode: %s\n", mode); - file.createFile(attr); + Files.createFile(file, attr); try { - checkSecure(requested, file - .getFileAttributeView(PosixFileAttributeView.class) - .readAttributes() - .permissions()); + checkSecure(requested, + Files.getFileAttributeView(file, PosixFileAttributeView.class) + .readAttributes() + .permissions()); } finally { - file.delete(); + Files.delete(file); } System.out.format("create directory with mode: %s\n", mode); - file.createDirectory(attr); + Files.createDirectory(file, attr); try { - checkSecure(requested, file - .getFileAttributeView(PosixFileAttributeView.class) - .readAttributes() - .permissions()); + checkSecure(requested, + Files.getFileAttributeView(file, PosixFileAttributeView.class) + .readAttributes() + .permissions()); } finally { - file.delete(); + Files.delete(file); } } @@ -130,11 +129,11 @@ public class Basic { // create file and test updating and reading its permissions Path file = dir.resolve("foo"); System.out.format("create %s\n", file); - file.createFile(); + Files.createFile(file); try { // get initial permissions so that we can restore them later - PosixFileAttributeView view = file - .getFileAttributeView(PosixFileAttributeView.class); + PosixFileAttributeView view = + Files.getFileAttributeView(file, PosixFileAttributeView.class); Set save = view.readAttributes() .permissions(); @@ -165,7 +164,7 @@ public class Basic { view.setPermissions(save); } } finally { - file.delete(); + Files.delete(file); } // create link (to file that doesn't exist) and test reading of @@ -173,15 +172,18 @@ public class Basic { if (TestUtil.supportsLinks(dir)) { Path link = dir.resolve("link"); System.out.format("create link %s\n", link); - link.createSymbolicLink(file); + Files.createSymbolicLink(link, file); try { - PosixFileAttributes attrs = Attributes - .readPosixFileAttributes(link, NOFOLLOW_LINKS); + PosixFileAttributes attrs = + Files.getFileAttributeView(link, + PosixFileAttributeView.class, + NOFOLLOW_LINKS) + .readAttributes(); if (!attrs.isSymbolicLink()) { throw new RuntimeException("not a link"); } } finally { - link.delete(); + Files.delete(link); } } @@ -235,12 +237,12 @@ public class Basic { Path file = dir.resolve("gus"); System.out.format("create %s\n", file); - file.createFile(); + Files.createFile(file); try { // read attributes of directory to get owner/group - PosixFileAttributeView view = file - .getFileAttributeView(PosixFileAttributeView.class); + PosixFileAttributeView view = + Files.getFileAttributeView(file, PosixFileAttributeView.class); PosixFileAttributes attrs = view.readAttributes(); // set to existing owner/group @@ -248,13 +250,13 @@ public class Basic { view.setGroup(attrs.group()); // repeat test using set/getAttribute - UserPrincipal owner = (UserPrincipal)file.getAttribute("posix:owner"); - file.setAttribute("posix:owner", owner); - UserPrincipal group = (UserPrincipal)file.getAttribute("posix:group"); - file.setAttribute("posix:group", group); + UserPrincipal owner = (UserPrincipal)Files.getAttribute(file, "posix:owner"); + Files.setAttribute(file, "posix:owner", owner); + UserPrincipal group = (UserPrincipal)Files.getAttribute(file, "posix:group"); + Files.setAttribute(file, "posix:group", group); } finally { - file.delete(); + Files.delete(file); } System.out.println("OKAY"); @@ -272,7 +274,7 @@ public class Basic { .getUserPrincipalLookupService(); // read attributes of directory to get owner/group - PosixFileAttributes attrs = Attributes.readPosixFileAttributes(dir); + PosixFileAttributes attrs = Files.readAttributes(dir, PosixFileAttributes.class); // lookup owner and check it matches file's owner System.out.format("lookup: %s\n", attrs.owner().getName()); @@ -322,8 +324,8 @@ public class Basic { { System.out.println("-- Exceptions --"); - PosixFileAttributeView view = dir - .getFileAttributeView(PosixFileAttributeView.class); + PosixFileAttributeView view = + Files.getFileAttributeView(dir,PosixFileAttributeView.class); // NullPointerException try { @@ -355,7 +357,7 @@ public class Basic { } catch (NullPointerException x) { } try { - Set perms = new HashSet(); + Set perms = new HashSet<>(); perms.add(null); view.setPermissions(perms); throw new RuntimeException("NullPointerException not thrown"); @@ -377,7 +379,7 @@ public class Basic { public static void main(String[] args) throws IOException { Path dir = TestUtil.createTemporaryDirectory(); try { - if (!dir.getFileStore().supportsFileAttributeView("posix")) { + if (!Files.getFileStore(dir).supportsFileAttributeView("posix")) { System.out.println("PosixFileAttributeView not supported"); return; } diff --git a/jdk/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java b/jdk/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java index c6a807a45ec..a6af4192234 100644 --- a/jdk/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java +++ b/jdk/test/java/nio/file/attribute/UserDefinedFileAttributeView/Basic.java @@ -79,8 +79,8 @@ public class Basic { } static void test(Path file, LinkOption... options) throws IOException { - final UserDefinedFileAttributeView view = file - .getFileAttributeView(UserDefinedFileAttributeView.class, options); + final UserDefinedFileAttributeView view = + Files.getFileAttributeView(file, UserDefinedFileAttributeView.class, options); ByteBuffer buf = rand.nextBoolean() ? ByteBuffer.allocate(100) : ByteBuffer.allocateDirect(100); @@ -131,24 +131,24 @@ public class Basic { // Test: dynamic access String name = "user:" + ATTR_NAME; byte[] valueAsBytes = ATTR_VALUE.getBytes(); - file.setAttribute(name, valueAsBytes); - byte[] actualAsBytes = (byte[])file.getAttribute(name); + Files.setAttribute(file, name, valueAsBytes); + byte[] actualAsBytes = (byte[])Files.getAttribute(file, name); if (!Arrays.equals(valueAsBytes, actualAsBytes)) throw new RuntimeException("Unexpected attribute value"); - Map map = file.readAttributes(name); + Map map = Files.readAttributes(file, name); if (!Arrays.equals(valueAsBytes, (byte[])map.get(ATTR_NAME))) throw new RuntimeException("Unexpected attribute value"); - map = file.readAttributes("user:*"); + map = Files.readAttributes(file, "user:*"); if (!Arrays.equals(valueAsBytes, (byte[])map.get(ATTR_NAME))) throw new RuntimeException("Unexpected attribute value"); - map = file.readAttributes("user:DoesNotExist"); + map = Files.readAttributes(file, "user:DoesNotExist"); if (!map.isEmpty()) throw new RuntimeException("Map expected to be empty"); } static void miscTests(final Path file) throws IOException { - final UserDefinedFileAttributeView view = file - .getFileAttributeView(UserDefinedFileAttributeView.class); + final UserDefinedFileAttributeView view = + Files.getFileAttributeView(file, UserDefinedFileAttributeView.class); view.write(ATTR_NAME, ByteBuffer.wrap(ATTR_VALUE.getBytes())); // NullPointerException @@ -180,31 +180,31 @@ public class Basic { }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.getAttribute(null); + Files.getAttribute(file, null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.getAttribute("user:" + ATTR_NAME, (LinkOption[])null); + Files.getAttribute(file, "user:" + ATTR_NAME, (LinkOption[])null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.setAttribute("user:" + ATTR_NAME, null); + Files.setAttribute(file, "user:" + ATTR_NAME, null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.setAttribute(null, new byte[0]); + Files.setAttribute(file, null, new byte[0]); }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.setAttribute("user: " + ATTR_NAME, new byte[0], (LinkOption[])null); + Files.setAttribute(file, "user: " + ATTR_NAME, new byte[0], (LinkOption[])null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.readAttributes((String)null); + Files.readAttributes(file, (String)null); }}); expectNullPointerException(new Task() { public void run() throws IOException { - file.readAttributes("*", (LinkOption[])null); + Files.readAttributes(file, "*", (LinkOption[])null); }}); // Read-only buffer @@ -229,46 +229,50 @@ public class Basic { // create temporary directory to run tests Path dir = TestUtil.createTemporaryDirectory(); try { - if (!dir.getFileStore().supportsFileAttributeView("user")) { + if (!Files.getFileStore(dir).supportsFileAttributeView("user")) { System.out.println("UserDefinedFileAttributeView not supported - skip test"); return; } // test access to user defined attributes of regular file - Path file = dir.resolve("foo.html").createFile(); + Path file = dir.resolve("foo.html"); + Files.createFile(file); try { test(file); } finally { - file.delete(); + Files.delete(file); } - // test access to user define attributes of directory - file = dir.resolve("foo").createDirectory(); + // test access to user defined attributes of directory + Path subdir = dir.resolve("foo"); + Files.createDirectory(subdir); try { - test(file); + test(subdir); } finally { - file.delete(); + Files.delete(subdir); } // test access to user defined attributes of sym link if (TestUtil.supportsLinks(dir)) { Path target = dir.resolve("doesnotexist"); - Path link = dir.resolve("link").createSymbolicLink(target); + Path link = dir.resolve("link"); + Files.createSymbolicLink(link, target); try { test(link, NOFOLLOW_LINKS); } catch (IOException x) { // access to attributes of sym link may not be supported } finally { - link.delete(); + Files.delete(link); } } // misc. tests try { - file = dir.resolve("foo.txt").createFile(); + file = dir.resolve("foo.txt"); + Files.createFile(file); miscTests(dir); } finally { - file.delete(); + Files.delete(file); } } finally { diff --git a/jdk/test/java/nio/file/spi/SetDefaultProvider.java b/jdk/test/java/nio/file/spi/SetDefaultProvider.java index 7852edb717d..e21be72985a 100644 --- a/jdk/test/java/nio/file/spi/SetDefaultProvider.java +++ b/jdk/test/java/nio/file/spi/SetDefaultProvider.java @@ -22,14 +22,13 @@ */ /* @test - * @bug 4313887 + * @bug 4313887 7006126 * @summary Unit test for java.nio.file.spi.FileSystemProvider * @build TestProvider SetDefaultProvider * @run main/othervm -Djava.nio.file.spi.DefaultFileSystemProvider=TestProvider SetDefaultProvider */ import java.nio.file.*; -import java.nio.file.spi.*; public class SetDefaultProvider { public static void main(String[] args) throws Exception { diff --git a/jdk/test/java/nio/file/spi/TestProvider.java b/jdk/test/java/nio/file/spi/TestProvider.java index 248b568858f..a604b6dfe7e 100644 --- a/jdk/test/java/nio/file/spi/TestProvider.java +++ b/jdk/test/java/nio/file/spi/TestProvider.java @@ -24,6 +24,7 @@ import java.nio.file.spi.FileSystemProvider; import java.nio.file.*; import java.nio.file.attribute.*; +import java.nio.channels.SeekableByteChannel; import java.net.URI; import java.util.*; import java.io.IOException; @@ -34,7 +35,6 @@ public class TestProvider extends FileSystemProvider { public TestProvider(FileSystemProvider defaultProvider) { theFileSystem = new TestFileSystem(this); - } @Override @@ -57,6 +57,124 @@ public class TestProvider extends FileSystemProvider { throw new RuntimeException("not implemented"); } + @Override + public void setAttribute(Path file, String attribute, Object value, + LinkOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public Map readAttributes(Path file, String attributes, + LinkOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public V getFileAttributeView(Path file, + Class type, + LinkOption... options) + { + throw new RuntimeException("not implemented"); + } + + + @Override + public void delete(Path file) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public void createSymbolicLink(Path link, Path target, FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void createLink(Path link, Path existing) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public Path readSymbolicLink(Path link) throws IOException { + throw new RuntimeException("not implemented"); + } + + + @Override + public void copy(Path source, Path target, CopyOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void move(Path source, Path target, CopyOption... options) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public DirectoryStream newDirectoryStream(Path dir, + DirectoryStream.Filter filter) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public void createDirectory(Path dir, FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + @Override + public SeekableByteChannel newByteChannel(Path file, + Set options, + FileAttribute... attrs) + throws IOException + { + throw new RuntimeException("not implemented"); + } + + + @Override + public boolean isHidden(Path file) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public FileStore getFileStore(Path file) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public boolean isSameFile(Path file, Path other) throws IOException { + throw new RuntimeException("not implemented"); + } + + @Override + public void checkAccess(Path file, AccessMode... modes) + throws IOException + { + throw new RuntimeException("not implemented"); + } + static class TestFileSystem extends FileSystem { private final TestProvider provider; @@ -105,7 +223,7 @@ public class TestProvider extends FileSystemProvider { } @Override - public Path getPath(String path) { + public Path getPath(String first, String... more) { throw new RuntimeException("not implemented"); } @@ -124,5 +242,4 @@ public class TestProvider extends FileSystemProvider { throw new RuntimeException("not implemented"); } } - } From 26b3b9744fed017bb663a7e788df68a148092b36 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Fri, 28 Jan 2011 13:26:14 +0000 Subject: [PATCH 13/84] 7015410: test/java/net/Socks/SocksProxyVersion.java needs to be updated due to 7013420 Reviewed-by: chegar --- .../java/net/Socks/SocksProxyVersion.java | 36 +++++++++++-------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/jdk/test/java/net/Socks/SocksProxyVersion.java b/jdk/test/java/net/Socks/SocksProxyVersion.java index 19298e59c6b..fe4f1c65b72 100644 --- a/jdk/test/java/net/Socks/SocksProxyVersion.java +++ b/jdk/test/java/net/Socks/SocksProxyVersion.java @@ -36,15 +36,22 @@ import java.io.DataInputStream; import java.io.IOException; public class SocksProxyVersion implements Runnable { - ServerSocket ss; + final ServerSocket ss; volatile boolean failed; public static void main(String[] args) throws Exception { new SocksProxyVersion(); } + @SuppressWarnings("try") public SocksProxyVersion() throws Exception { ss = new ServerSocket(0); + try (ServerSocket socket = ss) { + runTest(); + } + } + + void runTest() throws Exception { int port = ss.getLocalPort(); Thread serverThread = new Thread(this); serverThread.start(); @@ -75,22 +82,21 @@ public class SocksProxyVersion implements Runnable { } public void run() { - try (ss) { - Socket s = ss.accept(); - int version = (s.getInputStream()).read(); - if (version != 4) { - System.out.println("Got " + version + ", expected 4"); - failed = true; + try { + try (Socket s = ss.accept()) { + int version = (s.getInputStream()).read(); + if (version != 4) { + System.out.println("Got " + version + ", expected 4"); + failed = true; + } } - s.close(); - - s = ss.accept(); - version = (s.getInputStream()).read(); - if (version != 5) { - System.out.println("Got " + version + ", expected 5"); - failed = true; + try (Socket s = ss.accept()) { + int version = (s.getInputStream()).read(); + if (version != 5) { + System.out.println("Got " + version + ", expected 5"); + failed = true; + } } - s.close(); } catch (IOException e) { e.printStackTrace(); } From d4946d1ec34567e389f2e30421b8552f5eff0a41 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Fri, 28 Jan 2011 16:52:10 +0300 Subject: [PATCH 14/84] 6340263: Regression testcase java/awt/dnd/DnDClipboardDeadlockTest throughs IOException: Owner timed out Reviewed-by: anthony, art --- .../classes/sun/awt/X11/XSelection.java | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java index ea055bf4b64..1ffd1346361 100644 --- a/jdk/src/solaris/classes/sun/awt/X11/XSelection.java +++ b/jdk/src/solaris/classes/sun/awt/X11/XSelection.java @@ -301,13 +301,8 @@ public final class XSelection { } finally { XToolkit.awtUnlock(); } - if (!dataGetter.isExecuted()) { - throw new IOException("Owner timed out"); - } - if (dataGetter.isDisposed()) { - throw new IOException("Owner failed to convert data"); - } + validateDataGetter(dataGetter); // Handle incremental transfer. if (dataGetter.getActualType() == @@ -380,14 +375,7 @@ public final class XSelection { XToolkit.awtUnlock(); } - // The owner didn't respond - terminate the transfer. - if (!incrDataGetter.isExecuted()) { - throw new IOException("Owner timed out"); - } - - if (incrDataGetter.isDisposed()) { - throw new IOException("Owner failed to convert data"); - } + validateDataGetter(dataGetter); if (incrDataGetter.getActualFormat() != 8) { throw new IOException("Unsupported data format: " + @@ -445,6 +433,23 @@ public final class XSelection { return data != null ? data : new byte[0]; } + void validateDataGetter(WindowPropertyGetter propertyGetter) + throws IOException + { + // The order of checks is important because a property getter + // has not been executed in case of timeout as well as in case of + // changed selection owner. + + if (propertyGetter.isDisposed()) { + throw new IOException("Owner failed to convert data"); + } + + // The owner didn't respond - terminate the transfer. + if (!propertyGetter.isExecuted()) { + throw new IOException("Owner timed out"); + } + } + // To be MT-safe this method should be called under awtLock. boolean isOwner() { return isOwner; From 9b7612b045741fd8478f7e50090c035534796fd6 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Fri, 28 Jan 2011 17:09:49 -0800 Subject: [PATCH 15/84] 7015156: Remove JSR 308 changes from core libraries Reviewed-by: mduigou --- jdk/src/share/classes/java/lang/SuppressWarnings.java | 4 ++-- .../share/classes/java/lang/annotation/ElementType.java | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/jdk/src/share/classes/java/lang/SuppressWarnings.java b/jdk/src/share/classes/java/lang/SuppressWarnings.java index 6989c4023dd..babb060396a 100644 --- a/jdk/src/share/classes/java/lang/SuppressWarnings.java +++ b/jdk/src/share/classes/java/lang/SuppressWarnings.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, 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 @@ -44,7 +44,7 @@ import static java.lang.annotation.ElementType.*; * @since 1.5 * @author Josh Bloch */ -@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, TYPE_PARAMETER}) +@Target({TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE}) @Retention(RetentionPolicy.SOURCE) public @interface SuppressWarnings { /** diff --git a/jdk/src/share/classes/java/lang/annotation/ElementType.java b/jdk/src/share/classes/java/lang/annotation/ElementType.java index 3ca2c7a4372..917054991dd 100644 --- a/jdk/src/share/classes/java/lang/annotation/ElementType.java +++ b/jdk/src/share/classes/java/lang/annotation/ElementType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2009, 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,12 +40,6 @@ public enum ElementType { /** Class, interface (including annotation type), or enum declaration */ TYPE, - /** Uses of a type */ - TYPE_USE, - - /** type parameters */ - TYPE_PARAMETER, - /** Field declaration (includes enum constants) */ FIELD, From 066a92efdace9f35de6f8a82db0b10081c72e0bf Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 31 Jan 2011 21:22:42 +0300 Subject: [PATCH 16/84] 7001484: DOC: Method javax.swing.border.StrokeBorder.getBorderInsets() should specify how it converts float Reviewed-by: alexp --- jdk/src/share/classes/javax/swing/border/StrokeBorder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/jdk/src/share/classes/javax/swing/border/StrokeBorder.java b/jdk/src/share/classes/javax/swing/border/StrokeBorder.java index b2538bae2dc..eed8c00aa63 100644 --- a/jdk/src/share/classes/javax/swing/border/StrokeBorder.java +++ b/jdk/src/share/classes/javax/swing/border/StrokeBorder.java @@ -118,13 +118,17 @@ public class StrokeBorder extends AbstractBorder { /** * Reinitializes the {@code insets} parameter * with this border's current insets. - * All insets are equal to the line width of the stroke. + * Every inset is the smallest (closest to negative infinity) integer value + * that is greater than or equal to the line width of the stroke + * that is used to paint the border. * * @param c the component for which this border insets value applies * @param insets the {@code Insets} object to be reinitialized * @return the reinitialized {@code insets} parameter * * @throws NullPointerException if the specified {@code insets} is {@code null} + * + * @see Math#ceil */ @Override public Insets getBorderInsets(Component c, Insets insets) { From d12c1d0e4942e1cc987dc4d22d84f1eee142709d Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 31 Jan 2011 21:31:39 +0300 Subject: [PATCH 17/84] 7001118: DOC: javax.swing.border.StrokeBorder.paintBorder() doesn't throw NPE in all specified cases Reviewed-by: alexp --- .../share/classes/javax/swing/border/StrokeBorder.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/border/StrokeBorder.java b/jdk/src/share/classes/javax/swing/border/StrokeBorder.java index eed8c00aa63..34e81f024b3 100644 --- a/jdk/src/share/classes/javax/swing/border/StrokeBorder.java +++ b/jdk/src/share/classes/javax/swing/border/StrokeBorder.java @@ -88,6 +88,10 @@ public class StrokeBorder extends AbstractBorder { /** * Paints the border for the specified component * with the specified position and size. + * If the border was not specified with a {@link Paint} object, + * the component's foreground color will be used to render the border. + * If the component's foreground color is not available, + * the default color of the {@link Graphics} object will be used. * * @param c the component for which this border is being painted * @param g the paint graphics @@ -96,7 +100,7 @@ public class StrokeBorder extends AbstractBorder { * @param width the width of the painted border * @param height the height of the painted border * - * @throws NullPointerException if the specified {@code c} or {@code g} are {@code null} + * @throws NullPointerException if the specified {@code g} is {@code null} */ @Override public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) { @@ -106,7 +110,7 @@ public class StrokeBorder extends AbstractBorder { if (g instanceof Graphics2D) { Graphics2D g2d = (Graphics2D) g; g2d.setStroke(this.stroke); - g2d.setPaint(this.paint != null ? this.paint : c.getForeground()); + g2d.setPaint(this.paint != null ? this.paint : c == null ? null : c.getForeground()); g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g2d.draw(new Rectangle2D.Float(x + size / 2, y + size / 2, width - size, height - size)); From a09ca04b628b6e04d04cc28542cfdcacbd08fd83 Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Mon, 31 Jan 2011 21:49:27 +0300 Subject: [PATCH 18/84] 6999045: DOC: Unclear spec for BevelBorder constructor and BorderFactory factory method (colors switching) Reviewed-by: alexp --- jdk/src/share/classes/javax/swing/BorderFactory.java | 3 --- jdk/src/share/classes/javax/swing/border/BevelBorder.java | 6 +----- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/BorderFactory.java b/jdk/src/share/classes/javax/swing/BorderFactory.java index 8da7dd9579a..19b392ac198 100644 --- a/jdk/src/share/classes/javax/swing/BorderFactory.java +++ b/jdk/src/share/classes/javax/swing/BorderFactory.java @@ -159,9 +159,6 @@ public class BorderFactory * Creates a beveled border of the specified type, using * the specified colors for the inner and outer highlight * and shadow areas. - *

- * Note: The shadow inner and outer colors are - * switched for a lowered bevel border. * * @param type an integer specifying either * BevelBorder.LOWERED or diff --git a/jdk/src/share/classes/javax/swing/border/BevelBorder.java b/jdk/src/share/classes/javax/swing/border/BevelBorder.java index 564d316c43b..bd041aece0c 100644 --- a/jdk/src/share/classes/javax/swing/border/BevelBorder.java +++ b/jdk/src/share/classes/javax/swing/border/BevelBorder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package javax.swing.border; import java.awt.Graphics; import java.awt.Insets; -import java.awt.Rectangle; import java.awt.Color; import java.awt.Component; import java.beans.ConstructorProperties; @@ -82,9 +81,6 @@ public class BevelBorder extends AbstractBorder /** * Creates a bevel border with the specified type, highlight and * shadow colors. - *

- * Note: The shadow inner and outer colors are - * switched for a lowered bevel border. * * @param bevelType the type of bevel for the border * @param highlightOuterColor the color to use for the bevel outer highlight From d18d952e56ca293efb940410280b8180f75df9e2 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Mon, 31 Jan 2011 16:28:40 -0500 Subject: [PATCH 19/84] 7014679: G1: deadlock during concurrent cleanup There's a potential deadlock between the concurrent cleanup thread and the GC workers that are trying to allocate and waiting for more free regions to be made available. Reviewed-by: iveresov, jcoomes --- .../vm/gc_implementation/g1/concurrentMarkThread.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp index 91fdd4a1996..5ff79ac6122 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMarkThread.cpp @@ -251,6 +251,14 @@ void ConcurrentMarkThread::run() { // Now do the remainder of the cleanup operation. _cm->completeCleanup(); + // Notify anyone who's waiting that there are no more free + // regions coming. We have to do this before we join the STS, + // otherwise we might deadlock: a GC worker could be blocked + // waiting for the notification whereas this thread will be + // blocked for the pause to finish while it's trying to join + // the STS, which is conditional on the GC workers finishing. + g1h->reset_free_regions_coming(); + _sts.join(); g1_policy->record_concurrent_mark_cleanup_completed(); _sts.leave(); @@ -262,9 +270,6 @@ void ConcurrentMarkThread::run() { gclog_or_tty->print_cr("[GC concurrent-cleanup-end, %1.7lf]", cleanup_end_sec - cleanup_start_sec); } - - // We're done: no more free regions coming. - g1h->reset_free_regions_coming(); } guarantee(cm()->cleanup_list_is_empty(), "at this point there should be no regions on the cleanup list"); From 8e948a84faeb1eb127dad1fd12de071442ab3568 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Tue, 1 Feb 2011 00:29:26 -0800 Subject: [PATCH 20/84] 7015827: Fix HTML validation issues in java.math package Reviewed-by: mduigou --- .../share/classes/java/math/BigDecimal.java | 28 +++++++++---------- .../share/classes/java/math/RoundingMode.java | 4 +-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/jdk/src/share/classes/java/math/BigDecimal.java b/jdk/src/share/classes/java/math/BigDecimal.java index 578c2c1159c..0d695f3bda5 100644 --- a/jdk/src/share/classes/java/math/BigDecimal.java +++ b/jdk/src/share/classes/java/math/BigDecimal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 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 @@ -121,8 +121,8 @@ import static java.math.BigInteger.LONG_MASK; * scale for each operation is listed in the table below. * * - * + * * * * @@ -661,25 +661,25 @@ public class BigDecimal extends Number implements Comparable { *
{@code .} FractionPart *
IntegerPart *

- *

IntegerPart: - *
Digits + *
IntegerPart: + *
Digits *

- *

FractionPart: - *
Digits + *
FractionPart: + *
Digits *

- *

Exponent: - *
ExponentIndicator SignedInteger + *
Exponent: + *
ExponentIndicator SignedInteger *

*

ExponentIndicator: *
{@code e} *
{@code E} *

- *

SignedInteger: - *
Signopt Digits + *
SignedInteger: + *
Signopt Digits *

- *

Digits: - *
Digit - *
Digits Digit + *
Digits: + *
Digit + *
Digits Digit *

*

Digit: *
any character for which {@link Character#isDigit} diff --git a/jdk/src/share/classes/java/math/RoundingMode.java b/jdk/src/share/classes/java/math/RoundingMode.java index 91c25a73510..69994a4c316 100644 --- a/jdk/src/share/classes/java/math/RoundingMode.java +++ b/jdk/src/share/classes/java/math/RoundingMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2007, 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 @@ -53,7 +53,7 @@ package java.math; * *

*

Preferred Scales for Results of Arithmetic Operations - *

Preferred Scales for Results of Arithmetic Operations + *
OperationPreferred Scale of Result
Addmax(addend.scale(), augend.scale())
Subtractmax(minuend.scale(), subtrahend.scale())
- * + * * * From 85a3f20cefefd9d4f5f88ace61256b5ad564a08c Mon Sep 17 00:00:00 2001 From: Xue-Lei Andrew Fan Date: Tue, 1 Feb 2011 04:45:10 -0800 Subject: [PATCH 21/84] 7011497: new CertPathValidatorException.BasicReason enum constant for constrained algorithm Add new BasicReason and improve trust anchor searching method during cert path validation Reviewed-by: mullan --- .../cert/CertPathValidatorException.java | 9 +- .../certpath/AdaptableX509CertSelector.java | 173 +++++++++++++++++ .../provider/certpath/AlgorithmChecker.java | 21 +- .../certpath/DistributionPointFetcher.java | 43 ++++- .../provider/certpath/ForwardBuilder.java | 180 +++--------------- .../certpath/PKIXCertPathValidator.java | 61 ++++-- .../security/validator/SimpleValidator.java | 6 +- .../CPValidatorEndEntity.java | 23 ++- .../CPValidatorIntermediate.java | 21 +- .../CPValidatorTrustAnchor.java | 14 +- 10 files changed, 360 insertions(+), 191 deletions(-) create mode 100644 jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java diff --git a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java index b58b202cb5f..9eedb620d9a 100644 --- a/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java +++ b/jdk/src/share/classes/java/security/cert/CertPathValidatorException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -286,6 +286,11 @@ public class CertPathValidatorException extends GeneralSecurityException { /** * The signature is invalid. */ - INVALID_SIGNATURE + INVALID_SIGNATURE, + + /** + * The public key or the signature algorithm has been constrained. + */ + ALGORITHM_CONSTRAINED } } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java b/jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java new file mode 100644 index 00000000000..1b14bf8fa66 --- /dev/null +++ b/jdk/src/share/classes/sun/security/provider/certpath/AdaptableX509CertSelector.java @@ -0,0 +1,173 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.provider.certpath; + +import java.io.IOException; +import java.util.Date; + +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.security.cert.X509CertSelector; +import java.security.cert.CertificateException; + +import sun.security.util.DerOutputStream; +import sun.security.x509.SerialNumber; +import sun.security.x509.KeyIdentifier; +import sun.security.x509.AuthorityKeyIdentifierExtension; + +/** + * An adaptable X509 certificate selector for forward certification path + * building. + * + * @since 1.7 + */ +class AdaptableX509CertSelector extends X509CertSelector { + // The start date of a validity period. + private Date startDate = null; + + // The end date of a validity period. + private Date endDate = null; + + AdaptableX509CertSelector() { + super(); + } + + /** + * Sets the criterion of the X509Certificate validity period. + * + * Normally, we may not have to check that a certificate validity period + * must fall within its issuer's certificate validity period. However, + * when we face root CA key updates for version 1 certificates, according + * to scheme of RFC 4210 or 2510, the validity periods should be checked + * to determine the right issuer's certificate. + * + * Conservatively, we will only check the validity periods for version + * 1 and version 2 certificates. For version 3 certificates, we can + * determine the right issuer by authority and subject key identifier + * extensions. + * + * @param startDate the start date of a validity period that must fall + * within the certificate validity period for the X509Certificate + * @param endDate the end date of a validity period that must fall + * within the certificate validity period for the X509Certificate + */ + void setValidityPeriod(Date startDate, Date endDate) { + this.startDate = startDate; + this.endDate = endDate; + } + + /** + * Parse the authority key identifier extension. + * + * If the keyIdentifier field of the extension is non-null, set the + * subjectKeyIdentifier criterion. If the authorityCertSerialNumber + * field is non-null, set the serialNumber criterion. + * + * Note that we will not set the subject criterion according to the + * authorityCertIssuer field of the extension. The caller MUST set + * the subject criterion before call match(). + * + * @param akidext the authorityKeyIdentifier extension + */ + void parseAuthorityKeyIdentifierExtension( + AuthorityKeyIdentifierExtension akidext) throws IOException { + if (akidext != null) { + KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID); + if (akid != null) { + DerOutputStream derout = new DerOutputStream(); + derout.putOctetString(akid.getIdentifier()); + super.setSubjectKeyIdentifier(derout.toByteArray()); + } + + SerialNumber asn = + (SerialNumber)akidext.get(akidext.SERIAL_NUMBER); + if (asn != null) { + super.setSerialNumber(asn.getNumber()); + } + + // the subject criterion should be set by the caller. + } + } + + /** + * Decides whether a Certificate should be selected. + * + * For the purpose of compatibility, when a certificate is of + * version 1 and version 2, or the certificate does not include + * a subject key identifier extension, the selection criterion + * of subjectKeyIdentifier will be disabled. + */ + @Override + public boolean match(Certificate cert) { + if (!(cert instanceof X509Certificate)) { + return false; + } + + X509Certificate xcert = (X509Certificate)cert; + int version = xcert.getVersion(); + + // Check the validity period for version 1 and 2 certificate. + if (version < 3) { + if (startDate != null) { + try { + xcert.checkValidity(startDate); + } catch (CertificateException ce) { + return false; + } + } + + if (endDate != null) { + try { + xcert.checkValidity(endDate); + } catch (CertificateException ce) { + return false; + } + } + } + + if (version < 3 || xcert.getExtensionValue("2.5.29.14") == null) { + // If no SubjectKeyIdentifier extension, don't bother to check it. + setSubjectKeyIdentifier(null); + } + + return super.match(cert); + } + + @Override + public Object clone() { + AdaptableX509CertSelector copy = + (AdaptableX509CertSelector)super.clone(); + if (startDate != null) { + copy.startDate = (Date)startDate.clone(); + } + + if (endDate != null) { + copy.endDate = (Date)endDate.clone(); + } + + return copy; + } +} diff --git a/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java b/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java index 69e560ed4bf..27a9caa8c87 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/AlgorithmChecker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -46,6 +46,8 @@ import java.security.cert.TrustAnchor; import java.security.cert.CRLException; import java.security.cert.CertificateException; import java.security.cert.CertPathValidatorException; +import java.security.cert.CertPathValidatorException.BasicReason; +import java.security.cert.PKIXReason; import java.io.IOException; import java.security.interfaces.*; import java.security.spec.*; @@ -196,14 +198,16 @@ final public class AlgorithmChecker extends PKIXCertPathChecker { SIGNATURE_PRIMITIVE_SET, currSigAlg, currSigAlgParams)) { throw new CertPathValidatorException( - "Algorithm constraints check failed: " + currSigAlg); + "Algorithm constraints check failed: " + currSigAlg, + null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); } // check the key usage and key size boolean[] keyUsage = x509Cert.getKeyUsage(); if (keyUsage != null && keyUsage.length < 9) { throw new CertPathValidatorException( - "incorrect KeyUsage extension"); + "incorrect KeyUsage extension", + null, null, -1, PKIXReason.INVALID_KEY_USAGE); } if (keyUsage != null) { @@ -236,7 +240,8 @@ final public class AlgorithmChecker extends PKIXCertPathChecker { if (!primitives.isEmpty()) { if (!constraints.permits(primitives, currPubKey)) { throw new CertPathValidatorException( - "algorithm constraints check failed"); + "algorithm constraints check failed", + null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); } } } @@ -248,7 +253,8 @@ final public class AlgorithmChecker extends PKIXCertPathChecker { SIGNATURE_PRIMITIVE_SET, currSigAlg, prevPubKey, currSigAlgParams)) { throw new CertPathValidatorException( - "Algorithm constraints check failed: " + currSigAlg); + "Algorithm constraints check failed: " + currSigAlg, + null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); } } @@ -258,7 +264,7 @@ final public class AlgorithmChecker extends PKIXCertPathChecker { // Inherit DSA parameters from previous key if (!(prevPubKey instanceof DSAPublicKey)) { throw new CertPathValidatorException("Input key is not " + - "of a appropriate type for inheriting parameters"); + "of a appropriate type for inheriting parameters"); } DSAParams params = ((DSAPublicKey)prevPubKey).getParams(); @@ -352,7 +358,8 @@ final public class AlgorithmChecker extends PKIXCertPathChecker { if (!certPathDefaultConstraints.permits( SIGNATURE_PRIMITIVE_SET, sigAlgName, key, sigAlgParams)) { throw new CertPathValidatorException( - "algorithm check failed: " + sigAlgName + " is disabled"); + "algorithm check failed: " + sigAlgName + " is disabled", + null, null, -1, BasicReason.ALGORITHM_CONSTRAINED); } } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java index a980e7d1657..e367a1faef4 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -317,7 +317,7 @@ class DistributionPointFetcher { // we accept the case that a CRL issuer provide status // information for itself. - if (ForwardBuilder.issues(certImpl, crlImpl, provider)) { + if (issues(certImpl, crlImpl, provider)) { // reset the public key used to verify the CRL's signature prevKey = certImpl.getPublicKey(); } else { @@ -338,7 +338,7 @@ class DistributionPointFetcher { if (!Arrays.equals(certAKID, crlAKID)) { // we accept the case that a CRL issuer provide status // information for itself. - if (ForwardBuilder.issues(certImpl, crlImpl, provider)) { + if (issues(certImpl, crlImpl, provider)) { // reset the public key used to verify the CRL's signature prevKey = certImpl.getPublicKey(); } else { @@ -687,4 +687,41 @@ class DistributionPointFetcher { fullNames.add(new GeneralName(fullName)); return fullNames; } + + /** Verifies whether a CRL is issued by a certain certificate + * + * @param cert the certificate + * @param crl the CRL to be verified + * @param provider the name of the signature provider + */ + private static boolean issues(X509CertImpl cert, X509CRLImpl crl, + String provider) throws IOException { + + AdaptableX509CertSelector issuerSelector = + new AdaptableX509CertSelector(); + + // check certificate's key usage + boolean[] usages = cert.getKeyUsage(); + if (usages != null) { + usages[6] = true; // cRLSign + issuerSelector.setKeyUsage(usages); + } + + // check certificate's subject + X500Principal crlIssuer = crl.getIssuerX500Principal(); + issuerSelector.setSubject(crlIssuer); + + /* + * Facilitate certification path construction with authority + * key identifier and subject key identifier. + * + * In practice, conforming CAs MUST use the key identifier method, + * and MUST include authority key identifier extension in all CRLs + * issued. [section 5.2.1, RFC 2459] + */ + issuerSelector.parseAuthorityKeyIdentifierExtension( + crl.getAuthKeyIdExtension()); + + return issuerSelector.match(cert); + } } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java index 7e828884940..e9c0ca77879 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/ForwardBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -77,7 +77,7 @@ class ForwardBuilder extends Builder { private final Set trustedSubjectDNs; private final Set trustAnchors; private X509CertSelector eeSelector; - private X509CertSelector caSelector; + private AdaptableX509CertSelector caSelector; private X509CertSelector caTargetSelector; TrustAnchor trustAnchor; private Comparator comparator; @@ -230,9 +230,11 @@ class ForwardBuilder extends Builder { targetCertConstraints.clone(); /* - * Match on certificate validity date + * Since we don't check the validity period of trusted + * certificates, please don't set the certificate valid + * criterion unless the trusted certificate matching is + * completed. */ - caTargetSelector.setCertificateValid(date); /* * Policy processing optimizations @@ -246,17 +248,19 @@ class ForwardBuilder extends Builder { * at least as many CA certs that have already been traversed */ caTargetSelector.setBasicConstraints(currentState.traversedCACerts); - sel = caTargetSelector; + sel = caTargetSelector; } else { if (caSelector == null) { caSelector = new AdaptableX509CertSelector(); /* - * Match on certificate validity date. + * Since we don't check the validity period of trusted + * certificates, please don't set the certificate valid + * criterion unless the trusted certificate matching is + * completed. */ - caSelector.setCertificateValid(date); /* * Policy processing optimizations @@ -290,42 +294,19 @@ class ForwardBuilder extends Builder { */ AuthorityKeyIdentifierExtension akidext = currentState.cert.getAuthorityKeyIdentifierExtension(); - if (akidext != null) { - KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID); - if (akid != null) { - DerOutputStream derout = new DerOutputStream(); - derout.putOctetString(akid.getIdentifier()); - caSelector.setSubjectKeyIdentifier(derout.toByteArray()); - } + caSelector.parseAuthorityKeyIdentifierExtension(akidext); - SerialNumber asn = - (SerialNumber)akidext.get(akidext.SERIAL_NUMBER); - if (asn != null) { - caSelector.setSerialNumber(asn.getNumber()); - } - // the subject criterion was set previously. - } + /* + * check the validity period + */ + caSelector.setValidityPeriod(currentState.cert.getNotBefore(), + currentState.cert.getNotAfter()); sel = caSelector; } - /* - * Check if any of the trusted certs could be a match. - * Since we are not validating the trusted cert, we can't - * re-use the selector we've built up (sel) - we need - * to use a new selector (trustedSel) - */ - X509CertSelector trustedSel = null; - if (currentState.isInitial()) { - trustedSel = targetCertConstraints; - } else { - trustedSel = new X509CertSelector(); - trustedSel.setSubject(currentState.issuerDN); - } - - boolean foundMatchingCert = false; for (X509Certificate trustedCert : trustedCerts) { - if (trustedSel.match(trustedCert)) { + if (sel.match(trustedCert)) { if (debug != null) { debug.println("ForwardBuilder.getMatchingCACerts: " + "found matching trust anchor"); @@ -336,6 +317,11 @@ class ForwardBuilder extends Builder { } } + /* + * The trusted certificate matching is completed. We need to match + * on certificate validity date. + */ + sel.setCertificateValid(date); /* * If we have already traversed as many CA certs as the maxPathLength @@ -348,8 +334,8 @@ class ForwardBuilder extends Builder { (buildParams.getMaxPathLength() == -1) || (buildParams.getMaxPathLength() > currentState.traversedCACerts)) { - if (addMatchingCerts(sel, certStores, caCerts, searchAllCertStores) - && !searchAllCertStores) { + if (addMatchingCerts(sel, certStores, + caCerts, searchAllCertStores) && !searchAllCertStores) { return; } } @@ -939,120 +925,4 @@ class ForwardBuilder extends Builder { void removeFinalCertFromPath(LinkedList certPathList) { certPathList.removeFirst(); } - - /** Verifies whether a CRL is issued by a certain certificate - * - * @param cert the certificate - * @param crl the CRL to be verified - * @param provider the name of the signature provider - */ - static boolean issues(X509CertImpl cert, X509CRLImpl crl, String provider) - throws IOException { - - boolean kidmatched = false; - - // check certificate's key usage - boolean[] usages = cert.getKeyUsage(); - if (usages != null && !usages[6]) { - return false; - } - - // check certificate's SKID and CRL's AKID - AuthorityKeyIdentifierExtension akidext = crl.getAuthKeyIdExtension(); - if (akidext != null) { - // the highest priority, matching KID - KeyIdentifier akid = (KeyIdentifier)akidext.get(akidext.KEY_ID); - if (akid != null) { - SubjectKeyIdentifierExtension skidext = - cert.getSubjectKeyIdentifierExtension(); - if (skidext != null) { - KeyIdentifier skid = - (KeyIdentifier)skidext.get(skidext.KEY_ID); - if (!akid.equals(skid)) { - return false; - } - - kidmatched = true; - } - // conservatively, in case of X509 V1 certificate, - // does return false here if no SKID extension. - } - - // the medium priority, matching issuer name/serial number - SerialNumber asn = (SerialNumber)akidext.get(akidext.SERIAL_NUMBER); - GeneralNames anames = (GeneralNames)akidext.get(akidext.AUTH_NAME); - if (asn != null && anames != null) { - X500Name subject = (X500Name)cert.getSubjectDN(); - BigInteger serial = cert.getSerialNumber(); - - if (serial != null && subject != null) { - if (serial.equals(asn.getNumber())) { - return false; - } - - for (GeneralName name : anames.names()) { - GeneralNameInterface gni = name.getName(); - if (subject.equals(gni)) { - return true; - } - } - } - - return false; - } - - if (kidmatched) { - return true; - } - } - - // the last priority, verify the CRL signature with the cert. - X500Principal crlIssuer = crl.getIssuerX500Principal(); - X500Principal certSubject = cert.getSubjectX500Principal(); - if (certSubject != null && certSubject.equals(crlIssuer)) { - try { - crl.verify(cert.getPublicKey(), provider); - return true; - } catch (Exception e) { - // ignore all exceptions. - } - } - - return false; - } - - /** - * An adaptable X509 certificate selector for forward certification path - * building. - */ - private static class AdaptableX509CertSelector extends X509CertSelector { - public AdaptableX509CertSelector() { - super(); - } - - /** - * Decides whether a Certificate should be selected. - * - * For the purpose of compatibility, when a certificate is of - * version 1 and version 2, or the certificate does not include - * a subject key identifier extension, the selection criterion - * of subjectKeyIdentifier will be disabled. - * - * @Override - */ - public boolean match(Certificate cert) { - if (!(cert instanceof X509Certificate)) { - return false; - } - X509Certificate xcert = (X509Certificate)cert; - - if (xcert.getVersion() < 3 || - xcert.getExtensionValue("2.5.29.14") == null) { - // disable the subjectKeyIdentifier criterion - setSubjectKeyIdentifier(null); - } - - return super.match(cert); - } - } } diff --git a/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java b/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java index d8fbadf199a..a4f83c87bbb 100644 --- a/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java +++ b/jdk/src/share/classes/sun/security/provider/certpath/PKIXCertPathValidator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -50,6 +50,9 @@ import javax.security.auth.x500.X500Principal; import sun.security.action.GetBooleanSecurityPropertyAction; import sun.security.util.Debug; +import sun.security.x509.X509CertImpl; + + /** * This class implements the PKIX validation algorithm for certification * paths consisting exclusively of X509Certificates. It uses @@ -162,6 +165,7 @@ public class PKIXCertPathValidator extends CertPathValidatorSpi { debug.println("PKIXCertPathValidator.engineValidate() " + "anchor.getTrustedCert() != null"); } + // if this trust anchor is not worth trying, // we move on to the next one if (!isWorthTrying(trustedCert, firstCert)) { @@ -211,8 +215,10 @@ public class PKIXCertPathValidator extends CertPathValidatorSpi { * worth trying to validate in the chain. */ private boolean isWorthTrying(X509Certificate trustedCert, - X509Certificate firstCert) - { + X509Certificate firstCert) { + + boolean worthy = false; + if (debug != null) { debug.println("PKIXCertPathValidator.isWorthTrying() checking " + "if this trusted cert is worth trying ..."); @@ -222,19 +228,46 @@ public class PKIXCertPathValidator extends CertPathValidatorSpi { return true; } - // the subject of the trusted cert should match the - // issuer of the first cert in the certpath + AdaptableX509CertSelector issuerSelector = + new AdaptableX509CertSelector(); - X500Principal trustedSubject = trustedCert.getSubjectX500Principal(); - if (trustedSubject.equals(firstCert.getIssuerX500Principal())) { - if (debug != null) - debug.println("YES - try this trustedCert"); - return true; - } else { - if (debug != null) - debug.println("NO - don't try this trustedCert"); - return false; + // check trusted certificate's key usage + boolean[] usages = trustedCert.getKeyUsage(); + if (usages != null) { + usages[5] = true; // keyCertSign + issuerSelector.setKeyUsage(usages); } + + // check trusted certificate's subject + issuerSelector.setSubject(firstCert.getIssuerX500Principal()); + + // check the validity period + issuerSelector.setValidityPeriod(firstCert.getNotBefore(), + firstCert.getNotAfter()); + + /* + * Facilitate certification path construction with authority + * key identifier and subject key identifier. + */ + try { + X509CertImpl firstCertImpl = X509CertImpl.toImpl(firstCert); + issuerSelector.parseAuthorityKeyIdentifierExtension( + firstCertImpl.getAuthorityKeyIdentifierExtension()); + + worthy = issuerSelector.match(trustedCert); + } catch (Exception e) { + // It is not worth trying. + } + + if (debug != null) { + if (worthy) { + debug.println("YES - try this trustedCert"); + } else { + debug.println("NO - don't try this trustedCert"); + } + } + + return worthy; } /** diff --git a/jdk/src/share/classes/sun/security/validator/SimpleValidator.java b/jdk/src/share/classes/sun/security/validator/SimpleValidator.java index f825a4d6867..9ad04b8773e 100644 --- a/jdk/src/share/classes/sun/security/validator/SimpleValidator.java +++ b/jdk/src/share/classes/sun/security/validator/SimpleValidator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 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 @@ -156,8 +156,8 @@ public final class SimpleValidator extends Validator { // check certificate algorithm try { - // Algorithm checker don't care about the unresolved critical - // extensions. + // Algorithm checker does not care about the unresolved + // critical extensions. defaultAlgChecker.check(cert, Collections.emptySet()); if (appAlgChecker != null) { appAlgChecker.check(cert, Collections.emptySet()); diff --git a/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java b/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java index 05e7cc5ad2c..725ed6b5d99 100644 --- a/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java +++ b/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorEndEntity.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -24,8 +24,10 @@ /** * @test * - * @bug 6861062 - * @summary Disable MD2 support + * @bug 6861062 7011497 + * @summary Disable MD2 support. + * New CertPathValidatorException.BasicReason enum constant for + * constrained algorithm. * * @author Xuelei Fan */ @@ -35,6 +37,7 @@ import java.net.SocketException; import java.util.*; import java.security.Security; import java.security.cert.*; +import java.security.cert.CertPathValidatorException.*; public class CPValidatorEndEntity { @@ -329,6 +332,13 @@ public class CPValidatorEndEntity { intermediate_SHA1withRSA_1024_1024); throw new Exception("expected algorithm disabled exception"); } catch (CertPathValidatorException cpve) { + // we may get ClassCastException here + BasicReason reason = (BasicReason)cpve.getReason(); + if (reason != BasicReason.ALGORITHM_CONSTRAINED) { + throw new Exception( + "Expect to get ALGORITHM_CONSTRAINED CPVE", cpve); + } + System.out.println("Get the expected exception " + cpve); } @@ -337,6 +347,13 @@ public class CPValidatorEndEntity { intermediate_SHA1withRSA_512_1024); throw new Exception("expected algorithm disabled exception"); } catch (CertPathValidatorException cpve) { + // we may get ClassCastException here + BasicReason reason = (BasicReason)cpve.getReason(); + if (reason != BasicReason.ALGORITHM_CONSTRAINED) { + throw new Exception( + "Expect to get ALGORITHM_CONSTRAINED CPVE", cpve); + } + System.out.println("Get the expected exception " + cpve); } } diff --git a/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java b/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java index 871afe35483..6b4f3cdc126 100644 --- a/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java +++ b/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorIntermediate.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -24,8 +24,10 @@ /** * @test * - * @bug 6861062 + * @bug 6861062 7011497 * @summary Disable MD2 support + * new CertPathValidatorException.BasicReason enum constant for + * constrained algorithm * * @author Xuelei Fan */ @@ -35,6 +37,7 @@ import java.net.SocketException; import java.util.*; import java.security.Security; import java.security.cert.*; +import java.security.cert.CertPathValidatorException.*; public class CPValidatorIntermediate { @@ -223,6 +226,13 @@ public class CPValidatorIntermediate { validate(intermediate_MD2withRSA_1024_1024); throw new Exception("expected algorithm disabled exception"); } catch (CertPathValidatorException cpve) { + // we may get ClassCastException here + BasicReason reason = (BasicReason)cpve.getReason(); + if (reason != BasicReason.ALGORITHM_CONSTRAINED) { + throw new Exception( + "Expect to get ALGORITHM_CONSTRAINED CPVE", cpve); + } + System.out.println("Get the expected exception " + cpve); } @@ -230,6 +240,13 @@ public class CPValidatorIntermediate { validate(intermediate_MD2withRSA_1024_512); throw new Exception("expected algorithm disabled exception"); } catch (CertPathValidatorException cpve) { + // we may get ClassCastException here + BasicReason reason = (BasicReason)cpve.getReason(); + if (reason != BasicReason.ALGORITHM_CONSTRAINED) { + throw new Exception( + "Expect to get ALGORITHM_CONSTRAINED CPVE", cpve); + } + System.out.println("Get the expected exception " + cpve); } } diff --git a/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java b/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java index 94f7f288a1c..e1a70002073 100644 --- a/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java +++ b/jdk/test/sun/security/provider/certpath/DisabledAlgorithms/CPValidatorTrustAnchor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 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 @@ -24,8 +24,10 @@ /** * @test * - * @bug 6861062 + * @bug 6861062 7011497 * @summary Disable MD2 support + * new CertPathValidatorException.BasicReason enum constant for + * constrained algorithm * * @author Xuelei Fan */ @@ -35,6 +37,7 @@ import java.net.SocketException; import java.util.*; import java.security.Security; import java.security.cert.*; +import java.security.cert.CertPathValidatorException.*; public class CPValidatorTrustAnchor { @@ -142,6 +145,13 @@ public class CPValidatorTrustAnchor { validate(trustAnchor_MD2withRSA_2048); throw new Exception("expected algorithm disabled exception"); } catch (CertPathValidatorException cpve) { + // we may get ClassCastException here + BasicReason reason = (BasicReason)cpve.getReason(); + if (reason != BasicReason.ALGORITHM_CONSTRAINED) { + throw new Exception( + "Expect to get ALGORITHM_CONSTRAINED CPVE", cpve); + } + System.out.println("Get the expected exception " + cpve); } } From 1046ee088f92a118c92fd9630f43a746ff148b4c Mon Sep 17 00:00:00 2001 From: "Y. Srinivas Ramakrishna" Date: Tue, 1 Feb 2011 10:02:01 -0800 Subject: [PATCH 22/84] 6999988: CMS: Increased fragmentation leading to promotion failure after CR#6631166 got implemented Fix calculation of _desired, in free list statistics, which was missing an intended set of parentheses. Reviewed-by: poonam, jmasa --- .../share/vm/gc_implementation/shared/allocationStats.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp index b2d410ad617..4e089c14cde 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp +++ b/hotspot/src/share/vm/gc_implementation/shared/allocationStats.hpp @@ -116,10 +116,8 @@ class AllocationStats VALUE_OBJ_CLASS_SPEC { _demand_rate_estimate.sample(rate); float new_rate = _demand_rate_estimate.padded_average(); ssize_t old_desired = _desired; - _desired = (ssize_t)(new_rate * (inter_sweep_estimate - + CMSExtrapolateSweep - ? intra_sweep_estimate - : 0.0)); + float delta_ise = (CMSExtrapolateSweep ? intra_sweep_estimate : 0.0); + _desired = (ssize_t)(new_rate * (inter_sweep_estimate + delta_ise)); if (PrintFLSStatistics > 1) { gclog_or_tty->print_cr("demand: %d, old_rate: %f, current_rate: %f, new_rate: %f, old_desired: %d, new_desired: %d", demand, old_rate, rate, new_rate, old_desired, _desired); From 1c643e68f0acce46b569cc7834c108946145487c Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Tue, 1 Feb 2011 14:05:46 +0100 Subject: [PATCH 23/84] 6789220: CMS: intermittent timeout running nsk/regression/b4796926 The reference handler java thread and the GC could dead lock Reviewed-by: never, johnc, jcoomes --- hotspot/src/share/vm/compiler/compileBroker.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index b8f7ae47383..c59d4c4ce56 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -1210,7 +1210,17 @@ uint CompileBroker::assign_compile_id(methodHandle method, int osr_bci) { // Should the current thread be blocked until this compilation request // has been fulfilled? bool CompileBroker::is_compile_blocking(methodHandle method, int osr_bci) { - return !BackgroundCompilation; + if (!BackgroundCompilation) { + Symbol* class_name = method->method_holder()->klass_part()->name(); + if (class_name->starts_with("java/lang/ref/Reference", 23)) { + // The reference handler thread can dead lock with the GC if compilation is blocking, + // so we avoid blocking compiles for anything in the java.lang.ref.Reference class, + // including inner classes such as ReferenceHandler. + return false; + } + return true; + } + return false; } From 932380b9e07d8ffdc6c85b63887b50261fd79778 Mon Sep 17 00:00:00 2001 From: Athijegannathan Sundararajan Date: Tue, 1 Feb 2011 21:00:09 +0530 Subject: [PATCH 24/84] 7015908: 3 javax.script tests fail with openjdk build Reviewed-by: alanb --- jdk/test/javax/script/CauseExceptionTest.java | 4 ++++ jdk/test/javax/script/StringWriterPrintTest.java | 4 ++++ jdk/test/javax/script/UnescapedBracketRegExTest.java | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/jdk/test/javax/script/CauseExceptionTest.java b/jdk/test/javax/script/CauseExceptionTest.java index 535717609e9..f1ff708bc1e 100644 --- a/jdk/test/javax/script/CauseExceptionTest.java +++ b/jdk/test/javax/script/CauseExceptionTest.java @@ -34,6 +34,10 @@ public class CauseExceptionTest { public static void main(String[] args) throws ScriptException, NoSuchMethodException { ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine engine = sem.getEngineByName("js"); + if (engine == null) { + System.out.println("Warning: No js engine found; test vacuously passes."); + return; + } engine.eval("function hello_world() { println('hello world'); throw 'out of here'; } "); Invocable invocable = (Invocable) engine; try { diff --git a/jdk/test/javax/script/StringWriterPrintTest.java b/jdk/test/javax/script/StringWriterPrintTest.java index 65b401ce637..42345791878 100644 --- a/jdk/test/javax/script/StringWriterPrintTest.java +++ b/jdk/test/javax/script/StringWriterPrintTest.java @@ -34,6 +34,10 @@ public class StringWriterPrintTest { public static void main(String[] args) throws ScriptException { ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine engine = sem.getEngineByName("js"); + if (engine == null) { + System.out.println("Warning: No js engine found; test vacuously passes."); + return; + } StringWriter sw = new StringWriter(); engine.eval("print(\"hello world 1\\n\")"); engine.getContext().setWriter(sw); diff --git a/jdk/test/javax/script/UnescapedBracketRegExTest.java b/jdk/test/javax/script/UnescapedBracketRegExTest.java index d444ec74aaa..f2a807065f7 100644 --- a/jdk/test/javax/script/UnescapedBracketRegExTest.java +++ b/jdk/test/javax/script/UnescapedBracketRegExTest.java @@ -34,6 +34,10 @@ public class UnescapedBracketRegExTest { public static void main(String[] args) throws ScriptException { ScriptEngineManager sem = new ScriptEngineManager(); ScriptEngine engine = sem.getEngineByName("js"); + if (engine == null) { + System.out.println("Warning: No js engine found; test vacuously passes."); + return; + } // the following throws exception engine.eval("var x = /[a-zA-Z+/=]/;"); } From cba53708ec282f3a62b3c09a825edb0554f94530 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Tue, 1 Feb 2011 11:23:19 -0500 Subject: [PATCH 25/84] 6588413: Use -fvisibility=hidden for gcc compiles Add option for gcc 4 and above, define JNIEXPORT and JNIIMPORT to visibility=default, add for jio_snprintf and others since -fvisibility=hidden overrides --version-script definitions. Reviewed-by: kamg, never --- hotspot/make/linux/makefiles/gcc.make | 5 ++ .../make/linux/makefiles/mapfile-vers-debug | 8 ---- .../make/linux/makefiles/mapfile-vers-product | 8 ---- hotspot/src/cpu/sparc/vm/jni_sparc.h | 9 +++- hotspot/src/cpu/x86/vm/jni_x86.h | 8 +++- hotspot/src/cpu/zero/vm/jni_zero.h | 10 +++- hotspot/src/os/linux/vm/jvm_linux.cpp | 5 -- hotspot/src/os/linux/vm/os_linux.cpp | 46 ++----------------- hotspot/src/os/solaris/vm/os_solaris.cpp | 4 +- .../os_cpu/linux_sparc/vm/os_linux_sparc.cpp | 2 +- .../src/os_cpu/linux_x86/vm/os_linux_x86.cpp | 2 +- .../os_cpu/linux_zero/vm/os_linux_zero.cpp | 2 +- .../solaris_sparc/vm/os_solaris_sparc.cpp | 6 +-- .../os_cpu/solaris_x86/vm/os_solaris_x86.cpp | 6 +-- hotspot/src/share/vm/prims/forte.cpp | 1 + hotspot/src/share/vm/prims/jvm.cpp | 2 +- hotspot/src/share/vm/prims/jvm.h | 8 ++-- 17 files changed, 50 insertions(+), 82 deletions(-) diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make index aa879b10fc3..04c407bce9e 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -75,6 +75,11 @@ CFLAGS += -fno-rtti CFLAGS += -fno-exceptions CFLAGS += -D_REENTRANT CFLAGS += -fcheck-new +# version 4 and above support fvisibility=hidden (matches jni_x86.h file) +# except 4.1.2 gives pointless warnings that can't be disabled (afaik) +ifneq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 3 \) \))" "0" +CFLAGS += -fvisibility=hidden +endif ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG/i486 = -m32 -march=i586 diff --git a/hotspot/make/linux/makefiles/mapfile-vers-debug b/hotspot/make/linux/makefiles/mapfile-vers-debug index a7ba4583ee9..7022aba2e39 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-debug +++ b/hotspot/make/linux/makefiles/mapfile-vers-debug @@ -262,14 +262,6 @@ SUNWprivate_1.1 { JVM_SetField; JVM_SetPrimitiveField; - # Needed for dropping VM into JDK 1.3.x, 1.4 - _JVM_native_threads; - jdk_sem_init; - jdk_sem_post; - jdk_sem_wait; - jdk_pthread_sigmask; - jdk_waitpid; - # debug JVM JVM_AccessVMBooleanFlag; JVM_AccessVMIntFlag; diff --git a/hotspot/make/linux/makefiles/mapfile-vers-product b/hotspot/make/linux/makefiles/mapfile-vers-product index 7f7e279aa2f..201252d2d29 100644 --- a/hotspot/make/linux/makefiles/mapfile-vers-product +++ b/hotspot/make/linux/makefiles/mapfile-vers-product @@ -262,14 +262,6 @@ SUNWprivate_1.1 { JVM_SetField; JVM_SetPrimitiveField; - # Needed for dropping VM into JDK 1.3.x, 1.4 - _JVM_native_threads; - jdk_sem_init; - jdk_sem_post; - jdk_sem_wait; - jdk_pthread_sigmask; - jdk_waitpid; - # miscellaneous functions jio_fprintf; jio_printf; diff --git a/hotspot/src/cpu/sparc/vm/jni_sparc.h b/hotspot/src/cpu/sparc/vm/jni_sparc.h index 9712dfc9d0d..2e177a8692e 100644 --- a/hotspot/src/cpu/sparc/vm/jni_sparc.h +++ b/hotspot/src/cpu/sparc/vm/jni_sparc.h @@ -23,8 +23,13 @@ * questions. */ -#define JNIEXPORT -#define JNIIMPORT +#if defined(__GNUC__) && (__GNUC__ >= 4) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else + #define JNIEXPORT + #define JNIIMPORT +#endif #define JNICALL typedef int jint; diff --git a/hotspot/src/cpu/x86/vm/jni_x86.h b/hotspot/src/cpu/x86/vm/jni_x86.h index c6d322f2b24..9715d0e3237 100644 --- a/hotspot/src/cpu/x86/vm/jni_x86.h +++ b/hotspot/src/cpu/x86/vm/jni_x86.h @@ -27,10 +27,16 @@ #define _JAVASOFT_JNI_MD_H_ #if defined(SOLARIS) || defined(LINUX) + +#if defined(__GNUC__) && (__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else #define JNIEXPORT #define JNIIMPORT - #define JNICALL +#endif + #define JNICALL typedef int jint; #ifdef _LP64 diff --git a/hotspot/src/cpu/zero/vm/jni_zero.h b/hotspot/src/cpu/zero/vm/jni_zero.h index 0e21634dff6..132a6bbb60d 100644 --- a/hotspot/src/cpu/zero/vm/jni_zero.h +++ b/hotspot/src/cpu/zero/vm/jni_zero.h @@ -24,8 +24,14 @@ * questions. */ -#define JNIEXPORT -#define JNIIMPORT + +#if defined(__GNUC__) && (__GNUC__ >= 4) + #define JNIEXPORT __attribute__((visibility("default"))) + #define JNIIMPORT __attribute__((visibility("default"))) +#else + #define JNIEXPORT + #define JNIIMPORT +#endif #define JNICALL typedef int jint; diff --git a/hotspot/src/os/linux/vm/jvm_linux.cpp b/hotspot/src/os/linux/vm/jvm_linux.cpp index ea5bf2d36c7..6e305b80211 100644 --- a/hotspot/src/os/linux/vm/jvm_linux.cpp +++ b/hotspot/src/os/linux/vm/jvm_linux.cpp @@ -29,11 +29,6 @@ #include -/* - * FIXME: This is temporary hack to keep Linux Runtime.exec() - * code happy. See $JDK/src/linux/native/java/lang/UnixProcess_md.c - */ -int _JVM_native_threads = 1; // sun.misc.Signal /////////////////////////////////////////////////////////// // Signal code is mostly copied from classic vm, signals_md.c 1.4 98/08/23 diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 5d34fc50c7d..8f9c60cfd1d 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -2509,8 +2509,10 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info return end; } -extern "C" void numa_warn(int number, char *where, ...) { } -extern "C" void numa_error(char *where) { } +// Something to do with the numa-aware allocator needs these symbols +extern "C" JNIEXPORT void numa_warn(int number, char *where, ...) { } +extern "C" JNIEXPORT void numa_error(char *where) { } +extern "C" JNIEXPORT int fork1() { return fork(); } // If we are running with libnuma version > 2, then we should @@ -3483,7 +3485,7 @@ bool os::is_interrupted(Thread* thread, bool clear_interrupted) { // Note that the VM will print warnings if it detects conflicting signal // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". // -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); @@ -4678,44 +4680,6 @@ void os::pause() { } } -extern "C" { - -/** - * NOTE: the following code is to keep the green threads code - * in the libjava.so happy. Once the green threads is removed, - * these code will no longer be needed. - */ -int -jdk_waitpid(pid_t pid, int* status, int options) { - return waitpid(pid, status, options); -} - -int -fork1() { - return fork(); -} - -int -jdk_sem_init(sem_t *sem, int pshared, unsigned int value) { - return sem_init(sem, pshared, value); -} - -int -jdk_sem_post(sem_t *sem) { - return sem_post(sem); -} - -int -jdk_sem_wait(sem_t *sem) { - return sem_wait(sem); -} - -int -jdk_pthread_sigmask(int how , const sigset_t* newmask, sigset_t* oldmask) { - return pthread_sigmask(how , newmask, oldmask); -} - -} // Refer to the comments in os_solaris.cpp park-unpark. // diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 80c7c4d5058..fad8d4466b5 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -4221,7 +4221,9 @@ void os::os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* met // Note that the VM will print warnings if it detects conflicting signal // handlers, unless invoked with the option "-XX:+AllowUserSignalHandlers". // -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); +extern "C" JNIEXPORT int +JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, + int abort_if_unrecognized); void signalHandler(int sig, siginfo_t* info, void* ucVoid) { diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp index e759e7d8dea..a9984d0e615 100644 --- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp +++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp @@ -542,7 +542,7 @@ inline static bool checkICMiss(sigcontext* uc, address* pc, address* stub) { return false; } -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int sig, siginfo_t* info, void* ucVoid, diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp index f657dfec2d6..b5e159076d5 100644 --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp @@ -216,7 +216,7 @@ extern "C" void FetchNPFI () ; extern "C" void FetchNResume () ; #endif // AMD64 -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int sig, siginfo_t* info, void* ucVoid, diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp index 40e15e2f4f8..afeb60a93f4 100644 --- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp +++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp @@ -116,7 +116,7 @@ frame os::fetch_frame_from_context(void* ucVoid) { ShouldNotCallThis(); } -extern "C" int +extern "C" JNIEXPORT int JVM_handle_linux_signal(int sig, siginfo_t* info, void* ucVoid, diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp index 3b83be3ebba..e9724f1cd8e 100644 --- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp +++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp @@ -317,9 +317,9 @@ extern "C" void Fetch32Resume () ; extern "C" void FetchNPFI () ; extern "C" void FetchNResume () ; -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); - -int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { +extern "C" JNIEXPORT int +JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, + int abort_if_unrecognized) { ucontext_t* uc = (ucontext_t*) ucVoid; Thread* t = ThreadLocalStorage::get_thread_slow(); diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index d9bb0eb58c3..2de4d6969bd 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -365,8 +365,6 @@ bool os::is_allocatable(size_t bytes) { } -extern "C" int JVM_handle_solaris_signal(int signo, siginfo_t* siginfo, void* ucontext, int abort_if_unrecognized); - extern "C" void Fetch32PFI () ; extern "C" void Fetch32Resume () ; #ifdef AMD64 @@ -374,7 +372,9 @@ extern "C" void FetchNPFI () ; extern "C" void FetchNResume () ; #endif // AMD64 -int JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, int abort_if_unrecognized) { +extern "C" JNIEXPORT int +JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, + int abort_if_unrecognized) { ucontext_t* uc = (ucontext_t*) ucVoid; #ifndef AMD64 diff --git a/hotspot/src/share/vm/prims/forte.cpp b/hotspot/src/share/vm/prims/forte.cpp index c1cb5531263..3c48f01d245 100644 --- a/hotspot/src/share/vm/prims/forte.cpp +++ b/hotspot/src/share/vm/prims/forte.cpp @@ -520,6 +520,7 @@ static void forte_fill_call_trace_given_top(JavaThread* thd, // method_id - jmethodID of the method being executed extern "C" { +JNIEXPORT void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) { // This is if'd out because we no longer use thread suspension. diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 86851e686ee..417052502cc 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -2585,7 +2585,7 @@ int jio_vfprintf(FILE* f, const char *fmt, va_list args) { } -int jio_printf(const char *fmt, ...) { +JNIEXPORT int jio_printf(const char *fmt, ...) { int len; va_list args; va_start(args, fmt); diff --git a/hotspot/src/share/vm/prims/jvm.h b/hotspot/src/share/vm/prims/jvm.h index ec8ca4049a6..07097af3cc5 100644 --- a/hotspot/src/share/vm/prims/jvm.h +++ b/hotspot/src/share/vm/prims/jvm.h @@ -1417,16 +1417,16 @@ JVM_GetHostName(char* name, int namelen); * BE CAREFUL! The following functions do not implement the * full feature set of standard C printf formats. */ -int +JNIEXPORT int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args); -int +JNIEXPORT int jio_snprintf(char *str, size_t count, const char *fmt, ...); -int +JNIEXPORT int jio_fprintf(FILE *, const char *fmt, ...); -int +JNIEXPORT int jio_vfprintf(FILE *, const char *fmt, va_list args); From 0c44452fefb789895eddb1606ccb6ff147f2f989 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Tue, 1 Feb 2011 17:44:47 +0000 Subject: [PATCH 26/84] 7015232: missing copyright header in CheckZOrderChange.java Add standard GPL header as on other tests Reviewed-by: anthony --- .../CheckZOrderChange/CheckZOrderChange.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/jdk/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java b/jdk/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java index 0814b52b25d..3c06a523b29 100644 --- a/jdk/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java +++ b/jdk/test/java/awt/Container/CheckZOrderChange/CheckZOrderChange.java @@ -1,3 +1,26 @@ +/* + * Copyright (c) 2008, 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 %I% %E% @bug 2161766 From d0c8cd68156ff41265c19df920953373d35f7662 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Tue, 1 Feb 2011 14:20:01 -0800 Subject: [PATCH 27/84] 7015391: (zipfs) Update zip provider for 1/2011 changes 7014948: (zipfs) ZipFileSystem.newFileSystem(Path...) should not throw FileSystemAlreadyExistsException 7015139: (zipfs) ZipPath.delete() should throw DirectoryNotEmptyException when handling "real, non-empty" dir Zip filesystem provider update Reviewed-by: alanb --- jdk/make/mkdemo/Makefile | 2 +- jdk/src/share/demo/nio/zipfs/Demo.java | 249 +++---- jdk/src/share/demo/nio/zipfs/README.txt | 3 +- .../sun/nio/zipfs/ZipFileAttributeView.java | 17 +- .../src/com/sun/nio/zipfs/ZipFileStore.java | 99 ++- .../src/com/sun/nio/zipfs/ZipFileSystem.java | 129 ++-- .../sun/nio/zipfs/ZipFileSystemProvider.java | 195 ++++- .../zipfs/src/com/sun/nio/zipfs/ZipPath.java | 416 ++++------- jdk/src/share/demo/zipfs | 703 ------------------ jdk/test/demo/zipfs/Basic.java | 33 +- jdk/test/demo/zipfs/PathOps.java | 17 +- jdk/test/demo/zipfs/ZipFSTester.java | 247 +++--- jdk/test/demo/zipfs/basic.sh | 3 +- 13 files changed, 705 insertions(+), 1408 deletions(-) delete mode 100644 jdk/src/share/demo/zipfs diff --git a/jdk/make/mkdemo/Makefile b/jdk/make/mkdemo/Makefile index bb29498d5a7..1e1739467cc 100644 --- a/jdk/make/mkdemo/Makefile +++ b/jdk/make/mkdemo/Makefile @@ -31,7 +31,7 @@ BUILDDIR = .. PRODUCT = demos include $(BUILDDIR)/common/Defs.gmk -SUBDIRS = jni +SUBDIRS = jni nio SUBDIRS_desktop = applets jfc SUBDIRS_management = management SUBDIRS_misc = scripting diff --git a/jdk/src/share/demo/nio/zipfs/Demo.java b/jdk/src/share/demo/nio/zipfs/Demo.java index fd2ba7311b1..9f83633d128 100644 --- a/jdk/src/share/demo/nio/zipfs/Demo.java +++ b/jdk/src/share/demo/nio/zipfs/Demo.java @@ -33,6 +33,7 @@ import java.io.*; import java.nio.*; import java.nio.channels.*; import java.nio.file.*; +import java.nio.file.spi.*; import java.nio.file.attribute.*; import java.net.*; import java.text.DateFormat; @@ -144,16 +145,17 @@ public class Demo { } public static void main(String[] args) throws Throwable { + FileSystemProvider provider = getZipFSProvider(); + if (provider == null) { + System.err.println("ZIP filesystem provider is not installed"); + System.exit(1); + } Action action = Action.valueOf(args[0]); Map env = env = new HashMap<>(); if (action == Action.create) env.put("create", "true"); - if (action == Action.tlist || action == Action.twalk) - env.put("buildDirTree", true); - FileSystem fs = FileSystems.newFileSystem(Paths.get(args[1]), env, null); - - try { + try (FileSystem fs = provider.newFileSystem(Paths.get(args[1]), env)) { FileSystem fs2; Path path, src, dst; boolean isRename = false; @@ -161,61 +163,59 @@ public class Demo { case rename: src = fs.getPath(args[2]); dst = fs.getPath(args[3]); - src.moveTo(dst); + Files.move(src, dst); break; case moveout: src = fs.getPath(args[2]); dst = Paths.get(args[3]); - src.moveTo(dst); + Files.move(src, dst); break; case movein: src = Paths.get(args[2]); dst = fs.getPath(args[3]); - src.moveTo(dst); + Files.move(src, dst); break; case copy: src = fs.getPath(args[2]); dst = fs.getPath(args[3]); - src.copyTo(dst); + Files.copy(src, dst); break; case copyout: src = fs.getPath(args[2]); dst = Paths.get(args[3]); - src.copyTo(dst); + Files.copy(src, dst); break; case copyin: src = Paths.get(args[2]); dst = fs.getPath(args[3]); - src.copyTo(dst); + Files.copy(src, dst); break; case copyin_attrs: src = Paths.get(args[2]); dst = fs.getPath(args[3]); - src.copyTo(dst, COPY_ATTRIBUTES); + Files.copy(src, dst, COPY_ATTRIBUTES); break; case copyout_attrs: src = fs.getPath(args[2]); dst = Paths.get(args[3]); - src.copyTo(dst, COPY_ATTRIBUTES); + Files.copy(src, dst, COPY_ATTRIBUTES); break; case zzmove: - fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); - //sf1.getPath(args[3]).moveTo(fs2.getPath(args[3])); - z2zmove(fs, fs2, args[3]); - fs2.close(); + try (fs2 = provider.newFileSystem(Paths.get(args[2]), env)) { + z2zmove(fs, fs2, args[3]); + } break; case zzcopy: - fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); - //sf1.getPath(args[3]).copyTo(fs2.getPath(args[3])); - z2zcopy(fs, fs2, args[3]); - fs2.close(); + try (fs2 = provider.newFileSystem(Paths.get(args[2]), env)) { + z2zcopy(fs, fs2, args[3]); + } break; case attrs: for (int i = 2; i < args.length; i++) { path = fs.getPath(args[i]); System.out.println(path); System.out.println( - Attributes.readBasicFileAttributes(path).toString()); + Files.readAttributes(path, BasicFileAttributes.class).toString()); } break; case setmtime: @@ -223,10 +223,10 @@ public class Demo { Date newDatetime = df.parse(args[2]); for (int i = 3; i < args.length; i++) { path = fs.getPath(args[i]); - path.setAttribute("lastModifiedTime", - FileTime.fromMillis(newDatetime.getTime())); + Files.setAttribute(path, "lastModifiedTime", + FileTime.fromMillis(newDatetime.getTime())); System.out.println( - Attributes.readBasicFileAttributes(path).toString()); + Files.readAttributes(path, BasicFileAttributes.class).toString()); } break; case setctime: @@ -234,10 +234,10 @@ public class Demo { newDatetime = df.parse(args[2]); for (int i = 3; i < args.length; i++) { path = fs.getPath(args[i]); - path.setAttribute("creationTime", - FileTime.fromMillis(newDatetime.getTime())); + Files.setAttribute(path, "creationTime", + FileTime.fromMillis(newDatetime.getTime())); System.out.println( - Attributes.readBasicFileAttributes(path).toString()); + Files.readAttributes(path, BasicFileAttributes.class).toString()); } break; case setatime: @@ -245,25 +245,22 @@ public class Demo { newDatetime = df.parse(args[2]); for (int i = 3; i < args.length; i++) { path = fs.getPath(args[i]); - path.setAttribute("lastAccessTime", - FileTime.fromMillis(newDatetime.getTime())); + Files.setAttribute(path, "lastAccessTime", + FileTime.fromMillis(newDatetime.getTime())); System.out.println( - Attributes.readBasicFileAttributes(path).toString()); + Files.readAttributes(path, BasicFileAttributes.class).toString()); } break; case attrsspace: path = fs.getPath("/"); - FileStore fstore = path.getFileStore(); - //System.out.println(fstore.getFileStoreAttributeView(FileStoreSpaceAttributeView.class) - // .readAttributes()); - // or + FileStore fstore = Files.getFileStore(path); System.out.printf("filestore[%s]%n", fstore.name()); System.out.printf(" totalSpace: %d%n", - (Long)fstore.getAttribute("space:totalSpace")); + (Long)fstore.getAttribute("totalSpace")); System.out.printf(" usableSpace: %d%n", - (Long)fstore.getAttribute("space:usableSpace")); + (Long)fstore.getAttribute("usableSpace")); System.out.printf(" unallocSpace: %d%n", - (Long)fstore.getAttribute("space:unallocatedSpace")); + (Long)fstore.getAttribute("unallocatedSpace")); break; case list: case tlist: @@ -293,7 +290,7 @@ public class Demo { break; case delete: for (int i = 2; i < args.length; i++) - fs.getPath(args[i]).delete(); + Files.delete(fs.getPath(args[i])); break; case create: case add: @@ -305,17 +302,19 @@ public class Demo { case lsdir: path = fs.getPath(args[2]); final String fStr = (args.length > 3)?args[3]:""; - DirectoryStream ds = path.newDirectoryStream( + try (DirectoryStream ds = Files.newDirectoryStream(path, new DirectoryStream.Filter() { public boolean accept(Path path) { return path.toString().contains(fStr); } - }); - for (Path p : ds) - System.out.println(p); + })) + { + for (Path p : ds) + System.out.println(p); + } break; case mkdir: - fs.getPath(args[2]).createDirectory(); + Files.createDirectory(fs.getPath(args[2])); break; case mkdirs: mkdirs(fs.getPath(args[2])); @@ -326,14 +325,14 @@ public class Demo { System.out.printf("%n%s%n", path); System.out.println("-------(1)---------"); System.out.println( - Attributes.readBasicFileAttributes(path).toString()); + Files.readAttributes(path, BasicFileAttributes.class).toString()); System.out.println("-------(2)---------"); - Map map = path.readAttributes("zip:*"); - for (Map.Entry e : map.entrySet()) { + Map map = Files.readAttributes(path, "zip:*"); + for (Map.Entry e : map.entrySet()) { System.out.printf(" %s : %s%n", e.getKey(), e.getValue()); } System.out.println("-------(3)---------"); - map = path.readAttributes("size,lastModifiedTime,isDirectory"); + map = Files.readAttributes(path, "size,lastModifiedTime,isDirectory"); for (Map.Entry e : map.entrySet()) { System.out.printf(" %s : %s%n", e.getKey(), e.getValue()); } @@ -349,12 +348,17 @@ public class Demo { } } catch (Exception x) { x.printStackTrace(); - } finally { - if (fs != null) - fs.close(); } } + private static FileSystemProvider getZipFSProvider() { + for (FileSystemProvider provider : FileSystemProvider.installedProviders()) { + if ("jar".equals(provider.getScheme())) + return provider; + } + return null; + } + private static byte[] getBytes(String name) { return name.getBytes(); } @@ -380,7 +384,7 @@ public class Demo { BasicFileAttributes attrs) { indent(); - System.out.printf("%s%n", file.getName().toString()); + System.out.printf("%s%n", file.getFileName().toString()); return FileVisitResult.CONTINUE; } @@ -406,35 +410,35 @@ public class Demo { private static void update(FileSystem fs, String path) throws Throwable{ Path src = FileSystems.getDefault().getPath(path); - if (Boolean.TRUE.equals(src.getAttribute("isDirectory"))) { - DirectoryStream ds = src.newDirectoryStream(); - for (Path child : ds) - update(fs, child.toString()); - ds.close(); + if (Files.isDirectory(src)) { + try (DirectoryStream ds = Files.newDirectoryStream(src)) { + for (Path child : ds) + update(fs, child.toString()); + } } else { Path dst = fs.getPath(path); Path parent = dst.getParent(); - if (parent != null && parent.notExists()) + if (parent != null && Files.notExists(parent)) mkdirs(parent); - src.copyTo(dst, REPLACE_EXISTING); + Files.copy(src, dst, REPLACE_EXISTING); } } private static void extract(FileSystem fs, String path) throws Throwable{ Path src = fs.getPath(path); - if (Boolean.TRUE.equals(src.getAttribute("isDirectory"))) { - DirectoryStream ds = src.newDirectoryStream(); - for (Path child : ds) - extract(fs, child.toString()); - ds.close(); + if (Files.isDirectory(src)) { + try (DirectoryStream ds = Files.newDirectoryStream(src)) { + for (Path child : ds) + extract(fs, child.toString()); + } } else { if (path.startsWith("/")) path = path.substring(1); Path dst = FileSystems.getDefault().getPath(path); Path parent = dst.getParent(); - if (parent.notExists()) + if (Files.notExists(parent)) mkdirs(parent); - src.copyTo(dst, REPLACE_EXISTING); + Files.copy(src, dst, REPLACE_EXISTING); } } @@ -445,21 +449,21 @@ public class Demo { Path srcPath = src.getPath(path); Path dstPath = dst.getPath(path); - if (Boolean.TRUE.equals(srcPath.getAttribute("isDirectory"))) { - if (!dstPath.exists()) { + if (Files.isDirectory(srcPath)) { + if (!Files.exists(dstPath)) { try { mkdirs(dstPath); } catch (FileAlreadyExistsException x) {} } - DirectoryStream ds = srcPath.newDirectoryStream(); - for (Path child : ds) { - z2zcopy(src, dst, - path + (path.endsWith("/")?"":"/") + child.getName()); + try (DirectoryStream ds = Files.newDirectoryStream(srcPath)) { + for (Path child : ds) { + z2zcopy(src, dst, + path + (path.endsWith("/")?"":"/") + child.getFileName()); + } } - ds.close(); } else { //System.out.println("copying..." + path); - srcPath.copyTo(dstPath); + Files.copy(srcPath, dstPath); } } @@ -480,9 +484,9 @@ public class Demo { dst = dstPath.resolve(dst); try { Path parent = dstPath.getParent(); - if (parent != null && parent.notExists()) + if (parent != null && Files.notExists(parent)) mkdirs(parent); - file.moveTo(dst); + Files.move(file, dst); } catch (IOException x) { x.printStackTrace(); } @@ -497,7 +501,7 @@ public class Demo { dst = dstPath.resolve(dst); try { - if (dst.notExists()) + if (Files.notExists(dst)) mkdirs(dst); } catch (IOException x) { x.printStackTrace(); @@ -511,7 +515,7 @@ public class Demo { throws IOException { try { - dir.delete(); + Files.delete(dir); } catch (IOException x) { //x.printStackTrace(); } @@ -525,15 +529,15 @@ public class Demo { path = path.toAbsolutePath(); Path parent = path.getParent(); if (parent != null) { - if (parent.notExists()) + if (Files.notExists(parent)) mkdirs(parent); } - path.createDirectory(); + Files.createDirectory(path); } private static void rmdirs(Path path) throws IOException { while (path != null && path.getNameCount() != 0) { - path.delete(); + Files.delete(path); path = path.getParent(); } } @@ -542,15 +546,15 @@ public class Demo { if (!"/".equals(path.toString())) { System.out.printf(" %s%n", path.toString()); if (verbose) - System.out.println(Attributes.readBasicFileAttributes(path).toString()); + System.out.println(Files.readAttributes(path, BasicFileAttributes.class).toString()); } - if (path.notExists()) + if (Files.notExists(path)) return; - if (Attributes.readBasicFileAttributes(path).isDirectory()) { - DirectoryStream ds = path.newDirectoryStream(); - for (Path child : ds) - list(child, verbose); - ds.close(); + if (Files.isDirectory(path)) { + try (DirectoryStream ds = Files.newDirectoryStream(path)) { + for (Path child : ds) + list(child, verbose); + } } } @@ -561,12 +565,11 @@ public class Demo { // src.toString(), dst.toString()); //streams - InputStream isSrc = src.newInputStream(); - InputStream isDst = dst.newInputStream(); byte[] bufSrc = new byte[8192]; byte[] bufDst = new byte[8192]; - - try { + try (InputStream isSrc = Files.newInputStream(src); + InputStream isDst = Files.newInputStream(dst)) + { int nSrc = 0; while ((nSrc = isSrc.read(bufSrc)) != -1) { int nDst = 0; @@ -588,24 +591,22 @@ public class Demo { nSrc--; } } - } finally { - isSrc.close(); - isDst.close(); } // channels - SeekableByteChannel chSrc = src.newByteChannel(); - SeekableByteChannel chDst = dst.newByteChannel(); - if (chSrc.size() != chDst.size()) { - System.out.printf("src[%s].size=%d, dst[%s].size=%d%n", - chSrc.toString(), chSrc.size(), - chDst.toString(), chDst.size()); - throw new RuntimeException("CHECK FAILED!"); - } - ByteBuffer bbSrc = ByteBuffer.allocate(8192); - ByteBuffer bbDst = ByteBuffer.allocate(8192); - try { + try (SeekableByteChannel chSrc = Files.newByteChannel(src); + SeekableByteChannel chDst = Files.newByteChannel(dst)) + { + if (chSrc.size() != chDst.size()) { + System.out.printf("src[%s].size=%d, dst[%s].size=%d%n", + chSrc.toString(), chSrc.size(), + chDst.toString(), chDst.size()); + throw new RuntimeException("CHECK FAILED!"); + } + ByteBuffer bbSrc = ByteBuffer.allocate(8192); + ByteBuffer bbDst = ByteBuffer.allocate(8192); + int nSrc = 0; while ((nSrc = chSrc.read(bbSrc)) != -1) { int nDst = chDst.read(bbDst); @@ -627,9 +628,6 @@ public class Demo { } } catch (IOException x) { x.printStackTrace(); - } finally { - chSrc.close(); - chDst.close(); } } @@ -641,23 +639,15 @@ public class Demo { openwrite.add(CREATE_NEW); openwrite.add(WRITE); - FileChannel srcFc = src.getFileSystem() - .provider() - .newFileChannel(src, read); - FileChannel dstFc = dst.getFileSystem() - .provider() - .newFileChannel(dst, openwrite); - - try { + try (FileChannel srcFc = src.getFileSystem().provider().newFileChannel(src, read); + FileChannel dstFc = dst.getFileSystem().provider().newFileChannel(dst, openwrite)) + { ByteBuffer bb = ByteBuffer.allocate(8192); while (srcFc.read(bb) >= 0) { bb.flip(); dstFc.write(bb); bb.clear(); } - } finally { - srcFc.close(); - dstFc.close(); } } @@ -669,35 +659,28 @@ public class Demo { openwrite.add(CREATE_NEW); openwrite.add(WRITE); - SeekableByteChannel srcCh = src.newByteChannel(read); - SeekableByteChannel dstCh = dst.newByteChannel(openwrite); - - try { + try (SeekableByteChannel srcCh = Files.newByteChannel(src, read); + SeekableByteChannel dstCh = Files.newByteChannel(dst, openwrite)) + { ByteBuffer bb = ByteBuffer.allocate(8192); while (srcCh.read(bb) >= 0) { bb.flip(); dstCh.write(bb); bb.clear(); } - } finally { - srcCh.close(); - dstCh.close(); } } private static void streamCopy(Path src, Path dst) throws IOException { - InputStream isSrc = src.newInputStream(); - OutputStream osDst = dst.newOutputStream(); byte[] buf = new byte[8192]; - try { + try (InputStream isSrc = Files.newInputStream(src); + OutputStream osDst = Files.newOutputStream(dst)) + { int n = 0; while ((n = isSrc.read(buf)) != -1) { osDst.write(buf, 0, n); } - } finally { - isSrc.close(); - osDst.close(); } } } diff --git a/jdk/src/share/demo/nio/zipfs/README.txt b/jdk/src/share/demo/nio/zipfs/README.txt index 9a216e48d70..e147b2900ec 100644 --- a/jdk/src/share/demo/nio/zipfs/README.txt +++ b/jdk/src/share/demo/nio/zipfs/README.txt @@ -5,9 +5,8 @@ The factory methods defined by the java.nio.file.FileSystems class can be used to create a FileSystem, eg: // use file type detection - Map env = Collections.emptyMap(); Path jarfile = Paths.get("foo.jar"); - FileSystem fs = FileSystems.newFileSystem(jarfile, env, null); + FileSystem fs = FileSystems.newFileSystem(jarfile, null); -or diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java index 5c31ebe7ba6..22b183d97a7 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileAttributeView.java @@ -32,11 +32,10 @@ package com.sun.nio.zipfs; -import java.nio.file.attribute.BasicFileAttributeView; -import java.nio.file.attribute.FileAttributeView; -import java.nio.file.attribute.FileTime; +import java.nio.file.attribute.*; import java.io.IOException; import java.util.LinkedHashMap; +import java.util.Map; /* * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal @@ -122,25 +121,19 @@ public class ZipFileAttributeView implements BasicFileAttributeView "' is unknown or read-only attribute"); } - public Object getAttribute(String attribute, boolean domap) + Map readAttributes(String attributes) throws IOException { ZipFileAttributes zfas = readAttributes(); - if (!domap) { - try { - return attribute(AttrID.valueOf(attribute), zfas); - } catch (IllegalArgumentException x) {} - return null; - } LinkedHashMap map = new LinkedHashMap<>(); - if ("*".equals(attribute)) { + if ("*".equals(attributes)) { for (AttrID id : AttrID.values()) { try { map.put(id.name(), attribute(id, zfas)); } catch (IllegalArgumentException x) {} } } else { - String[] as = attribute.split(","); + String[] as = attributes.split(","); for (String a : as) { try { map.put(a, attribute(AttrID.valueOf(a), zfas)); diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java index 681509719e7..05719072de3 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileStore.java @@ -32,14 +32,13 @@ package com.sun.nio.zipfs; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.FileStore; import java.nio.file.FileSystems; import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.FileAttributeView; import java.nio.file.attribute.FileStoreAttributeView; -import java.nio.file.attribute.FileStoreSpaceAttributeView; -import java.nio.file.attribute.FileStoreSpaceAttributes; -import java.nio.file.attribute.Attributes; import java.nio.file.attribute.BasicFileAttributeView; import java.util.Formatter; @@ -87,71 +86,61 @@ public class ZipFileStore extends FileStore { public V getFileStoreAttributeView(Class type) { if (type == null) throw new NullPointerException(); - if (type == FileStoreSpaceAttributeView.class) - return (V) new ZipFileStoreAttributeView(this); - return null; + return (V)null; + } + + @Override + public long getTotalSpace() throws IOException { + return new ZipFileStoreAttributes(this).totalSpace(); + } + + @Override + public long getUsableSpace() throws IOException { + return new ZipFileStoreAttributes(this).usableSpace(); + } + + @Override + public long getUnallocatedSpace() throws IOException { + return new ZipFileStoreAttributes(this).unallocatedSpace(); } @Override public Object getAttribute(String attribute) throws IOException { - if (attribute.equals("space:totalSpace")) - return new ZipFileStoreAttributeView(this).readAttributes().totalSpace(); - if (attribute.equals("space:usableSpace")) - return new ZipFileStoreAttributeView(this).readAttributes().usableSpace(); - if (attribute.equals("space:unallocatedSpace")) - return new ZipFileStoreAttributeView(this).readAttributes().unallocatedSpace(); + if (attribute.equals("totalSpace")) + return getTotalSpace(); + if (attribute.equals("usableSpace")) + return getUsableSpace(); + if (attribute.equals("unallocatedSpace")) + return getUnallocatedSpace(); throw new UnsupportedOperationException("does not support the given attribute"); } - private static class ZipFileStoreAttributeView implements FileStoreSpaceAttributeView { + private static class ZipFileStoreAttributes { + final FileStore fstore; + final long size; - private final ZipFileStore fileStore; - - public ZipFileStoreAttributeView(ZipFileStore fileStore) { - this.fileStore = fileStore; + public ZipFileStoreAttributes(ZipFileStore fileStore) + throws IOException + { + Path path = FileSystems.getDefault().getPath(fileStore.name()); + this.size = Files.size(path); + this.fstore = Files.getFileStore(path); } - @Override - public String name() { - return "space"; + public long totalSpace() { + return size; } - @Override - public FileStoreSpaceAttributes readAttributes() throws IOException { - final String file = fileStore.name(); - Path path = FileSystems.getDefault().getPath(file); - final long size = Attributes.readBasicFileAttributes(path).size(); - final FileStore fstore = path.getFileStore(); - final FileStoreSpaceAttributes fstoreAttrs = - Attributes.readFileStoreSpaceAttributes(fstore); - return new FileStoreSpaceAttributes() { - public long totalSpace() { - return size; - } + public long usableSpace() throws IOException { + if (!fstore.isReadOnly()) + return fstore.getUsableSpace(); + return 0; + } - public long usableSpace() { - if (!fstore.isReadOnly()) - return fstoreAttrs.usableSpace(); - return 0; - } - - public long unallocatedSpace() { - if (!fstore.isReadOnly()) - return fstoreAttrs.unallocatedSpace(); - return 0; - } - - public String toString() { - StringBuilder sb = new StringBuilder(); - Formatter fm = new Formatter(sb); - fm.format("FileStoreSpaceAttributes[%s]%n", file); - fm.format(" totalSpace: %d%n", totalSpace()); - fm.format(" usableSpace: %d%n", usableSpace()); - fm.format(" unallocSpace: %d%n", unallocatedSpace()); - fm.close(); - return sb.toString(); - } - }; + public long unallocatedSpace() throws IOException { + if (!fstore.isReadOnly()) + return fstore.getUnallocatedSpace(); + return 0; } } } diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java index 1cd59db8bc1..40afd8afb84 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystem.java @@ -101,24 +101,25 @@ public class ZipFileSystem extends FileSystem { this.provider = provider; this.zfpath = zfpath; - if (zfpath.notExists()) { + if (Files.notExists(zfpath)) { if (createNew) { - OutputStream os = zfpath.newOutputStream(CREATE_NEW, WRITE); - new END().write(os, 0); - os.close(); + try (OutputStream os = Files.newOutputStream(zfpath, CREATE_NEW, WRITE)) { + new END().write(os, 0); + } } else { throw new FileSystemNotFoundException(zfpath.toString()); } } - zfpath.checkAccess(AccessMode.READ); // sm and existence check + // sm and existence check + zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.READ); try { - zfpath.checkAccess(AccessMode.WRITE); + zfpath.getFileSystem().provider().checkAccess(zfpath, AccessMode.WRITE); } catch (AccessDeniedException x) { this.readOnly = true; } this.zc = ZipCoder.get(nameEncoding); this.defaultdir = new ZipPath(this, getBytes(defaultDir)); - this.ch = zfpath.newByteChannel(READ); + this.ch = Files.newByteChannel(zfpath, READ); this.cen = initCEN(); } @@ -159,9 +160,22 @@ public class ZipFileSystem extends FileSystem { } @Override - public ZipPath getPath(String path) { - if (path.length() == 0) - throw new InvalidPathException(path, "path should not be empty"); + public ZipPath getPath(String first, String... more) { + String path; + if (more.length == 0) { + path = first; + } else { + StringBuilder sb = new StringBuilder(); + sb.append(first); + for (String segment: more) { + if (segment.length() > 0) { + if (sb.length() > 0) + sb.append('/'); + sb.append(segment); + } + } + path = sb.toString(); + } return new ZipPath(this, getBytes(path)); } @@ -268,16 +282,22 @@ public class ZipFileSystem extends FileSystem { def.end(); } + IOException ioe = null; synchronized (tmppaths) { for (Path p: tmppaths) { try { - p.deleteIfExists(); + Files.deleteIfExists(p); } catch (IOException x) { - x.printStackTrace(); + if (ioe == null) + ioe = x; + else + ioe.addSuppressed(x); } } } - provider.removeFileSystem(zfpath); + provider.removeFileSystem(zfpath, this); + if (ioe != null) + throw ioe; } ZipFileAttributes getFileAttributes(byte[] path) @@ -444,7 +464,7 @@ public class ZipFileSystem extends FileSystem { u.bytes = Arrays.copyOf(eSrc.bytes, eSrc.bytes.length); else if (eSrc.file != null) { u.file = getTempPathForEntry(null); - eSrc.file.copyTo(u.file, REPLACE_EXISTING); + Files.copy(eSrc.file, u.file, REPLACE_EXISTING); } } } @@ -778,7 +798,8 @@ public class ZipFileSystem extends FileSystem { fch.close(); if (forWrite) { u.mtime = System.currentTimeMillis(); - u.size = Attributes.readBasicFileAttributes(u.file).size(); + u.size = Files.size(u.file); + update(u); } else { if (!isFCH) // if this is a new fch for reading @@ -805,13 +826,8 @@ public class ZipFileSystem extends FileSystem { if (path != null) { Entry e = getEntry0(path); if (e != null) { - InputStream is = newInputStream(path); - OutputStream os = tmpPath.newOutputStream(WRITE); - try { - copyStream(is, os); - } finally { - is.close(); - os.close(); + try (InputStream is = newInputStream(path)) { + Files.copy(is, tmpPath, REPLACE_EXISTING); } } } @@ -819,7 +835,7 @@ public class ZipFileSystem extends FileSystem { } private void removeTempPathForEntry(Path path) throws IOException { - path.delete(); + Files.delete(path); tmppaths.remove(path); } @@ -1073,11 +1089,11 @@ public class ZipFileSystem extends FileSystem { // shared key. consumer guarantees the "writeLock" before use it. private final IndexNode LOOKUPKEY = IndexNode.keyOf(null); - private void updateDelete(Entry e) { + private void updateDelete(IndexNode inode) { beginWrite(); try { - removeFromTree(e); - inodes.remove(e); + removeFromTree(inode); + inodes.remove(inode); hasUpdate = true; } finally { endWrite(); @@ -1158,7 +1174,7 @@ public class ZipFileSystem extends FileSystem { for (ExChannelCloser ecc : exChClosers) { if (ecc.streams.isEmpty()) { ecc.ch.close(); - ecc.path.delete(); + Files.delete(ecc.path); exChClosers.remove(ecc); } } @@ -1166,7 +1182,7 @@ public class ZipFileSystem extends FileSystem { if (!hasUpdate) return; Path tmpFile = createTempFileInSameDirectoryAs(zfpath); - OutputStream os = tmpFile.newOutputStream(WRITE); + OutputStream os = Files.newOutputStream(tmpFile, WRITE); ArrayList elist = new ArrayList<>(inodes.size()); long written = 0; byte[] buf = new byte[8192]; @@ -1191,26 +1207,26 @@ public class ZipFileSystem extends FileSystem { os.write(e.bytes); // already written += e.bytes.length; } else if (e.file != null) { // tmp file - InputStream is = e.file.newInputStream(); - int n; - if (e.type == Entry.NEW) { // deflated already - while ((n = is.read(buf)) != -1) { - os.write(buf, 0, n); - written += n; + 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 - OutputStream os2 = new EntryOutputStream(e, os); - while ((n = is.read(buf)) != -1) { - os2.write(buf, 0, n); - } - os2.close(); - written += e.csize; - if ((e.flag & FLAG_DATADESCR) != 0) - written += e.writeEXT(os); } - is.close(); - e.file.delete(); + Files.delete(e.file); tmppaths.remove(e.file); } else { // dir, 0-length data @@ -1257,15 +1273,15 @@ public class ZipFileSystem extends FileSystem { createTempFileInSameDirectoryAs(zfpath), ch, streams); - zfpath.moveTo(ecc.path, REPLACE_EXISTING); + Files.move(zfpath, ecc.path, REPLACE_EXISTING); exChClosers.add(ecc); streams = Collections.synchronizedSet(new HashSet()); } else { ch.close(); - zfpath.delete(); + Files.delete(zfpath); } - tmpFile.moveTo(zfpath, REPLACE_EXISTING); + Files.move(tmpFile, zfpath, REPLACE_EXISTING); hasUpdate = false; // clear /* if (isOpen) { @@ -1304,16 +1320,17 @@ public class ZipFileSystem extends FileSystem { throws IOException { checkWritable(); - Entry e = getEntry0(path); - if (e == null) { + + IndexNode inode = getInode(path); + if (inode == null) { if (path != null && path.length == 0) throw new ZipException("root directory can't not be delete"); if (failIfNotExists) throw new NoSuchFileException(getString(path)); } else { - if (e.isDir() && e.child != null) + if (inode.isDir() && inode.child != null) throw new DirectoryNotEmptyException(getString(path)); - updateDelete(e); + updateDelete(inode); } } @@ -1343,7 +1360,7 @@ public class ZipFileSystem extends FileSystem { OutputStream os; if (useTempFile) { e.file = getTempPathForEntry(null); - os = e.file.newOutputStream(WRITE); + os = Files.newOutputStream(e.file, WRITE); } else { os = new ByteArrayOutputStream((e.size > 0)? (int)e.size : 8192); } @@ -1359,12 +1376,12 @@ public class ZipFileSystem extends FileSystem { if (e.bytes != null) eis = new ByteArrayInputStream(e.bytes); else if (e.file != null) - eis = e.file.newInputStream(); + eis = Files.newInputStream(e.file); else throw new ZipException("update entry data is missing"); } else if (e.type == Entry.FILECH) { // FILECH result is un-compressed. - eis = e.file.newInputStream(); + eis = Files.newInputStream(e.file); // TBD: wrap to hook close() // streams.add(eis); return eis; diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java index cf39b07cae7..60c8fed9291 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipFileSystemProvider.java @@ -31,23 +31,18 @@ package com.sun.nio.zipfs; -import java.io.IOException; -import java.nio.channels.FileChannel; -import java.nio.file.FileRef; -import java.nio.file.FileSystem; -import java.nio.file.FileSystemNotFoundException; -import java.nio.file.FileSystemAlreadyExistsException; -import java.nio.file.OpenOption; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.ProviderMismatchException; -import java.nio.file.attribute.FileAttribute; +import java.io.*; +import java.nio.channels.*; +import java.nio.file.*; +import java.nio.file.DirectoryStream.Filter; +import java.nio.file.attribute.*; import java.nio.file.spi.FileSystemProvider; import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.concurrent.ExecutorService; /* * @@ -87,28 +82,25 @@ public class ZipFileSystemProvider extends FileSystemProvider { public FileSystem newFileSystem(URI uri, Map env) throws IOException { - return newFileSystem(uriToPath(uri), env); + return newFileSystem(uriToPath(uri), env, true); } @Override - public FileSystem newFileSystem(FileRef file, Map env) + public FileSystem newFileSystem(Path path, Map env) throws IOException { - if (!(file instanceof Path)) - throw new UnsupportedOperationException(); - Path path = (Path)file; if (!path.toUri().getScheme().equalsIgnoreCase("file")) { throw new UnsupportedOperationException(); } - return newFileSystem(path, env); + return newFileSystem(path, env, false); } - private FileSystem newFileSystem(Path path, Map env) + private FileSystem newFileSystem(Path path, Map env, boolean checkIfFSExists) throws IOException { synchronized(filesystems) { Path realPath = null; - if (path.exists()) { + if (checkIfFSExists && Files.exists(path)) { realPath = path.toRealPath(true); if (filesystems.containsKey(realPath)) throw new FileSystemAlreadyExistsException(); @@ -116,7 +108,8 @@ public class ZipFileSystemProvider extends FileSystemProvider { ZipFileSystem zipfs = new ZipFileSystem(this, path, env); if (realPath == null) realPath = path.toRealPath(true); - filesystems.put(realPath, zipfs); + if (!filesystems.containsKey(realPath)) + filesystems.put(realPath, zipfs); return zipfs; } } @@ -133,18 +126,6 @@ public class ZipFileSystemProvider extends FileSystemProvider { return getFileSystem(uri).getPath(spec.substring(sep + 1)); } - @Override - public FileChannel newFileChannel(Path path, - Set options, - FileAttribute... attrs) - throws IOException - { - if (path == null) - throw new NullPointerException("path is null"); - if (path instanceof ZipPath) - return ((ZipPath)path).newFileChannel(options, attrs); - throw new ProviderMismatchException(); - } @Override public FileSystem getFileSystem(URI uri) { @@ -161,9 +142,155 @@ public class ZipFileSystemProvider extends FileSystemProvider { } } - void removeFileSystem(Path zfpath) throws IOException { + // Checks that the given file is a UnixPath + static final ZipPath toZipPath(Path path) { + if (path == null) + throw new NullPointerException(); + if (!(path instanceof ZipPath)) + throw new ProviderMismatchException(); + return (ZipPath)path; + } + + @Override + public void checkAccess(Path path, AccessMode... modes) throws IOException { + toZipPath(path).checkAccess(modes); + } + + @Override + public void copy(Path src, Path target, CopyOption... options) + throws IOException + { + toZipPath(src).copy(toZipPath(target), options); + } + + @Override + public void createDirectory(Path path, FileAttribute... attrs) + throws IOException + { + toZipPath(path).createDirectory(attrs); + } + + @Override + public final void delete(Path path) throws IOException { + toZipPath(path).delete(); + } + + @Override + @SuppressWarnings("unchecked") + public V + getFileAttributeView(Path path, Class type, LinkOption... options) + { + return (V)ZipFileAttributeView.get(toZipPath(path), type); + } + + @Override + public FileStore getFileStore(Path path) throws IOException { + return toZipPath(path).getFileStore(); + } + + @Override + public boolean isHidden(Path path) { + return toZipPath(path).isHidden(); + } + + @Override + public boolean isSameFile(Path path, Path other) throws IOException { + return toZipPath(path).isSameFile(other); + } + + @Override + public void move(Path src, Path target, CopyOption... options) + throws IOException + { + toZipPath(src).move(toZipPath(target), options); + } + + @Override + public AsynchronousFileChannel newAsynchronousFileChannel(Path path, + Set options, + ExecutorService exec, + FileAttribute... attrs) + throws IOException + { + throw new UnsupportedOperationException(); + } + + @Override + public SeekableByteChannel newByteChannel(Path path, + Set options, + FileAttribute... attrs) + throws IOException + { + return toZipPath(path).newByteChannel(options, attrs); + } + + @Override + public DirectoryStream newDirectoryStream( + Path path, Filter filter) throws IOException + { + return toZipPath(path).newDirectoryStream(filter); + } + + @Override + public FileChannel newFileChannel(Path path, + Set options, + FileAttribute... attrs) + throws IOException + { + return toZipPath(path).newFileChannel(options, attrs); + } + + @Override + public InputStream newInputStream(Path path, OpenOption... options) + throws IOException + { + return toZipPath(path).newInputStream(options); + } + + @Override + public OutputStream newOutputStream(Path path, OpenOption... options) + throws IOException + { + return toZipPath(path).newOutputStream(options); + } + + @Override + public A + readAttributes(Path path, Class type, LinkOption... options) + throws IOException + { + if (type == BasicFileAttributes.class || type == ZipFileAttributes.class) + return (A)toZipPath(path).getAttributes(); + return null; + } + + @Override + public Map + readAttributes(Path path, String attribute, LinkOption... options) + throws IOException + { + return toZipPath(path).readAttributes(attribute, options); + } + + @Override + public Path readSymbolicLink(Path link) throws IOException { + throw new UnsupportedOperationException("Not supported."); + } + + @Override + public void setAttribute(Path path, String attribute, + Object value, LinkOption... options) + throws IOException + { + toZipPath(path).setAttribute(attribute, value, options); + } + + ////////////////////////////////////////////////////////////// + void removeFileSystem(Path zfpath, ZipFileSystem zfs) throws IOException { synchronized (filesystems) { - filesystems.remove(zfpath.toRealPath(true)); + zfpath = zfpath.toRealPath(true); + if (filesystems.get(zfpath) == zfs) + filesystems.remove(zfpath); } } } diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java index f1617db40d2..0c5c1591bb2 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java @@ -31,29 +31,23 @@ package com.sun.nio.zipfs; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; import java.net.URI; -import java.nio.channels.FileChannel; -import java.nio.channels.SeekableByteChannel; +import java.nio.channels.*; import java.nio.file.*; import java.nio.file.DirectoryStream.Filter; -import java.nio.file.attribute.BasicFileAttributeView; -import java.nio.file.attribute.FileAttribute; -import java.nio.file.attribute.FileAttributeView; -import java.nio.file.attribute.FileTime; +import java.nio.file.attribute.*; import java.util.*; import static java.nio.file.StandardOpenOption.*; import static java.nio.file.StandardCopyOption.*; + /** * * @author Xueming Shen, Rajendra Gutupalli,Jaya Hangal */ -public class ZipPath extends Path { +public class ZipPath implements Path { private final ZipFileSystem zfs; private final byte[] path; @@ -82,7 +76,7 @@ public class ZipPath extends Path { } @Override - public Path getName() { + public Path getFileName() { initOffsets(); int count = offsets.length; if (count == 0) @@ -162,8 +156,7 @@ public class ZipPath extends Path { return realPath; } - @Override - public boolean isHidden() { + boolean isHidden() { return false; } @@ -230,7 +223,7 @@ public class ZipPath extends Path { public Path relativize(Path other) { final ZipPath o = checkPath(other); if (o.equals(this)) - return null; + return new ZipPath(getFileSystem(), new byte[0], true); if (/* this.getFileSystem() != o.getFileSystem() || */ this.isAbsolute() != o.isAbsolute()) { throw new IllegalArgumentException(); @@ -277,8 +270,6 @@ public class ZipPath extends Path { @Override public ZipPath resolve(Path other) { - if (other == null) - return this; final ZipPath o = checkPath(other); if (o.isAbsolute()) return o; @@ -297,8 +288,11 @@ public class ZipPath extends Path { } @Override - public ZipPath resolve(String other) { - return resolve(getFileSystem().getPath(other)); + public Path resolveSibling(Path other) { + if (other == null) + throw new NullPointerException(); + Path parent = getParent(); + return (parent == null) ? other : parent.resolve(other); } @Override @@ -332,13 +326,31 @@ public class ZipPath extends Path { return true; } + @Override + public ZipPath resolve(String other) { + return resolve(getFileSystem().getPath(other)); + } + + @Override + public final Path resolveSibling(String other) { + return resolveSibling(getFileSystem().getPath(other)); + } + + @Override + public final boolean startsWith(String other) { + return startsWith(getFileSystem().getPath(other)); + } + + @Override + public final boolean endsWith(String other) { + return endsWith(getFileSystem().getPath(other)); + } + @Override public Path normalize() { byte[] resolved = getResolved(); if (resolved == path) // no change return this; - if (resolved.length == 0) - return null; return new ZipPath(zfs, resolved, true); } @@ -548,198 +560,6 @@ public class ZipPath extends Path { return len1 - len2; } - @Override - public Path createSymbolicLink( - Path target, FileAttribute... attrs) throws IOException { - throw new UnsupportedOperationException("Not supported."); - } - - @Override - public Path createLink( - Path existing) throws IOException { - throw new UnsupportedOperationException("Not supported."); - } - - @Override - public Path readSymbolicLink() throws IOException { - throw new UnsupportedOperationException("Not supported."); - } - - @Override - public Path createDirectory(FileAttribute... attrs) - throws IOException - { - zfs.createDirectory(getResolvedPath(), attrs); - return this; - } - - public final Path createFile(FileAttribute... attrs) - throws IOException - { - OutputStream os = newOutputStream(CREATE_NEW, WRITE); - try { - os.close(); - } catch (IOException x) {} - return this; - } - - @Override - public InputStream newInputStream(OpenOption... options) - throws IOException { - if (options.length > 0) { - for (OpenOption opt : options) { - if (opt != READ) - throw new UnsupportedOperationException("'" + opt + "' not allowed"); - } - } - return zfs.newInputStream(getResolvedPath()); - } - - private static final DirectoryStream.Filter acceptAllFilter = - new DirectoryStream.Filter<>() { - @Override public boolean accept(Path entry) { return true; } - }; - - @Override - public final DirectoryStream newDirectoryStream() throws IOException { - return newDirectoryStream(acceptAllFilter); - } - - @Override - public DirectoryStream newDirectoryStream(Filter filter) - throws IOException - { - return new ZipDirectoryStream(this, filter); - } - - @Override - public final DirectoryStream newDirectoryStream(String glob) - throws IOException - { - // avoid creating a matcher if all entries are required. - if (glob.equals("*")) - return newDirectoryStream(); - - // create a matcher and return a filter that uses it. - final PathMatcher matcher = getFileSystem().getPathMatcher("glob:" + glob); - DirectoryStream.Filter filter = new DirectoryStream.Filter<>() { - @Override - public boolean accept(Path entry) { - return matcher.matches(entry.getName()); - } - }; - return newDirectoryStream(filter); - } - - @Override - public final void delete() throws IOException { - zfs.deleteFile(getResolvedPath(), true); - } - - @Override - public final void deleteIfExists() throws IOException { - zfs.deleteFile(getResolvedPath(), false); - } - - ZipFileAttributes getAttributes() throws IOException - { - ZipFileAttributes zfas = zfs.getFileAttributes(getResolvedPath()); - if (zfas == null) - throw new NoSuchFileException(toString()); - return zfas; - } - - @Override - @SuppressWarnings("unchecked") - public V getFileAttributeView(Class type, - LinkOption... options) - { - return (V)ZipFileAttributeView.get(this, type); - } - - @Override - public void setAttribute(String attribute, - Object value, - LinkOption... options) - throws IOException - { - String type = null; - String attr = null; - int colonPos = attribute.indexOf(':'); - if (colonPos == -1) { - type = "basic"; - attr = attribute; - } else { - type = attribute.substring(0, colonPos++); - attr = attribute.substring(colonPos); - } - ZipFileAttributeView view = ZipFileAttributeView.get(this, type); - if (view == null) - throw new UnsupportedOperationException("view <" + view + "> is not supported"); - view.setAttribute(attr, value); - } - - void setTimes(FileTime mtime, FileTime atime, FileTime ctime) - throws IOException - { - zfs.setTimes(getResolvedPath(), mtime, atime, ctime); - } - - private Object getAttributesImpl(String attribute, boolean domap) - throws IOException - { - String view = null; - String attr = null; - int colonPos = attribute.indexOf(':'); - if (colonPos == -1) { - view = "basic"; - attr = attribute; - } else { - view = attribute.substring(0, colonPos++); - attr = attribute.substring(colonPos); - } - ZipFileAttributeView zfv = ZipFileAttributeView.get(this, view); - if (zfv == null) { - throw new UnsupportedOperationException("view not supported"); - } - return zfv.getAttribute(attr, domap); - } - - @Override - public Object getAttribute(String attribute, LinkOption... options) - throws IOException - { - return getAttributesImpl(attribute, false); - } - - @Override - public Map readAttributes(String attribute, LinkOption... options) - throws IOException - { - return (Map)getAttributesImpl(attribute, true); - } - - @Override - public FileStore getFileStore() throws IOException { - // each ZipFileSystem only has one root (as requested for now) - if (exists()) - return zfs.getFileStore(this); - throw new NoSuchFileException(zfs.getString(path)); - } - - @Override - public boolean isSameFile(Path other) throws IOException { - if (this.equals(other)) - return true; - if (other == null || - this.getFileSystem() != other.getFileSystem()) - return false; - this.checkAccess(); - other.checkAccess(); - return Arrays.equals(this.getResolvedPath(), - ((ZipPath)other).getResolvedPath()); - } - public WatchKey register( WatchService watcher, WatchEvent.Kind[] events, @@ -755,6 +575,11 @@ public class ZipPath extends Path { return register(watcher, events, new WatchEvent.Modifier[0]); } + @Override + public final File toFile() { + throw new UnsupportedOperationException(); + } + @Override public Iterator iterator() { return new Iterator<>() { @@ -783,9 +608,115 @@ public class ZipPath extends Path { }; } - @Override - public SeekableByteChannel newByteChannel(Set options, - FileAttribute... attrs) + ///////////////////////////////////////////////////////////////////// + + + void createDirectory(FileAttribute... attrs) + throws IOException + { + zfs.createDirectory(getResolvedPath(), attrs); + } + + InputStream newInputStream(OpenOption... options) throws IOException + { + if (options.length > 0) { + for (OpenOption opt : options) { + if (opt != READ) + throw new UnsupportedOperationException("'" + opt + "' not allowed"); + } + } + return zfs.newInputStream(getResolvedPath()); + } + + DirectoryStream newDirectoryStream(Filter filter) + throws IOException + { + return new ZipDirectoryStream(this, filter); + } + + void delete() throws IOException { + zfs.deleteFile(getResolvedPath(), true); + } + + void deleteIfExists() throws IOException { + zfs.deleteFile(getResolvedPath(), false); + } + + ZipFileAttributes getAttributes() throws IOException + { + ZipFileAttributes zfas = zfs.getFileAttributes(getResolvedPath()); + if (zfas == null) + throw new NoSuchFileException(toString()); + return zfas; + } + + void setAttribute(String attribute, Object value, LinkOption... options) + throws IOException + { + String type = null; + String attr = null; + int colonPos = attribute.indexOf(':'); + if (colonPos == -1) { + type = "basic"; + attr = attribute; + } else { + type = attribute.substring(0, colonPos++); + attr = attribute.substring(colonPos); + } + ZipFileAttributeView view = ZipFileAttributeView.get(this, type); + if (view == null) + throw new UnsupportedOperationException("view <" + view + "> is not supported"); + view.setAttribute(attr, value); + } + + void setTimes(FileTime mtime, FileTime atime, FileTime ctime) + throws IOException + { + zfs.setTimes(getResolvedPath(), mtime, atime, ctime); + } + + Map readAttributes(String attributes, LinkOption... options) + throws IOException + + { + String view = null; + String attrs = null; + int colonPos = attributes.indexOf(':'); + if (colonPos == -1) { + view = "basic"; + attrs = attributes; + } else { + view = attributes.substring(0, colonPos++); + attrs = attributes.substring(colonPos); + } + ZipFileAttributeView zfv = ZipFileAttributeView.get(this, view); + if (zfv == null) { + throw new UnsupportedOperationException("view not supported"); + } + return zfv.readAttributes(attrs); + } + + FileStore getFileStore() throws IOException { + // each ZipFileSystem only has one root (as requested for now) + if (exists()) + return zfs.getFileStore(this); + throw new NoSuchFileException(zfs.getString(path)); + } + + boolean isSameFile(Path other) throws IOException { + if (this.equals(other)) + return true; + if (other == null || + this.getFileSystem() != other.getFileSystem()) + return false; + this.checkAccess(); + ((ZipPath)other).checkAccess(); + return Arrays.equals(this.getResolvedPath(), + ((ZipPath)other).getResolvedPath()); + } + + SeekableByteChannel newByteChannel(Set options, + FileAttribute... attrs) throws IOException { return zfs.newByteChannel(getResolvedPath(), options, attrs); @@ -799,16 +730,7 @@ public class ZipPath extends Path { return zfs.newFileChannel(getResolvedPath(), options, attrs); } - @Override - public SeekableByteChannel newByteChannel(OpenOption... options) - throws IOException { - Set set = new HashSet<>(options.length); - Collections.addAll(set, options); - return newByteChannel(set); - } - - @Override - public void checkAccess(AccessMode... modes) throws IOException { + void checkAccess(AccessMode... modes) throws IOException { boolean w = false; boolean x = false; for (AccessMode mode : modes) { @@ -834,11 +756,9 @@ public class ZipPath extends Path { } if (x) throw new AccessDeniedException(toString()); - } - @Override - public boolean exists() { + boolean exists() { if (path.length == 1 && path[0] == '/') return true; try { @@ -847,15 +767,7 @@ public class ZipPath extends Path { return false; } - @Override - public boolean notExists() { - return !exists(); - } - - - @Override - public OutputStream newOutputStream(OpenOption... options) - throws IOException + OutputStream newOutputStream(OpenOption... options) throws IOException { if (options.length == 0) return zfs.newOutputStream(getResolvedPath(), @@ -863,42 +775,32 @@ public class ZipPath extends Path { return zfs.newOutputStream(getResolvedPath(), options); } - @Override - public Path moveTo(Path target, CopyOption... options) + void move(ZipPath target, CopyOption... options) throws IOException { - if (this.zfs.provider() == target.getFileSystem().provider() && - this.zfs.getZipFile().isSameFile(((ZipPath)target).zfs.getZipFile())) + if (Files.isSameFile(this.zfs.getZipFile(), target.zfs.getZipFile())) { zfs.copyFile(true, - getResolvedPath(), - ((ZipPath)target).getResolvedPath(), + getResolvedPath(), target.getResolvedPath(), options); } else { copyToTarget(target, options); delete(); } - return target; } - @Override - public Path copyTo(Path target, CopyOption... options) + void copy(ZipPath target, CopyOption... options) throws IOException { - if (this.zfs.provider() == target.getFileSystem().provider() && - this.zfs.getZipFile().isSameFile(((ZipPath)target).zfs.getZipFile())) - { + if (Files.isSameFile(this.zfs.getZipFile(), target.zfs.getZipFile())) zfs.copyFile(false, - getResolvedPath(), - ((ZipPath)target).getResolvedPath(), + getResolvedPath(), target.getResolvedPath(), options); - } else { + else copyToTarget(target, options); - } - return target; } - private void copyToTarget(Path target, CopyOption... options) + private void copyToTarget(ZipPath target, CopyOption... options) throws IOException { boolean replaceExisting = false; @@ -948,7 +850,7 @@ public class ZipPath extends Path { } if (copyAttrs) { BasicFileAttributeView view = - target.getFileAttributeView(BasicFileAttributeView.class); + ZipFileAttributeView.get(target, BasicFileAttributeView.class); try { view.setTimes(zfas.lastModifiedTime(), zfas.lastAccessTime(), diff --git a/jdk/src/share/demo/zipfs b/jdk/src/share/demo/zipfs deleted file mode 100644 index fd2ba7311b1..00000000000 --- a/jdk/src/share/demo/zipfs +++ /dev/null @@ -1,703 +0,0 @@ -/* - * Copyright (c) 2010 Oracle and/or its affiliates. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Oracle nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -import java.io.*; -import java.nio.*; -import java.nio.channels.*; -import java.nio.file.*; -import java.nio.file.attribute.*; -import java.net.*; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.*; - -import static java.nio.file.StandardOpenOption.*; -import static java.nio.file.StandardCopyOption.*; - -/* - * ZipFileSystem usage demo - * - * java Demo action ZipfileName [...] - * - * @author Xueming Shen - */ - -public class Demo { - - static enum Action { - rename, // - // rename entry src to dst inside zipfile - - movein, // - // move an external src file into zipfile - // as entry dst - - moveout, // - // move a zipfile entry src out to dst - - copy, // - // copy entry src to dst inside zipfile - - copyin, // - // copy an external src file into zipfile - // as entry dst - - copyin_attrs, // - // copy an external src file into zipfile - // as entry dst, with attributes (timestamp) - - copyout, // - // copy zipfile entry src" out to file dst - - copyout_attrs, // - - zzmove, // - // move entry path/dir from zfsrc to zfdst - - zzcopy, // - // copy path from zipfile zfsrc to zipfile - // zfdst - - attrs, // - // printout the attributes of entry path - - attrsspace, // - // printout the storespace attrs of entry path - - setmtime, // - // set the lastModifiedTime of entry path - - setatime, // - setctime, // - - lsdir, // - // list dir's direct child files/dirs - - mkdir, // - - mkdirs, // - - rmdirs, // - - list, // - // recursively list all entries of dir - // via DirectoryStream - - tlist, // - // list with buildDirTree=true - - vlist, // - // recursively verbose list all entries of - // dir via DirectoryStream - - walk, // - // recursively walk all entries of dir - // via Files.walkFileTree - - twalk, // - // walk with buildDirTree=true - - extract, // - - update, // - - delete, // - - add, // - - create, // - // create a new zipfile if it doesn't exit - // and then add the file(s) into it. - - attrs2, // - // test different ways to print attrs - - prof, - } - - public static void main(String[] args) throws Throwable { - - Action action = Action.valueOf(args[0]); - Map env = env = new HashMap<>(); - if (action == Action.create) - env.put("create", "true"); - if (action == Action.tlist || action == Action.twalk) - env.put("buildDirTree", true); - FileSystem fs = FileSystems.newFileSystem(Paths.get(args[1]), env, null); - - try { - FileSystem fs2; - Path path, src, dst; - boolean isRename = false; - switch (action) { - case rename: - src = fs.getPath(args[2]); - dst = fs.getPath(args[3]); - src.moveTo(dst); - break; - case moveout: - src = fs.getPath(args[2]); - dst = Paths.get(args[3]); - src.moveTo(dst); - break; - case movein: - src = Paths.get(args[2]); - dst = fs.getPath(args[3]); - src.moveTo(dst); - break; - case copy: - src = fs.getPath(args[2]); - dst = fs.getPath(args[3]); - src.copyTo(dst); - break; - case copyout: - src = fs.getPath(args[2]); - dst = Paths.get(args[3]); - src.copyTo(dst); - break; - case copyin: - src = Paths.get(args[2]); - dst = fs.getPath(args[3]); - src.copyTo(dst); - break; - case copyin_attrs: - src = Paths.get(args[2]); - dst = fs.getPath(args[3]); - src.copyTo(dst, COPY_ATTRIBUTES); - break; - case copyout_attrs: - src = fs.getPath(args[2]); - dst = Paths.get(args[3]); - src.copyTo(dst, COPY_ATTRIBUTES); - break; - case zzmove: - fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); - //sf1.getPath(args[3]).moveTo(fs2.getPath(args[3])); - z2zmove(fs, fs2, args[3]); - fs2.close(); - break; - case zzcopy: - fs2 = FileSystems.newFileSystem(Paths.get(args[2]), env, null); - //sf1.getPath(args[3]).copyTo(fs2.getPath(args[3])); - z2zcopy(fs, fs2, args[3]); - fs2.close(); - break; - case attrs: - for (int i = 2; i < args.length; i++) { - path = fs.getPath(args[i]); - System.out.println(path); - System.out.println( - Attributes.readBasicFileAttributes(path).toString()); - } - break; - case setmtime: - DateFormat df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); - Date newDatetime = df.parse(args[2]); - for (int i = 3; i < args.length; i++) { - path = fs.getPath(args[i]); - path.setAttribute("lastModifiedTime", - FileTime.fromMillis(newDatetime.getTime())); - System.out.println( - Attributes.readBasicFileAttributes(path).toString()); - } - break; - case setctime: - df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); - newDatetime = df.parse(args[2]); - for (int i = 3; i < args.length; i++) { - path = fs.getPath(args[i]); - path.setAttribute("creationTime", - FileTime.fromMillis(newDatetime.getTime())); - System.out.println( - Attributes.readBasicFileAttributes(path).toString()); - } - break; - case setatime: - df = new SimpleDateFormat("MM/dd/yyyy-HH:mm:ss"); - newDatetime = df.parse(args[2]); - for (int i = 3; i < args.length; i++) { - path = fs.getPath(args[i]); - path.setAttribute("lastAccessTime", - FileTime.fromMillis(newDatetime.getTime())); - System.out.println( - Attributes.readBasicFileAttributes(path).toString()); - } - break; - case attrsspace: - path = fs.getPath("/"); - FileStore fstore = path.getFileStore(); - //System.out.println(fstore.getFileStoreAttributeView(FileStoreSpaceAttributeView.class) - // .readAttributes()); - // or - System.out.printf("filestore[%s]%n", fstore.name()); - System.out.printf(" totalSpace: %d%n", - (Long)fstore.getAttribute("space:totalSpace")); - System.out.printf(" usableSpace: %d%n", - (Long)fstore.getAttribute("space:usableSpace")); - System.out.printf(" unallocSpace: %d%n", - (Long)fstore.getAttribute("space:unallocatedSpace")); - break; - case list: - case tlist: - if (args.length < 3) - list(fs.getPath("/"), false); - else - list(fs.getPath(args[2]), false); - break; - case vlist: - if (args.length < 3) - list(fs.getPath("/"), true); - else - list(fs.getPath(args[2]), true); - break; - case twalk: - case walk: - walk(fs.getPath((args.length > 2)? args[2] : "/")); - break; - case extract: - if (args.length == 2) { - extract(fs, "/"); - } else { - for (int i = 2; i < args.length; i++) { - extract(fs, args[i]); - } - } - break; - case delete: - for (int i = 2; i < args.length; i++) - fs.getPath(args[i]).delete(); - break; - case create: - case add: - case update: - for (int i = 2; i < args.length; i++) { - update(fs, args[i]); - } - break; - case lsdir: - path = fs.getPath(args[2]); - final String fStr = (args.length > 3)?args[3]:""; - DirectoryStream ds = path.newDirectoryStream( - new DirectoryStream.Filter() { - public boolean accept(Path path) { - return path.toString().contains(fStr); - } - }); - for (Path p : ds) - System.out.println(p); - break; - case mkdir: - fs.getPath(args[2]).createDirectory(); - break; - case mkdirs: - mkdirs(fs.getPath(args[2])); - break; - case attrs2: - for (int i = 2; i < args.length; i++) { - path = fs.getPath(args[i]); - System.out.printf("%n%s%n", path); - System.out.println("-------(1)---------"); - System.out.println( - Attributes.readBasicFileAttributes(path).toString()); - System.out.println("-------(2)---------"); - Map map = path.readAttributes("zip:*"); - for (Map.Entry e : map.entrySet()) { - System.out.printf(" %s : %s%n", e.getKey(), e.getValue()); - } - System.out.println("-------(3)---------"); - map = path.readAttributes("size,lastModifiedTime,isDirectory"); - for (Map.Entry e : map.entrySet()) { - System.out.printf(" %s : %s%n", e.getKey(), e.getValue()); - } - } - break; - case prof: - list(fs.getPath("/"), false); - while (true) { - Thread.sleep(10000); - //list(fs.getPath("/"), true); - System.out.println("sleeping..."); - } - } - } catch (Exception x) { - x.printStackTrace(); - } finally { - if (fs != null) - fs.close(); - } - } - - private static byte[] getBytes(String name) { - return name.getBytes(); - } - - private static String getString(byte[] name) { - return new String(name); - } - - private static void walk(Path path) throws IOException - { - Files.walkFileTree( - path, - new SimpleFileVisitor() { - private int indent = 0; - private void indent() { - int n = 0; - while (n++ < indent) - System.out.printf(" "); - } - - @Override - public FileVisitResult visitFile(Path file, - BasicFileAttributes attrs) - { - indent(); - System.out.printf("%s%n", file.getName().toString()); - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult preVisitDirectory(Path dir, - BasicFileAttributes attrs) - { - indent(); - System.out.printf("[%s]%n", dir.toString()); - indent += 2; - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, - IOException ioe) - { - indent -= 2; - return FileVisitResult.CONTINUE; - } - }); - } - - private static void update(FileSystem fs, String path) throws Throwable{ - Path src = FileSystems.getDefault().getPath(path); - if (Boolean.TRUE.equals(src.getAttribute("isDirectory"))) { - DirectoryStream ds = src.newDirectoryStream(); - for (Path child : ds) - update(fs, child.toString()); - ds.close(); - } else { - Path dst = fs.getPath(path); - Path parent = dst.getParent(); - if (parent != null && parent.notExists()) - mkdirs(parent); - src.copyTo(dst, REPLACE_EXISTING); - } - } - - private static void extract(FileSystem fs, String path) throws Throwable{ - Path src = fs.getPath(path); - if (Boolean.TRUE.equals(src.getAttribute("isDirectory"))) { - DirectoryStream ds = src.newDirectoryStream(); - for (Path child : ds) - extract(fs, child.toString()); - ds.close(); - } else { - if (path.startsWith("/")) - path = path.substring(1); - Path dst = FileSystems.getDefault().getPath(path); - Path parent = dst.getParent(); - if (parent.notExists()) - mkdirs(parent); - src.copyTo(dst, REPLACE_EXISTING); - } - } - - // use DirectoryStream - private static void z2zcopy(FileSystem src, FileSystem dst, String path) - throws IOException - { - Path srcPath = src.getPath(path); - Path dstPath = dst.getPath(path); - - if (Boolean.TRUE.equals(srcPath.getAttribute("isDirectory"))) { - if (!dstPath.exists()) { - try { - mkdirs(dstPath); - } catch (FileAlreadyExistsException x) {} - } - DirectoryStream ds = srcPath.newDirectoryStream(); - for (Path child : ds) { - z2zcopy(src, dst, - path + (path.endsWith("/")?"":"/") + child.getName()); - } - ds.close(); - } else { - //System.out.println("copying..." + path); - srcPath.copyTo(dstPath); - } - } - - // use TreeWalk to move - private static void z2zmove(FileSystem src, FileSystem dst, String path) - throws IOException - { - final Path srcPath = src.getPath(path).toAbsolutePath(); - final Path dstPath = dst.getPath(path).toAbsolutePath(); - - Files.walkFileTree(srcPath, new SimpleFileVisitor() { - - @Override - public FileVisitResult visitFile(Path file, - BasicFileAttributes attrs) - { - Path dst = srcPath.relativize(file); - dst = dstPath.resolve(dst); - try { - Path parent = dstPath.getParent(); - if (parent != null && parent.notExists()) - mkdirs(parent); - file.moveTo(dst); - } catch (IOException x) { - x.printStackTrace(); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult preVisitDirectory(Path dir, - BasicFileAttributes attrs) - { - Path dst = srcPath.relativize(dir); - dst = dstPath.resolve(dst); - try { - - if (dst.notExists()) - mkdirs(dst); - } catch (IOException x) { - x.printStackTrace(); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, - IOException ioe) - throws IOException - { - try { - dir.delete(); - } catch (IOException x) { - //x.printStackTrace(); - } - return FileVisitResult.CONTINUE; - } - }); - - } - - private static void mkdirs(Path path) throws IOException { - path = path.toAbsolutePath(); - Path parent = path.getParent(); - if (parent != null) { - if (parent.notExists()) - mkdirs(parent); - } - path.createDirectory(); - } - - private static void rmdirs(Path path) throws IOException { - while (path != null && path.getNameCount() != 0) { - path.delete(); - path = path.getParent(); - } - } - - private static void list(Path path, boolean verbose ) throws IOException { - if (!"/".equals(path.toString())) { - System.out.printf(" %s%n", path.toString()); - if (verbose) - System.out.println(Attributes.readBasicFileAttributes(path).toString()); - } - if (path.notExists()) - return; - if (Attributes.readBasicFileAttributes(path).isDirectory()) { - DirectoryStream ds = path.newDirectoryStream(); - for (Path child : ds) - list(child, verbose); - ds.close(); - } - } - - // check the content of two paths are equal - private static void checkEqual(Path src, Path dst) throws IOException - { - //System.out.printf("checking <%s> vs <%s>...%n", - // src.toString(), dst.toString()); - - //streams - InputStream isSrc = src.newInputStream(); - InputStream isDst = dst.newInputStream(); - byte[] bufSrc = new byte[8192]; - byte[] bufDst = new byte[8192]; - - try { - int nSrc = 0; - while ((nSrc = isSrc.read(bufSrc)) != -1) { - int nDst = 0; - while (nDst < nSrc) { - int n = isDst.read(bufDst, nDst, nSrc - nDst); - if (n == -1) { - System.out.printf("checking <%s> vs <%s>...%n", - src.toString(), dst.toString()); - throw new RuntimeException("CHECK FAILED!"); - } - nDst += n; - } - while (--nSrc >= 0) { - if (bufSrc[nSrc] != bufDst[nSrc]) { - System.out.printf("checking <%s> vs <%s>...%n", - src.toString(), dst.toString()); - throw new RuntimeException("CHECK FAILED!"); - } - nSrc--; - } - } - } finally { - isSrc.close(); - isDst.close(); - } - - // channels - SeekableByteChannel chSrc = src.newByteChannel(); - SeekableByteChannel chDst = dst.newByteChannel(); - if (chSrc.size() != chDst.size()) { - System.out.printf("src[%s].size=%d, dst[%s].size=%d%n", - chSrc.toString(), chSrc.size(), - chDst.toString(), chDst.size()); - throw new RuntimeException("CHECK FAILED!"); - } - ByteBuffer bbSrc = ByteBuffer.allocate(8192); - ByteBuffer bbDst = ByteBuffer.allocate(8192); - - try { - int nSrc = 0; - while ((nSrc = chSrc.read(bbSrc)) != -1) { - int nDst = chDst.read(bbDst); - if (nSrc != nDst) { - System.out.printf("checking <%s> vs <%s>...%n", - src.toString(), dst.toString()); - throw new RuntimeException("CHECK FAILED!"); - } - while (--nSrc >= 0) { - if (bbSrc.get(nSrc) != bbDst.get(nSrc)) { - System.out.printf("checking <%s> vs <%s>...%n", - src.toString(), dst.toString()); - throw new RuntimeException("CHECK FAILED!"); - } - nSrc--; - } - bbSrc.flip(); - bbDst.flip(); - } - } catch (IOException x) { - x.printStackTrace(); - } finally { - chSrc.close(); - chDst.close(); - } - } - - private static void fchCopy(Path src, Path dst) throws IOException - { - Set read = new HashSet<>(); - read.add(READ); - Set openwrite = new HashSet<>(); - openwrite.add(CREATE_NEW); - openwrite.add(WRITE); - - FileChannel srcFc = src.getFileSystem() - .provider() - .newFileChannel(src, read); - FileChannel dstFc = dst.getFileSystem() - .provider() - .newFileChannel(dst, openwrite); - - try { - ByteBuffer bb = ByteBuffer.allocate(8192); - while (srcFc.read(bb) >= 0) { - bb.flip(); - dstFc.write(bb); - bb.clear(); - } - } finally { - srcFc.close(); - dstFc.close(); - } - } - - private static void chCopy(Path src, Path dst) throws IOException - { - Set read = new HashSet<>(); - read.add(READ); - Set openwrite = new HashSet<>(); - openwrite.add(CREATE_NEW); - openwrite.add(WRITE); - - SeekableByteChannel srcCh = src.newByteChannel(read); - SeekableByteChannel dstCh = dst.newByteChannel(openwrite); - - try { - ByteBuffer bb = ByteBuffer.allocate(8192); - while (srcCh.read(bb) >= 0) { - bb.flip(); - dstCh.write(bb); - bb.clear(); - } - } finally { - srcCh.close(); - dstCh.close(); - } - } - - private static void streamCopy(Path src, Path dst) throws IOException - { - InputStream isSrc = src.newInputStream(); - OutputStream osDst = dst.newOutputStream(); - byte[] buf = new byte[8192]; - try { - int n = 0; - while ((n = isSrc.read(buf)) != -1) { - osDst.write(buf, 0, n); - } - } finally { - isSrc.close(); - osDst.close(); - } - } -} diff --git a/jdk/test/demo/zipfs/Basic.java b/jdk/test/demo/zipfs/Basic.java index 8341b939273..c0e478bc8f2 100644 --- a/jdk/test/demo/zipfs/Basic.java +++ b/jdk/test/demo/zipfs/Basic.java @@ -48,9 +48,9 @@ public class Basic { if (!found) throw new RuntimeException("'jar' provider not installed"); - // Test: FileSystems#newFileSystem(FileRef) + // Test: FileSystems#newFileSystem(Path) Map env = new HashMap(); - FileSystems.newFileSystem(zipfile, env, null).close(); + FileSystems.newFileSystem(zipfile, null).close(); // Test: FileSystems#newFileSystem(URI) URI uri = new URI("jar", zipfile.toUri().toString(), null); @@ -69,14 +69,11 @@ public class Basic { // Test: DirectoryStream found = false; - DirectoryStream stream = fs.getPath("/").newDirectoryStream(); - try { + try (DirectoryStream stream = Files.newDirectoryStream(fs.getPath("/"))) { for (Path entry: stream) { found = entry.toString().equals("/META-INF/"); if (found) break; } - } finally { - stream.close(); } if (!found) @@ -84,21 +81,21 @@ public class Basic { // Test: copy file from zip file to current (scratch) directory Path source = fs.getPath("/META-INF/services/java.nio.file.spi.FileSystemProvider"); - if (source.exists()) { - Path target = Paths.get(source.getName().toString()); - source.copyTo(target, StandardCopyOption.REPLACE_EXISTING); + if (Files.exists(source)) { + Path target = Paths.get(source.getFileName().toString()); + Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING); try { - long s1 = Attributes.readBasicFileAttributes(source).size(); - long s2 = Attributes.readBasicFileAttributes(target).size(); + long s1 = Files.readAttributes(source, BasicFileAttributes.class).size(); + long s2 = Files.readAttributes(target, BasicFileAttributes.class).size(); if (s2 != s1) throw new RuntimeException("target size != source size"); } finally { - target.delete(); + Files.delete(target); } } // Test: FileStore - FileStore store = fs.getPath("/").getFileStore(); + FileStore store = Files.getFileStore(fs.getPath("/")); if (!store.supportsFileAttributeView("basic")) throw new RuntimeException("BasicFileAttributeView should be supported"); @@ -107,7 +104,7 @@ public class Basic { if (fs.isOpen()) throw new RuntimeException("FileSystem should be closed"); try { - fs.getPath("/missing").checkAccess(AccessMode.READ); + fs.provider().checkAccess(fs.getPath("/missing"), AccessMode.READ); } catch (ClosedFileSystemException x) { } } @@ -125,9 +122,9 @@ public class Basic { public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { - if (dir.getName() != null) { + if (dir.getFileName() != null) { indent(); - System.out.println(dir.getName() + "/"); + System.out.println(dir.getFileName() + "/"); indent++; } return FileVisitResult.CONTINUE; @@ -138,7 +135,7 @@ public class Basic { BasicFileAttributes attrs) { indent(); - System.out.print(file.getName()); + System.out.print(file.getFileName()); if (attrs.isRegularFile()) System.out.format(" (%d)", attrs.size()); System.out.println(); @@ -151,7 +148,7 @@ public class Basic { { if (exc != null) super.postVisitDirectory(dir, exc); - if (dir.getName() != null) + if (dir.getFileName() != null) indent--; return FileVisitResult.CONTINUE; } diff --git a/jdk/test/demo/zipfs/PathOps.java b/jdk/test/demo/zipfs/PathOps.java index 64b78e64ce4..f08ce4f723a 100644 --- a/jdk/test/demo/zipfs/PathOps.java +++ b/jdk/test/demo/zipfs/PathOps.java @@ -100,7 +100,7 @@ public class PathOps { PathOps name(String expected) { out.println("check name"); checkPath(); - check(path.getName(), expected); + check(path.getFileName(), expected); return this; } @@ -197,7 +197,7 @@ public class PathOps { try { out.println("check two paths are same"); checkPath(); - check(path.isSameFile(test(target).path()), true); + check(Files.isSameFile(path, test(target).path()), true); } catch (IOException ioe) { fail(); } @@ -320,7 +320,7 @@ public class PathOps { // relativize test("/a/b/c") - .relativize("/a/b/c", null) + .relativize("/a/b/c", "") .relativize("/a/b/c/d/e", "d/e") .relativize("/a/x", "../../x"); @@ -332,7 +332,7 @@ public class PathOps { test("/foo") .normalize("/foo"); test(".") - .normalize(null); + .normalize(""); test("..") .normalize(".."); test("/..") @@ -344,7 +344,7 @@ public class PathOps { test("./foo") .normalize("foo"); test("foo/..") - .normalize(null); + .normalize(""); test("../foo") .normalize("../foo"); test("../../foo") @@ -411,13 +411,13 @@ public class PathOps { } try { - path.startsWith(null); + path.startsWith((Path)null); throw new RuntimeException("NullPointerException not thrown"); } catch (NullPointerException npe) { } try { - path.endsWith(null); + path.endsWith((Path)null); throw new RuntimeException("NullPointerException not thrown"); } catch (NullPointerException npe) { } @@ -427,8 +427,7 @@ public class PathOps { public static void main(String[] args) throws Throwable { Path zipfile = Paths.get(args[0]); - Map env = new HashMap(); - fs = FileSystems.newFileSystem(zipfile, env, null); + fs = FileSystems.newFileSystem(zipfile, null); npes(); doPathOpTests(); fs.close(); diff --git a/jdk/test/demo/zipfs/ZipFSTester.java b/jdk/test/demo/zipfs/ZipFSTester.java index d4c5b44007b..71dfa8d26a2 100644 --- a/jdk/test/demo/zipfs/ZipFSTester.java +++ b/jdk/test/demo/zipfs/ZipFSTester.java @@ -25,6 +25,7 @@ import java.io.*; import java.nio.*; import java.nio.channels.*; import java.nio.file.*; +import java.nio.file.spi.*; import java.nio.file.attribute.*; import java.net.*; import java.util.*; @@ -40,15 +41,13 @@ import static java.nio.file.StandardCopyOption.*; public class ZipFSTester { public static void main(String[] args) throws Throwable { - FileSystem fs = null; - try { - fs = newZipFileSystem(Paths.get(args[0]), new HashMap()); + + try (FileSystem fs = newZipFileSystem(Paths.get(args[0]), + new HashMap())) + { test0(fs); test1(fs); test2(fs); // more tests - } finally { - if (fs != null) - fs.close(); } } @@ -63,10 +62,10 @@ public class ZipFSTester { } for (String pname : list) { Path path = fs.getPath(pname); - if (!path.exists()) + if (!Files.exists(path)) throw new RuntimeException("path existence check failed!"); while ((path = path.getParent()) != null) { - if (!path.exists()) + if (!Files.exists(path)) throw new RuntimeException("parent existence check failed!"); } } @@ -85,12 +84,22 @@ public class ZipFSTester { z2zcopy(fs, fs0, "/", 0); fs0.close(); // sync to file - fs = newZipFileSystem(tmpfsPath, new HashMap()); - try { + try (fs = newZipFileSystem(tmpfsPath, new HashMap())) { + + FileSystemProvider provider = fs.provider(); + // newFileSystem(path...) should not throw exception + try (FileSystem fsPath = provider.newFileSystem(tmpfsPath, new HashMap())){} + try (FileSystem fsUri = provider.newFileSystem( + new URI("jar", tmpfsPath.toUri().toString(), null), + new HashMap())) + { + throw new RuntimeException("newFileSystem(uri...) does not throw exception"); + } catch (FileSystemAlreadyExistsException fsaee) {} + // prepare a src Path src = getTempPath(); String tmpName = src.toString(); - OutputStream os = src.newOutputStream(); + OutputStream os = Files.newOutputStream(src); byte[] bits = new byte[12345]; rdm.nextBytes(bits); os.write(bits); @@ -98,37 +107,37 @@ public class ZipFSTester { // copyin Path dst = getPathWithParents(fs, tmpName); - src.copyTo(dst); + Files.copy(src, dst); checkEqual(src, dst); // copy Path dst2 = getPathWithParents(fs, "/xyz" + rdm.nextInt(100) + "/efg" + rdm.nextInt(100) + "/foo.class"); - dst.copyTo(dst2); + Files.copy(dst, dst2); //dst.moveTo(dst2); checkEqual(src, dst2); // delete - dst.delete(); - if (dst.exists()) + Files.delete(dst); + if (Files.exists(dst)) throw new RuntimeException("Failed!"); // moveout Path dst3 = Paths.get(tmpName + "_Tmp"); - dst2.moveTo(dst3); + Files.move(dst2, dst3); checkEqual(src, dst3); // delete - if (dst2.exists()) + if (Files.exists(dst2)) throw new RuntimeException("Failed!"); - dst3.delete(); - if (dst3.exists()) + Files.delete(dst3); + if (Files.exists(dst3)) throw new RuntimeException("Failed!"); // newInputStream on dir Path parent = dst2.getParent(); try { - parent.newInputStream(); + Files.newInputStream(parent); throw new RuntimeException("Failed"); } catch (FileSystemException e) { e.printStackTrace(); // expected fse @@ -147,17 +156,15 @@ public class ZipFSTester { Path tmp = Paths.get(tmpName + "_Tmp"); fchCopy(dst, tmp); // out checkEqual(src, tmp); - tmp.delete(); + Files.delete(tmp); // test channels channel(fs, dst); - dst.delete(); - src.delete(); + Files.delete(dst); + Files.delete(src); } finally { - if (fs != null) - fs.close(); - if (tmpfsPath.exists()) - tmpfsPath.delete(); + if (Files.exists(tmpfsPath)) + Files.delete(tmpfsPath); } } @@ -242,7 +249,7 @@ public class ZipFSTester { while (itr.hasNext()) { String path = itr.next(); try { - if (fs2.getPath(path).exists()) { + if (Files.exists(fs2.getPath(path))) { z2zmove(fs2, fs3, path); itr.remove(); } @@ -296,15 +303,16 @@ public class ZipFSTester { fs4.close(); System.out.printf("failed=%d%n", failed); - fs1Path.delete(); - fs2Path.delete(); - fs3Path.delete(); + Files.delete(fs1Path); + Files.delete(fs2Path); + Files.delete(fs3Path); } private static FileSystem newZipFileSystem(Path path, Map env) - throws IOException + throws Exception { - return FileSystems.newFileSystem(path, env, null); + return FileSystems.newFileSystem( + new URI("jar", path.toUri().toString(), null), env, null); } private static Path getTempPath() throws IOException @@ -317,11 +325,11 @@ public class ZipFSTester { private static void list(Path path, List files, List dirs ) throws IOException { - if (Attributes.readBasicFileAttributes(path).isDirectory()) { - DirectoryStream ds = path.newDirectoryStream(); - for (Path child : ds) - list(child, files, dirs); - ds.close(); + if (Files.isDirectory(path)) { + try (DirectoryStream ds = Files.newDirectoryStream(path)) { + for (Path child : ds) + list(child, files, dirs); + } dirs.add(path.toString()); } else { files.add(path.toString()); @@ -335,26 +343,26 @@ public class ZipFSTester { Path srcPath = src.getPath(path); Path dstPath = dst.getPath(path); - if (Boolean.TRUE.equals(srcPath.getAttribute("isDirectory"))) { - if (!dstPath.exists()) { + if (Files.isDirectory(srcPath)) { + if (!Files.exists(dstPath)) { try { mkdirs(dstPath); } catch (FileAlreadyExistsException x) {} } - DirectoryStream ds = srcPath.newDirectoryStream(); - for (Path child : ds) { - z2zcopy(src, dst, - path + (path.endsWith("/")?"":"/") + child.getName(), - method); + try (DirectoryStream ds = Files.newDirectoryStream(srcPath)) { + for (Path child : ds) { + z2zcopy(src, dst, + path + (path.endsWith("/")?"":"/") + child.getFileName(), + method); + } } - ds.close(); } else { try { - if (dstPath.exists()) + if (Files.exists(dstPath)) return; switch (method) { case 0: - srcPath.copyTo(dstPath); + Files.copy(srcPath, dstPath); break; case 1: chCopy(srcPath, dstPath); @@ -374,21 +382,21 @@ public class ZipFSTester { Path srcPath = src.getPath(path); Path dstPath = dst.getPath(path); - if (Boolean.TRUE.equals(srcPath.getAttribute("isDirectory"))) { - if (!dstPath.exists()) + if (Files.isDirectory(srcPath)) { + if (!Files.exists(dstPath)) mkdirs(dstPath); - DirectoryStream ds = srcPath.newDirectoryStream(); - for (Path child : ds) { - z2zmove(src, dst, - path + (path.endsWith("/")?"":"/") + child.getName()); + try (DirectoryStream ds = Files.newDirectoryStream(srcPath)) { + for (Path child : ds) { + z2zmove(src, dst, + path + (path.endsWith("/")?"":"/") + child.getFileName()); + } } - ds.close(); } else { //System.out.println("moving..." + path); Path parent = dstPath.getParent(); - if (parent != null && parent.notExists()) + if (parent != null && Files.notExists(parent)) mkdirs(parent); - srcPath.moveTo(dstPath); + Files.move(srcPath, dstPath); } } @@ -409,7 +417,7 @@ public class ZipFSTester { BasicFileAttributes attrs) { indent(); - System.out.printf("%s%n", file.getName().toString()); + System.out.printf("%s%n", file.getFileName().toString()); return FileVisitResult.CONTINUE; } @@ -435,20 +443,20 @@ public class ZipFSTester { } private static void mkdirs(Path path) throws IOException { - if (path.exists()) + if (Files.exists(path)) return; path = path.toAbsolutePath(); Path parent = path.getParent(); if (parent != null) { - if (parent.notExists()) + if (Files.notExists(parent)) mkdirs(parent); } - path.createDirectory(); + Files.createDirectory(path); } private static void rmdirs(Path path) throws IOException { while (path != null && path.getNameCount() != 0) { - path.delete(); + Files.delete(path); path = path.getParent(); } } @@ -460,12 +468,11 @@ public class ZipFSTester { // src.toString(), dst.toString()); //streams - InputStream isSrc = src.newInputStream(); - InputStream isDst = dst.newInputStream(); byte[] bufSrc = new byte[8192]; byte[] bufDst = new byte[8192]; - - try { + try (InputStream isSrc = Files.newInputStream(src); + InputStream isDst = Files.newInputStream(dst)) + { int nSrc = 0; while ((nSrc = isSrc.read(bufSrc)) != -1) { int nDst = 0; @@ -487,24 +494,21 @@ public class ZipFSTester { nSrc--; } } - } finally { - isSrc.close(); - isDst.close(); } // channels - SeekableByteChannel chSrc = src.newByteChannel(); - SeekableByteChannel chDst = dst.newByteChannel(); - if (chSrc.size() != chDst.size()) { - System.out.printf("src[%s].size=%d, dst[%s].size=%d%n", - chSrc.toString(), chSrc.size(), - chDst.toString(), chDst.size()); - throw new RuntimeException("CHECK FAILED!"); - } - ByteBuffer bbSrc = ByteBuffer.allocate(8192); - ByteBuffer bbDst = ByteBuffer.allocate(8192); + try (SeekableByteChannel chSrc = Files.newByteChannel(src); + SeekableByteChannel chDst = Files.newByteChannel(dst)) + { + if (chSrc.size() != chDst.size()) { + System.out.printf("src[%s].size=%d, dst[%s].size=%d%n", + chSrc.toString(), chSrc.size(), + chDst.toString(), chDst.size()); + throw new RuntimeException("CHECK FAILED!"); + } + ByteBuffer bbSrc = ByteBuffer.allocate(8192); + ByteBuffer bbDst = ByteBuffer.allocate(8192); - try { int nSrc = 0; while ((nSrc = chSrc.read(bbSrc)) != -1) { int nDst = chDst.read(bbDst); @@ -526,9 +530,6 @@ public class ZipFSTester { } } catch (IOException x) { x.printStackTrace(); - } finally { - chSrc.close(); - chDst.close(); } } @@ -540,23 +541,19 @@ public class ZipFSTester { openwrite.add(CREATE_NEW); openwrite.add(WRITE); - FileChannel srcFc = src.getFileSystem() - .provider() - .newFileChannel(src, read); - FileChannel dstFc = dst.getFileSystem() - .provider() - .newFileChannel(dst, openwrite); - - try { + try (FileChannel srcFc = src.getFileSystem() + .provider() + .newFileChannel(src, read); + FileChannel dstFc = dst.getFileSystem() + .provider() + .newFileChannel(dst, openwrite)) + { ByteBuffer bb = ByteBuffer.allocate(8192); while (srcFc.read(bb) >= 0) { bb.flip(); dstFc.write(bb); bb.clear(); } - } finally { - srcFc.close(); - dstFc.close(); } } @@ -568,35 +565,29 @@ public class ZipFSTester { openwrite.add(CREATE_NEW); openwrite.add(WRITE); - SeekableByteChannel srcCh = src.newByteChannel(read); - SeekableByteChannel dstCh = dst.newByteChannel(openwrite); + try (SeekableByteChannel srcCh = Files.newByteChannel(src, read); + SeekableByteChannel dstCh = Files.newByteChannel(dst, openwrite)) + { - try { ByteBuffer bb = ByteBuffer.allocate(8192); while (srcCh.read(bb) >= 0) { bb.flip(); dstCh.write(bb); bb.clear(); } - } finally { - srcCh.close(); - dstCh.close(); } } private static void streamCopy(Path src, Path dst) throws IOException { - InputStream isSrc = src.newInputStream(); - OutputStream osDst = dst.newOutputStream(); byte[] buf = new byte[8192]; - try { + try (InputStream isSrc = Files.newInputStream(src); + OutputStream osDst = Files.newOutputStream(dst)) + { int n = 0; while ((n = isSrc.read(buf)) != -1) { osDst.write(buf, 0, n); } - } finally { - isSrc.close(); - osDst.close(); } } @@ -604,31 +595,35 @@ public class ZipFSTester { throws Exception { System.out.println("test ByteChannel..."); - SeekableByteChannel sbc = path.newByteChannel(); Set read = new HashSet<>(); read.add(READ); - System.out.printf(" sbc[0]: pos=%d, size=%d%n", sbc.position(), sbc.size()); - ByteBuffer bb = ByteBuffer.allocate((int)sbc.size()); - int n = sbc.read(bb); - System.out.printf(" sbc[1]: read=%d, pos=%d, size=%d%n", - n, sbc.position(), sbc.size()); - ByteBuffer bb2 = ByteBuffer.allocate((int)sbc.size()); + int n = 0; + ByteBuffer bb = null; + ByteBuffer bb2 = null; int N = 120; - sbc.close(); + + try (SeekableByteChannel sbc = Files.newByteChannel(path)) { + System.out.printf(" sbc[0]: pos=%d, size=%d%n", sbc.position(), sbc.size()); + bb = ByteBuffer.allocate((int)sbc.size()); + n = sbc.read(bb); + System.out.printf(" sbc[1]: read=%d, pos=%d, size=%d%n", + n, sbc.position(), sbc.size()); + bb2 = ByteBuffer.allocate((int)sbc.size()); + } // sbc.position(pos) is not supported in current version // try the FileChannel - sbc = fs.provider().newFileChannel(path, read); - sbc.position(N); - System.out.printf(" sbc[2]: pos=%d, size=%d%n", - sbc.position(), sbc.size()); - bb2.limit(100); - n = sbc.read(bb2); - System.out.printf(" sbc[3]: read=%d, pos=%d, size=%d%n", - n, sbc.position(), sbc.size()); - System.out.printf(" sbc[4]: bb[%d]=%d, bb1[0]=%d%n", - N, bb.get(N) & 0xff, bb2.get(0) & 0xff); - sbc.close(); + try (SeekableByteChannel sbc = fs.provider().newFileChannel(path, read)) { + sbc.position(N); + System.out.printf(" sbc[2]: pos=%d, size=%d%n", + sbc.position(), sbc.size()); + bb2.limit(100); + n = sbc.read(bb2); + System.out.printf(" sbc[3]: read=%d, pos=%d, size=%d%n", + n, sbc.position(), sbc.size()); + System.out.printf(" sbc[4]: bb[%d]=%d, bb1[0]=%d%n", + N, bb.get(N) & 0xff, bb2.get(0) & 0xff); + } } // create parents if does not exist @@ -637,7 +632,7 @@ public class ZipFSTester { { Path path = fs.getPath(name); Path parent = path.getParent(); - if (parent != null && parent.notExists()) + if (parent != null && Files.notExists(parent)) mkdirs(parent); return path; } diff --git a/jdk/test/demo/zipfs/basic.sh b/jdk/test/demo/zipfs/basic.sh index cd5bcebccfd..6e326d0e8cf 100644 --- a/jdk/test/demo/zipfs/basic.sh +++ b/jdk/test/demo/zipfs/basic.sh @@ -21,8 +21,7 @@ # questions. # # @test -# @bug 6990846 7009092 7009085 -# @ignore Until zipfs updated (7015391) +# @bug 6990846 7009092 7009085 7015391 7014948 # @summary Test ZipFileSystem demo # @build Basic PathOps ZipFSTester # @run shell basic.sh From 069ec3aa004045f6793983ec4869a5a80c7d1f61 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Wed, 2 Feb 2011 18:37:31 +0300 Subject: [PATCH 28/84] 6988168: Press the "Toggle Font" button.The size of the combo box didn't change Reviewed-by: alexp --- .../share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java index 08e8c6fa718..d55e4490cd0 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java @@ -1721,6 +1721,7 @@ public class BasicComboBoxUI extends ComboBoxUI { editor.setFont( comboBox.getFont() ); } isMinimumSizeDirty = true; + isDisplaySizeDirty = true; comboBox.validate(); } else if ( propertyName == JComponent.TOOL_TIP_TEXT_KEY ) { From dd26efb159f7c6f224388b1caa4f79d706e2a165 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Wed, 2 Feb 2011 18:41:30 +0300 Subject: [PATCH 29/84] 6988176: There is focus painted inside the button Reviewed-by: alexp --- jdk/src/share/classes/sun/swing/WindowsPlacesBar.java | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java b/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java index fcc8717ec80..313ba7ecf26 100644 --- a/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java +++ b/jdk/src/share/classes/sun/swing/WindowsPlacesBar.java @@ -120,6 +120,7 @@ public class WindowsPlacesBar extends JToolBar buttons[i].setForeground(fgColor); } buttons[i].setMargin(new Insets(3, 2, 1, 2)); + buttons[i].setFocusPainted(false); buttons[i].setIconTextGap(0); buttons[i].setHorizontalTextPosition(JToggleButton.CENTER); buttons[i].setVerticalTextPosition(JToggleButton.BOTTOM); From 31e3fe4a984b82e68b85b79ca34b2730938ff8ed Mon Sep 17 00:00:00 2001 From: Bob Vandette Date: Wed, 2 Feb 2011 11:35:26 -0500 Subject: [PATCH 30/84] 7016023: Enable building ARM and PPC from src/closed repository Reviewed-by: dholmes, bdelsart --- hotspot/make/Makefile | 3 +- hotspot/make/closed.make | 59 ++++++++ hotspot/make/jprt.properties | 141 +++++++++++++++++- hotspot/make/linux/Makefile | 2 +- hotspot/make/linux/makefiles/adlc.make | 4 +- hotspot/make/linux/makefiles/arm.make | 10 ++ hotspot/make/linux/makefiles/buildtree.make | 22 ++- hotspot/make/linux/makefiles/ppc.make | 11 ++ hotspot/make/linux/makefiles/rules.make | 2 + hotspot/make/linux/makefiles/top.make | 4 +- hotspot/make/linux/makefiles/vm.make | 4 +- hotspot/make/linux/platform_arm | 17 +++ hotspot/make/linux/platform_ppc | 17 +++ hotspot/src/os/linux/vm/osThread_linux.cpp | 6 + hotspot/src/os/linux/vm/os_linux.cpp | 8 + hotspot/src/os/linux/vm/os_linux.inline.hpp | 8 + .../src/os/linux/vm/thread_linux.inline.hpp | 10 ++ hotspot/src/share/vm/asm/assembler.cpp | 6 + hotspot/src/share/vm/asm/assembler.hpp | 14 ++ hotspot/src/share/vm/asm/codeBuffer.hpp | 6 + hotspot/src/share/vm/c1/c1_Defs.hpp | 12 ++ hotspot/src/share/vm/c1/c1_FpuStackSim.hpp | 6 + hotspot/src/share/vm/c1/c1_FrameMap.cpp | 6 + hotspot/src/share/vm/c1/c1_FrameMap.hpp | 6 + hotspot/src/share/vm/c1/c1_Instruction.hpp | 2 + hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 8 + hotspot/src/share/vm/c1/c1_LIRAssembler.hpp | 6 + hotspot/src/share/vm/c1/c1_LinearScan.cpp | 6 + hotspot/src/share/vm/c1/c1_LinearScan.hpp | 6 + hotspot/src/share/vm/c1/c1_MacroAssembler.hpp | 12 ++ hotspot/src/share/vm/c1/c1_globals.hpp | 6 + .../share/vm/classfile/classFileStream.hpp | 6 + .../src/share/vm/classfile/stackMapTable.hpp | 6 + hotspot/src/share/vm/classfile/verifier.cpp | 6 + hotspot/src/share/vm/code/codeBlob.cpp | 6 + hotspot/src/share/vm/code/compiledIC.hpp | 6 + hotspot/src/share/vm/code/icBuffer.cpp | 6 + hotspot/src/share/vm/code/relocInfo.cpp | 8 + hotspot/src/share/vm/code/relocInfo.hpp | 6 + hotspot/src/share/vm/code/vmreg.hpp | 18 +++ .../src/share/vm/compiler/disassembler.cpp | 6 + .../src/share/vm/compiler/disassembler.hpp | 6 + .../vm/interpreter/abstractInterpreter.hpp | 6 + hotspot/src/share/vm/interpreter/bytecode.hpp | 6 + .../vm/interpreter/bytecodeInterpreter.cpp | 6 + .../vm/interpreter/bytecodeInterpreter.hpp | 12 ++ .../bytecodeInterpreter.inline.hpp | 6 + .../share/vm/interpreter/bytecodeStream.hpp | 6 + .../src/share/vm/interpreter/bytecodes.cpp | 6 + .../src/share/vm/interpreter/bytecodes.hpp | 6 + .../share/vm/interpreter/cppInterpreter.hpp | 6 + .../interpreter/cppInterpreterGenerator.hpp | 6 + .../src/share/vm/interpreter/interpreter.hpp | 6 + .../vm/interpreter/interpreterGenerator.hpp | 6 + .../vm/interpreter/interpreterRuntime.cpp | 6 + .../vm/interpreter/interpreterRuntime.hpp | 6 + .../vm/interpreter/templateInterpreter.hpp | 6 + .../templateInterpreterGenerator.hpp | 6 + .../share/vm/interpreter/templateTable.hpp | 12 ++ hotspot/src/share/vm/oops/constantPoolOop.hpp | 6 + hotspot/src/share/vm/oops/oop.inline.hpp | 6 + hotspot/src/share/vm/oops/typeArrayOop.hpp | 6 + hotspot/src/share/vm/opto/buildOopMap.cpp | 6 + hotspot/src/share/vm/opto/c2_globals.hpp | 3 + hotspot/src/share/vm/opto/c2compiler.cpp | 6 + hotspot/src/share/vm/opto/compile.cpp | 6 + hotspot/src/share/vm/opto/gcm.cpp | 6 + hotspot/src/share/vm/opto/locknode.hpp | 6 + hotspot/src/share/vm/opto/output.hpp | 6 + hotspot/src/share/vm/opto/regmask.cpp | 6 + hotspot/src/share/vm/opto/regmask.hpp | 6 + hotspot/src/share/vm/opto/runtime.cpp | 6 + hotspot/src/share/vm/prims/jniCheck.cpp | 6 + hotspot/src/share/vm/prims/jni_md.h | 6 + .../vm/prims/jvmtiClassFileReconstituter.cpp | 6 + .../src/share/vm/runtime/deoptimization.cpp | 12 ++ hotspot/src/share/vm/runtime/dtraceJSDT.hpp | 6 + hotspot/src/share/vm/runtime/frame.cpp | 6 + hotspot/src/share/vm/runtime/frame.hpp | 12 ++ hotspot/src/share/vm/runtime/frame.inline.hpp | 12 ++ hotspot/src/share/vm/runtime/globals.hpp | 68 ++++++++- hotspot/src/share/vm/runtime/icache.hpp | 6 + hotspot/src/share/vm/runtime/java.cpp | 6 + hotspot/src/share/vm/runtime/javaCalls.hpp | 6 + .../src/share/vm/runtime/javaFrameAnchor.hpp | 12 ++ hotspot/src/share/vm/runtime/os.hpp | 6 + hotspot/src/share/vm/runtime/registerMap.hpp | 12 ++ hotspot/src/share/vm/runtime/relocator.hpp | 6 + hotspot/src/share/vm/runtime/safepoint.cpp | 8 + .../src/share/vm/runtime/sharedRuntime.cpp | 9 ++ .../share/vm/runtime/stackValueCollection.cpp | 6 + hotspot/src/share/vm/runtime/statSampler.cpp | 6 + .../share/vm/runtime/stubCodeGenerator.cpp | 6 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 12 ++ hotspot/src/share/vm/runtime/thread.hpp | 6 + .../share/vm/runtime/threadLocalStorage.hpp | 6 + hotspot/src/share/vm/runtime/vmStructs.cpp | 18 +++ hotspot/src/share/vm/runtime/vm_version.cpp | 21 ++- hotspot/src/share/vm/utilities/copy.hpp | 6 + .../share/vm/utilities/globalDefinitions.hpp | 6 + hotspot/src/share/vm/utilities/taskqueue.hpp | 6 + 101 files changed, 972 insertions(+), 31 deletions(-) create mode 100644 hotspot/make/closed.make create mode 100644 hotspot/make/linux/makefiles/arm.make create mode 100644 hotspot/make/linux/makefiles/ppc.make create mode 100644 hotspot/make/linux/platform_arm create mode 100644 hotspot/make/linux/platform_ppc diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index e55408cc484..c07f286e4bc 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -73,6 +73,7 @@ else include defs.make endif +include $(GAMMADIR)/make/closed.make ifneq ($(ALT_OUTPUTDIR),) ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR) @@ -361,7 +362,7 @@ $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/% $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/% $(install-file) -$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h +$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC) $(install-file) $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/% diff --git a/hotspot/make/closed.make b/hotspot/make/closed.make new file mode 100644 index 00000000000..df4a45af53d --- /dev/null +++ b/hotspot/make/closed.make @@ -0,0 +1,59 @@ +# +# 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. +# +# + +# Support for setting HS_CLOSED_PATH, required GAMMADIR and SRCARCH + +CLOSED_DIR_EXISTS := $(shell \ + if [ -d $(GAMMADIR)/src/closed ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +CLOSED_SRCARCH_DIR_EXISTS := $(shell \ + if [ -d $(GAMMADIR)/src/closed/cpu/$(SRCARCH)/vm ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +ifeq ($(CLOSED_SRCARCH_DIR_EXISTS), true) + HS_CLOSED_PATH=closed/ +endif + +# Support for setting HS_JNI_ARCH_SRC, requires HS_SRC_DIR and HS_ARCH + +CLOSED_HS_ARCH_DIR_EXISTS := $(shell \ + if [ -d $(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm ] ; then \ + echo true; \ + else \ + echo false; \ + fi) + +ifeq ($(CLOSED_HS_ARCH_DIR_EXISTS), true) + HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h +else + HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h +endif + diff --git a/hotspot/make/jprt.properties b/hotspot/make/jprt.properties index c8bbb3c6c14..698ad33dce6 100644 --- a/hotspot/make/jprt.properties +++ b/hotspot/make/jprt.properties @@ -44,6 +44,11 @@ jprt.tools.default.release=${jprt.submit.release} jprt.sync.push=false +# Note: we want both embedded releases and regular releases to build and test +# all platforms so that regressions are not introduced (eg. change to +# common code by SE breaks PPC/ARM; change to common code by SE-E breaks +# sparc etc. + # Define the Solaris platforms we want for the various releases jprt.my.solaris.sparc.jdk7=solaris_sparc_5.10 @@ -55,6 +60,8 @@ jprt.my.solaris.sparc.jdk6u10=solaris_sparc_5.8 jprt.my.solaris.sparc.jdk6u14=solaris_sparc_5.8 jprt.my.solaris.sparc.jdk6u18=solaris_sparc_5.8 jprt.my.solaris.sparc.jdk6u20=solaris_sparc_5.8 +jprt.my.solaris.sparc.ejdk7=${jprt.my.solaris.sparc.jdk7} +jprt.my.solaris.sparc.ejdk6=${jprt.my.solaris.sparc.jdk6} jprt.my.solaris.sparc=${jprt.my.solaris.sparc.${jprt.tools.default.release}} jprt.my.solaris.sparcv9.jdk7=solaris_sparcv9_5.10 @@ -66,6 +73,8 @@ jprt.my.solaris.sparcv9.jdk6u10=solaris_sparcv9_5.8 jprt.my.solaris.sparcv9.jdk6u14=solaris_sparcv9_5.8 jprt.my.solaris.sparcv9.jdk6u18=solaris_sparcv9_5.8 jprt.my.solaris.sparcv9.jdk6u20=solaris_sparcv9_5.8 +jprt.my.solaris.sparcv9.ejdk7=${jprt.my.solaris.sparcv9.jdk7} +jprt.my.solaris.sparcv9.ejdk6=${jprt.my.solaris.sparcv9.jdk6} jprt.my.solaris.sparcv9=${jprt.my.solaris.sparcv9.${jprt.tools.default.release}} jprt.my.solaris.i586.jdk7=solaris_i586_5.10 @@ -77,6 +86,8 @@ jprt.my.solaris.i586.jdk6u10=solaris_i586_5.8 jprt.my.solaris.i586.jdk6u14=solaris_i586_5.8 jprt.my.solaris.i586.jdk6u18=solaris_i586_5.8 jprt.my.solaris.i586.jdk6u20=solaris_i586_5.8 +jprt.my.solaris.i586.ejdk7=${jprt.my.solaris.i586.jdk7} +jprt.my.solaris.i586.ejdk6=${jprt.my.solaris.i586.jdk6} jprt.my.solaris.i586=${jprt.my.solaris.i586.${jprt.tools.default.release}} jprt.my.solaris.x64.jdk7=solaris_x64_5.10 @@ -88,6 +99,8 @@ jprt.my.solaris.x64.jdk6u10=solaris_x64_5.10 jprt.my.solaris.x64.jdk6u14=solaris_x64_5.10 jprt.my.solaris.x64.jdk6u18=solaris_x64_5.10 jprt.my.solaris.x64.jdk6u20=solaris_x64_5.10 +jprt.my.solaris.x64.ejdk7=${jprt.my.solaris.x64.jdk7} +jprt.my.solaris.x64.ejdk6=${jprt.my.solaris.x64.jdk6} jprt.my.solaris.x64=${jprt.my.solaris.x64.${jprt.tools.default.release}} jprt.my.linux.i586.jdk7=linux_i586_2.6 @@ -99,6 +112,8 @@ jprt.my.linux.i586.jdk6u10=linux_i586_2.4 jprt.my.linux.i586.jdk6u14=linux_i586_2.4 jprt.my.linux.i586.jdk6u18=linux_i586_2.4 jprt.my.linux.i586.jdk6u20=linux_i586_2.4 +jprt.my.linux.i586.ejdk7=linux_i586_2.6 +jprt.my.linux.i586.ejdk6=linux_i586_2.6 jprt.my.linux.i586=${jprt.my.linux.i586.${jprt.tools.default.release}} jprt.my.linux.x64.jdk7=linux_x64_2.6 @@ -110,8 +125,45 @@ jprt.my.linux.x64.jdk6u10=linux_x64_2.4 jprt.my.linux.x64.jdk6u14=linux_x64_2.4 jprt.my.linux.x64.jdk6u18=linux_x64_2.4 jprt.my.linux.x64.jdk6u20=linux_x64_2.4 +jprt.my.linux.x64.ejdk7=${jprt.my.linux.x64.jdk7} +jprt.my.linux.x64.ejdk6=${jprt.my.linux.x64.jdk6} jprt.my.linux.x64=${jprt.my.linux.x64.${jprt.tools.default.release}} +jprt.my.linux.ppc.jdk7=linux_ppc_2.6 +jprt.my.linux.ppc.jdk7b107=linux_ppc_2.6 +jprt.my.linux.ppc.jdk7temp=linux_ppc_2.6 +jprt.my.linux.ppc.ejdk6=linux_ppc_2.6 +jprt.my.linux.ppc.ejdk7=linux_ppc_2.6 +jprt.my.linux.ppc=${jprt.my.linux.ppc.${jprt.tools.default.release}} + +jprt.my.linux.ppcv2.jdk7=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.jdk7b107=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.jdk7temp=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.ejdk6=linux_ppcv2_2.6 +jprt.my.linux.ppcv2.ejdk7=linux_ppcv2_2.6 +jprt.my.linux.ppcv2=${jprt.my.linux.ppcv2.${jprt.tools.default.release}} + +jprt.my.linux.ppcsflt.jdk7=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.jdk7b107=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.jdk7temp=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.ejdk6=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt.ejdk7=linux_ppcsflt_2.6 +jprt.my.linux.ppcsflt=${jprt.my.linux.ppcsflt.${jprt.tools.default.release}} + +jprt.my.linux.armvfp.jdk7=linux_armvfp_2.6 +jprt.my.linux.armvfp.jdk7b107=linux_armvfp_2.6 +jprt.my.linux.armvfp.jdk7temp=linux_armvfp_2.6 +jprt.my.linux.armvfp.ejdk6=linux_armvfp_2.6 +jprt.my.linux.armvfp.ejdk7=linux_armvfp_2.6 +jprt.my.linux.armvfp=${jprt.my.linux.armvfp.${jprt.tools.default.release}} + +jprt.my.linux.armsflt.jdk7=linux_armsflt_2.6 +jprt.my.linux.armsflt.jdk7b107=linux_armsflt_2.6 +jprt.my.linux.armsflt.jdk7temp=linux_armsflt_2.6 +jprt.my.linux.armsflt.ejdk6=linux_armsflt_2.6 +jprt.my.linux.armsflt.ejdk7=linux_armsflt_2.6 +jprt.my.linux.armsflt=${jprt.my.linux.armsflt.${jprt.tools.default.release}} + jprt.my.windows.i586.jdk7=windows_i586_5.1 jprt.my.windows.i586.jdk7b107=windows_i586_5.0 jprt.my.windows.i586.jdk7temp=windows_i586_5.0 @@ -121,6 +173,8 @@ jprt.my.windows.i586.jdk6u10=windows_i586_5.0 jprt.my.windows.i586.jdk6u14=windows_i586_5.0 jprt.my.windows.i586.jdk6u18=windows_i586_5.0 jprt.my.windows.i586.jdk6u20=windows_i586_5.0 +jprt.my.windows.i586.ejdk7=${jprt.my.windows.i586.jdk7} +jprt.my.windows.i586.ejdk6=${jprt.my.windows.i586.jdk6} jprt.my.windows.i586=${jprt.my.windows.i586.${jprt.tools.default.release}} jprt.my.windows.x64.jdk7=windows_x64_5.2 @@ -132,11 +186,13 @@ jprt.my.windows.x64.jdk6u10=windows_x64_5.2 jprt.my.windows.x64.jdk6u14=windows_x64_5.2 jprt.my.windows.x64.jdk6u18=windows_x64_5.2 jprt.my.windows.x64.jdk6u20=windows_x64_5.2 +jprt.my.windows.x64.ejdk7=${jprt.my.windows.x64.jdk7} +jprt.my.windows.x64.ejdk6=${jprt.my.windows.x64.jdk6} jprt.my.windows.x64=${jprt.my.windows.x64.${jprt.tools.default.release}} # Standard list of jprt build targets for this source tree -jprt.build.targets= \ +jprt.build.targets.standard= \ ${jprt.my.solaris.sparc}-{product|fastdebug|debug}, \ ${jprt.my.solaris.sparcv9}-{product|fastdebug|debug}, \ ${jprt.my.solaris.i586}-{product|fastdebug|debug}, \ @@ -146,6 +202,30 @@ jprt.build.targets= \ ${jprt.my.windows.i586}-{product|fastdebug|debug}, \ ${jprt.my.windows.x64}-{product|fastdebug|debug} +jprt.build.targets.embedded= \ + ${jprt.my.linux.i586}-{product|fastdebug|debug}, \ + ${jprt.my.linux.ppc}-{product|fastdebug}, \ + ${jprt.my.linux.ppcv2}-{product|fastdebug}, \ + ${jprt.my.linux.ppcsflt}-{product|fastdebug}, \ + ${jprt.my.linux.armvfp}-{product|fastdebug}, \ + ${jprt.my.linux.armsflt}-{product|fastdebug} + +jprt.build.targets.all=${jprt.build.targets.standard}, \ + ${jprt.build.targets.embedded} + +jprt.build.targets.jdk7=${jprt.build.targets.all} +jprt.build.targets.jdk7temp=${jprt.build.targets.all} +jprt.build.targets.jdk7b107=${jprt.build.targets.all} +jprt.build.targets.jdk6=${jprt.build.targets.standard} +jprt.build.targets.jdk6perf=${jprt.build.targets.standard} +jprt.build.targets.jdk6u10=${jprt.build.targets.standard} +jprt.build.targets.jdk6u14=${jprt.build.targets.standard} +jprt.build.targets.jdk6u18=${jprt.build.targets.standard} +jprt.build.targets.jdk6u20=${jprt.build.targets.standard} +jprt.build.targets.ejdk6=${jprt.build.targets.all} +jprt.build.targets.ejdk7=${jprt.build.targets.all} +jprt.build.targets=${jprt.build.targets.${jprt.tools.default.release}} + # Subset lists of test targets for this source tree jprt.my.solaris.sparc.test.targets= \ @@ -372,9 +452,14 @@ jprt.my.windows.x64.test.targets = \ ${jprt.my.windows.x64}-product-c2-jbb_G1, \ ${jprt.my.windows.x64}-product-c2-jbb_ParOldGC -# The complete list of test targets for jprt +# Testing for actual embedded builds is different to standard +jprt.my.linux.i586.test.targets.embedded = \ + linux_i586_2.6-product-c1-scimark -jprt.test.targets = \ +# The complete list of test targets for jprt +# Note: no PPC or ARM tests at this stage + +jprt.test.targets.standard = \ ${jprt.my.solaris.sparc.test.targets}, \ ${jprt.my.solaris.sparcv9.test.targets}, \ ${jprt.my.solaris.i586.test.targets}, \ @@ -384,15 +469,41 @@ jprt.test.targets = \ ${jprt.my.windows.i586.test.targets}, \ ${jprt.my.windows.x64.test.targets} +jprt.test.targets.embedded= \ + ${jprt.my.linux.i586.test.targets.embedded}, \ + ${jprt.my.solaris.sparc.test.targets}, \ + ${jprt.my.solaris.sparcv9.test.targets}, \ + ${jprt.my.solaris.i586.test.targets}, \ + ${jprt.my.solaris.x64.test.targets}, \ + ${jprt.my.linux.x64.test.targets}, \ + ${jprt.my.windows.i586.test.targets}, \ + ${jprt.my.windows.x64.test.targets} + + +jprt.test.targets.jdk7=${jprt.test.targets.standard} +jprt.test.targets.jdk7temp=${jprt.test.targets.standard} +jprt.test.targets.jdk7b105=${jprt.test.targets.standard} +jprt.test.targets.jdk6=${jprt.test.targets.standard} +jprt.test.targets.jdk6perf=${jprt.test.targets.standard} +jprt.test.targets.jdk6u10=${jprt.test.targets.standard} +jprt.test.targets.jdk6u14=${jprt.test.targets.standard} +jprt.test.targets.jdk6u18=${jprt.test.targets.standard} +jprt.test.targets.jdk6u20=${jprt.test.targets.standard} +jprt.test.targets.ejdk6=${jprt.test.targets.embedded} +jprt.test.targets.ejdk7=${jprt.test.targets.embedded} +jprt.test.targets=${jprt.test.targets.${jprt.tools.default.release}} + # The default test/Makefile targets that should be run #jprt.make.rule.test.targets=*-product-*-packtest -jprt.make.rule.test.targets = \ +jprt.make.rule.test.targets.standard.client = \ ${jprt.my.solaris.sparc}-*-c1-clienttest, \ ${jprt.my.solaris.i586}-*-c1-clienttest, \ ${jprt.my.linux.i586}-*-c1-clienttest, \ - ${jprt.my.windows.i586}-*-c1-clienttest, \ + ${jprt.my.windows.i586}-*-c1-clienttest + +jprt.make.rule.test.targets.standard.server = \ ${jprt.my.solaris.sparc}-*-c2-servertest, \ ${jprt.my.solaris.sparcv9}-*-c2-servertest, \ ${jprt.my.solaris.i586}-*-c2-servertest, \ @@ -402,3 +513,23 @@ jprt.make.rule.test.targets = \ ${jprt.my.windows.i586}-*-c2-servertest, \ ${jprt.my.windows.x64}-*-c2-servertest +jprt.make.rule.test.targets.standard = \ + ${jprt.make.rule.test.targets.standard.client}, \ + ${jprt.make.rule.test.targets.standard.server} + +jprt.make.rule.test.targets.embedded = \ + ${jprt.make.rule.test.targets.standard.client} + +jprt.make.rule.test.targets.jdk7=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk7temp=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk7b107=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6perf=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u10=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u14=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u18=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.jdk6u20=${jprt.make.rule.test.targets.standard} +jprt.make.rule.test.targets.ejdk6=${jprt.make.rule.test.targets.embedded} +jprt.make.rule.test.targets.ejdk7=${jprt.make.rule.test.targets.embedded} +jprt.make.rule.test.targets=${jprt.make.rule.test.targets.${jprt.tools.default.release}} + diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile index 93d83ea2f81..ec1e60b7c2d 100644 --- a/hotspot/make/linux/Makefile +++ b/hotspot/make/linux/Makefile @@ -208,7 +208,7 @@ TARGETS_ZERO = $(addsuffix zero,$(TARGETS)) TARGETS_SHARK = $(addsuffix shark,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make -BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) ARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) +BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HOTSPOT_RELEASE_VERSION) HOTSPOT_BUILD_VERSION=$(HOTSPOT_BUILD_VERSION) JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION) BUILDTREE = $(MAKE) -f $(BUILDTREE_MAKE) $(BUILDTREE_VARS) diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index a4d2babb4b8..821cfa74ad2 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -39,8 +39,8 @@ OS = $(Platform_os_family) SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad -SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ - $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad +SOURCES.AD = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ + $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad EXEC = $(OUTDIR)/adlc diff --git a/hotspot/make/linux/makefiles/arm.make b/hotspot/make/linux/makefiles/arm.make new file mode 100644 index 00000000000..3c5dc2ca151 --- /dev/null +++ b/hotspot/make/linux/makefiles/arm.make @@ -0,0 +1,10 @@ +# +# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. +# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. +# + +Obj_Files += linux_arm.o + +LIBS += $(EXT_LIBS_PATH)/sflt_glibc.a + +CFLAGS += -DVM_LITTLE_ENDIAN diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make index 4ba1f0e74b4..279e210aed4 100644 --- a/hotspot/make/linux/makefiles/buildtree.make +++ b/hotspot/make/linux/makefiles/buildtree.make @@ -24,7 +24,7 @@ # Usage: # -# $(MAKE) -f buildtree.make ARCH=arch BUILDARCH=buildarch LIBARCH=libarch +# $(MAKE) -f buildtree.make SRCARCH=srcarch BUILDARCH=buildarch LIBARCH=libarch # GAMMADIR=dir OS_FAMILY=os VARIANT=variant # # The macros ARCH, GAMMADIR, OS_FAMILY and VARIANT must be defined in the @@ -56,6 +56,8 @@ # having to read the dependency files for the vm. include $(GAMMADIR)/make/scm.make +include $(GAMMADIR)/make/closed.make + # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. QUIETLY$(MAKE_VERBOSE) = @ @@ -127,7 +129,7 @@ BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.ma env.sh env.csh jdkpath.sh .dbxrc test_gamma BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ - ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) + SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) # Define variables to be set in flags.make. # Default values are set in make/defs.make. @@ -146,12 +148,6 @@ endif # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro # or make/hotspot_distro. ifndef HOTSPOT_VM_DISTRO - CLOSED_DIR_EXISTS := $(shell \ - if [ -d $(GAMMADIR)/src/closed ] ; then \ - echo true; \ - else \ - echo false; \ - fi) ifeq ($(CLOSED_DIR_EXISTS), true) include $(GAMMADIR)/make/hotspot_distro else @@ -187,7 +183,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo; \ echo "GAMMADIR = $(GAMMADIR)"; \ echo "SYSDEFS = \$$(Platform_sysdefs)"; \ - echo "SRCARCH = $(ARCH)"; \ + echo "SRCARCH = $(SRCARCH)"; \ echo "BUILDARCH = $(BUILDARCH)"; \ echo "LIBARCH = $(LIBARCH)"; \ echo "TARGET = $(TARGET)"; \ @@ -208,16 +204,16 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo; \ echo "Src_Dirs_V = \\"; \ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \ echo; \ echo "Src_Dirs_I = \\"; \ echo "\$$(GAMMADIR)/src/share/vm \\"; \ echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \ echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ diff --git a/hotspot/make/linux/makefiles/ppc.make b/hotspot/make/linux/makefiles/ppc.make new file mode 100644 index 00000000000..50ac9fe0d8c --- /dev/null +++ b/hotspot/make/linux/makefiles/ppc.make @@ -0,0 +1,11 @@ +# +# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. +# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. +# + +# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized +OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT) + +# Must also specify if CPU is big endian +CFLAGS += -DVM_BIG_ENDIAN + diff --git a/hotspot/make/linux/makefiles/rules.make b/hotspot/make/linux/makefiles/rules.make index 4ce9e3db872..603037efa26 100644 --- a/hotspot/make/linux/makefiles/rules.make +++ b/hotspot/make/linux/makefiles/rules.make @@ -146,6 +146,8 @@ ifndef LP64 include $(GAMMADIR)/make/pic.make endif +include $(GAMMADIR)/make/closed.make + # The non-PIC object files are only generated for 32 bit platforms. ifdef LP64 %.o: %.cpp diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index db9224fc215..688ba373a43 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -39,6 +39,8 @@ # Instead, use "gmake" (or "gnumake") from the command line. --Rose #MAKE = gmake +include $(GAMMADIR)/make/closed.make + TOPDIR = $(shell echo `pwd`) GENERATED = $(TOPDIR)/../generated VM = $(GAMMADIR)/src/share/vm @@ -57,7 +59,7 @@ Cached_plat = $(GENERATED)/platform.current AD_Dir = $(GENERATED)/adfiles ADLC = $(AD_Dir)/adlc -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad +AD_Spec = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad AD_Src = $(GAMMADIR)/src/share/vm/adlc AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp AD_Files = $(AD_Names:%=$(AD_Dir)/%) diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index 653da7de6a7..c772c6ff597 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -121,8 +121,8 @@ LIBJVM_G = lib$(JVM)$(G_SUFFIX).so CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm -CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm -CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm +CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm +CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(Platform_os_arch)/vm CORE_PATHS += $(GENERATED)/jvmtifiles COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 diff --git a/hotspot/make/linux/platform_arm b/hotspot/make/linux/platform_arm new file mode 100644 index 00000000000..13206d63738 --- /dev/null +++ b/hotspot/make/linux/platform_arm @@ -0,0 +1,17 @@ +os_family = linux + +arch = arm + +arch_model = arm + +os_arch = linux_arm + +os_arch_model = linux_arm + +lib_arch = arm + +compiler = gcc + +gnu_dis_arch = arm + +sysdefs = -DLINUX -D_GNU_SOURCE -DARM diff --git a/hotspot/make/linux/platform_ppc b/hotspot/make/linux/platform_ppc new file mode 100644 index 00000000000..c37b8d6b12c --- /dev/null +++ b/hotspot/make/linux/platform_ppc @@ -0,0 +1,17 @@ +os_family = linux + +arch = ppc + +arch_model = ppc + +os_arch = linux_ppc + +os_arch_model = linux_ppc + +lib_arch = ppc + +compiler = gcc + +gnu_dis_arch = ppc + +sysdefs = -DLINUX -D_GNU_SOURCE -DPPC diff --git a/hotspot/src/os/linux/vm/osThread_linux.cpp b/hotspot/src/os/linux/vm/osThread_linux.cpp index f4ec9f78faa..bf454ff9003 100644 --- a/hotspot/src/os/linux/vm/osThread_linux.cpp +++ b/hotspot/src/os/linux/vm/osThread_linux.cpp @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif void OSThread::pd_initialize() { diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 5d34fc50c7d..0d25cd3f721 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -76,6 +76,14 @@ # include "assembler_zero.inline.hpp" # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +# include "nativeInst_ppc.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp index 9af7e789764..c2301be5052 100644 --- a/hotspot/src/os/linux/vm/os_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp @@ -39,6 +39,14 @@ # include "atomic_linux_zero.inline.hpp" # include "orderAccess_linux_zero.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "atomic_linux_arm.inline.hpp" +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "atomic_linux_ppc.inline.hpp" +# include "orderAccess_linux_ppc.inline.hpp" +#endif // System includes diff --git a/hotspot/src/os/linux/vm/thread_linux.inline.hpp b/hotspot/src/os/linux/vm/thread_linux.inline.hpp index f09ed2877ef..93e1d481ef7 100644 --- a/hotspot/src/os/linux/vm/thread_linux.inline.hpp +++ b/hotspot/src/os/linux/vm/thread_linux.inline.hpp @@ -44,6 +44,16 @@ # include "orderAccess_linux_zero.inline.hpp" # include "prefetch_linux_zero.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "atomic_linux_arm.inline.hpp" +# include "orderAccess_linux_arm.inline.hpp" +# include "prefetch_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "atomic_linux_ppc.inline.hpp" +# include "orderAccess_linux_ppc.inline.hpp" +# include "prefetch_linux_ppc.inline.hpp" +#endif // Contains inlined functions for class Thread and ThreadLocalStorage diff --git a/hotspot/src/share/vm/asm/assembler.cpp b/hotspot/src/share/vm/asm/assembler.cpp index e4e890931f5..2f739393f58 100644 --- a/hotspot/src/share/vm/asm/assembler.cpp +++ b/hotspot/src/share/vm/asm/assembler.cpp @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif // Implementation of AbstractAssembler diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp index 0b3544e695f..db0fbadbd5c 100644 --- a/hotspot/src/share/vm/asm/assembler.hpp +++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -43,6 +43,14 @@ # include "register_zero.hpp" # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +# include "vm_version_ppc.hpp" +#endif // This file contains platform-independent assembler declarations. @@ -395,6 +403,12 @@ class AbstractAssembler : public ResourceObj { #ifdef TARGET_ARCH_zero # include "assembler_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.hpp" +#endif #endif // SHARE_VM_ASM_ASSEMBLER_HPP diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp index 8ab664d4963..dfcd1cf0a27 100644 --- a/hotspot/src/share/vm/asm/codeBuffer.hpp +++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -566,6 +566,12 @@ class CodeBuffer: public StackObj { #ifdef TARGET_ARCH_zero # include "codeBuffer_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "codeBuffer_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "codeBuffer_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp index 7f964c09ac6..564e7b3cb5f 100644 --- a/hotspot/src/share/vm/c1/c1_Defs.hpp +++ b/hotspot/src/share/vm/c1/c1_Defs.hpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "register_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +#endif // set frame size and return address offset to these values in blobs // (if the compiled frame uses ebp as link pointer on IA; otherwise, @@ -50,6 +56,12 @@ enum { #ifdef TARGET_ARCH_sparc # include "c1_Defs_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_Defs_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_Defs_ppc.hpp" +#endif // native word offsets from memory address diff --git a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp index a84d8a15269..3e8adbe14c4 100644 --- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp +++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp @@ -38,6 +38,12 @@ class FpuStackSim; #ifdef TARGET_ARCH_sparc # include "c1_FpuStackSim_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_FpuStackSim_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_FpuStackSim_ppc.hpp" +#endif #endif // SHARE_VM_C1_C1_FPUSTACKSIM_HPP diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp index 5b10b966db1..74eab9bd08e 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp index c112ad54006..266ae094057 100644 --- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp +++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp @@ -87,6 +87,12 @@ class FrameMap : public CompilationResourceObj { #endif #ifdef TARGET_ARCH_sparc # include "c1_FrameMap_sparc.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "c1_FrameMap_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_FrameMap_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp index 1f37449db41..3a5eecc2d7b 100644 --- a/hotspot/src/share/vm/c1/c1_Instruction.hpp +++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp @@ -316,6 +316,8 @@ class Instruction: public CompilationResourceObj { return res; } + static const int no_bci = -99; + enum InstructionFlag { NeedsNullCheckFlag = 0, CanTrapFlag, diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp index 1b57ea2f095..510bf2f92a5 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp @@ -42,6 +42,14 @@ # include "nativeInst_zero.hpp" # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +# include "vmreg_ppc.inline.hpp" +#endif void LIR_Assembler::patching_epilog(PatchingStub* patch, LIR_PatchCode patch_code, Register obj, CodeEmitInfo* info) { diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp index bb18c253eb5..074027a8719 100644 --- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp @@ -252,6 +252,12 @@ class LIR_Assembler: public CompilationResourceObj { #ifdef TARGET_ARCH_sparc # include "c1_LIRAssembler_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_LIRAssembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_LIRAssembler_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp index 7419f9e8fac..16fd0aea1ca 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif #ifndef PRODUCT diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp index 018570f9c56..3436cb5c2be 100644 --- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp +++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp @@ -972,6 +972,12 @@ class LinearScanTimers : public StackObj { #ifdef TARGET_ARCH_sparc # include "c1_LinearScan_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_LinearScan_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_LinearScan_ppc.hpp" +#endif #endif // SHARE_VM_C1_C1_LINEARSCAN_HPP diff --git a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp index 41ee336343e..9887c2af61d 100644 --- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp +++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif class CodeEmitInfo; @@ -61,6 +67,12 @@ class C1_MacroAssembler: public MacroAssembler { #ifdef TARGET_ARCH_sparc # include "c1_MacroAssembler_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_MacroAssembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_MacroAssembler_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp index 9b4db1c0f9f..fd890cf7e47 100644 --- a/hotspot/src/share/vm/c1/c1_globals.hpp +++ b/hotspot/src/share/vm/c1/c1_globals.hpp @@ -32,6 +32,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_globals_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_globals_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c1_globals_linux.hpp" #endif diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp index dfadb7b00db..3c94a1edf1e 100644 --- a/hotspot/src/share/vm/classfile/classFileStream.hpp +++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // Input stream for reading .class file // diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp index 96115b40e15..2d2798a717a 100644 --- a/hotspot/src/share/vm/classfile/stackMapTable.hpp +++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif class StackMapReader; diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp index 4d5e8257b90..65e6fbf5a54 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -51,6 +51,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif #define NOFAILOVER_MAJOR_VERSION 51 diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp index 81d09f5cc5c..b90ed8cbdda 100644 --- a/hotspot/src/share/vm/code/codeBlob.cpp +++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -48,6 +48,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp index a5524ca164c..979dcd52300 100644 --- a/hotspot/src/share/vm/code/compiledIC.hpp +++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -38,6 +38,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. diff --git a/hotspot/src/share/vm/code/icBuffer.cpp b/hotspot/src/share/vm/code/icBuffer.cpp index d36f9109efa..90dbf934a47 100644 --- a/hotspot/src/share/vm/code/icBuffer.cpp +++ b/hotspot/src/share/vm/code/icBuffer.cpp @@ -46,6 +46,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif DEF_STUB_INTERFACE(ICStub); diff --git a/hotspot/src/share/vm/code/relocInfo.cpp b/hotspot/src/share/vm/code/relocInfo.cpp index fa63dc7d827..55676b444de 100644 --- a/hotspot/src/share/vm/code/relocInfo.cpp +++ b/hotspot/src/share/vm/code/relocInfo.cpp @@ -41,6 +41,14 @@ # include "assembler_zero.inline.hpp" # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +# include "nativeInst_ppc.hpp" +#endif const RelocationHolder RelocationHolder::none; // its type is relocInfo::none diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp index c3c4468a71f..e5587b259ed 100644 --- a/hotspot/src/share/vm/code/relocInfo.hpp +++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -429,6 +429,12 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { #endif #ifdef TARGET_ARCH_zero # include "relocInfo_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "relocInfo_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "relocInfo_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp index 1be8ea2f8da..cd00dd42836 100644 --- a/hotspot/src/share/vm/code/vmreg.hpp +++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "register_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +#endif #ifdef COMPILER2 #include "opto/adlcVMDeps.hpp" #include "utilities/ostream.hpp" @@ -51,6 +57,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif #endif //------------------------------VMReg------------------------------------------ @@ -164,6 +176,12 @@ public: #ifdef TARGET_ARCH_zero # include "vmreg_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp index f81ce0e686b..4b1ad9ab8bf 100644 --- a/hotspot/src/share/vm/compiler/disassembler.cpp +++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "depChecker_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "depChecker_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "depChecker_ppc.hpp" +#endif #ifdef SHARK #include "shark/sharkEntry.hpp" #endif diff --git a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp index f954109228a..03b377065b7 100644 --- a/hotspot/src/share/vm/compiler/disassembler.hpp +++ b/hotspot/src/share/vm/compiler/disassembler.hpp @@ -69,6 +69,12 @@ class Disassembler { #endif #ifdef TARGET_ARCH_zero # include "disassembler_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "disassembler_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "disassembler_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 73eae232dc9..2dd19992785 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "interp_masm_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "interp_masm_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp index b798c9a7a1b..7fb50dffb99 100644 --- a/hotspot/src/share/vm/interpreter/bytecode.hpp +++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif class ciBytecodeStream; diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp index c214457b4f4..7b77e875b3d 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.cpp @@ -59,6 +59,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // no precompiled headers diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp index 636a070d668..1f59ee47ceb 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif #ifdef CC_INTERP @@ -587,6 +593,12 @@ void print(); #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytecodeInterpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytecodeInterpreter_ppc.hpp" +#endif }; // BytecodeInterpreter diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp index d0dcf6ce7b7..c0dc4b61b40 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -52,6 +52,12 @@ #ifdef TARGET_ARCH_zero # include "bytecodeInterpreter_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytecodeInterpreter_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytecodeInterpreter_ppc.inline.hpp" +#endif #endif // CC_INTERP diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp index 05e4e64d088..532a05632ad 100644 --- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // A BytecodeStream is used for fast iteration over the bytecodes // of a methodOop. diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp index 45c42bb592e..5e4b9dcee2a 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif #if defined(WIN32) && (defined(_MSC_VER) && (_MSC_VER < 1600)) diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp index 29313cd44b6..6194ad62134 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -293,6 +293,12 @@ class Bytecodes: AllStatic { #endif #ifdef TARGET_ARCH_zero # include "bytecodes_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "bytecodes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytecodes_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp index c428634ecac..45d7921c07f 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -90,6 +90,12 @@ class CppInterpreter: public AbstractInterpreter { #ifdef TARGET_ARCH_zero # include "cppInterpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "cppInterpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "cppInterpreter_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp index fa0b785c3c5..b324f953e30 100644 --- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -53,6 +53,12 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator { #ifdef TARGET_ARCH_zero # include "cppInterpreterGenerator_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "cppInterpreterGenerator_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "cppInterpreterGenerator_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp index 9de4afa6ade..698a2edcd8f 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.hpp +++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -152,6 +152,12 @@ class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateI #ifdef TARGET_ARCH_zero # include "interpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "interpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "interpreter_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp index 1030248f4ec..1a228e20795 100644 --- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp @@ -50,6 +50,12 @@ InterpreterGenerator(StubQueue* _code); #ifdef TARGET_ARCH_zero # include "interpreterGenerator_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "interpreterGenerator_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "interpreterGenerator_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index b6ece3c2421..69fa7e0eacd 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -65,6 +65,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif #ifdef COMPILER2 #include "opto/runtime.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp index 84b3910224b..caa9068af33 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -156,6 +156,12 @@ class InterpreterRuntime: AllStatic { #endif #ifdef TARGET_ARCH_zero # include "interpreterRT_zero.hpp" +#endif +#ifdef TARGET_ARCH_arm +# include "interpreterRT_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "interpreterRT_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp index 73b02b57f33..40717ec5677 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -192,6 +192,12 @@ class TemplateInterpreter: public AbstractInterpreter { #ifdef TARGET_ARCH_zero # include "templateInterpreter_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "templateInterpreter_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "templateInterpreter_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp index 3d92fff0454..dc63589ed42 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -96,6 +96,12 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { #ifdef TARGET_ARCH_zero # include "templateInterpreterGenerator_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "templateInterpreterGenerator_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "templateInterpreterGenerator_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp index 0bca2dcd348..d38623247e4 100644 --- a/hotspot/src/share/vm/interpreter/templateTable.hpp +++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "interp_masm_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "interp_masm_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "interp_masm_ppc.hpp" +#endif #ifndef CC_INTERP // All the necessary definitions used for (bytecode) template generation. Instead of @@ -364,6 +370,12 @@ class TemplateTable: AllStatic { #ifdef TARGET_ARCH_MODEL_zero # include "templateTable_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "templateTable_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "templateTable_ppc.hpp" +#endif }; #endif /* !CC_INTERP */ diff --git a/hotspot/src/share/vm/oops/constantPoolOop.hpp b/hotspot/src/share/vm/oops/constantPoolOop.hpp index 8fbfcb05fec..fa482a5c4da 100644 --- a/hotspot/src/share/vm/oops/constantPoolOop.hpp +++ b/hotspot/src/share/vm/oops/constantPoolOop.hpp @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // A constantPool is an array containing class constants as described in the // class file. diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp index 9975941cc62..afdccfb262b 100644 --- a/hotspot/src/share/vm/oops/oop.inline.hpp +++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -52,6 +52,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references diff --git a/hotspot/src/share/vm/oops/typeArrayOop.hpp b/hotspot/src/share/vm/oops/typeArrayOop.hpp index 05d4ef81db0..c39987be5c7 100644 --- a/hotspot/src/share/vm/oops/typeArrayOop.hpp +++ b/hotspot/src/share/vm/oops/typeArrayOop.hpp @@ -45,6 +45,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // A typeArrayOop is an array containing basic types (non oop elements). // It is used for arrays of {characters, singles, doubles, bytes, shorts, integers, longs} diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp index 564fd369aff..32a174729c7 100644 --- a/hotspot/src/share/vm/opto/buildOopMap.cpp +++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -41,6 +41,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif // The functions in this file builds OopMaps after all scheduling is done. // diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp index fe516dff508..159b2805081 100644 --- a/hotspot/src/share/vm/opto/c2_globals.hpp +++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -32,6 +32,9 @@ #ifdef TARGET_ARCH_sparc # include "c2_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c2_globals_arm.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c2_globals_linux.hpp" #endif diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp index 889fc4295ae..7b0b9be59a6 100644 --- a/hotspot/src/share/vm/opto/c2compiler.cpp +++ b/hotspot/src/share/vm/opto/c2compiler.cpp @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif volatile int C2Compiler::_runtimes = uninitialized; diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp index cad5224e62d..a1d9659af82 100644 --- a/hotspot/src/share/vm/opto/compile.cpp +++ b/hotspot/src/share/vm/opto/compile.cpp @@ -74,6 +74,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif // -------------------- Compile::mach_constant_base_node ----------------------- diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp index 1a0116445d2..2122f7ca733 100644 --- a/hotspot/src/share/vm/opto/gcm.cpp +++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -47,6 +47,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif // Portions of code courtesy of Clifford Click diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp index 3858a038fc2..64a1027a73c 100644 --- a/hotspot/src/share/vm/opto/locknode.hpp +++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif //------------------------------BoxLockNode------------------------------------ class BoxLockNode : public Node { diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp index 7e3237198e3..51eaa5c5e2b 100644 --- a/hotspot/src/share/vm/opto/output.hpp +++ b/hotspot/src/share/vm/opto/output.hpp @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif class Arena; class Bundle; diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp index b1ba93801f9..3841a42fc53 100644 --- a/hotspot/src/share/vm/opto/regmask.cpp +++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -37,6 +37,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp index b1c280da298..7c3e7182580 100644 --- a/hotspot/src/share/vm/opto/regmask.hpp +++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif // Some fun naming (textual) substitutions: // diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp index 5231c0e0a10..b0544fef2ec 100644 --- a/hotspot/src/share/vm/opto/runtime.cpp +++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -80,6 +80,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif // For debugging purposes: diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp index f344c0e3d40..6301c9865cb 100644 --- a/hotspot/src/share/vm/prims/jniCheck.cpp +++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -45,6 +45,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif // Heap objects are allowed to be directly referenced only in VM code, diff --git a/hotspot/src/share/vm/prims/jni_md.h b/hotspot/src/share/vm/prims/jni_md.h index 3cf4017f4db..72aa1dc3977 100644 --- a/hotspot/src/share/vm/prims/jni_md.h +++ b/hotspot/src/share/vm/prims/jni_md.h @@ -33,6 +33,12 @@ #ifdef TARGET_ARCH_zero # include "jni_zero.h" #endif +#ifdef TARGET_ARCH_arm +# include "jni_arm.h" +#endif +#ifdef TARGET_ARCH_ppc +# include "jni_ppc.h" +#endif /* diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp index 16bdd1291c5..fa08cf712d0 100644 --- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // FIXME: add Deprecated, LVT, LVTT attributes // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for constantPoolOopDesc::copy_cpool_bytes() diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index 7944c5a74a7..36fd0be4bd3 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -59,6 +59,12 @@ #ifdef TARGET_ARCH_zero # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmreg_ppc.inline.hpp" +#endif #ifdef COMPILER2 #ifdef TARGET_ARCH_MODEL_x86_32 # include "adfiles/ad_x86_32.hpp" @@ -72,6 +78,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/ad_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/ad_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/ad_ppc.hpp" +#endif #endif bool DeoptimizationMarker::_is_active = false; diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp index 15febe45916..d6c80c7374a 100644 --- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif class RegisteredProbes; typedef jlong OpaqueProbes; diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp index c1ce9690752..5c205501a2c 100644 --- a/hotspot/src/share/vm/runtime/frame.cpp +++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -52,6 +52,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif RegisterMap::RegisterMap(JavaThread *thread, bool update_map) { _thread = thread; diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp index 8fc6699dbaa..4750f3a5a69 100644 --- a/hotspot/src/share/vm/runtime/frame.hpp +++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -44,6 +44,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif #endif #ifdef ZERO #ifdef TARGET_ARCH_zero @@ -457,6 +463,12 @@ class frame VALUE_OBJ_CLASS_SPEC { #ifdef TARGET_ARCH_zero # include "frame_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "frame_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "frame_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp index 9ecae452766..739a50b9a25 100644 --- a/hotspot/src/share/vm/runtime/frame.inline.hpp +++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif #ifdef ZERO #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" @@ -88,6 +94,12 @@ inline bool frame::is_first_frame() const { #ifdef TARGET_ARCH_zero # include "frame_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "frame_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "frame_ppc.inline.hpp" +#endif #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 94bc7818841..4a83a419537 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "globals_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "globals_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "globals_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "globals_linux.hpp" #endif @@ -62,6 +68,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "globals_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "globals_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "globals_linux_ppc.hpp" +#endif #ifdef COMPILER1 #ifdef TARGET_ARCH_x86 # include "c1_globals_x86.hpp" @@ -69,6 +81,12 @@ #ifdef TARGET_ARCH_sparc # include "c1_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c1_globals_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "c1_globals_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c1_globals_linux.hpp" #endif @@ -86,6 +104,9 @@ #ifdef TARGET_ARCH_sparc # include "c2_globals_sparc.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "c2_globals_arm.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "c2_globals_linux.hpp" #endif @@ -410,7 +431,14 @@ class CommandLineFlags { product_pd(bool, UseMembar, \ "(Unstable) Issues membars on thread state transitions") \ \ - /* Temporary: See 6948537 */ \ + /* Temp PPC Flag to allow disabling the use of lwsync on ppc platforms \ + * that don't support it. This will be replaced by processor detection \ + * logic. \ + */ \ + product(bool, UsePPCLWSYNC, true, \ + "Use lwsync instruction if true, else use slower sync") \ + \ + /* Temporary: See 6948537 */ \ experimental(bool, UseMemSetInBOT, true, \ "(Unstable) uses memset in BOT updates in GC code") \ \ @@ -1926,6 +1954,9 @@ class CommandLineFlags { product(bool, PrintRevisitStats, false, \ "Print revisit (klass and MDO) stack related information") \ \ + EMBEDDED_ONLY(product(bool, LowMemoryProtection, true, \ + "Enable LowMemoryProtection")) \ + \ product_pd(bool, NeverActAsServerClassMachine, \ "Never act like a server-class machine") \ \ @@ -2630,6 +2661,25 @@ class CommandLineFlags { product(bool, UseStringCache, false, \ "Enable String cache capabilities on String.java") \ \ + /* byte strings */ \ + product(bool, UseCompressedStrings, false, \ + "Enable byte-valued strings") \ + \ + product(bool, SpecialStringCompress, true, \ + "special version of string compress") \ + \ + product(bool, SpecialStringInflate, true, \ + "special version of string inflate") \ + \ + product(bool, SpecialStringCompareToCC, true, \ + "special version of string compareToCC") \ + \ + product(bool, SpecialStringIndexOfCC, true, \ + "special version of string indexOfCC") \ + \ + product(bool, SpecialStringEqualsCC, true, \ + "special version of string equalsCC") \ + \ /* statistics */ \ develop(bool, CountCompiledCalls, false, \ "counts method invocations") \ @@ -2851,9 +2901,13 @@ class CommandLineFlags { "Max. no. of lines in the stack trace for Java exceptions " \ "(0 means all)") \ \ - develop(intx, GuaranteedSafepointInterval, 1000, \ + NOT_EMBEDDED(develop(intx, GuaranteedSafepointInterval, 1000, \ "Guarantee a safepoint (at least) every so many milliseconds " \ - "(0 means none)") \ + "(0 means none)")) \ + \ + EMBEDDED_ONLY(product(intx, GuaranteedSafepointInterval, 0, \ + "Guarantee a safepoint (at least) every so many milliseconds " \ + "(0 means none)")) \ \ product(intx, SafepointTimeoutDelay, 10000, \ "Delay in milliseconds for option SafepointTimeout") \ @@ -3543,9 +3597,13 @@ class CommandLineFlags { \ /* flags for performance data collection */ \ \ - product(bool, UsePerfData, true, \ + NOT_EMBEDDED(product(bool, UsePerfData, true, \ "Flag to disable jvmstat instrumentation for performance testing" \ - "and problem isolation purposes.") \ + "and problem isolation purposes.")) \ + \ + EMBEDDED_ONLY(product(bool, UsePerfData, false, \ + "Flag to disable jvmstat instrumentation for performance testing" \ + "and problem isolation purposes.")) \ \ product(bool, PerfDataSaveToFile, false, \ "Save PerfData memory to hsperfdata_ file on exit") \ diff --git a/hotspot/src/share/vm/runtime/icache.hpp b/hotspot/src/share/vm/runtime/icache.hpp index d8b991fbd65..7ffce5b140d 100644 --- a/hotspot/src/share/vm/runtime/icache.hpp +++ b/hotspot/src/share/vm/runtime/icache.hpp @@ -77,6 +77,12 @@ class AbstractICache : AllStatic { #ifdef TARGET_ARCH_zero # include "icache_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "icache_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "icache_ppc.hpp" +#endif diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index ea7cc2860e5..f833dd2e400 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -70,6 +70,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp index 7567268e0f6..535bcc15957 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.hpp +++ b/hotspot/src/share/vm/runtime/javaCalls.hpp @@ -39,6 +39,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp index 314031b7ca0..af5d7728411 100644 --- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -44,6 +44,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // // An object for encapsulating the machine/os dependent part of a JavaThread frame state // @@ -102,6 +108,12 @@ friend class JavaCallWrapper; #ifdef TARGET_ARCH_zero # include "javaFrameAnchor_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "javaFrameAnchor_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "javaFrameAnchor_ppc.hpp" +#endif public: diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index b1476b6395c..c7f03462d54 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -675,6 +675,12 @@ class os: AllStatic { #endif #ifdef TARGET_OS_ARCH_windows_x86 # include "os_windows_x86.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "os_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "os_linux_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp index aea349b9316..da597d40ed4 100644 --- a/hotspot/src/share/vm/runtime/registerMap.hpp +++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "register_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "register_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "register_ppc.hpp" +#endif class JavaThread; @@ -138,6 +144,12 @@ class RegisterMap : public StackObj { #ifdef TARGET_ARCH_zero # include "registerMap_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "registerMap_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "registerMap_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp index 7fc4241c800..c34866f746c 100644 --- a/hotspot/src/share/vm/runtime/relocator.hpp +++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "bytes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "bytes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "bytes_ppc.hpp" +#endif // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp index 6edd8c9f8de..bd9a9e6eb32 100644 --- a/hotspot/src/share/vm/runtime/safepoint.cpp +++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -61,6 +61,14 @@ # include "nativeInst_zero.hpp" # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +# include "vmreg_ppc.inline.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp index 801189ce561..1fa811e0bd5 100644 --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -68,6 +68,14 @@ # include "nativeInst_zero.hpp" # include "vmreg_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +# include "vmreg_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +# include "vmreg_ppc.inline.hpp" +#endif #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif @@ -2618,6 +2626,7 @@ void SharedRuntime::get_utf(oopDesc* src, address dst) { int jlsLen = java_lang_String::length(src); jchar* jlsPos = (jlsLen == 0) ? NULL : jlsValue->char_at_addr(jlsOffset); + assert(typeArrayKlass::cast(jlsValue->klass())->element_type() == T_CHAR, "compressed string"); (void) UNICODE::as_utf8(jlsPos, jlsLen, (char *)dst, max_dtrace_string_size); } #endif // ndef HAVE_DTRACE_H diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp index 62bef8c8318..bc391e599aa 100644 --- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp +++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -33,6 +33,12 @@ #ifdef TARGET_ARCH_zero # include "jniTypes_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "jniTypes_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "jniTypes_ppc.hpp" +#endif jint StackValueCollection::int_at(int slot) const { intptr_t val = at(slot)->get_int(); diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp index 250dbf37f89..bbb947737be 100644 --- a/hotspot/src/share/vm/runtime/statSampler.cpp +++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -42,6 +42,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif // -------------------------------------------------------- // StatSamplerTask diff --git a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp index ab9d763526f..ba395194f7f 100644 --- a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp +++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp @@ -36,6 +36,12 @@ #ifdef TARGET_ARCH_zero # include "assembler_zero.inline.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "assembler_arm.inline.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "assembler_ppc.inline.hpp" +#endif // Implementation of StubCodeDesc diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index 46aaf7c0c1b..0eb0d1136af 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -40,6 +40,12 @@ #ifdef TARGET_ARCH_zero # include "nativeInst_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "nativeInst_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "nativeInst_ppc.hpp" +#endif // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry @@ -104,6 +110,12 @@ class StubRoutines: AllStatic { #endif #ifdef TARGET_ARCH_MODEL_zero # include "stubRoutines_zero.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_arm +# include "stubRoutines_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "stubRoutines_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index acdc227bdcc..c0818321fb3 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -1597,6 +1597,12 @@ public: #endif #ifdef TARGET_OS_ARCH_windows_x86 # include "thread_windows_x86.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "thread_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "thread_linux_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp index 8a78e579535..2ca4260d902 100644 --- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp +++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp @@ -61,6 +61,12 @@ class ThreadLocalStorage : AllStatic { #endif #ifdef TARGET_OS_ARCH_windows_x86 # include "threadLS_windows_x86.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "threadLS_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "threadLS_linux_ppc.hpp" #endif diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index bdcbbfd2581..003e659e815 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -108,6 +108,12 @@ #ifdef TARGET_ARCH_zero # include "vmStructs_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vmStructs_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vmStructs_ppc.hpp" +#endif #ifdef TARGET_OS_FAMILY_linux # include "thread_linux.inline.hpp" #endif @@ -135,6 +141,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "vmStructs_windows_x86.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "vmStructs_linux_arm.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "vmStructs_linux_ppc.hpp" +#endif #ifndef SERIALGC #include "gc_implementation/concurrentMarkSweep/cmsPermGen.hpp" #include "gc_implementation/concurrentMarkSweep/compactibleFreeListSpace.hpp" @@ -166,6 +178,12 @@ #ifdef TARGET_ARCH_MODEL_zero # include "adfiles/adGlobals_zero.hpp" #endif +#ifdef TARGET_ARCH_MODEL_arm +# include "adfiles/adGlobals_arm.hpp" +#endif +#ifdef TARGET_ARCH_MODEL_ppc +# include "adfiles/adGlobals_ppc.hpp" +#endif #endif // Note: the cross-product of (c1, c2, product, nonproduct, ...), diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index 5571db998e6..11db0c39ab3 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -35,6 +35,12 @@ #ifdef TARGET_ARCH_zero # include "vm_version_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "vm_version_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "vm_version_ppc.hpp" +#endif const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); @@ -220,8 +226,21 @@ const char* Abstract_VM_Version::internal_vm_info_string() { #endif #endif + #ifndef FLOAT_ARCH + #if defined(__SOFTFP__) + #define FLOAT_ARCH "-sflt" + #elif defined(E500V2) + #define FLOAT_ARCH "-e500v2" + #elif defined(ARM) + #define FLOAT_ARCH "-vfp" + #elif defined(PPC) + #define FLOAT_ARCH "-hflt" + #else + #define FLOAT_ARCH "" + #endif + #endif - return VMNAME " (" VM_RELEASE ") for " OS "-" CPU + return VMNAME " (" VM_RELEASE ") for " OS "-" CPU FLOAT_ARCH " JRE (" JRE_RELEASE_VERSION "), built on " __DATE__ " " __TIME__ " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER; } diff --git a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp index 67c11a32d85..8772fe44f06 100644 --- a/hotspot/src/share/vm/utilities/copy.hpp +++ b/hotspot/src/share/vm/utilities/copy.hpp @@ -331,6 +331,12 @@ class Copy : AllStatic { #ifdef TARGET_ARCH_zero # include "copy_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "copy_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "copy_ppc.hpp" +#endif }; diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 56a9043e546..820b6abcb7e 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -328,6 +328,12 @@ extern int LogMinObjAlignmentInBytes; #ifdef TARGET_ARCH_zero # include "globalDefinitions_zero.hpp" #endif +#ifdef TARGET_ARCH_arm +# include "globalDefinitions_arm.hpp" +#endif +#ifdef TARGET_ARCH_ppc +# include "globalDefinitions_ppc.hpp" +#endif // The byte alignment to be used by Arena::Amalloc. See bugid 4169348. diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp index 8cfd83df395..79f293444d9 100644 --- a/hotspot/src/share/vm/utilities/taskqueue.hpp +++ b/hotspot/src/share/vm/utilities/taskqueue.hpp @@ -47,6 +47,12 @@ #ifdef TARGET_OS_ARCH_windows_x86 # include "orderAccess_windows_x86.inline.hpp" #endif +#ifdef TARGET_OS_ARCH_linux_arm +# include "orderAccess_linux_arm.inline.hpp" +#endif +#ifdef TARGET_OS_ARCH_linux_ppc +# include "orderAccess_linux_ppc.inline.hpp" +#endif // Simple TaskQueue stats that are collected by default in debug builds. From ce8ab391641c8d4938df036977a26c6b9b271e84 Mon Sep 17 00:00:00 2001 From: Brian Goetz Date: Wed, 2 Feb 2011 13:13:34 -0500 Subject: [PATCH 31/84] 7012540: java.util.Objects.nonNull() incorrectly named Reviewed-by: darcy, weijun --- jdk/src/share/classes/java/io/PrintStream.java | 12 ++++++------ jdk/src/share/classes/java/io/PrintWriter.java | 2 +- .../classes/java/lang/StackTraceElement.java | 4 ++-- .../nio/file/DirectoryIteratorException.java | 2 +- .../classes/java/nio/file/FileTreeWalker.java | 3 +-- jdk/src/share/classes/java/nio/file/Files.java | 8 ++++---- .../java/nio/file/SimpleFileVisitor.java | 12 ++++++------ jdk/src/share/classes/java/util/Formatter.java | 7 ++----- jdk/src/share/classes/java/util/Objects.java | 10 +++++----- jdk/src/share/classes/java/util/Scanner.java | 17 +++++++++-------- .../classes/sun/security/krb5/KrbAsRep.java | 2 +- .../java/util/Objects/BasicObjectsTest.java | 8 ++++---- 12 files changed, 42 insertions(+), 45 deletions(-) diff --git a/jdk/src/share/classes/java/io/PrintStream.java b/jdk/src/share/classes/java/io/PrintStream.java index 9ed3ff6f910..f29b5407abf 100644 --- a/jdk/src/share/classes/java/io/PrintStream.java +++ b/jdk/src/share/classes/java/io/PrintStream.java @@ -70,11 +70,11 @@ public class PrintStream extends FilterOutputStream private OutputStreamWriter charOut; /** - * nonNull is explicitly declared here so as not to create an extra - * dependency on java.util.Objects.nonNull. PrintStream is loaded + * requireNonNull is explicitly declared here so as not to create an extra + * dependency on java.util.Objects.requireNonNull. PrintStream is loaded * early during system initialization. */ - private static T nonNull(T obj, String message) { + private static T requireNonNull(T obj, String message) { if (obj == null) throw new NullPointerException(message); return obj; @@ -88,7 +88,7 @@ public class PrintStream extends FilterOutputStream private static Charset toCharset(String csn) throws UnsupportedEncodingException { - nonNull(csn, "charsetName"); + requireNonNull(csn, "charsetName"); try { return Charset.forName(csn); } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) { @@ -148,7 +148,7 @@ public class PrintStream extends FilterOutputStream * @see java.io.PrintWriter#PrintWriter(java.io.OutputStream, boolean) */ public PrintStream(OutputStream out, boolean autoFlush) { - this(autoFlush, nonNull(out, "Null output stream")); + this(autoFlush, requireNonNull(out, "Null output stream")); } /** @@ -173,7 +173,7 @@ public class PrintStream extends FilterOutputStream throws UnsupportedEncodingException { this(autoFlush, - nonNull(out, "Null output stream"), + requireNonNull(out, "Null output stream"), toCharset(encoding)); } diff --git a/jdk/src/share/classes/java/io/PrintWriter.java b/jdk/src/share/classes/java/io/PrintWriter.java index 16044567065..0e9ea8f5688 100644 --- a/jdk/src/share/classes/java/io/PrintWriter.java +++ b/jdk/src/share/classes/java/io/PrintWriter.java @@ -82,7 +82,7 @@ public class PrintWriter extends Writer { private static Charset toCharset(String csn) throws UnsupportedEncodingException { - Objects.nonNull(csn, "charsetName"); + Objects.requireNonNull(csn, "charsetName"); try { return Charset.forName(csn); } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) { diff --git a/jdk/src/share/classes/java/lang/StackTraceElement.java b/jdk/src/share/classes/java/lang/StackTraceElement.java index b95587d7185..3bd8ed433c0 100644 --- a/jdk/src/share/classes/java/lang/StackTraceElement.java +++ b/jdk/src/share/classes/java/lang/StackTraceElement.java @@ -68,8 +68,8 @@ public final class StackTraceElement implements java.io.Serializable { */ public StackTraceElement(String declaringClass, String methodName, String fileName, int lineNumber) { - this.declaringClass = Objects.nonNull(declaringClass, "Declaring class is null"); - this.methodName = Objects.nonNull(methodName, "Method name is null"); + this.declaringClass = Objects.requireNonNull(declaringClass, "Declaring class is null"); + this.methodName = Objects.requireNonNull(methodName, "Method name is null"); this.fileName = fileName; this.lineNumber = lineNumber; } diff --git a/jdk/src/share/classes/java/nio/file/DirectoryIteratorException.java b/jdk/src/share/classes/java/nio/file/DirectoryIteratorException.java index 729c84a77cd..a74369c5a22 100644 --- a/jdk/src/share/classes/java/nio/file/DirectoryIteratorException.java +++ b/jdk/src/share/classes/java/nio/file/DirectoryIteratorException.java @@ -56,7 +56,7 @@ public final class DirectoryIteratorException * if the cause is {@code null} */ public DirectoryIteratorException(IOException cause) { - super(Objects.nonNull(cause)); + super(Objects.requireNonNull(cause)); } /** diff --git a/jdk/src/share/classes/java/nio/file/FileTreeWalker.java b/jdk/src/share/classes/java/nio/file/FileTreeWalker.java index fb3995315cc..4c0896f70c1 100644 --- a/jdk/src/share/classes/java/nio/file/FileTreeWalker.java +++ b/jdk/src/share/classes/java/nio/file/FileTreeWalker.java @@ -69,8 +69,7 @@ class FileTreeWalker { FileVisitResult result = walk(start, 0, new ArrayList()); - if (result == null) - throw new NullPointerException("FileVisitor returned null"); + Objects.requireNonNull(result, "FileVisitor returned null"); } /** diff --git a/jdk/src/share/classes/java/nio/file/Files.java b/jdk/src/share/classes/java/nio/file/Files.java index cb1fde29685..357529ac9cf 100644 --- a/jdk/src/share/classes/java/nio/file/Files.java +++ b/jdk/src/share/classes/java/nio/file/Files.java @@ -2779,7 +2779,7 @@ public final class Files { throws IOException { // ensure not null before opening file - Objects.nonNull(in); + Objects.requireNonNull(in); // check for REPLACE_EXISTING boolean replaceExisting = false; @@ -2861,7 +2861,7 @@ public final class Files { */ public static long copy(Path source, OutputStream out) throws IOException { // ensure not null before opening file - Objects.nonNull(out); + Objects.requireNonNull(out); try (InputStream in = newInputStream(source)) { return copy(in, out); @@ -3035,7 +3035,7 @@ public final class Files { throws IOException { // ensure bytes is not null before opening file - Objects.nonNull(bytes); + Objects.requireNonNull(bytes); try (OutputStream out = Files.newOutputStream(path, options)) { int len = bytes.length; @@ -3094,7 +3094,7 @@ public final class Files { throws IOException { // ensure lines is not null before opening file - Objects.nonNull(lines); + Objects.requireNonNull(lines); CharsetEncoder encoder = cs.newEncoder(); OutputStream out = newOutputStream(path, options); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(out, encoder))) { diff --git a/jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java b/jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java index 5b0a4602b4e..8bedbd4c9b3 100644 --- a/jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java +++ b/jdk/src/share/classes/java/nio/file/SimpleFileVisitor.java @@ -57,8 +57,8 @@ public class SimpleFileVisitor implements FileVisitor { public FileVisitResult preVisitDirectory(T dir, BasicFileAttributes attrs) throws IOException { - Objects.nonNull(dir); - Objects.nonNull(attrs); + Objects.requireNonNull(dir); + Objects.requireNonNull(attrs); return FileVisitResult.CONTINUE; } @@ -72,8 +72,8 @@ public class SimpleFileVisitor implements FileVisitor { public FileVisitResult visitFile(T file, BasicFileAttributes attrs) throws IOException { - Objects.nonNull(file); - Objects.nonNull(attrs); + Objects.requireNonNull(file); + Objects.requireNonNull(attrs); return FileVisitResult.CONTINUE; } @@ -87,7 +87,7 @@ public class SimpleFileVisitor implements FileVisitor { public FileVisitResult visitFileFailed(T file, IOException exc) throws IOException { - Objects.nonNull(file); + Objects.requireNonNull(file); throw exc; } @@ -104,7 +104,7 @@ public class SimpleFileVisitor implements FileVisitor { public FileVisitResult postVisitDirectory(T dir, IOException exc) throws IOException { - Objects.nonNull(dir); + Objects.requireNonNull(dir); if (exc != null) throw exc; return FileVisitResult.CONTINUE; diff --git a/jdk/src/share/classes/java/util/Formatter.java b/jdk/src/share/classes/java/util/Formatter.java index 6c9ead3b7f0..797b9e2f8aa 100644 --- a/jdk/src/share/classes/java/util/Formatter.java +++ b/jdk/src/share/classes/java/util/Formatter.java @@ -47,9 +47,6 @@ import java.text.DateFormatSymbols; import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -1859,7 +1856,7 @@ public final class Formatter implements Closeable, Flushable { private static Charset toCharset(String csn) throws UnsupportedEncodingException { - Objects.nonNull(csn, "charsetName"); + Objects.requireNonNull(csn, "charsetName"); try { return Charset.forName(csn); } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) { @@ -2179,7 +2176,7 @@ public final class Formatter implements Closeable, Flushable { */ public Formatter(PrintStream ps) { this(Locale.getDefault(Locale.Category.FORMAT), - (Appendable)Objects.nonNull(ps)); + (Appendable)Objects.requireNonNull(ps)); } /** diff --git a/jdk/src/share/classes/java/util/Objects.java b/jdk/src/share/classes/java/util/Objects.java index e6212235f45..e3d5ad415f2 100644 --- a/jdk/src/share/classes/java/util/Objects.java +++ b/jdk/src/share/classes/java/util/Objects.java @@ -187,7 +187,7 @@ public final class Objects { * and constructors, as demonstrated below: *
      * public Foo(Bar bar) {
-     *     this.bar = Objects.nonNull(bar);
+     *     this.bar = Objects.requireNonNull(bar);
      * }
      * 
* @@ -196,7 +196,7 @@ public final class Objects { * @return {@code obj} if not {@code null} * @throws NullPointerException if {@code obj} is {@code null} */ - public static T nonNull(T obj) { + public static T requireNonNull(T obj) { if (obj == null) throw new NullPointerException(); return obj; @@ -209,8 +209,8 @@ public final class Objects { * constructors with multiple parameters, as demonstrated below: *
      * public Foo(Bar bar, Baz baz) {
-     *     this.bar = Objects.nonNull(bar, "bar must not be null");
-     *     this.baz = Objects.nonNull(baz, "baz must not be null");
+     *     this.bar = Objects.requireNonNull(bar, "bar must not be null");
+     *     this.baz = Objects.requireNonNull(baz, "baz must not be null");
      * }
      * 
* @@ -221,7 +221,7 @@ public final class Objects { * @return {@code obj} if not {@code null} * @throws NullPointerException if {@code obj} is {@code null} */ - public static T nonNull(T obj, String message) { + public static T requireNonNull(T obj, String message) { if (obj == null) throw new NullPointerException(message); return obj; diff --git a/jdk/src/share/classes/java/util/Scanner.java b/jdk/src/share/classes/java/util/Scanner.java index 4aa5c9fb8c5..e80b27a393b 100644 --- a/jdk/src/share/classes/java/util/Scanner.java +++ b/jdk/src/share/classes/java/util/Scanner.java @@ -35,6 +35,7 @@ import java.nio.channels.*; import java.nio.charset.*; import java.text.*; import java.util.Locale; + import sun.misc.LRUCache; /** @@ -592,7 +593,7 @@ public final class Scanner implements Iterator, Closeable { * interface */ public Scanner(Readable source) { - this(Objects.nonNull(source, "source"), WHITESPACE_PATTERN); + this(Objects.requireNonNull(source, "source"), WHITESPACE_PATTERN); } /** @@ -619,7 +620,7 @@ public final class Scanner implements Iterator, Closeable { * does not exist */ public Scanner(InputStream source, String charsetName) { - this(makeReadable(Objects.nonNull(source, "source"), toCharset(charsetName)), + this(makeReadable(Objects.requireNonNull(source, "source"), toCharset(charsetName)), WHITESPACE_PATTERN); } @@ -629,7 +630,7 @@ public final class Scanner implements Iterator, Closeable { * @throws IllegalArgumentException if the charset is not supported */ private static Charset toCharset(String csn) { - Objects.nonNull(csn, "charsetName"); + Objects.requireNonNull(csn, "charsetName"); try { return Charset.forName(csn); } catch (IllegalCharsetNameException|UnsupportedCharsetException e) { @@ -670,7 +671,7 @@ public final class Scanner implements Iterator, Closeable { public Scanner(File source, String charsetName) throws FileNotFoundException { - this(Objects.nonNull(source), toDecoder(charsetName)); + this(Objects.requireNonNull(source), toDecoder(charsetName)); } private Scanner(File source, CharsetDecoder dec) @@ -680,7 +681,7 @@ public final class Scanner implements Iterator, Closeable { } private static CharsetDecoder toDecoder(String charsetName) { - Objects.nonNull(charsetName, "charsetName"); + Objects.requireNonNull(charsetName, "charsetName"); try { return Charset.forName(charsetName).newDecoder(); } catch (IllegalCharsetNameException|UnsupportedCharsetException unused) { @@ -729,7 +730,7 @@ public final class Scanner implements Iterator, Closeable { * @since 1.7 */ public Scanner(Path source, String charsetName) throws IOException { - this(Objects.nonNull(source), toCharset(charsetName)); + this(Objects.requireNonNull(source), toCharset(charsetName)); } private Scanner(Path source, Charset charset) throws IOException { @@ -755,7 +756,7 @@ public final class Scanner implements Iterator, Closeable { * @param source A channel to scan */ public Scanner(ReadableByteChannel source) { - this(makeReadable(Objects.nonNull(source, "source")), + this(makeReadable(Objects.requireNonNull(source, "source")), WHITESPACE_PATTERN); } @@ -775,7 +776,7 @@ public final class Scanner implements Iterator, Closeable { * does not exist */ public Scanner(ReadableByteChannel source, String charsetName) { - this(makeReadable(Objects.nonNull(source, "source"), toDecoder(charsetName)), + this(makeReadable(Objects.requireNonNull(source, "source"), toDecoder(charsetName)), WHITESPACE_PATTERN); } diff --git a/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java b/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java index c05d8bd08bf..140d5981b5e 100644 --- a/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java +++ b/jdk/src/share/classes/sun/security/krb5/KrbAsRep.java @@ -173,7 +173,7 @@ class KrbAsRep extends KrbKdcRep { } Credentials getCreds() { - return Objects.nonNull(creds, "Creds not available yet."); + return Objects.requireNonNull(creds, "Creds not available yet."); } sun.security.krb5.internal.ccache.Credentials getCCreds() { diff --git a/jdk/test/java/util/Objects/BasicObjectsTest.java b/jdk/test/java/util/Objects/BasicObjectsTest.java index 7584d2cffc2..bf025a8ad2c 100644 --- a/jdk/test/java/util/Objects/BasicObjectsTest.java +++ b/jdk/test/java/util/Objects/BasicObjectsTest.java @@ -164,7 +164,7 @@ public class BasicObjectsTest { // Test 1-arg variant try { - s = Objects.nonNull("pants"); + s = Objects.requireNonNull("pants"); if (s != "pants") { System.err.printf("1-arg non-null failed to return its arg"); errors++; @@ -175,7 +175,7 @@ public class BasicObjectsTest { } try { - s = Objects.nonNull(null); + s = Objects.requireNonNull(null); System.err.printf("1-arg nonNull failed to throw NPE"); errors++; } catch (NullPointerException e) { @@ -184,7 +184,7 @@ public class BasicObjectsTest { // Test 2-arg variant try { - s = Objects.nonNull("pants", "trousers"); + s = Objects.requireNonNull("pants", "trousers"); if (s != "pants") { System.err.printf("2-arg nonNull failed to return its arg"); errors++; @@ -195,7 +195,7 @@ public class BasicObjectsTest { } try { - s = Objects.nonNull(null, "pantaloons"); + s = Objects.requireNonNull(null, "pantaloons"); System.err.printf("2-arg nonNull failed to throw NPE"); errors++; } catch (NullPointerException e) { From 3373070e7fb0d0379d2481e0496250050a0407d1 Mon Sep 17 00:00:00 2001 From: John Cuthbertson Date: Wed, 2 Feb 2011 10:41:20 -0800 Subject: [PATCH 32/84] 6923430: G1: assert(res != 0,"This should have worked.") 7007446: G1: expand the heap with a single step, not one region at a time Changed G1CollectedHeap::expand() to expand the committed space by calling VirtualSpace::expand_by() once rather than for every region in the expansion amount. This allows the success or failure of the expansion to be determined before creating any heap regions. Introduced a develop flag G1ExitOnExpansionFailure (false by default) that, when true, will exit the VM if the expansion of the committed space fails. Finally G1CollectedHeap::expand() returns a status back to it's caller so that the caller knows whether to attempt the allocation. Reviewed-by: brutisso, tonyp --- .../g1/concurrentG1Refine.cpp | 4 +- .../gc_implementation/g1/g1CollectedHeap.cpp | 157 +++++++++++------- .../gc_implementation/g1/g1CollectedHeap.hpp | 7 +- .../g1/g1CollectorPolicy.cpp | 2 +- .../vm/gc_implementation/g1/g1RemSet.cpp | 4 +- .../vm/gc_implementation/g1/g1_globals.hpp | 8 +- 6 files changed, 114 insertions(+), 68 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp index d26530323d2..c0d968aa8f4 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentG1Refine.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, 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 @@ -99,7 +99,7 @@ void ConcurrentG1Refine::init() { if (G1ConcRSLogCacheSize > 0) { _g1h = G1CollectedHeap::heap(); _max_n_card_counts = - (unsigned) (_g1h->g1_reserved_obj_bytes() >> CardTableModRefBS::card_shift); + (unsigned) (_g1h->max_capacity() >> CardTableModRefBS::card_shift); size_t max_card_num = ((size_t)1 << (sizeof(unsigned)*BitsPerByte-1)) - 1; guarantee(_max_n_card_counts < max_card_num, "card_num representation"); diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 3d3522461a5..a4f01adf0aa 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -546,8 +546,11 @@ HeapRegion* G1CollectedHeap::new_region_work(size_t word_size, res = new_region_try_secondary_free_list(word_size); } if (res == NULL && do_expand) { - expand(word_size * HeapWordSize); - res = _free_list.remove_head_or_null(); + if (expand(word_size * HeapWordSize)) { + // The expansion succeeded and so we should have at least one + // region on the free list. + res = _free_list.remove_head(); + } } if (res != NULL) { if (G1PrintHeapRegions) { @@ -631,9 +634,22 @@ HeapWord* G1CollectedHeap::humongous_obj_allocate(size_t word_size) { if (first == -1) { // The only thing we can do now is attempt expansion. if (fs + x_size >= num_regions) { - expand((num_regions - fs) * HeapRegion::GrainBytes); - first = humongous_obj_allocate_find_first(num_regions, word_size); - assert(first != -1, "this should have worked"); + // If the number of regions we're trying to allocate for this + // object is at most the number of regions in the free suffix, + // then the call to humongous_obj_allocate_find_first() above + // should have succeeded and we wouldn't be here. + // + // We should only be trying to expand when the free suffix is + // not sufficient for the object _and_ we have some expansion + // room available. + assert(num_regions > fs, "earlier allocation should have succeeded"); + + if (expand((num_regions - fs) * HeapRegion::GrainBytes)) { + first = humongous_obj_allocate_find_first(num_regions, word_size); + // If the expansion was successful then the allocation + // should have been successful. + assert(first != -1, "this should have worked"); + } } } @@ -1647,16 +1663,17 @@ resize_if_necessary_after_full_collection(size_t word_size) { if (capacity_after_gc < minimum_desired_capacity) { // Don't expand unless it's significant size_t expand_bytes = minimum_desired_capacity - capacity_after_gc; - expand(expand_bytes); - if (PrintGC && Verbose) { - gclog_or_tty->print_cr(" " - " expanding:" - " max_heap_size: %6.1fK" - " minimum_desired_capacity: %6.1fK" - " expand_bytes: %6.1fK", - (double) max_heap_size / (double) K, - (double) minimum_desired_capacity / (double) K, - (double) expand_bytes / (double) K); + if (expand(expand_bytes)) { + if (PrintGC && Verbose) { + gclog_or_tty->print_cr(" " + " expanding:" + " max_heap_size: %6.1fK" + " minimum_desired_capacity: %6.1fK" + " expand_bytes: %6.1fK", + (double) max_heap_size / (double) K, + (double) minimum_desired_capacity / (double) K, + (double) expand_bytes / (double) K); + } } // No expansion, now see if we want to shrink @@ -1757,66 +1774,84 @@ HeapWord* G1CollectedHeap::expand_and_allocate(size_t word_size) { verify_region_sets_optional(); - size_t expand_bytes = word_size * HeapWordSize; - if (expand_bytes < MinHeapDeltaBytes) { - expand_bytes = MinHeapDeltaBytes; + size_t expand_bytes = MAX2(word_size * HeapWordSize, MinHeapDeltaBytes); + if (expand(expand_bytes)) { + verify_region_sets_optional(); + return attempt_allocation_at_safepoint(word_size, + false /* expect_null_cur_alloc_region */); } - expand(expand_bytes); - - verify_region_sets_optional(); - - return attempt_allocation_at_safepoint(word_size, - false /* expect_null_cur_alloc_region */); + return NULL; } -// FIXME: both this and shrink could probably be more efficient by -// doing one "VirtualSpace::expand_by" call rather than several. -void G1CollectedHeap::expand(size_t expand_bytes) { +bool G1CollectedHeap::expand(size_t expand_bytes) { size_t old_mem_size = _g1_storage.committed_size(); - // We expand by a minimum of 1K. - expand_bytes = MAX2(expand_bytes, (size_t)K); - size_t aligned_expand_bytes = - ReservedSpace::page_align_size_up(expand_bytes); + size_t aligned_expand_bytes = ReservedSpace::page_align_size_up(expand_bytes); aligned_expand_bytes = align_size_up(aligned_expand_bytes, HeapRegion::GrainBytes); - expand_bytes = aligned_expand_bytes; - while (expand_bytes > 0) { - HeapWord* base = (HeapWord*)_g1_storage.high(); - // Commit more storage. - bool successful = _g1_storage.expand_by(HeapRegion::GrainBytes); - if (!successful) { - expand_bytes = 0; - } else { - expand_bytes -= HeapRegion::GrainBytes; - // Expand the committed region. - HeapWord* high = (HeapWord*) _g1_storage.high(); - _g1_committed.set_end(high); + + if (Verbose && PrintGC) { + gclog_or_tty->print("Expanding garbage-first heap from %ldK by %ldK", + old_mem_size/K, aligned_expand_bytes/K); + } + + HeapWord* old_end = (HeapWord*)_g1_storage.high(); + bool successful = _g1_storage.expand_by(aligned_expand_bytes); + if (successful) { + HeapWord* new_end = (HeapWord*)_g1_storage.high(); + + // Expand the committed region. + _g1_committed.set_end(new_end); + + // Tell the cardtable about the expansion. + Universe::heap()->barrier_set()->resize_covered_region(_g1_committed); + + // And the offset table as well. + _bot_shared->resize(_g1_committed.word_size()); + + expand_bytes = aligned_expand_bytes; + HeapWord* base = old_end; + + // Create the heap regions for [old_end, new_end) + while (expand_bytes > 0) { + HeapWord* high = base + HeapRegion::GrainWords; + // Create a new HeapRegion. MemRegion mr(base, high); bool is_zeroed = !_g1_max_committed.contains(base); HeapRegion* hr = new HeapRegion(_bot_shared, mr, is_zeroed); - // Now update max_committed if necessary. - _g1_max_committed.set_end(MAX2(_g1_max_committed.end(), high)); - // Add it to the HeapRegionSeq. _hrs->insert(hr); _free_list.add_as_tail(hr); + // And we used up an expansion region to create it. _expansion_regions--; - // Tell the cardtable about it. - Universe::heap()->barrier_set()->resize_covered_region(_g1_committed); - // And the offset table as well. - _bot_shared->resize(_g1_committed.word_size()); + + expand_bytes -= HeapRegion::GrainBytes; + base += HeapRegion::GrainWords; + } + assert(base == new_end, "sanity"); + + // Now update max_committed if necessary. + _g1_max_committed.set_end(MAX2(_g1_max_committed.end(), new_end)); + + } else { + // The expansion of the virtual storage space was unsuccessful. + // Let's see if it was because we ran out of swap. + if (G1ExitOnExpansionFailure && + _g1_storage.uncommitted_size() >= aligned_expand_bytes) { + // We had head room... + vm_exit_out_of_memory(aligned_expand_bytes, "G1 heap expansion"); } } if (Verbose && PrintGC) { size_t new_mem_size = _g1_storage.committed_size(); - gclog_or_tty->print_cr("Expanding garbage-first heap from %ldK by %ldK to %ldK", - old_mem_size/K, aligned_expand_bytes/K, + gclog_or_tty->print_cr("...%s, expanded to %ldK", + (successful ? "Successful" : "Failed"), new_mem_size/K); } + return successful; } void G1CollectedHeap::shrink_helper(size_t shrink_bytes) @@ -2088,7 +2123,10 @@ jint G1CollectedHeap::initialize() { HeapRegionRemSet::init_heap(max_regions()); // Now expand into the initial heap size. - expand(init_byte_size); + if (!expand(init_byte_size)) { + vm_exit_during_initialization("Failed to allocate initial heap."); + return JNI_ENOMEM; + } // Perform any initialization actions delegated to the policy. g1_policy()->init(); @@ -2744,7 +2782,7 @@ size_t G1CollectedHeap::large_typearray_limit() { } size_t G1CollectedHeap::max_capacity() const { - return g1_reserved_obj_bytes(); + return _g1_reserved.byte_size(); } jlong G1CollectedHeap::millis_since_last_gc() { @@ -3538,7 +3576,12 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) { size_t expand_bytes = g1_policy()->expansion_amount(); if (expand_bytes > 0) { size_t bytes_before = capacity(); - expand(expand_bytes); + if (!expand(expand_bytes)) { + // We failed to expand the heap so let's verify that + // committed/uncommitted amount match the backing store + assert(capacity() == _g1_storage.committed_size(), "committed size mismatch"); + assert(max_capacity() == _g1_storage.reserved_size(), "reserved size mismatch"); + } } } @@ -3762,7 +3805,7 @@ void G1CollectedHeap::get_gc_alloc_regions() { if (alloc_region == NULL) { // we will get a new GC alloc region - alloc_region = new_gc_alloc_region(ap, 0); + alloc_region = new_gc_alloc_region(ap, HeapRegion::GrainWords); } else { // the region was retained from the last collection ++_gc_alloc_region_counts[ap]; @@ -5311,7 +5354,7 @@ size_t G1CollectedHeap::n_regions() { size_t G1CollectedHeap::max_regions() { return - (size_t)align_size_up(g1_reserved_obj_bytes(), HeapRegion::GrainBytes) / + (size_t)align_size_up(max_capacity(), HeapRegion::GrainBytes) / HeapRegion::GrainBytes; } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp index 4bad5fd4320..e3185856948 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp @@ -619,8 +619,10 @@ protected: public: // Expand the garbage-first heap by at least the given size (in bytes!). + // Returns true if the heap was expanded by the requested amount; + // false otherwise. // (Rounds up to a HeapRegion boundary.) - virtual void expand(size_t expand_bytes); + bool expand(size_t expand_bytes); // Do anything common to GC's. virtual void gc_prologue(bool full); @@ -981,9 +983,6 @@ public: // Reference Processing accessor ReferenceProcessor* ref_processor() { return _ref_processor; } - // Reserved (g1 only; super method includes perm), capacity and the used - // portion in bytes. - size_t g1_reserved_obj_bytes() const { return _g1_reserved.byte_size(); } virtual size_t capacity() const; virtual size_t used() const; // This should be called when we're not holding the heap lock. The diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp index 63a5d63c780..ff3c55acc4b 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectorPolicy.cpp @@ -2011,7 +2011,7 @@ size_t G1CollectorPolicy::expansion_amount() { // space, whichever is smaller, bounded below by a minimum // expansion (unless that's all that's left.) const size_t min_expand_bytes = 1*M; - size_t reserved_bytes = _g1->g1_reserved_obj_bytes(); + size_t reserved_bytes = _g1->max_capacity(); size_t committed_bytes = _g1->capacity(); size_t uncommitted_bytes = reserved_bytes - committed_bytes; size_t expand_bytes; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index 622028c402d..48d3dbd100c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, 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 @@ -735,7 +735,7 @@ bool G1RemSet::concurrentRefineOneCard_impl(jbyte* card_ptr, int worker_i, MemRegion dirtyRegion(start, end); #if CARD_REPEAT_HISTO - init_ct_freq_table(_g1->g1_reserved_obj_bytes()); + init_ct_freq_table(_g1->max_capacity()); ct_freq_note_card(_ct_bs->index_for(start)); #endif diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp index 0e5d2318953..19a8338c6e6 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -301,9 +301,13 @@ develop(uintx, G1StressConcRegionFreeingDelayMillis, 0, \ "Artificial delay during concurrent region freeing") \ \ - develop(bool, ReduceInitialCardMarksForG1, false, \ + develop(bool, ReduceInitialCardMarksForG1, false, \ "When ReduceInitialCardMarks is true, this flag setting " \ - " controls whether G1 allows the RICM optimization") + " controls whether G1 allows the RICM optimization") \ + \ + develop(bool, G1ExitOnExpansionFailure, false, \ + "Raise a fatal VM exit out of memory failure in the event " \ + " that heap expansion fails due to running out of swap.") G1_FLAGS(DECLARE_DEVELOPER_FLAG, DECLARE_PD_DEVELOPER_FLAG, DECLARE_PRODUCT_FLAG, DECLARE_PD_PRODUCT_FLAG, DECLARE_DIAGNOSTIC_FLAG, DECLARE_EXPERIMENTAL_FLAG, DECLARE_NOTPRODUCT_FLAG, DECLARE_MANAGEABLE_FLAG, DECLARE_PRODUCT_RW_FLAG) From 8a44936bb0d2c629f2fdc240975739046a657b4f Mon Sep 17 00:00:00 2001 From: Keith McGuigan Date: Wed, 2 Feb 2011 14:38:01 -0500 Subject: [PATCH 33/84] 6766644: Redefinition of compiled method fails with assertion "Can not load classes with the Compiler thread" Defer posting events from the compiler thread: use service thread Reviewed-by: coleenp, dholmes, never, dcubed --- ...DetectorThread.java => ServiceThread.java} | 8 +- .../sun/jvm/hotspot/runtime/Thread.java | 4 +- .../sun/jvm/hotspot/runtime/Threads.java | 8 +- hotspot/src/share/vm/code/nmethod.cpp | 19 +- hotspot/src/share/vm/code/nmethod.hpp | 5 +- hotspot/src/share/vm/prims/jvmtiExport.cpp | 144 ++---------- hotspot/src/share/vm/prims/jvmtiExport.hpp | 31 +-- hotspot/src/share/vm/prims/jvmtiImpl.cpp | 208 +++++++++++++++++- hotspot/src/share/vm/prims/jvmtiImpl.hpp | 145 +++++++++++- hotspot/src/share/vm/runtime/fprofiler.hpp | 8 +- hotspot/src/share/vm/runtime/mutexLocker.cpp | 4 +- hotspot/src/share/vm/runtime/mutexLocker.hpp | 2 +- .../src/share/vm/runtime/serviceThread.cpp | 122 ++++++++++ .../src/share/vm/runtime/serviceThread.hpp | 51 +++++ hotspot/src/share/vm/runtime/thread.hpp | 10 - hotspot/src/share/vm/runtime/vmStructs.cpp | 3 +- .../src/share/vm/services/attachListener.hpp | 4 +- .../share/vm/services/lowMemoryDetector.cpp | 120 +++------- .../share/vm/services/lowMemoryDetector.hpp | 12 +- hotspot/src/share/vm/services/management.cpp | 5 +- hotspot/src/share/vm/utilities/macros.hpp | 2 +- 21 files changed, 617 insertions(+), 298 deletions(-) rename hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/{LowMemoryDetectorThread.java => ServiceThread.java} (83%) create mode 100644 hotspot/src/share/vm/runtime/serviceThread.cpp create mode 100644 hotspot/src/share/vm/runtime/serviceThread.hpp diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java similarity index 83% rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java rename to hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java index f3d630d16f9..ad81488091a 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/LowMemoryDetectorThread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ServiceThread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 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 @@ -29,13 +29,13 @@ import java.io.*; import sun.jvm.hotspot.debugger.*; import sun.jvm.hotspot.types.*; -public class LowMemoryDetectorThread extends JavaThread { - public LowMemoryDetectorThread(Address addr) { +public class ServiceThread extends JavaThread { + public ServiceThread(Address addr) { super(addr); } public boolean isJavaThread() { return false; } public boolean isHiddenFromExternalView() { return true; } - public boolean isLowMemoryDetectorThread() { return true; } + public boolean isServiceThread() { return true; } } diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java index 3a3466eeb3c..2948f7b95ca 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Thread.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -111,7 +111,7 @@ public class Thread extends VMObject { public boolean isJvmtiAgentThread() { return false; } public boolean isWatcherThread() { return false; } public boolean isConcurrentMarkSweepThread() { return false; } - public boolean isLowMemoryDetectorThread() { return false; } + public boolean isServiceThread() { return false; } /** Memory operations */ public void oopsDo(AddressVisitor oopVisitor) { diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java index 29196ee05d6..d90d08bd726 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 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 @@ -107,14 +107,14 @@ public class Threads { // for now, use JavaThread itself. fix it later with appropriate class if needed virtualConstructor.addMapping("SurrogateLockerThread", JavaThread.class); virtualConstructor.addMapping("JvmtiAgentThread", JvmtiAgentThread.class); - virtualConstructor.addMapping("LowMemoryDetectorThread", LowMemoryDetectorThread.class); + virtualConstructor.addMapping("ServiceThread", ServiceThread.class); } public Threads() { } /** NOTE: this returns objects of type JavaThread, CompilerThread, - JvmtiAgentThread, and LowMemoryDetectorThread. + JvmtiAgentThread, and ServiceThread. The latter four are subclasses of the former. Most operations (fetching the top frame, etc.) are only allowed to be performed on a "pure" JavaThread. For this reason, {@link @@ -143,7 +143,7 @@ public class Threads { return thread; } catch (Exception e) { throw new RuntimeException("Unable to deduce type of thread from address " + threadAddr + - " (expected type JavaThread, CompilerThread, LowMemoryDetectorThread, JvmtiAgentThread, or SurrogateLockerThread)", e); + " (expected type JavaThread, CompilerThread, ServiceThread, JvmtiAgentThread, or SurrogateLockerThread)", e); } } diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp index f7cbc48de84..19a00227690 100644 --- a/hotspot/src/share/vm/code/nmethod.cpp +++ b/hotspot/src/share/vm/code/nmethod.cpp @@ -34,6 +34,7 @@ #include "interpreter/bytecode.hpp" #include "oops/methodDataOop.hpp" #include "prims/jvmtiRedefineClassesTrace.hpp" +#include "prims/jvmtiImpl.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/sweeper.hpp" #include "utilities/dtrace.hpp" @@ -1533,7 +1534,10 @@ void nmethod::post_compiled_method_load_event() { } if (JvmtiExport::should_post_compiled_method_load()) { - JvmtiExport::post_compiled_method_load(this); + // Let the Service thread (which is a real Java thread) post the event + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + JvmtiDeferredEventQueue::enqueue( + JvmtiDeferredEvent::compiled_method_load_event(this)); } } @@ -1566,8 +1570,17 @@ void nmethod::post_compiled_method_unload() { // ref will have been cleared. if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) { assert(!unload_reported(), "already unloaded"); - HandleMark hm; - JvmtiExport::post_compiled_method_unload(_jmethod_id, insts_begin()); + JvmtiDeferredEvent event = + JvmtiDeferredEvent::compiled_method_unload_event( + _jmethod_id, insts_begin()); + if (SafepointSynchronize::is_at_safepoint()) { + // Don't want to take the queueing lock. Add it as pending and + // it will get enqueued later. + JvmtiDeferredEventQueue::add_pending_event(event); + } else { + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + JvmtiDeferredEventQueue::enqueue(event); + } } // The JVMTI CompiledMethodUnload event can be enabled or disabled at diff --git a/hotspot/src/share/vm/code/nmethod.hpp b/hotspot/src/share/vm/code/nmethod.hpp index 5fa91f46f89..650c654d687 100644 --- a/hotspot/src/share/vm/code/nmethod.hpp +++ b/hotspot/src/share/vm/code/nmethod.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -696,10 +696,11 @@ public: class nmethodLocker : public StackObj { nmethod* _nm; + public: + static void lock_nmethod(nmethod* nm); // note: nm can be NULL static void unlock_nmethod(nmethod* nm); // (ditto) - public: nmethodLocker(address pc); // derive nm from pc nmethodLocker(nmethod *nm) { _nm = nm; lock_nmethod(_nm); } nmethodLocker() { _nm = NULL; } diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp index 782ba3cfde6..49086af7869 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -750,15 +750,12 @@ public: // pending CompiledMethodUnload support // -bool JvmtiExport::_have_pending_compiled_method_unload_events; -GrowableArray* JvmtiExport::_pending_compiled_method_unload_method_ids; -GrowableArray* JvmtiExport::_pending_compiled_method_unload_code_begins; -JavaThread* JvmtiExport::_current_poster; - -void JvmtiExport::post_compiled_method_unload_internal(JavaThread* self, jmethodID method, const void *code_begin) { +void JvmtiExport::post_compiled_method_unload( + jmethodID method, const void *code_begin) { + JavaThread* thread = JavaThread::current(); EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD, ("JVMTI [%s] method compile unload event triggered", - JvmtiTrace::safe_get_thread_name(self))); + JvmtiTrace::safe_get_thread_name(thread))); // post the event for each environment that has this event enabled. JvmtiEnvIterator it; @@ -767,12 +764,12 @@ void JvmtiExport::post_compiled_method_unload_internal(JavaThread* self, jmethod EVT_TRACE(JVMTI_EVENT_COMPILED_METHOD_UNLOAD, ("JVMTI [%s] class compile method unload event sent jmethodID " PTR_FORMAT, - JvmtiTrace::safe_get_thread_name(self), method)); + JvmtiTrace::safe_get_thread_name(thread), method)); - ResourceMark rm(self); + ResourceMark rm(thread); - JvmtiEventMark jem(self); - JvmtiJavaThreadEventTransition jet(self); + JvmtiEventMark jem(thread); + JvmtiJavaThreadEventTransition jet(thread); jvmtiEventCompiledMethodUnload callback = env->callbacks()->CompiledMethodUnload; if (callback != NULL) { (*callback)(env->jvmti_external(), method, code_begin); @@ -781,90 +778,6 @@ void JvmtiExport::post_compiled_method_unload_internal(JavaThread* self, jmethod } } -// post any pending CompiledMethodUnload events - -void JvmtiExport::post_pending_compiled_method_unload_events() { - JavaThread* self = JavaThread::current(); - assert(!self->owns_locks(), "can't hold locks"); - - // Indicates if this is the first activiation of this function. - // In theory the profiler's callback could call back into VM and provoke - // another CompiledMethodLoad event to be posted from this thread. As the - // stack rewinds we need to ensure that the original activation does the - // completion and notifies any waiters. - bool first_activation = false; - - // the jmethodID (may not be valid) to be used for a single event - jmethodID method; - const void *code_begin; - - // grab the monitor and check if another thread is already posting - // events. If there is another thread posting events then we wait - // until it completes. (In theory we could check the pending events to - // see if any of the addresses overlap with the event that we want to - // post but as it will happen so rarely we just block any thread waiting - // to post a CompiledMethodLoad or DynamicCodeGenerated event until all - // pending CompiledMethodUnload events have been posted). - // - // If another thread isn't posting we examine the list of pending jmethodIDs. - // If the list is empty then we are done. If it's not empty then this thread - // (self) becomes the pending event poster and we remove the top (last) - // event from the list. Note that this means we remove the newest event first - // but as they are all CompiledMethodUnload events the order doesn't matter. - // Once we have removed a jmethodID then we exit the monitor. Any other thread - // wanting to post a CompiledMethodLoad or DynamicCodeGenerated event will - // be forced to wait on the monitor. - { - MutexLocker mu(JvmtiPendingEvent_lock); - if (_current_poster != self) { - while (_current_poster != NULL) { - JvmtiPendingEvent_lock->wait(); - } - } - if ((_pending_compiled_method_unload_method_ids == NULL) || - (_pending_compiled_method_unload_method_ids->length() == 0)) { - return; - } - if (_current_poster == NULL) { - _current_poster = self; - first_activation = true; - } else { - // re-entrant - guarantee(_current_poster == self, "checking"); - } - method = _pending_compiled_method_unload_method_ids->pop(); - code_begin = _pending_compiled_method_unload_code_begins->pop(); - } - - // This thread is the pending event poster so it first posts the CompiledMethodUnload - // event for the jmethodID that has been removed from the list. Once posted it - // re-grabs the monitor and checks the list again. If the list is empty then and this - // is the first activation of the function then we reset the _have_pending_events - // flag, cleanup _current_poster to indicate that no thread is now servicing the - // pending events list, and finally notify any thread that might be waiting. - for (;;) { - post_compiled_method_unload_internal(self, method, code_begin); - - // event posted, now re-grab monitor and get the next event - // If there's no next event then we are done. If this is the first - // activiation of this function by this thread notify any waiters - // so that they can post. - { - MutexLocker ml(JvmtiPendingEvent_lock); - if (_pending_compiled_method_unload_method_ids->length() == 0) { - if (first_activation) { - _have_pending_compiled_method_unload_events = false; - _current_poster = NULL; - JvmtiPendingEvent_lock->notify_all(); - } - return; - } - method = _pending_compiled_method_unload_method_ids->pop(); - code_begin = _pending_compiled_method_unload_code_begins->pop(); - } - } -} - /////////////////////////////////////////////////////////////// // // JvmtiExport @@ -1830,16 +1743,7 @@ jvmtiCompiledMethodLoadInlineRecord* create_inline_record(nmethod* nm) { } void JvmtiExport::post_compiled_method_load(nmethod *nm) { - // If there are pending CompiledMethodUnload events then these are - // posted before this CompiledMethodLoad event. We "lock" the nmethod and - // maintain a handle to the methodOop to ensure that the nmethod isn't - // flushed or unloaded while posting the events. JavaThread* thread = JavaThread::current(); - if (have_pending_compiled_method_unload_events()) { - methodHandle mh(thread, nm->method()); - nmethodLocker nml(nm); - post_pending_compiled_method_unload_events(); - } EVT_TRIG_TRACE(JVMTI_EVENT_COMPILED_METHOD_LOAD, ("JVMTI [%s] method compile load event triggered", @@ -1854,8 +1758,8 @@ void JvmtiExport::post_compiled_method_load(nmethod *nm) { JvmtiTrace::safe_get_thread_name(thread), (nm->method() == NULL) ? "NULL" : nm->method()->klass_name()->as_C_string(), (nm->method() == NULL) ? "NULL" : nm->method()->name()->as_C_string())); - ResourceMark rm(thread); + HandleMark hm(thread); // Add inlining information jvmtiCompiledMethodLoadInlineRecord* inlinerecord = create_inline_record(nm); @@ -1899,28 +1803,6 @@ void JvmtiExport::post_compiled_method_load(JvmtiEnv* env, const jmethodID metho } } -// used at a safepoint to post a CompiledMethodUnload event -void JvmtiExport::post_compiled_method_unload(jmethodID mid, const void *code_begin) { - if (SafepointSynchronize::is_at_safepoint()) { - // Class unloading can cause nmethod unloading which is reported - // by the VMThread. These must be batched to be processed later. - if (_pending_compiled_method_unload_method_ids == NULL) { - // create list lazily - _pending_compiled_method_unload_method_ids = new (ResourceObj::C_HEAP) GrowableArray(10,true); - _pending_compiled_method_unload_code_begins = new (ResourceObj::C_HEAP) GrowableArray(10,true); - } - _pending_compiled_method_unload_method_ids->append(mid); - _pending_compiled_method_unload_code_begins->append(code_begin); - _have_pending_compiled_method_unload_events = true; - } else { - // Unloading caused by the sweeper can be reported synchronously. - if (have_pending_compiled_method_unload_events()) { - post_pending_compiled_method_unload_events(); - } - post_compiled_method_unload_internal(JavaThread::current(), mid, code_begin); - } -} - void JvmtiExport::post_dynamic_code_generated_internal(const char *name, const void *code_begin, const void *code_end) { JavaThread* thread = JavaThread::current(); EVT_TRIG_TRACE(JVMTI_EVENT_DYNAMIC_CODE_GENERATED, @@ -1953,9 +1835,9 @@ void JvmtiExport::post_dynamic_code_generated(const char *name, const void *code return; } - if (have_pending_compiled_method_unload_events()) { - post_pending_compiled_method_unload_events(); - } + // Blocks until everything now in the queue has been posted + JvmtiDeferredEventQueue::flush_queue(Thread::current()); + post_dynamic_code_generated_internal(name, code_begin, code_end); } diff --git a/hotspot/src/share/vm/prims/jvmtiExport.hpp b/hotspot/src/share/vm/prims/jvmtiExport.hpp index c78384a5286..3bdff222a5f 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.hpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 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 @@ -141,25 +141,6 @@ class JvmtiExport : public AllStatic { private: - // CompiledMethodUnload events are reported from the VM thread so they - // are collected in lists (of jmethodID/addresses) and the events are posted later - // from threads posting CompieldMethodLoad or DynamicCodeGenerated events. - static bool _have_pending_compiled_method_unload_events; - static GrowableArray* _pending_compiled_method_unload_method_ids; - static GrowableArray* _pending_compiled_method_unload_code_begins; - static JavaThread* _current_poster; - - // tests if there are CompiledMethodUnload events pending - inline static bool have_pending_compiled_method_unload_events() { - return _have_pending_compiled_method_unload_events; - } - - // posts any pending CompiledMethodUnload events. - static void post_pending_compiled_method_unload_events(); - - // Perform the actual notification to interested JvmtiEnvs. - static void post_compiled_method_unload_internal(JavaThread* self, jmethodID mid, const void* code_begin); - // posts a DynamicCodeGenerated event (internal/private implementation). // The public post_dynamic_code_generated* functions make use of the // internal implementation. @@ -256,7 +237,7 @@ class JvmtiExport : public AllStatic { // single stepping management methods static void at_single_stepping_point(JavaThread *thread, methodOop method, address location) KERNEL_RETURN; static void expose_single_stepping(JavaThread *thread) KERNEL_RETURN; - static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(return false;); + static bool hide_single_stepping(JavaThread *thread) KERNEL_RETURN_(false); // Methods that notify the debugger that something interesting has happened in the VM. static void post_vm_start (); @@ -271,20 +252,20 @@ class JvmtiExport : public AllStatic { static oop jni_GetField_probe (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static) - KERNEL_RETURN_(return NULL;); + KERNEL_RETURN_(NULL); static oop jni_GetField_probe_nh (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static) - KERNEL_RETURN_(return NULL;); + KERNEL_RETURN_(NULL); static void post_field_access_by_jni (JavaThread *thread, oop obj, klassOop klass, jfieldID fieldID, bool is_static) KERNEL_RETURN; static void post_field_access (JavaThread *thread, methodOop method, address location, KlassHandle field_klass, Handle object, jfieldID field) KERNEL_RETURN; static oop jni_SetField_probe (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, - jvalue *value) KERNEL_RETURN_(return NULL;); + jvalue *value) KERNEL_RETURN_(NULL); static oop jni_SetField_probe_nh (JavaThread *thread, jobject jobj, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, - jvalue *value) KERNEL_RETURN_(return NULL;); + jvalue *value) KERNEL_RETURN_(NULL); static void post_field_modification_by_jni(JavaThread *thread, oop obj, klassOop klass, jfieldID fieldID, bool is_static, char sig_type, jvalue *value); diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.cpp b/hotspot/src/share/vm/prims/jvmtiImpl.cpp index 888d5bc18e6..7faf3eec57f 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.cpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -32,11 +32,13 @@ #include "prims/jvmtiEventController.inline.hpp" #include "prims/jvmtiImpl.hpp" #include "prims/jvmtiRedefineClasses.hpp" +#include "runtime/atomic.hpp" #include "runtime/deoptimization.hpp" #include "runtime/handles.hpp" #include "runtime/handles.inline.hpp" #include "runtime/interfaceSupport.hpp" #include "runtime/javaCalls.hpp" +#include "runtime/serviceThread.hpp" #include "runtime/signature.hpp" #include "runtime/vframe.hpp" #include "runtime/vframe_hp.hpp" @@ -910,3 +912,207 @@ void JvmtiSuspendControl::print() { tty->print_cr("]"); #endif } + +#ifndef KERNEL + +JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_load_event( + nmethod* nm) { + JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_LOAD); + event.set_compiled_method_load(nm); + nmethodLocker::lock_nmethod(nm); // will be unlocked when posted + return event; +} + +JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_unload_event( + jmethodID id, const void* code) { + JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_UNLOAD); + event.set_compiled_method_unload(id, code); + return event; +} + +void JvmtiDeferredEvent::post() { + switch(_type) { + case TYPE_COMPILED_METHOD_LOAD: + JvmtiExport::post_compiled_method_load(compiled_method_load()); + nmethodLocker::unlock_nmethod(compiled_method_load()); + break; + case TYPE_COMPILED_METHOD_UNLOAD: + JvmtiExport::post_compiled_method_unload( + compiled_method_unload_method_id(), + compiled_method_unload_code_begin()); + break; + case TYPE_FLUSH: + JvmtiDeferredEventQueue::flush_complete(flush_state_addr()); + break; + default: + ShouldNotReachHere(); + } +} + +JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_tail = NULL; +JvmtiDeferredEventQueue::QueueNode* JvmtiDeferredEventQueue::_queue_head = NULL; + +volatile JvmtiDeferredEventQueue::QueueNode* + JvmtiDeferredEventQueue::_pending_list = NULL; + +bool JvmtiDeferredEventQueue::has_events() { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + return _queue_head != NULL || _pending_list != NULL; +} + +void JvmtiDeferredEventQueue::enqueue(const JvmtiDeferredEvent& event) { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + + process_pending_events(); + + // Events get added to the end of the queue (and are pulled off the front). + QueueNode* node = new QueueNode(event); + if (_queue_tail == NULL) { + _queue_tail = _queue_head = node; + } else { + assert(_queue_tail->next() == NULL, "Must be the last element in the list"); + _queue_tail->set_next(node); + _queue_tail = node; + } + + Service_lock->notify_all(); + assert((_queue_head == NULL) == (_queue_tail == NULL), + "Inconsistent queue markers"); +} + +JvmtiDeferredEvent JvmtiDeferredEventQueue::dequeue() { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + + process_pending_events(); + + assert(_queue_head != NULL, "Nothing to dequeue"); + + if (_queue_head == NULL) { + // Just in case this happens in product; it shouldn't but let's not crash + return JvmtiDeferredEvent(); + } + + QueueNode* node = _queue_head; + _queue_head = _queue_head->next(); + if (_queue_head == NULL) { + _queue_tail = NULL; + } + + assert((_queue_head == NULL) == (_queue_tail == NULL), + "Inconsistent queue markers"); + + JvmtiDeferredEvent event = node->event(); + delete node; + return event; +} + +void JvmtiDeferredEventQueue::add_pending_event( + const JvmtiDeferredEvent& event) { + + QueueNode* node = new QueueNode(event); + + bool success = false; + QueueNode* prev_value = (QueueNode*)_pending_list; + do { + node->set_next(prev_value); + prev_value = (QueueNode*)Atomic::cmpxchg_ptr( + (void*)node, (volatile void*)&_pending_list, (void*)node->next()); + } while (prev_value != node->next()); +} + +// This method transfers any events that were added by someone NOT holding +// the lock into the mainline queue. +void JvmtiDeferredEventQueue::process_pending_events() { + assert(Service_lock->owned_by_self(), "Must own Service_lock"); + + if (_pending_list != NULL) { + QueueNode* head = + (QueueNode*)Atomic::xchg_ptr(NULL, (volatile void*)&_pending_list); + + assert((_queue_head == NULL) == (_queue_tail == NULL), + "Inconsistent queue markers"); + + if (head != NULL) { + // Since we've treated the pending list as a stack (with newer + // events at the beginning), we need to join the bottom of the stack + // with the 'tail' of the queue in order to get the events in the + // right order. We do this by reversing the pending list and appending + // it to the queue. + + QueueNode* new_tail = head; + QueueNode* new_head = NULL; + + // This reverses the list + QueueNode* prev = new_tail; + QueueNode* node = new_tail->next(); + new_tail->set_next(NULL); + while (node != NULL) { + QueueNode* next = node->next(); + node->set_next(prev); + prev = node; + node = next; + } + new_head = prev; + + // Now append the new list to the queue + if (_queue_tail != NULL) { + _queue_tail->set_next(new_head); + } else { // _queue_head == NULL + _queue_head = new_head; + } + _queue_tail = new_tail; + } + } +} + +enum { + // Random - used for debugging + FLUSHING = 0x50403020, + FLUSHED = 0x09080706 +}; + +void JvmtiDeferredEventQueue::flush_queue(Thread* thread) { + + volatile int flush_state = FLUSHING; + + JvmtiDeferredEvent flush(JvmtiDeferredEvent::TYPE_FLUSH); + flush.set_flush_state_addr((int*)&flush_state); + + if (ServiceThread::is_service_thread(thread)) { + // If we are the service thread we have to post all preceding events + // Use the flush event as a token to indicate when we can stop + JvmtiDeferredEvent event; + { + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + enqueue(flush); + event = dequeue(); + } + while (!event.is_flush_event() || + event.flush_state_addr() != &flush_state) { + event.post(); + { + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + event = dequeue(); + } + } + } else { + // Wake up the service thread so it will process events. When it gets + // to the flush event it will set 'flush_complete' and notify us. + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + enqueue(flush); + while (flush_state != FLUSHED) { + assert(flush_state == FLUSHING || flush_state == FLUSHED, + "only valid values for this"); + Service_lock->wait(Mutex::_no_safepoint_check_flag); + } + } +} + +void JvmtiDeferredEventQueue::flush_complete(int* state_addr) { + assert(state_addr != NULL && *state_addr == FLUSHING, "must be"); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + *state_addr = FLUSHED; + Service_lock->notify_all(); +} + +#endif // ndef KERNEL diff --git a/hotspot/src/share/vm/prims/jvmtiImpl.hpp b/hotspot/src/share/vm/prims/jvmtiImpl.hpp index 4f543cc4322..8adb5c44887 100644 --- a/hotspot/src/share/vm/prims/jvmtiImpl.hpp +++ b/hotspot/src/share/vm/prims/jvmtiImpl.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -433,6 +433,149 @@ public: #endif // !JVMTI_KERNEL +/** + * When a thread (such as the compiler thread or VM thread) cannot post a + * JVMTI event itself because the event needs to be posted from a Java + * thread, then it can defer the event to the Service thread for posting. + * The information needed to post the event is encapsulated into this class + * and then enqueued onto the JvmtiDeferredEventQueue, where the Service + * thread will pick it up and post it. + * + * This is currently only used for posting compiled-method-load and unload + * events, which we don't want posted from the compiler thread. + */ +class JvmtiDeferredEvent VALUE_OBJ_CLASS_SPEC { + friend class JvmtiDeferredEventQueue; + private: + typedef enum { + TYPE_NONE, + TYPE_COMPILED_METHOD_LOAD, + TYPE_COMPILED_METHOD_UNLOAD, + TYPE_FLUSH // pseudo-event used to implement flush_queue() + } Type; + + Type _type; + union { + nmethod* compiled_method_load; + struct { + jmethodID method_id; + const void* code_begin; + } compiled_method_unload; + int* flush_state_addr; + } _event_data; + + JvmtiDeferredEvent(Type t) : _type(t) {} + + void set_compiled_method_load(nmethod* nm) { + assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); + _event_data.compiled_method_load = nm; + } + + nmethod* compiled_method_load() const { + assert(_type == TYPE_COMPILED_METHOD_LOAD, "must be"); + return _event_data.compiled_method_load; + } + + void set_compiled_method_unload(jmethodID id, const void* code) { + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); + _event_data.compiled_method_unload.method_id = id; + _event_data.compiled_method_unload.code_begin = code; + } + + jmethodID compiled_method_unload_method_id() const { + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); + return _event_data.compiled_method_unload.method_id; + } + + const void* compiled_method_unload_code_begin() const { + assert(_type == TYPE_COMPILED_METHOD_UNLOAD, "must be"); + return _event_data.compiled_method_unload.code_begin; + } + + bool is_flush_event() const { return _type == TYPE_FLUSH; } + + int* flush_state_addr() const { + assert(is_flush_event(), "must be"); + return _event_data.flush_state_addr; + } + + void set_flush_state_addr(int* flag) { + assert(is_flush_event(), "must be"); + _event_data.flush_state_addr = flag; + } + + public: + + JvmtiDeferredEvent() : _type(TYPE_NONE) {} + + // Factory methods + static JvmtiDeferredEvent compiled_method_load_event(nmethod* nm) + KERNEL_RETURN_(JvmtiDeferredEvent()); + static JvmtiDeferredEvent compiled_method_unload_event( + jmethodID id, const void* code) KERNEL_RETURN_(JvmtiDeferredEvent()); + + // Actually posts the event. + void post() KERNEL_RETURN; +}; + +/** + * Events enqueued on this queue wake up the Service thread which dequeues + * and posts the events. The Service_lock is required to be held + * when operating on the queue (except for the "pending" events). + */ +class JvmtiDeferredEventQueue : AllStatic { + friend class JvmtiDeferredEvent; + private: + class QueueNode : public CHeapObj { + private: + JvmtiDeferredEvent _event; + QueueNode* _next; + + public: + QueueNode(const JvmtiDeferredEvent& event) + : _event(event), _next(NULL) {} + + const JvmtiDeferredEvent& event() const { return _event; } + QueueNode* next() const { return _next; } + + void set_next(QueueNode* next) { _next = next; } + }; + + static QueueNode* _queue_head; // Hold Service_lock to access + static QueueNode* _queue_tail; // Hold Service_lock to access + static volatile QueueNode* _pending_list; // Uses CAS for read/update + + // Transfers events from the _pending_list to the _queue. + static void process_pending_events() KERNEL_RETURN; + + static void flush_complete(int* flush_state) KERNEL_RETURN; + + public: + // Must be holding Service_lock when calling these + static bool has_events() KERNEL_RETURN_(false); + static void enqueue(const JvmtiDeferredEvent& event) KERNEL_RETURN; + static JvmtiDeferredEvent dequeue() KERNEL_RETURN_(JvmtiDeferredEvent()); + + // This call blocks until all events enqueued prior to this call + // have been posted. The Service_lock is acquired and waited upon. + // + // Implemented by creating a "flush" event and placing it in the queue. + // When the flush event is "posted" it will call flush_complete(), which + // will release the caller. + // + // Can be called by any thread (maybe even the service thread itself). + // Not necessary for the caller to be a JavaThread. + static void flush_queue(Thread* current) KERNEL_RETURN; + + // Used to enqueue events without using a lock, for times (such as during + // safepoint) when we can't or don't want to lock the Service_lock. + // + // Events will be held off to the side until there's a call to + // dequeue(), enqueue(), or process_pending_events() (all of which require + // the holding of the Service_lock), and will be enqueued at that time. + static void add_pending_event(const JvmtiDeferredEvent&) KERNEL_RETURN; +}; + // Utility macro that checks for NULL pointers: #define NULL_CHECK(X, Y) if ((X) == NULL) { return (Y); } diff --git a/hotspot/src/share/vm/runtime/fprofiler.hpp b/hotspot/src/share/vm/runtime/fprofiler.hpp index 58a5f8ca081..2731dea7b6b 100644 --- a/hotspot/src/share/vm/runtime/fprofiler.hpp +++ b/hotspot/src/share/vm/runtime/fprofiler.hpp @@ -231,13 +231,13 @@ public: static void engage(JavaThread* mainThread, bool fullProfile) KERNEL_RETURN ; static void disengage() KERNEL_RETURN ; static void print(int unused) KERNEL_RETURN ; - static bool is_active() KERNEL_RETURN_(return false;) ; + static bool is_active() KERNEL_RETURN_(false) ; // This is NULL if each thread has its own thread profiler, // else this is the single thread profiler used by all threads. // In particular it makes a difference during garbage collection, // where you only want to traverse each thread profiler once. - static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(return NULL;); + static ThreadProfiler* get_thread_profiler() KERNEL_RETURN_(NULL); // Garbage Collection Support static void oops_do(OopClosure* f) KERNEL_RETURN ; @@ -246,13 +246,13 @@ public: // Returns the start address for a given pc // NULL is returned if the PCRecorder is inactive - static address bucket_start_for(address pc) KERNEL_RETURN_(return NULL;); + static address bucket_start_for(address pc) KERNEL_RETURN_(NULL); enum { MillisecsPerTick = 10 }; // ms per profiling ticks // Returns the number of ticks recorded for the bucket // pc belongs to. - static int bucket_count_for(address pc) KERNEL_RETURN_(return 0;); + static int bucket_count_for(address pc) KERNEL_RETURN_(0); #ifndef FPROF_KERNEL diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 25b0c339d01..b3d082f8865 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -129,7 +129,7 @@ Mutex* HotCardCache_lock = NULL; Monitor* GCTaskManager_lock = NULL; Mutex* Management_lock = NULL; -Monitor* LowMemory_lock = NULL; +Monitor* Service_lock = NULL; #define MAX_NUM_MUTEX 128 static Monitor * _mutex_array[MAX_NUM_MUTEX]; @@ -203,7 +203,7 @@ void mutex_init() { def(Patching_lock , Mutex , special, true ); // used for safepointing and code patching. def(ObjAllocPost_lock , Monitor, special, false); - def(LowMemory_lock , Monitor, special, true ); // used for low memory detection + def(Service_lock , Monitor, special, true ); // used for service thread operations def(JmethodIdCreation_lock , Mutex , leaf, true ); // used for creating jmethodIDs. def(SystemDictionary_lock , Monitor, leaf, true ); // lookups done by VM thread diff --git a/hotspot/src/share/vm/runtime/mutexLocker.hpp b/hotspot/src/share/vm/runtime/mutexLocker.hpp index ad3c24ca8a5..58060b82887 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.hpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.hpp @@ -131,7 +131,7 @@ extern Mutex* MMUTracker_lock; // protects the MMU extern Mutex* HotCardCache_lock; // protects the hot card cache extern Mutex* Management_lock; // a lock used to serialize JVM management -extern Monitor* LowMemory_lock; // a lock used for low memory detection +extern Monitor* Service_lock; // a lock used for service thread operation // A MutexLocker provides mutual exclusion with respect to a given mutex // for the scope which contains the locker. The lock is an OS lock, not diff --git a/hotspot/src/share/vm/runtime/serviceThread.cpp b/hotspot/src/share/vm/runtime/serviceThread.cpp new file mode 100644 index 00000000000..600398d1c12 --- /dev/null +++ b/hotspot/src/share/vm/runtime/serviceThread.cpp @@ -0,0 +1,122 @@ +/* + * 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. + * + */ + +#include "precompiled.hpp" +#include "runtime/interfaceSupport.hpp" +#include "runtime/javaCalls.hpp" +#include "runtime/serviceThread.hpp" +#include "runtime/mutexLocker.hpp" +#include "prims/jvmtiImpl.hpp" + +ServiceThread* ServiceThread::_instance = NULL; + +void ServiceThread::initialize() { + EXCEPTION_MARK; + + instanceKlassHandle klass (THREAD, SystemDictionary::Thread_klass()); + instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); + + const char* name = JDK_Version::is_gte_jdk17x_version() ? + "Service Thread" : "Low Memory Detector"; + + Handle string = java_lang_String::create_from_str(name, CHECK); + + // Initialize thread_oop to put it into the system threadGroup + Handle thread_group (THREAD, Universe::system_thread_group()); + JavaValue result(T_VOID); + JavaCalls::call_special(&result, thread_oop, + klass, + vmSymbols::object_initializer_name(), + vmSymbols::threadgroup_string_void_signature(), + thread_group, + string, + CHECK); + + { + MutexLocker mu(Threads_lock); + ServiceThread* thread = new ServiceThread(&service_thread_entry); + + // At this point it may be possible that no osthread was created for the + // JavaThread due to lack of memory. We would have to throw an exception + // in that case. However, since this must work and we do not allow + // exceptions anyway, check and abort if this fails. + if (thread == NULL || thread->osthread() == NULL) { + vm_exit_during_initialization("java.lang.OutOfMemoryError", + "unable to create new native thread"); + } + + java_lang_Thread::set_thread(thread_oop(), thread); + java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); + java_lang_Thread::set_daemon(thread_oop()); + thread->set_threadObj(thread_oop()); + + Threads::add(thread); + Thread::start(thread); + + _instance = thread; + } +} + +void ServiceThread::service_thread_entry(JavaThread* jt, TRAPS) { + while (true) { + bool sensors_changed = false; + bool has_jvmti_events = false; + JvmtiDeferredEvent jvmti_event; + { + // Need state transition ThreadBlockInVM so that this thread + // will be handled by safepoint correctly when this thread is + // notified at a safepoint. + + // This ThreadBlockInVM object is not also considered to be + // suspend-equivalent because ServiceThread is not visible to + // external suspension. + + ThreadBlockInVM tbivm(jt); + + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); + while (!(sensors_changed = LowMemoryDetector::has_pending_requests()) && + !(has_jvmti_events = JvmtiDeferredEventQueue::has_events())) { + // wait until one of the sensors has pending requests, or there is a + // pending JVMTI event to post + Service_lock->wait(Mutex::_no_safepoint_check_flag); + } + + if (has_jvmti_events) { + jvmti_event = JvmtiDeferredEventQueue::dequeue(); + } + } + + if (has_jvmti_events) { + jvmti_event.post(); + } + + if (sensors_changed) { + LowMemoryDetector::process_sensor_changes(jt); + } + } +} + +bool ServiceThread::is_service_thread(Thread* thread) { + return thread == _instance; +} diff --git a/hotspot/src/share/vm/runtime/serviceThread.hpp b/hotspot/src/share/vm/runtime/serviceThread.hpp new file mode 100644 index 00000000000..42373e6f702 --- /dev/null +++ b/hotspot/src/share/vm/runtime/serviceThread.hpp @@ -0,0 +1,51 @@ +/* + * 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. + * + */ + +#ifndef SHARE_VM_RUNTIME_SERVICETHREAD_HPP +#define SHARE_VM_RUNTIME_SERVICETHREAD_HPP + +#include "runtime/thread.hpp" + +// A JavaThread for low memory detection support and JVMTI +// compiled-method-load events. +class ServiceThread : public JavaThread { + friend class VMStructs; + private: + + static ServiceThread* _instance; + + static void service_thread_entry(JavaThread* thread, TRAPS); + ServiceThread(ThreadFunction entry_point) : JavaThread(entry_point) {}; + + public: + static void initialize(); + + // Hide this thread from external view. + bool is_hidden_from_external_view() const { return true; } + + // Returns true if the passed thread is the service thread. + static bool is_service_thread(Thread* thread); +}; + +#endif // SHARE_VM_RUNTIME_SERVICETHREAD_HPP diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp index c0818321fb3..73e0fda0209 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -1680,16 +1680,6 @@ inline size_t JavaThread::stack_available(address cur_sp) { return cur_sp > low_addr ? cur_sp - low_addr : 0; } -// A JavaThread for low memory detection support -class LowMemoryDetectorThread : public JavaThread { - friend class VMStructs; -public: - LowMemoryDetectorThread(ThreadFunction entry_point) : JavaThread(entry_point) {}; - - // Hide this thread from external view. - bool is_hidden_from_external_view() const { return true; } -}; - // A thread used for Compilation. class CompilerThread : public JavaThread { friend class VMStructs; diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index 003e659e815..0e1c5a40b98 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -93,6 +93,7 @@ #include "runtime/java.hpp" #include "runtime/javaCalls.hpp" #include "runtime/perfMemory.hpp" +#include "runtime/serviceThread.hpp" #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "runtime/virtualspace.hpp" @@ -1250,7 +1251,7 @@ static inline uint64_t cast_uint64_t(size_t x) declare_type(WatcherThread, Thread) \ declare_type(JavaThread, Thread) \ declare_type(JvmtiAgentThread, JavaThread) \ - declare_type(LowMemoryDetectorThread, JavaThread) \ + declare_type(ServiceThread, JavaThread) \ declare_type(CompilerThread, JavaThread) \ declare_toplevel_type(OSThread) \ declare_toplevel_type(JavaFrameAnchor) \ diff --git a/hotspot/src/share/vm/services/attachListener.hpp b/hotspot/src/share/vm/services/attachListener.hpp index f0abf1cd1f2..68cd834fe65 100644 --- a/hotspot/src/share/vm/services/attachListener.hpp +++ b/hotspot/src/share/vm/services/attachListener.hpp @@ -59,10 +59,10 @@ class AttachListener: AllStatic { static void detachall() KERNEL_RETURN; // indicates if the Attach Listener needs to be created at startup - static bool init_at_startup() KERNEL_RETURN_(return false;); + static bool init_at_startup() KERNEL_RETURN_(false); // indicates if we have a trigger to start the Attach Listener - static bool is_init_trigger() KERNEL_RETURN_(return false;); + static bool is_init_trigger() KERNEL_RETURN_(false); #ifdef SERVICES_KERNEL static bool is_attach_supported() { return false; } diff --git a/hotspot/src/share/vm/services/lowMemoryDetector.cpp b/hotspot/src/share/vm/services/lowMemoryDetector.cpp index 71c04e1b2c2..23c9e7467b4 100644 --- a/hotspot/src/share/vm/services/lowMemoryDetector.cpp +++ b/hotspot/src/share/vm/services/lowMemoryDetector.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -34,55 +34,11 @@ #include "services/lowMemoryDetector.hpp" #include "services/management.hpp" -LowMemoryDetectorThread* LowMemoryDetector::_detector_thread = NULL; volatile bool LowMemoryDetector::_enabled_for_collected_pools = false; volatile jint LowMemoryDetector::_disabled_count = 0; -void LowMemoryDetector::initialize() { - EXCEPTION_MARK; - - instanceKlassHandle klass (THREAD, SystemDictionary::Thread_klass()); - instanceHandle thread_oop = klass->allocate_instance_handle(CHECK); - - const char thread_name[] = "Low Memory Detector"; - Handle string = java_lang_String::create_from_str(thread_name, CHECK); - - // Initialize thread_oop to put it into the system threadGroup - Handle thread_group (THREAD, Universe::system_thread_group()); - JavaValue result(T_VOID); - JavaCalls::call_special(&result, thread_oop, - klass, - vmSymbols::object_initializer_name(), - vmSymbols::threadgroup_string_void_signature(), - thread_group, - string, - CHECK); - - { - MutexLocker mu(Threads_lock); - _detector_thread = new LowMemoryDetectorThread(&low_memory_detector_thread_entry); - - // At this point it may be possible that no osthread was created for the - // JavaThread due to lack of memory. We would have to throw an exception - // in that case. However, since this must work and we do not allow - // exceptions anyway, check and abort if this fails. - if (_detector_thread == NULL || _detector_thread->osthread() == NULL) { - vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); - } - - java_lang_Thread::set_thread(thread_oop(), _detector_thread); - java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); - java_lang_Thread::set_daemon(thread_oop()); - _detector_thread->set_threadObj(thread_oop()); - - Threads::add(_detector_thread); - Thread::start(_detector_thread); - } -} - bool LowMemoryDetector::has_pending_requests() { - assert(LowMemory_lock->owned_by_self(), "Must own LowMemory_lock"); + assert(Service_lock->owned_by_self(), "Must own Service_lock"); bool has_requests = false; int num_memory_pools = MemoryService::num_memory_pools(); for (int i = 0; i < num_memory_pools; i++) { @@ -100,47 +56,21 @@ bool LowMemoryDetector::has_pending_requests() { return has_requests; } -void LowMemoryDetector::low_memory_detector_thread_entry(JavaThread* jt, TRAPS) { - while (true) { - bool sensors_changed = false; +void LowMemoryDetector::process_sensor_changes(TRAPS) { + ResourceMark rm(THREAD); + HandleMark hm(THREAD); - { - // _no_safepoint_check_flag is used here as LowMemory_lock is a - // special lock and the VMThread may acquire this lock at safepoint. - // Need state transition ThreadBlockInVM so that this thread - // will be handled by safepoint correctly when this thread is - // notified at a safepoint. - - // This ThreadBlockInVM object is not also considered to be - // suspend-equivalent because LowMemoryDetector threads are - // not visible to external suspension. - - ThreadBlockInVM tbivm(jt); - - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); - while (!(sensors_changed = has_pending_requests())) { - // wait until one of the sensors has pending requests - LowMemory_lock->wait(Mutex::_no_safepoint_check_flag); - } + // No need to hold Service_lock to call out to Java + int num_memory_pools = MemoryService::num_memory_pools(); + for (int i = 0; i < num_memory_pools; i++) { + MemoryPool* pool = MemoryService::get_memory_pool(i); + SensorInfo* sensor = pool->usage_sensor(); + SensorInfo* gc_sensor = pool->gc_usage_sensor(); + if (sensor != NULL && sensor->has_pending_requests()) { + sensor->process_pending_requests(CHECK); } - - { - ResourceMark rm(THREAD); - HandleMark hm(THREAD); - - // No need to hold LowMemory_lock to call out to Java - int num_memory_pools = MemoryService::num_memory_pools(); - for (int i = 0; i < num_memory_pools; i++) { - MemoryPool* pool = MemoryService::get_memory_pool(i); - SensorInfo* sensor = pool->usage_sensor(); - SensorInfo* gc_sensor = pool->gc_usage_sensor(); - if (sensor != NULL && sensor->has_pending_requests()) { - sensor->process_pending_requests(CHECK); - } - if (gc_sensor != NULL && gc_sensor->has_pending_requests()) { - gc_sensor->process_pending_requests(CHECK); - } - } + if (gc_sensor != NULL && gc_sensor->has_pending_requests()) { + gc_sensor->process_pending_requests(CHECK); } } } @@ -148,7 +78,7 @@ void LowMemoryDetector::low_memory_detector_thread_entry(JavaThread* jt, TRAPS) // This method could be called from any Java threads // and also VMThread. void LowMemoryDetector::detect_low_memory() { - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); bool has_pending_requests = false; int num_memory_pools = MemoryService::num_memory_pools(); @@ -166,7 +96,7 @@ void LowMemoryDetector::detect_low_memory() { } if (has_pending_requests) { - LowMemory_lock->notify_all(); + Service_lock->notify_all(); } } @@ -181,14 +111,14 @@ void LowMemoryDetector::detect_low_memory(MemoryPool* pool) { } { - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); MemoryUsage usage = pool->get_memory_usage(); sensor->set_gauge_sensor_level(usage, pool->usage_threshold()); if (sensor->has_pending_requests()) { // notify sensor state update - LowMemory_lock->notify_all(); + Service_lock->notify_all(); } } } @@ -203,14 +133,14 @@ void LowMemoryDetector::detect_after_gc_memory(MemoryPool* pool) { } { - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); MemoryUsage usage = pool->get_last_collection_usage(); sensor->set_counter_sensor_level(usage, pool->gc_usage_threshold()); if (sensor->has_pending_requests()) { // notify sensor state update - LowMemory_lock->notify_all(); + Service_lock->notify_all(); } } } @@ -384,8 +314,8 @@ void SensorInfo::trigger(int count, TRAPS) { } { - // Holds LowMemory_lock and update the sensor state - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + // Holds Service_lock and update the sensor state + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); _sensor_on = true; _sensor_count += count; _pending_trigger_count = _pending_trigger_count - count; @@ -410,8 +340,8 @@ void SensorInfo::clear(int count, TRAPS) { } { - // Holds LowMemory_lock and update the sensor state - MutexLockerEx ml(LowMemory_lock, Mutex::_no_safepoint_check_flag); + // Holds Service_lock and update the sensor state + MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag); _sensor_on = false; _pending_clear_count = 0; _pending_trigger_count = _pending_trigger_count - count; diff --git a/hotspot/src/share/vm/services/lowMemoryDetector.hpp b/hotspot/src/share/vm/services/lowMemoryDetector.hpp index 6f3a4b06dd1..ce15bad2e21 100644 --- a/hotspot/src/share/vm/services/lowMemoryDetector.hpp +++ b/hotspot/src/share/vm/services/lowMemoryDetector.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -58,8 +58,8 @@ // // May need to deal with hysteresis effect. // +// Memory detection code runs in the Service thread (serviceThread.hpp). -class LowMemoryDetectorThread; class OopClosure; class MemoryPool; @@ -211,23 +211,22 @@ public: }; class LowMemoryDetector : public AllStatic { -friend class LowMemoryDetectorDisabler; + friend class LowMemoryDetectorDisabler; + friend class ServiceThread; private: // true if any collected heap has low memory detection enabled static volatile bool _enabled_for_collected_pools; // > 0 if temporary disabed static volatile jint _disabled_count; - static LowMemoryDetectorThread* _detector_thread; - static void low_memory_detector_thread_entry(JavaThread* thread, TRAPS); static void check_memory_usage(); static bool has_pending_requests(); static bool temporary_disabled() { return _disabled_count > 0; } static void disable() { Atomic::inc(&_disabled_count); } static void enable() { Atomic::dec(&_disabled_count); } + static void process_sensor_changes(TRAPS); public: - static void initialize(); static void detect_low_memory(); static void detect_low_memory(MemoryPool* pool); static void detect_after_gc_memory(MemoryPool* pool); @@ -275,7 +274,6 @@ public: } } } - }; class LowMemoryDetectorDisabler: public StackObj { diff --git a/hotspot/src/share/vm/services/management.cpp b/hotspot/src/share/vm/services/management.cpp index c0a2f401e32..d517f24577e 100644 --- a/hotspot/src/share/vm/services/management.cpp +++ b/hotspot/src/share/vm/services/management.cpp @@ -38,6 +38,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/jniHandles.hpp" #include "runtime/os.hpp" +#include "runtime/serviceThread.hpp" #include "services/classLoadingService.hpp" #include "services/heapDumper.hpp" #include "services/lowMemoryDetector.hpp" @@ -112,8 +113,8 @@ void Management::init() { } void Management::initialize(TRAPS) { - // Start the low memory detector thread - LowMemoryDetector::initialize(); + // Start the service thread + ServiceThread::initialize(); if (ManagementServer) { ResourceMark rm(THREAD); diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp index f46da8efa91..808b9d0ce26 100644 --- a/hotspot/src/share/vm/utilities/macros.hpp +++ b/hotspot/src/share/vm/utilities/macros.hpp @@ -46,7 +46,7 @@ #define SERVICES_KERNEL #define KERNEL_RETURN {} -#define KERNEL_RETURN_(code) { code } +#define KERNEL_RETURN_(code) { return code; } #else // KERNEL From 052aed6276725a2dc9f0e11f73bc2b4f298f6222 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Wed, 2 Feb 2011 18:38:40 -0500 Subject: [PATCH 34/84] 7012088: jump to 0 address because of lack of memory ordering in SignatureHandlerLibrary::add Write method signature handler under lock to prevent race with growable array resizing Reviewed-by: dsamersoff, dholmes --- .../share/vm/interpreter/interpreterRuntime.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp index 69fa7e0eacd..a5e92ee13c8 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -1184,9 +1184,7 @@ void SignatureHandlerLibrary::add(methodHandle method) { handler_index = _fingerprints->length() - 1; } } - } else { - CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); - } + // Set handler under SignatureHandlerLibrary_lock if (handler_index < 0) { // use generic signature handler method->set_signature_handler(Interpreter::slow_signature_handler()); @@ -1194,21 +1192,29 @@ void SignatureHandlerLibrary::add(methodHandle method) { // set handler method->set_signature_handler(_handlers->at(handler_index)); } + } else { + CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); + // use generic signature handler + method->set_signature_handler(Interpreter::slow_signature_handler()); + } } #ifdef ASSERT - int handler_index, fingerprint_index; + int handler_index = -1; + int fingerprint_index = -2; { // '_handlers' and '_fingerprints' are 'GrowableArray's and are NOT synchronized // in any way if accessed from multiple threads. To avoid races with another // thread which may change the arrays in the above, mutex protected block, we // have to protect this read access here with the same mutex as well! MutexLocker mu(SignatureHandlerLibrary_lock); + if (_handlers != NULL) { handler_index = _handlers->find(method->signature_handler()); fingerprint_index = _fingerprints->find(Fingerprinter(method).fingerprint()); } + } assert(method->signature_handler() == Interpreter::slow_signature_handler() || handler_index == fingerprint_index, "sanity check"); -#endif +#endif // ASSERT } From d191a4687396cf90d7ce317bb9e257621ded1853 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Thu, 3 Feb 2011 10:10:11 +0000 Subject: [PATCH 35/84] 7008595: Class loader leak caused by keepAliveTimer thread in KeepAliveCache Reviewed-by: michaelm --- jdk/src/share/classes/sun/net/www/http/KeepAliveCache.java | 3 +++ jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/jdk/src/share/classes/sun/net/www/http/KeepAliveCache.java b/jdk/src/share/classes/sun/net/www/http/KeepAliveCache.java index e75e294c1e2..7c09e3965fa 100644 --- a/jdk/src/share/classes/sun/net/www/http/KeepAliveCache.java +++ b/jdk/src/share/classes/sun/net/www/http/KeepAliveCache.java @@ -106,6 +106,9 @@ public class KeepAliveCache keepAliveTimer = new Thread(grp, cache, "Keep-Alive-Timer"); keepAliveTimer.setDaemon(true); keepAliveTimer.setPriority(Thread.MAX_PRIORITY - 2); + // Set the context class loader to null in order to avoid + // keeping a strong reference to an application classloader. + keepAliveTimer.setContextClassLoader(null); keepAliveTimer.start(); return null; } diff --git a/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java b/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java index c430ae3518b..b3d3b607066 100644 --- a/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java +++ b/jdk/src/share/classes/sun/net/www/http/KeepAliveStream.java @@ -185,6 +185,9 @@ class KeepAliveStream extends MeteredStream implements Hurryable { cleanerThread = new Thread(grp, queue, "Keep-Alive-SocketCleaner"); cleanerThread.setDaemon(true); cleanerThread.setPriority(Thread.MAX_PRIORITY - 2); + // Set the context class loader to null in order to avoid + // keeping a strong reference to an application classloader. + cleanerThread.setContextClassLoader(null); cleanerThread.start(); return null; } From 6ed5196d7d82d196c04e8195aed5bc001b9b1cb1 Mon Sep 17 00:00:00 2001 From: Sean Coffey Date: Thu, 3 Feb 2011 11:28:04 +0000 Subject: [PATCH 36/84] 7016897: Copyright header correction : test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java Reviewed-by: vinnie --- .../security/provider/SeedGenerator/SeedGeneratorChoice.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java b/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java index ba49c6564b7..d91ce78db4b 100644 --- a/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java +++ b/jdk/test/sun/security/provider/SeedGenerator/SeedGeneratorChoice.java @@ -1,6 +1,6 @@ /* - * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * Copyright (c) 2010, 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 From bdd31714050a837447c62b69f3929e5e4e508612 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Thu, 3 Feb 2011 11:56:56 +0000 Subject: [PATCH 37/84] 6887710: Jar index should avoid putting META-INF in the INDEX.LIST Reviewed-by: michaelm --- jdk/src/share/classes/sun/misc/JarIndex.java | 50 +- .../misc/JarIndex/metaInfFilenames/Basic.java | 464 ++++++++++++++++++ .../jarA/META-INF/services/my.happy.land | 23 + .../JarIndex/metaInfFilenames/jarA/a/A.java | 30 ++ .../jarA/com/message/spi/MessageService.java | 28 ++ .../metaInfFilenames/jarB/META-INF/JAVA2.DS | 23 + .../jarB/META-INF/services/no.name.service | 23 + .../JarIndex/metaInfFilenames/jarB/b/B.java | 30 ++ .../metaInfFilenames/jarC/META-INF/fonts.mf | 23 + .../jarC/META-INF/fonts/Company-corporate.ttf | 22 + .../jarC/META-INF/fonts/kidpr.ttf | 22 + .../services/com.message.spi.MessageService | 22 + .../jarC/my/impl/StandardMessageService.java | 31 ++ 13 files changed, 784 insertions(+), 7 deletions(-) create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/META-INF/services/my.happy.land create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/a/A.java create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/com/message/spi/MessageService.java create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/JAVA2.DS create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/services/no.name.service create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/b/B.java create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts.mf create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/Company-corporate.ttf create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/kidpr.ttf create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/services/com.message.spi.MessageService create mode 100644 jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/my/impl/StandardMessageService.java diff --git a/jdk/src/share/classes/sun/misc/JarIndex.java b/jdk/src/share/classes/sun/misc/JarIndex.java index 0418befce12..39e2eca91d8 100644 --- a/jdk/src/share/classes/sun/misc/JarIndex.java +++ b/jdk/src/share/classes/sun/misc/JarIndex.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -66,6 +66,14 @@ public class JarIndex { */ public static final String INDEX_NAME = "META-INF/INDEX.LIST"; + /** + * true if, and only if, sun.misc.JarIndex.metaInfFilenames is set to true. + * If true, the names of the files in META-INF, and its subdirectories, will + * be added to the index. Otherwise, just the directory names are added. + */ + private static final boolean metaInfFilenames = + "true".equals(System.getProperty("sun.misc.JarIndex.metaInfFilenames")); + /** * Constructs a new, empty jar index. */ @@ -186,6 +194,18 @@ public class JarIndex { addToList(jarName, packageName, jarMap); } + /** + * Same as add(String,String) except that it doesn't strip off from the + * last index of '/'. It just adds the filename. + */ + private void addExplicit(String fileName, String jarName) { + // add the mapping to indexMap + addToList(fileName, jarName, indexMap); + + // add the mapping to jarMap + addToList(jarName, fileName, jarMap); + } + /** * Go through all the jar files and construct the * index table. @@ -204,15 +224,31 @@ public class JarIndex { Enumeration entries = zrf.entries(); while(entries.hasMoreElements()) { - String fileName = ((ZipEntry)(entries.nextElement())).getName(); - // Index the META-INF directory, but not the index or manifest. - if (!fileName.startsWith("META-INF/") || - !(fileName.equals("META-INF/") || - fileName.equals(INDEX_NAME) || - fileName.equals(JarFile.MANIFEST_NAME))) { + ZipEntry entry = (ZipEntry) entries.nextElement(); + String fileName = entry.getName(); + + // Skip the META-INF directory, the index, and manifest. + // Any files in META-INF/ will be indexed explicitly + if (fileName.equals("META-INF/") || + fileName.equals(INDEX_NAME) || + fileName.equals(JarFile.MANIFEST_NAME)) + continue; + + if (!metaInfFilenames) { add(fileName, currentJar); + } else { + if (!fileName.startsWith("META-INF/")) { + add(fileName, currentJar); + } else if (!entry.isDirectory()) { + // Add files under META-INF explicitly so that certain + // services, like ServiceLoader, etc, can be located + // with greater accuracy. Directories can be skipped + // since each file will be added explicitly. + addExplicit(fileName, currentJar); + } } } + zrf.close(); } } diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java b/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java new file mode 100644 index 00000000000..27b1f3f51d7 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/Basic.java @@ -0,0 +1,464 @@ +/* + * 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 6887710 + * @summary Verify the impact of sun.misc.JarIndex.metaInfFilenames on Service loaders + * @run main/othervm Basic + */ + +import java.io.IOException; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.net.InetSocketAddress; +import java.net.URI; +import java.net.URL; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.Iterator; +import java.util.ServiceLoader; +import com.sun.net.httpserver.Headers; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpHandler; +import com.sun.net.httpserver.HttpServer; + +/** + * Verifies the impact of sun.misc.JarIndex.metaInfFilenames on service loaders + * (sun.misc.Service & java.util.ServiceLoader), as well as finding resources + * through Class.getResouce. + * + * 1) Compile the test sources: + * jarA: + * META-INF/services/my.happy.land + * com/message/spi/MessageService.java + * a/A.java + * jarB: + * META-INF/JAVA2.DS + * META-INF/services/no.name.service + * b/B.java + * jarC: + * META-INF/fonts.mf + * META-INF/fonts/Company-corporate.ttf + * META-INF/fonts/kidpr.ttf + * META-INF/services/com.message.spi.MessageService + * my/impl/StandardMessageService.java + * + * 2) Build three jar files a.jar, b.jar, c.jar + * + * 3) Create an index in a.jar (jar -i a.jar b.jar c.jar) + * with sun.misc.JarIndex.metaInfFilenames=true + * + * 4) Start a HTTP server serving out the three jars. + * + * The test then tries to locate services/resources within the jars using + * URLClassLoader. Each request to the HTTP server is recorded to ensure + * only the correct amount of requests are being made. + * + * Note: Needs jdk/lib/tools.jar in the classpath to compile and run. + */ + +public class Basic { + static final String slash = File.separator; + static final String[] testSources = { + "jarA" + slash + "a" + slash + "A.java", + "jarA" + slash + "com" + slash + "message" + slash + "spi" + slash + "MessageService.java", + "jarB" + slash + "b" + slash + "B.java", + "jarC" + slash + "my" + slash + "impl" + slash + "StandardMessageService.java"}; + + static final String testSrc = System.getProperty("test.src"); + static final String testSrcDir = testSrc != null ? testSrc : "."; + static final String testClasses = System.getProperty("test.classes"); + static final String testClassesDir = testClasses != null ? testClasses : "."; + + static JarHttpServer httpServer; + + public static void main(String[] args) throws Exception { + + // Set global url cache to false so that we can track every jar request. + (new URL("http://localhost/")).openConnection().setDefaultUseCaches(false); + + buildTest(); + + try { + httpServer = new JarHttpServer(testClassesDir); + httpServer.start(); + + doTest(httpServer.getAddress()); + + } catch (IOException ioe) { + ioe.printStackTrace(); + } finally { + if (httpServer != null) { httpServer.stop(2); } + } + } + + static void buildTest() { + /* compile the source that will be used to generate the jars */ + for (int i=0; i */ + static void jar(String... args) { + debug("Running: jar " + Arrays.toString(args)); + sun.tools.jar.Main jar = new sun.tools.jar.Main(System.out, System.err, "jar"); + if (!jar.run(args)) { + throw new RuntimeException("jar failed: args=" + Arrays.toString(args)); + } + } + + /* run javac */ + static void compile(String... args) { + debug("Running: javac " + Arrays.toString(args)); + com.sun.tools.javac.main.Main compiler = new com.sun.tools.javac.main.Main("javac"); + if (compiler.compile(args) != 0) { + throw new RuntimeException("javac failed: args=" + Arrays.toString(args)); + } + } + + static String jar; + static { + String javaHome = System.getProperty("java.home"); + if (javaHome.endsWith("jre")) { + int index = javaHome.lastIndexOf(slash); + if (index != -1) + javaHome = javaHome.substring(0, index); + } + + jar = javaHome + slash+ "bin" + slash + "jar"; + } + + /* create the index */ + static void createIndex(String workingDir) { + // ProcessBuilder is used so that the current directory can be set + // to the directory that directly contains the jars. + debug("Running jar to create the index"); + ProcessBuilder pb = new ProcessBuilder( + jar, "-J-Dsun.misc.JarIndex.metaInfFilenames=true", "-i", "a.jar", "b.jar", "c.jar"); + pb.directory(new File(workingDir)); + //pd.inheritIO(); + try { + Process p = pb.start(); + if(p.waitFor() != 0) + throw new RuntimeException("jar indexing failed"); + + if(debug && p != null) { + String line = null; + BufferedReader reader = + new BufferedReader(new InputStreamReader(p.getInputStream())); + while((line = reader.readLine()) != null) + debug(line); + reader = new BufferedReader(new InputStreamReader(p.getErrorStream())); + while((line = reader.readLine()) != null) + debug(line); + } + } catch(InterruptedException ie) { throw new RuntimeException(ie); + } catch(IOException e) { throw new RuntimeException(e); } + } + + static final boolean debug = true; + + static void debug(Object message) { if (debug) System.out.println(message); } + + /* service define in c.jar */ + static final String messageService = "com.message.spi.MessageService"; + + /* a service that is not defined in any of the jars */ + static final String unknownService = "java.lang.Object"; + + static void doTest(InetSocketAddress serverAddress) throws IOException { + URL baseURL = new URL("http://localhost:" + serverAddress.getPort() + "/"); + + int failed = 0; + + // Tests using sun.misc.Service + if (!sunMiscServiceTest(baseURL, messageService, true, false, true)) { + System.out.println("Test: sun.misc.Service looking for " + messageService + ", failed"); + failed++; + } + if (!sunMiscServiceTest(baseURL, unknownService, false, false, false)) { + System.out.println("Test: sun.misc.Service looking for " + unknownService + " failed"); + failed++; + } + + // Tests using java.util.SerivceLoader + if (!javaUtilServiceLoaderTest(baseURL, messageService, true, false, true)) { + System.out.println("Test: sun.misc.Service looking for " + messageService + ", failed"); + failed++; + } + if (!javaUtilServiceLoaderTest(baseURL, unknownService, false, false, false)) { + System.out.println("Test: sun.misc.Service looking for " + unknownService + " failed"); + failed++; + } + + // Tests using java.lang.Class (similar to the FontManager in javafx) + if (!klassLoader(baseURL, "/META-INF/fonts.mf", true, false, true)) { + System.out.println("Test: klassLoader looking for /META-INF/fonts.mf failed"); + failed++; + } + if (!klassLoader(baseURL, "/META-INF/unknown.mf", false, false, false)) { + System.out.println("Test: klassLoader looking for /META-INF/unknown.mf failed"); + failed++; + } + + if (failed > 0) + throw new RuntimeException("Failed: " + failed + " tests"); + } + + static boolean sunMiscServiceTest(URL baseURL, + String serviceClass, + boolean expectToFind, + boolean expectbDotJar, + boolean expectcDotJar) throws IOException { + debug("----------------------------------"); + debug("Running test with sun.misc.Service looking for " + serviceClass); + URLClassLoader loader = getLoader(baseURL); + httpServer.reset(); + + Class messageServiceClass = null; + try { + messageServiceClass = loader.loadClass(serviceClass); + } catch (ClassNotFoundException cnfe) { + System.err.println(cnfe); + throw new RuntimeException("Error in test: " + cnfe); + } + + Iterator> iterator = sun.misc.Service.providers(messageServiceClass, loader); + if (expectToFind && !iterator.hasNext()) { + debug(messageServiceClass + " NOT found."); + return false; + } + + while (iterator.hasNext()) { + debug("found " + iterator.next() + " " + messageService); + } + + debug("HttpServer: " + httpServer); + + if (!expectbDotJar && httpServer.bDotJar > 0) { + debug("Unexpeced request sent to the httpserver for b.jar"); + return false; + } + if (!expectcDotJar && httpServer.cDotJar > 0) { + debug("Unexpeced request sent to the httpserver for c.jar"); + return false; + } + + return true; + } + + static boolean javaUtilServiceLoaderTest(URL baseURL, + String serviceClass, + boolean expectToFind, + boolean expectbDotJar, + boolean expectcDotJar) throws IOException { + debug("----------------------------------"); + debug("Running test with java.util.ServiceLoader looking for " + serviceClass); + URLClassLoader loader = getLoader(baseURL); + httpServer.reset(); + + Class messageServiceClass = null; + try { + messageServiceClass = loader.loadClass(serviceClass); + } catch (ClassNotFoundException cnfe) { + System.err.println(cnfe); + throw new RuntimeException("Error in test: " + cnfe); + } + + Iterator> iterator = (ServiceLoader.load(messageServiceClass, loader)).iterator(); + if (expectToFind && !iterator.hasNext()) { + debug(messageServiceClass + " NOT found."); + return false; + } + + while (iterator.hasNext()) { + debug("found " + iterator.next() + " " + messageService); + } + + debug("HttpServer: " + httpServer); + + if (!expectbDotJar && httpServer.bDotJar > 0) { + debug("Unexpeced request sent to the httpserver for b.jar"); + return false; + } + if (!expectcDotJar && httpServer.cDotJar > 0) { + debug("Unexpeced request sent to the httpserver for c.jar"); + return false; + } + + return true; + } + + /* Tries to find a resource in a similar way to the font manager in javafx + * com.sun.javafx.scene.text.FontManager */ + static boolean klassLoader(URL baseURL, + String resource, + boolean expectToFind, + boolean expectbDotJar, + boolean expectcDotJar) throws IOException { + debug("----------------------------------"); + debug("Running test looking for " + resource); + URLClassLoader loader = getLoader(baseURL); + httpServer.reset(); + + Class ADotAKlass = null; + try { + ADotAKlass = loader.loadClass("a.A"); + } catch (ClassNotFoundException cnfe) { + System.err.println(cnfe); + throw new RuntimeException("Error in test: " + cnfe); + } + + URL u = ADotAKlass.getResource(resource); + if (expectToFind && u == null) { + System.out.println("Expected to find " + resource + " but didn't"); + return false; + } + + debug("HttpServer: " + httpServer); + + if (!expectbDotJar && httpServer.bDotJar > 0) { + debug("Unexpeced request sent to the httpserver for b.jar"); + return false; + } + if (!expectcDotJar && httpServer.cDotJar > 0) { + debug("Unexpeced request sent to the httpserver for c.jar"); + return false; + } + + return true; + } + + static URLClassLoader getLoader(URL baseURL) throws IOException { + ClassLoader loader = Basic.class.getClassLoader(); + + while (loader.getParent() != null) + loader = loader.getParent(); + + return new URLClassLoader( new URL[]{ + new URL(baseURL, "a.jar"), + new URL(baseURL, "b.jar"), + new URL(baseURL, "c.jar")}, loader ); + } + + /** + * HTTP Server to server the jar files. + */ + static class JarHttpServer implements HttpHandler { + final String docsDir; + final HttpServer httpServer; + int aDotJar, bDotJar, cDotJar; + + JarHttpServer(String docsDir) throws IOException { + this.docsDir = docsDir; + + httpServer = HttpServer.create(new InetSocketAddress(0), 0); + httpServer.createContext("/", this); + } + + void start() throws IOException { + httpServer.start(); + } + + void stop(int delay) { + httpServer.stop(delay); + } + + InetSocketAddress getAddress() { + return httpServer.getAddress(); + } + + void reset() { + aDotJar = bDotJar = cDotJar = 0; + } + + @Override + public String toString() { + return "aDotJar=" + aDotJar + ", bDotJar=" + bDotJar + ", cDotJar=" + cDotJar; + } + + public void handle(HttpExchange t) throws IOException { + InputStream is = t.getRequestBody(); + Headers map = t.getRequestHeaders(); + Headers rmap = t.getResponseHeaders(); + URI uri = t.getRequestURI(); + + debug("Server: received request for " + uri); + String path = uri.getPath(); + if (path.endsWith("a.jar")) + aDotJar++; + else if (path.endsWith("b.jar")) + bDotJar++; + else if (path.endsWith("c.jar")) + cDotJar++; + else + System.out.println("Unexpected resource request" + path); + + while (is.read() != -1); + is.close(); + + File file = new File(docsDir, path); + if (!file.exists()) + throw new RuntimeException("Error: request for " + file); + long clen = file.length(); + t.sendResponseHeaders (200, clen); + OutputStream os = t.getResponseBody(); + FileInputStream fis = new FileInputStream(file); + try { + byte[] buf = new byte [16 * 1024]; + int len; + while ((len=fis.read(buf)) != -1) { + os.write (buf, 0, len); + } + } catch (IOException e) { + e.printStackTrace(); + } + fis.close(); + os.close(); + } + } +} diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/META-INF/services/my.happy.land b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/META-INF/services/my.happy.land new file mode 100644 index 00000000000..c109150a938 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/META-INF/services/my.happy.land @@ -0,0 +1,23 @@ +# 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. + +# The contents of this file do not matter. It exists +# simply to have a service defined in META-INF/services. diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/a/A.java b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/a/A.java new file mode 100644 index 00000000000..e22921b7cef --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/a/A.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 a; + +public class A { + public static void hello() throws Exception { + System.out.println("Hello from a.A"); + } +} diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/com/message/spi/MessageService.java b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/com/message/spi/MessageService.java new file mode 100644 index 00000000000..5030191791c --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarA/com/message/spi/MessageService.java @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package com.message.spi; + +public interface MessageService { + String message(); +} diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/JAVA2.DS b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/JAVA2.DS new file mode 100644 index 00000000000..17f1906ccd0 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/JAVA2.DS @@ -0,0 +1,23 @@ +# 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. + +# The contents of this file do not matter. It exists +# simply to have a file under META-INF. diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/services/no.name.service b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/services/no.name.service new file mode 100644 index 00000000000..6c23e062166 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/META-INF/services/no.name.service @@ -0,0 +1,23 @@ +# 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. + +# The contents of this file do not matter. It exists +# simply to have a service defined in META-INF/services. diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/b/B.java b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/b/B.java new file mode 100644 index 00000000000..a977889e4d8 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarB/b/B.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * 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 b; + +public class B { + public static void hello() { + System.out.println("Hello from b.B"); + } +} diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts.mf b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts.mf new file mode 100644 index 00000000000..11fd7cef264 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts.mf @@ -0,0 +1,23 @@ +# 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. + +corporate=/fonts/Company-corporate.ttf +crazy-looking=/fonts/kidpr.ttf diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/Company-corporate.ttf b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/Company-corporate.ttf new file mode 100644 index 00000000000..b21dd812254 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/Company-corporate.ttf @@ -0,0 +1,22 @@ +# 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. + +This is not a real font. diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/kidpr.ttf b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/kidpr.ttf new file mode 100644 index 00000000000..b21dd812254 --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/fonts/kidpr.ttf @@ -0,0 +1,22 @@ +# 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. + +This is not a real font. diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/services/com.message.spi.MessageService b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/services/com.message.spi.MessageService new file mode 100644 index 00000000000..1d36cb068cc --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/META-INF/services/com.message.spi.MessageService @@ -0,0 +1,22 @@ +# 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. + +my.impl.StandardMessageService diff --git a/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/my/impl/StandardMessageService.java b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/my/impl/StandardMessageService.java new file mode 100644 index 00000000000..f16b295b0de --- /dev/null +++ b/jdk/test/sun/misc/JarIndex/metaInfFilenames/jarC/my/impl/StandardMessageService.java @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package my.impl; + +public class StandardMessageService implements com.message.spi.MessageService { + @Override + public String message() { + return "This is a message from the standard message service"; + } +} From 1d6cc8fc424fbc452db0dafb4d2a0929e349882f Mon Sep 17 00:00:00 2001 From: Michael McMahon Date: Thu, 3 Feb 2011 12:57:04 +0000 Subject: [PATCH 38/84] 6751021: TEST_BUG: race condition in the test java/lang/Runtime/exec/Duped.java Reviewed-by: alanb --- jdk/test/java/lang/Runtime/exec/Duped.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jdk/test/java/lang/Runtime/exec/Duped.java b/jdk/test/java/lang/Runtime/exec/Duped.java index c8e7aa9dcb8..2788b77e48c 100644 --- a/jdk/test/java/lang/Runtime/exec/Duped.java +++ b/jdk/test/java/lang/Runtime/exec/Duped.java @@ -38,8 +38,7 @@ public class Duped { public static void main(String args[]) throws Exception { StringBuffer s = new StringBuffer(); int c; - while ((System.in.available() != 0) - && ((c = System.in.read()) != -1)) + while ((c = System.in.read()) != -1) s.append((char)c); System.out.println(s); } From d48bd086df5d153224840d42fd66cdc829a57932 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Thu, 3 Feb 2011 16:30:51 +0300 Subject: [PATCH 39/84] 7013453: BufferStrategyPaintManager.dispose will cause IllegalMonitorStateException in event thread Reviewed-by: alexp --- .../swing/BufferStrategyPaintManager.java | 2 +- .../RepaintManager/7013453/bug7013453.java | 103 ++++++++++++++++++ 2 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 jdk/test/javax/swing/RepaintManager/7013453/bug7013453.java diff --git a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java index 781fb4c0e3a..4a7f87085c2 100644 --- a/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java +++ b/jdk/src/share/classes/javax/swing/BufferStrategyPaintManager.java @@ -209,7 +209,7 @@ class BufferStrategyPaintManager extends RepaintManager.PaintManager { synchronized(BufferStrategyPaintManager.this) { while (showing) { try { - wait(); + BufferStrategyPaintManager.this.wait(); } catch (InterruptedException ie) { } } diff --git a/jdk/test/javax/swing/RepaintManager/7013453/bug7013453.java b/jdk/test/javax/swing/RepaintManager/7013453/bug7013453.java new file mode 100644 index 00000000000..2314e3d749b --- /dev/null +++ b/jdk/test/javax/swing/RepaintManager/7013453/bug7013453.java @@ -0,0 +1,103 @@ +/* + * 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 7013453 + @summary BufferStrategyPaintManager.dispose will cause IllegalMonitorStateException in event thread + @author Pavel Porvatov +*/ + +import javax.swing.*; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +public class bug7013453 { + public static void main(String[] args) throws Exception { + SwingUtilities.invokeAndWait(new Runnable() { + public void run() { + try { + Method getPaintManagerMethod = RepaintManager.class.getDeclaredMethod("getPaintManager"); + + getPaintManagerMethod.setAccessible(true); + + final Object paintManager = getPaintManagerMethod.invoke(RepaintManager.currentManager(new JLabel())); + + String paintManagerName = paintManager.getClass().getCanonicalName(); + + if (!paintManagerName.equals("javax.swing.BufferStrategyPaintManager")) { + System.out.println("The test is not suitable for the " + paintManagerName + + " paint manager. The test skipped."); + + return; + } + + final Field showingField = paintManager.getClass().getDeclaredField("showing"); + + showingField.setAccessible(true); + + synchronized (paintManager) { + showingField.setBoolean(paintManager, true); + } + + // Postpone reset the showing field + Thread thread = new Thread(new Runnable() { + public void run() { + try { + Thread.sleep(500); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + synchronized (paintManager) { + try { + showingField.setBoolean(paintManager, false); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + } + } + }); + + thread.start(); + + Method disposeMethod = paintManager.getClass().getDeclaredMethod("dispose"); + + disposeMethod.setAccessible(true); + + disposeMethod.invoke(paintManager); + + System.out.println("The test passed."); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } catch (NoSuchFieldException e) { + throw new RuntimeException(e); + } + } + }); + } +} From 6232632ef8db69b2b1ea4c5916aedc088a75d1a5 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Thu, 3 Feb 2011 13:37:42 +0000 Subject: [PATCH 40/84] 7014794: (file) lookupPrincipalByGroupName fails to find large NIS groups Reviewed-by: chegar --- .../native/sun/nio/fs/UnixNativeDispatcher.c | 233 +++++++++++------- 1 file changed, 142 insertions(+), 91 deletions(-) diff --git a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c index 5c6a2baee47..d01f09e3c64 100644 --- a/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c +++ b/jdk/src/solaris/native/sun/nio/fs/UnixNativeDispatcher.c @@ -55,12 +55,23 @@ #include "sun_nio_fs_UnixNativeDispatcher.h" +/** + * Size of password or group entry when not available via sysconf + */ +#define ENT_BUF_SIZE 1024 + #define RESTARTABLE(_cmd, _result) do { \ do { \ _result = _cmd; \ } while((_result == -1) && (errno == EINTR)); \ } while(0) +#define RESTARTABLE_RETURN_PTR(_cmd, _result) do { \ + do { \ + _result = _cmd; \ + } while((_result == NULL) && (errno == EINTR)); \ +} while(0) + static jfieldID attrs_st_mode; static jfieldID attrs_st_ino; static jfieldID attrs_st_dev; @@ -858,37 +869,41 @@ Java_sun_nio_fs_UnixNativeDispatcher_getpwuid(JNIEnv* env, jclass this, jint uid { jbyteArray result = NULL; int buflen; + char* pwbuf; + /* allocate buffer for password record */ buflen = (int)sysconf(_SC_GETPW_R_SIZE_MAX); - if (buflen == -1) { - throwUnixException(env, errno); + if (buflen == -1) + buflen = ENT_BUF_SIZE; + pwbuf = (char*)malloc(buflen); + if (pwbuf == NULL) { + JNU_ThrowOutOfMemoryError(env, "native heap"); } else { - char* pwbuf = (char*)malloc(buflen); - if (pwbuf == NULL) { - JNU_ThrowOutOfMemoryError(env, "native heap"); - } else { - struct passwd pwent; - struct passwd* p; - int res = 0; + struct passwd pwent; + struct passwd* p = NULL; + int res = 0; -#ifdef __solaris__ - p = getpwuid_r((uid_t)uid, &pwent, pwbuf, (size_t)buflen); -#else - res = getpwuid_r((uid_t)uid, &pwent, pwbuf, (size_t)buflen, &p); -#endif + errno = 0; + #ifdef __solaris__ + RESTARTABLE_RETURN_PTR(getpwuid_r((uid_t)uid, &pwent, pwbuf, (size_t)buflen), p); + #else + RESTARTABLE(getpwuid_r((uid_t)uid, &pwent, pwbuf, (size_t)buflen, &p), res); + #endif - if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') { + if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') { + /* not found or error */ + if (errno != 0 && errno != ENOENT) throwUnixException(env, errno); - } else { - jsize len = strlen(p->pw_name); - result = (*env)->NewByteArray(env, len); - if (result != NULL) { - (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)(p->pw_name)); - } + } else { + jsize len = strlen(p->pw_name); + result = (*env)->NewByteArray(env, len); + if (result != NULL) { + (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)(p->pw_name)); } - free(pwbuf); } + free(pwbuf); } + return result; } @@ -898,36 +913,55 @@ Java_sun_nio_fs_UnixNativeDispatcher_getgrgid(JNIEnv* env, jclass this, jint gid { jbyteArray result = NULL; int buflen; + int retry; + /* initial size of buffer for group record */ buflen = (int)sysconf(_SC_GETGR_R_SIZE_MAX); - if (buflen == -1) { - throwUnixException(env, errno); - } else { + if (buflen == -1) + buflen = ENT_BUF_SIZE; + + do { + struct group grent; + struct group* g = NULL; + int res = 0; + char* grbuf = (char*)malloc(buflen); if (grbuf == NULL) { JNU_ThrowOutOfMemoryError(env, "native heap"); - } else { - struct group grent; - struct group* g; - int res = 0; + return NULL; + } -#ifdef __solaris__ - g = getgrgid_r((gid_t)gid, &grent, grbuf, (size_t)buflen); -#else - res = getgrgid_r((gid_t)gid, &grent, grbuf, (size_t)buflen, &g); -#endif - if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') { - throwUnixException(env, errno); - } else { - jsize len = strlen(g->gr_name); - result = (*env)->NewByteArray(env, len); - if (result != NULL) { - (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)(g->gr_name)); + errno = 0; + #ifdef __solaris__ + RESTARTABLE_RETURN_PTR(getgrgid_r((gid_t)gid, &grent, grbuf, (size_t)buflen), g); + #else + RESTARTABLE(getgrgid_r((gid_t)gid, &grent, grbuf, (size_t)buflen, &g), res); + #endif + + retry = 0; + if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') { + /* not found or error */ + if (errno != 0 && errno != ENOENT) { + if (errno == ERANGE) { + /* insufficient buffer size so need larger buffer */ + buflen += ENT_BUF_SIZE; + retry = 1; + } else { + throwUnixException(env, errno); } } - free(grbuf); + } else { + jsize len = strlen(g->gr_name); + result = (*env)->NewByteArray(env, len); + if (result != NULL) { + (*env)->SetByteArrayRegion(env, result, 0, len, (jbyte*)(g->gr_name)); + } } - } + + free(grbuf); + + } while (retry); + return result; } @@ -938,35 +972,36 @@ Java_sun_nio_fs_UnixNativeDispatcher_getpwnam0(JNIEnv* env, jclass this, jint uid = -1; int buflen; char* pwbuf; - struct passwd pwent; - struct passwd* p; - int res = 0; - const char* name = (const char*)jlong_to_ptr(nameAddress); + /* allocate buffer for password record */ buflen = (int)sysconf(_SC_GETPW_R_SIZE_MAX); - if (buflen == -1) { - throwUnixException(env, errno); - return -1; - } + if (buflen == -1) + buflen = ENT_BUF_SIZE; pwbuf = (char*)malloc(buflen); if (pwbuf == NULL) { JNU_ThrowOutOfMemoryError(env, "native heap"); - return -1; - } - -#ifdef __solaris__ - p = getpwnam_r(name, &pwent, pwbuf, (size_t)buflen); -#else - res = getpwnam_r(name, &pwent, pwbuf, (size_t)buflen, &p); -#endif - - if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') { - /* not found or error */ } else { - uid = p->pw_uid; - } + struct passwd pwent; + struct passwd* p = NULL; + int res = 0; + const char* name = (const char*)jlong_to_ptr(nameAddress); - free(pwbuf); + errno = 0; + #ifdef __solaris__ + RESTARTABLE_RETURN_PTR(getpwnam_r(name, &pwent, pwbuf, (size_t)buflen), p); + #else + RESTARTABLE(getpwnam_r(name, &pwent, pwbuf, (size_t)buflen, &p), res); + #endif + + if (res != 0 || p == NULL || p->pw_name == NULL || *(p->pw_name) == '\0') { + /* not found or error */ + if (errno != 0 && errno != ENOENT) + throwUnixException(env, errno); + } else { + uid = p->pw_uid; + } + free(pwbuf); + } return uid; } @@ -976,36 +1011,52 @@ Java_sun_nio_fs_UnixNativeDispatcher_getgrnam0(JNIEnv* env, jclass this, jlong nameAddress) { jint gid = -1; - int buflen; - char* grbuf; - struct group grent; - struct group* g; - int res = 0; - const char* name = (const char*)jlong_to_ptr(nameAddress); + int buflen, retry; + /* initial size of buffer for group record */ buflen = (int)sysconf(_SC_GETGR_R_SIZE_MAX); - if (buflen == -1) { - throwUnixException(env, errno); - return -1; - } - grbuf = (char*)malloc(buflen); - if (grbuf == NULL) { - JNU_ThrowOutOfMemoryError(env, "native heap"); - return -1; - } + if (buflen == -1) + buflen = ENT_BUF_SIZE; -#ifdef __solaris__ - g = getgrnam_r(name, &grent, grbuf, (size_t)buflen); -#else - res = getgrnam_r(name, &grent, grbuf, (size_t)buflen, &g); -#endif + do { + struct group grent; + struct group* g = NULL; + int res = 0; + char *grbuf; + const char* name = (const char*)jlong_to_ptr(nameAddress); - if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') { - /* not found or error */ - } else { - gid = g->gr_gid; - } - free(grbuf); + grbuf = (char*)malloc(buflen); + if (grbuf == NULL) { + JNU_ThrowOutOfMemoryError(env, "native heap"); + return -1; + } + + errno = 0; + #ifdef __solaris__ + RESTARTABLE_RETURN_PTR(getgrnam_r(name, &grent, grbuf, (size_t)buflen), g); + #else + RESTARTABLE(getgrnam_r(name, &grent, grbuf, (size_t)buflen, &g), res); + #endif + + retry = 0; + if (res != 0 || g == NULL || g->gr_name == NULL || *(g->gr_name) == '\0') { + /* not found or error */ + if (errno != 0 && errno != ENOENT) { + if (errno == ERANGE) { + /* insufficient buffer size so need larger buffer */ + buflen += ENT_BUF_SIZE; + retry = 1; + } else { + throwUnixException(env, errno); + } + } + } else { + gid = g->gr_gid; + } + + free(grbuf); + + } while (retry); return gid; } From 3ed07d01b93b020050385a9d94560d554c1c7cd4 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Thu, 3 Feb 2011 09:59:20 -0800 Subject: [PATCH 41/84] 7013282: No appropriate CCC request for listed JDK 7 changes in java.util.spi package (b121) Reviewed-by: peytoia --- jdk/src/share/classes/java/util/spi/LocaleNameProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jdk/src/share/classes/java/util/spi/LocaleNameProvider.java b/jdk/src/share/classes/java/util/spi/LocaleNameProvider.java index 5277738f0c1..741895f1128 100644 --- a/jdk/src/share/classes/java/util/spi/LocaleNameProvider.java +++ b/jdk/src/share/classes/java/util/spi/LocaleNameProvider.java @@ -77,7 +77,7 @@ public abstract class LocaleNameProvider extends LocaleServiceProvider { * is "Cyrl" and locale is fr_FR, getDisplayScript() will return "cyrillique". * If the name returned cannot be localized according to locale, * (say, the provider does not have a Japanese name for Cyrillic), - * this method returns null. + * this method returns null. The default implementation returns null. * @param scriptCode the four letter script code string in the form of title-case * letters (the first letter is upper-case character between 'A' (U+0041) and * 'Z' (U+005A) followed by three lower-case character between 'a' (U+0061) From e9f2c8444e2c3cbcfdff4b29840945b4c41c0460 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Thu, 3 Feb 2011 19:09:05 +0000 Subject: [PATCH 42/84] 6997561: A request for better error handling in JNDI Reviewed-by: robm --- .../sun/jndi/toolkit/ctx/Continuation.java | 2 +- .../jndi/ldap/LdapName/EmptyNameSearch.java | 118 ++++++++++++++++++ 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java diff --git a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java index bd3dc18fc24..7ecd4d75aea 100644 --- a/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java +++ b/jdk/src/share/classes/com/sun/jndi/toolkit/ctx/Continuation.java @@ -143,7 +143,7 @@ public class Continuation extends ResolveResult { e.setRemainingName(remainingName); e.setResolvedObj(resolvedObj); - if (starter == null) + if (starter == null || starter.isEmpty()) e.setResolvedName(null); else if (remainingName == null) e.setResolvedName(starter); diff --git a/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java b/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java new file mode 100644 index 00000000000..a3ca1bdf2f6 --- /dev/null +++ b/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java @@ -0,0 +1,118 @@ +/** + * @test + * @bug 6997561 + * @summary A request for better error handling in JNDI + */ + +import java.net.Socket; +import java.net.ServerSocket; +import java.io.*; +import javax.naming.*; +import javax.naming.directory.*; +import javax.naming.ldap.*; +import java.util.Collections; +import java.util.Hashtable; + +public class EmptyNameSearch { + + public static void main(String[] args) throws Exception { + + // Start the LDAP server + Server s = new Server(); + s.start(); + Thread.sleep(3000); + + // Setup JNDI parameters + Hashtable env = new Hashtable(); + env.put(Context.INITIAL_CONTEXT_FACTORY, + "com.sun.jndi.ldap.LdapCtxFactory"); + env.put(Context.PROVIDER_URL, "ldap://localhost:" + s.getPortNumber()); + + try { + + // Create initial context + System.out.println("Client: connecting..."); + DirContext ctx = new InitialDirContext(env); + + System.out.println("Client: performing search..."); + ctx.search(new LdapName(Collections.EMPTY_LIST), "cn=*", null); + ctx.close(); + + // Exit + throw new RuntimeException(); + + } catch (NamingException e) { + System.err.println("Passed: caught the expected Exception - " + e); + + } catch (Exception e) { + System.err.println("Failed: caught an unexpected Exception - " + e); + throw e; + } + } + + static class Server extends Thread { + + private int serverPort = 0; + private byte[] bindResponse = { + 0x30, 0x0C, 0x02, 0x01, 0x01, 0x61, 0x07, 0x0A, + 0x01, 0x00, 0x04, 0x00, 0x04, 0x00 + }; + private byte[] searchResponse = { + 0x30, 0x0C, 0x02, 0x01, 0x02, 0x65, 0x07, 0x0A, + 0x01, 0x02, 0x04, 0x00, 0x04, 0x00 + }; + + Server() { + } + + public int getPortNumber() { + return serverPort; + } + + public void run() { + try { + ServerSocket serverSock = new ServerSocket(0); + serverPort = serverSock.getLocalPort(); + System.out.println("Server: listening on port " + serverPort); + + Socket socket = serverSock.accept(); + System.out.println("Server: connection accepted"); + + InputStream in = socket.getInputStream(); + OutputStream out = socket.getOutputStream(); + + // Read the LDAP BindRequest + System.out.println("Server: reading request..."); + while (in.read() != -1) { + in.skip(in.available()); + break; + } + + // Write an LDAP BindResponse + System.out.println("Server: writing response..."); + out.write(bindResponse); + out.flush(); + + // Read the LDAP SearchRequest + System.out.println("Server: reading request..."); + while (in.read() != -1) { + in.skip(in.available()); + break; + } + + // Write an LDAP SearchResponse + System.out.println("Server: writing response..."); + out.write(searchResponse); + out.flush(); + + in.close(); + out.close(); + socket.close(); + serverSock.close(); + + } catch (IOException e) { + // ignore + } + } + } +} From 5b37c4faec06f19dbce1f20a2f06228c67ee638d Mon Sep 17 00:00:00 2001 From: Paul Hohensee Date: Thu, 3 Feb 2011 16:06:01 -0500 Subject: [PATCH 43/84] 7016998: gcutil class LinearLeastSquareFit doesn't initialize some of its fields Initialize _sum_x_squared, _intercept and _slope in constructor. Reviewed-by: bobv, coleenp --- hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp index 267f73d3b99..caa6efed1c8 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/gcUtil.cpp @@ -106,8 +106,8 @@ void AdaptivePaddedNoZeroDevAverage::sample(float new_sample) { } LinearLeastSquareFit::LinearLeastSquareFit(unsigned weight) : - _sum_x(0), _sum_y(0), _sum_xy(0), - _mean_x(weight), _mean_y(weight) {} + _sum_x(0), _sum_x_squared(0), _sum_y(0), _sum_xy(0), + _intercept(0), _slope(0), _mean_x(weight), _mean_y(weight) {} void LinearLeastSquareFit::update(double x, double y) { _sum_x = _sum_x + x; From 6435c3ecac3d663a528bee5f9f4a7d8709fec3a8 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Thu, 3 Feb 2011 13:49:25 -0800 Subject: [PATCH 44/84] 7014645: Support perl style Unicode hex notation \x{...} Added the construct \x{...} for Unicode hex notation support Reviewed-by: alanb, okutsu --- .../classes/java/util/regex/Pattern.java | 22 +++++++ jdk/test/java/util/regex/RegExTest.java | 63 ++++++++++++++++--- 2 files changed, 75 insertions(+), 10 deletions(-) diff --git a/jdk/src/share/classes/java/util/regex/Pattern.java b/jdk/src/share/classes/java/util/regex/Pattern.java index 7c012e5de31..e0494ab4292 100644 --- a/jdk/src/share/classes/java/util/regex/Pattern.java +++ b/jdk/src/share/classes/java/util/regex/Pattern.java @@ -101,6 +101,11 @@ import java.util.Arrays; *
* * + * + * * * * @@ -529,6 +534,13 @@ import java.util.Arrays; * while not equal, compile into the same pattern, which matches the character * with hexadecimal value 0x2014. * + *

A Unicode character can also be represented in a regular-expression by + * using its hexadecimal code point value directly as described in construct + * \x{...}, for example a supplementary character U+2011F + * can be specified as \x{2011F}, instead of two consecutive + * Unicode escape sequences of the surrogate pair + * \uD840\uDD1F. + * * *

Unicode scripts, blocks and categories are written with the \p and * \P constructs as in Perl. \p{prop} matches if @@ -2993,6 +3005,16 @@ loop: for(int x=0, offset=0; x Character.MAX_CODE_POINT) + throw error("Hexadecimal codepoint is too big"); + } + if (n != '}') + throw error("Unclosed hexadecimal escape sequence"); + return ch; } throw error("Illegal hexadecimal escape sequence"); } diff --git a/jdk/test/java/util/regex/RegExTest.java b/jdk/test/java/util/regex/RegExTest.java index 0e8470c4c11..e323066c3a2 100644 --- a/jdk/test/java/util/regex/RegExTest.java +++ b/jdk/test/java/util/regex/RegExTest.java @@ -32,7 +32,7 @@ * 4872664 4803179 4892980 4900747 4945394 4938995 4979006 4994840 4997476 * 5013885 5003322 4988891 5098443 5110268 6173522 4829857 5027748 6376940 * 6358731 6178785 6284152 6231989 6497148 6486934 6233084 6504326 6635133 - * 6350801 6676425 6878475 6919132 6931676 6948903 + * 6350801 6676425 6878475 6919132 6931676 6948903 7014645 */ import java.util.regex.*; @@ -136,6 +136,7 @@ public class RegExTest { namedGroupCaptureTest(); nonBmpClassComplementTest(); unicodePropertiesTest(); + unicodeHexNotationTest(); if (failure) throw new RuntimeException("Failure in the RE handling."); else @@ -161,18 +162,19 @@ public class RegExTest { private static void check(Matcher m, String result, boolean expected) { m.find(); - if (m.group().equals(result)) - failCount += (expected) ? 0 : 1; - else - failCount += (expected) ? 1 : 0; + if (m.group().equals(result) != expected) + failCount++; } private static void check(Pattern p, String s, boolean expected) { - Matcher matcher = p.matcher(s); - if (matcher.find()) - failCount += (expected) ? 0 : 1; - else - failCount += (expected) ? 1 : 0; + if (p.matcher(s).find() != expected) + failCount++; + } + + private static void check(String p, String s, boolean expected) { + Matcher matcher = Pattern.compile(p).matcher(s); + if (matcher.find() != expected) + failCount++; } private static void check(String p, char c, boolean expected) { @@ -3614,4 +3616,45 @@ public class RegExTest { } report("unicodeProperties"); } + + private static void unicodeHexNotationTest() throws Exception { + + // negative + checkExpectedFail("\\x{-23}"); + checkExpectedFail("\\x{110000}"); + checkExpectedFail("\\x{}"); + checkExpectedFail("\\x{AB[ef]"); + + // codepoint + check("^\\x{1033c}$", "\uD800\uDF3C", true); + check("^\\xF0\\x90\\x8C\\xBC$", "\uD800\uDF3C", false); + check("^\\x{D800}\\x{DF3c}+$", "\uD800\uDF3C", false); + check("^\\xF0\\x90\\x8C\\xBC$", "\uD800\uDF3C", false); + + // in class + check("^[\\x{D800}\\x{DF3c}]+$", "\uD800\uDF3C", false); + check("^[\\xF0\\x90\\x8C\\xBC]+$", "\uD800\uDF3C", false); + check("^[\\x{D800}\\x{DF3C}]+$", "\uD800\uDF3C", false); + check("^[\\x{DF3C}\\x{D800}]+$", "\uD800\uDF3C", false); + check("^[\\x{D800}\\x{DF3C}]+$", "\uDF3C\uD800", true); + check("^[\\x{DF3C}\\x{D800}]+$", "\uDF3C\uD800", true); + + for (int cp = 0; cp <= 0x10FFFF; cp++) { + String s = "A" + new String(Character.toChars(cp)) + "B"; + String hexUTF16 = (cp <= 0xFFFF)? String.format("\\u%04x", cp) + : String.format("\\u%04x\\u%04x", + (int) Character.toChars(cp)[0], + (int) Character.toChars(cp)[1]); + String hexCodePoint = "\\x{" + Integer.toHexString(cp) + "}"; + if (!Pattern.matches("A" + hexUTF16 + "B", s)) + failCount++; + if (!Pattern.matches("A[" + hexUTF16 + "]B", s)) + failCount++; + if (!Pattern.matches("A" + hexCodePoint + "B", s)) + failCount++; + if (!Pattern.matches("A[" + hexCodePoint + "]B", s)) + failCount++; + } + report("unicodeHexNotation"); + } } From 4c1f2a17d9064995587817fcee7d2353723adc20 Mon Sep 17 00:00:00 2001 From: Kumar Srinivasan Date: Thu, 3 Feb 2011 15:41:23 -0800 Subject: [PATCH 45/84] 6968053: (launcher) hide exceptions under certain launcher failures Reviewed-by: mchung --- jdk/src/share/bin/java.c | 3 + .../classes/sun/launcher/LauncherHelper.java | 116 +++++++++--------- .../launcher/resources/launcher.properties | 9 +- jdk/src/share/classes/sun/misc/VM.java | 6 + jdk/test/tools/launcher/Arrrghs.java | 45 +++++-- 5 files changed, 108 insertions(+), 71 deletions(-) diff --git a/jdk/src/share/bin/java.c b/jdk/src/share/bin/java.c index c2a6ab99249..2d339547761 100644 --- a/jdk/src/share/bin/java.c +++ b/jdk/src/share/bin/java.c @@ -244,6 +244,7 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */ for (i = 0; i < argc ; i++) { printf("argv[%d] = %s\n", i, argv[i]); } + AddOption("-Dsun.java.launcher.diag=true", NULL); } CreateExecutionEnvironment(&argc, &argv, @@ -1009,6 +1010,8 @@ ParseArguments(int *pargc, char ***pargv, } else if (JLI_StrCmp(arg, "-XshowSettings") == 0 || JLI_StrCCmp(arg, "-XshowSettings:") == 0) { showSettings = arg; + } else if (JLI_StrCmp(arg, "-Xdiag") == 0) { + AddOption("-Dsun.java.launcher.diag=true", NULL); /* * The following case provide backward compatibility with old-style * command line options. diff --git a/jdk/src/share/classes/sun/launcher/LauncherHelper.java b/jdk/src/share/classes/sun/launcher/LauncherHelper.java index 870ed30e9f0..ff71e8908b1 100644 --- a/jdk/src/share/classes/sun/launcher/LauncherHelper.java +++ b/jdk/src/share/classes/sun/launcher/LauncherHelper.java @@ -63,8 +63,6 @@ import java.util.jar.Manifest; public enum LauncherHelper { INSTANCE; - private static final String defaultBundleName = - "sun.launcher.resources.launcher"; private static final String MAIN_CLASS = "Main-Class"; private static StringBuilder outBuf = new StringBuilder(); @@ -76,11 +74,14 @@ public enum LauncherHelper { private static final String PROP_SETTINGS = "Property settings:"; private static final String LOCALE_SETTINGS = "Locale settings:"; - private static synchronized ResourceBundle getLauncherResourceBundle() { - if (javarb == null) { - javarb = ResourceBundle.getBundle(defaultBundleName); - } - return javarb; + // sync with java.c and sun.misc.VM + private static final String diagprop = "sun.java.launcher.diag"; + + private static final String defaultBundleName = + "sun.launcher.resources.launcher"; + private static class ResourceBundleHolder { + private static final ResourceBundle RB = + ResourceBundle.getBundle(defaultBundleName); } /* @@ -308,7 +309,7 @@ public enum LauncherHelper { * apply any arguments that we might pass. */ private static String getLocalizedMessage(String key, Object... args) { - String msg = getLauncherResourceBundle().getString(key); + String msg = ResourceBundleHolder.RB.getString(key); return (args != null) ? MessageFormat.format(msg, args) : msg; } @@ -380,25 +381,29 @@ public enum LauncherHelper { File.pathSeparator)); } - static String getMainClassFromJar(String jarname) throws IOException { - JarFile jarFile = null; + static String getMainClassFromJar(PrintStream ostream, String jarname) { try { - jarFile = new JarFile(jarname); - Manifest manifest = jarFile.getManifest(); - if (manifest == null) { - throw new IOException("manifest not found in " + jarname); - } - Attributes mainAttrs = manifest.getMainAttributes(); - if (mainAttrs == null) { - throw new IOException("no main mainifest attributes, in " + - jarname); - } - return mainAttrs.getValue(MAIN_CLASS).trim(); - } finally { - if (jarFile != null) { - jarFile.close(); + JarFile jarFile = null; + try { + jarFile = new JarFile(jarname); + Manifest manifest = jarFile.getManifest(); + if (manifest == null) { + abort(ostream, null, "java.launcher.jar.error2", jarname); + } + Attributes mainAttrs = manifest.getMainAttributes(); + if (mainAttrs == null) { + abort(ostream, null, "java.launcher.jar.error3", jarname); + } + return mainAttrs.getValue(MAIN_CLASS).trim(); + } finally { + if (jarFile != null) { + jarFile.close(); + } } + } catch (IOException ioe) { + abort(ostream, ioe, "java.launcher.jar.error1", jarname); } + return null; } @@ -409,6 +414,20 @@ public enum LauncherHelper { private static final int LM_CLASS = 1; private static final int LM_JAR = 2; + static void abort(PrintStream ostream, Throwable t, String msgKey, Object... args) { + if (msgKey != null) { + ostream.println(getLocalizedMessage(msgKey, args)); + } + if (sun.misc.VM.getSavedProperty(diagprop) != null) { + if (t != null) { + t.printStackTrace(); + } else { + Thread.currentThread().dumpStack(); + } + } + System.exit(1); + } + /** * This method does the following: * 1. gets the classname from a Jar's manifest, if necessary @@ -426,39 +445,31 @@ public enum LauncherHelper { * @param isJar * @param name * @return - * @throws java.io.IOException */ public static Class checkAndLoadMain(boolean printToStderr, int mode, - String what) throws IOException - { - - ClassLoader ld = ClassLoader.getSystemClassLoader(); - + String what) { + final PrintStream ostream = (printToStderr) ? System.err : System.out; + final ClassLoader ld = ClassLoader.getSystemClassLoader(); // get the class name String cn = null; switch (mode) { - case LM_CLASS: - cn = what; - break; - case LM_JAR: - cn = getMainClassFromJar(what); - break; - default: - throw new InternalError("" + mode + ": Unknown launch mode"); + case LM_CLASS: + cn = what; + break; + case LM_JAR: + cn = getMainClassFromJar(ostream, what); + break; + default: + // should never happen + throw new InternalError("" + mode + ": Unknown launch mode"); } cn = cn.replace('/', '.'); - - PrintStream ostream = (printToStderr) ? System.err : System.out; Class c = null; try { c = ld.loadClass(cn); } catch (ClassNotFoundException cnfe) { - ostream.println(getLocalizedMessage("java.launcher.cls.error1", - cn)); - NoClassDefFoundError ncdfe = new NoClassDefFoundError(cn); - ncdfe.initCause(cnfe); - throw ncdfe; + abort(ostream, cnfe, "java.launcher.cls.error1", cn); } signatureDiagnostic(ostream, c); return c; @@ -470,9 +481,7 @@ public enum LauncherHelper { try { method = clazz.getMethod("main", String[].class); } catch (NoSuchMethodException nsme) { - ostream.println(getLocalizedMessage("java.launcher.cls.error4", - classname)); - throw new RuntimeException("Main method not found in " + classname); + abort(ostream, null, "java.launcher.cls.error4", classname); } /* * getMethod (above) will choose the correct method, based @@ -481,17 +490,10 @@ public enum LauncherHelper { */ int mod = method.getModifiers(); if (!Modifier.isStatic(mod)) { - ostream.println(getLocalizedMessage("java.launcher.cls.error2", - "static", classname)); - throw new RuntimeException("Main method is not static in class " + - classname); + abort(ostream, null, "java.launcher.cls.error2", "static", classname); } if (method.getReturnType() != java.lang.Void.TYPE) { - ostream.println(getLocalizedMessage("java.launcher.cls.error3", - classname)); - throw new RuntimeException("Main method must return a value" + - " of type void in class " + - classname); + abort(ostream, null, "java.launcher.cls.error3", classname); } return; } diff --git a/jdk/src/share/classes/sun/launcher/resources/launcher.properties b/jdk/src/share/classes/sun/launcher/resources/launcher.properties index 17ba48a1384..f508e9f49fc 100644 --- a/jdk/src/share/classes/sun/launcher/resources/launcher.properties +++ b/jdk/src/share/classes/sun/launcher/resources/launcher.properties @@ -84,6 +84,7 @@ java.launcher.X.usage=\ \ append to end of bootstrap class path\n\ \ -Xbootclasspath/p:\n\ \ prepend in front of bootstrap class path\n\ +\ -Xdiag show additional diagnostic messages\n\ \ -Xnoclassgc disable class garbage collection\n\ \ -Xincgc enable incremental garbage collection\n\ \ -Xloggc: log GC status to a file with time stamps\n\ @@ -109,7 +110,7 @@ java.launcher.X.usage=\ The -X options are non-standard and subject to change without notice.\n java.launcher.cls.error1=\ - Error: Could not find main class {0} + Error: Could not find or load main class {0} java.launcher.cls.error2=\ Error: Main method is not {0} in class {1}, please define the main method as:\n\ \ public static void main(String[] args) @@ -120,5 +121,7 @@ java.launcher.cls.error3=\ java.launcher.cls.error4=\ Error: Main method not found in class {0}, please define the main method as:\n\ \ public static void main(String[] args) - - +java.launcher.jar.error1=\ + Error: An unexpected error occurred while trying to open file {0} +java.launcher.jar.error2=manifest not found in {0} +java.launcher.jar.error3=no main manifest attribute, in {0} diff --git a/jdk/src/share/classes/sun/misc/VM.java b/jdk/src/share/classes/sun/misc/VM.java index 0d8369a9d01..e3dc5efd64e 100644 --- a/jdk/src/share/classes/sun/misc/VM.java +++ b/jdk/src/share/classes/sun/misc/VM.java @@ -235,6 +235,9 @@ public class VM { return savedProps.getProperty(key); } + // TODO: the Property Management needs to be refactored and + // the appropriate prop keys need to be accessible to the + // calling classes to avoid duplication of keys. private static final Properties savedProps = new Properties(); // Save a private copy of the system properties and remove @@ -283,6 +286,9 @@ public class VM { // used by java.util.zip.ZipFile props.remove("sun.zip.disableMemoryMapping"); + + // used by sun.launcher.LauncherHelper + props.remove("sun.java.launcher.diag"); } // Initialize any miscellenous operating system settings that need to be diff --git a/jdk/test/tools/launcher/Arrrghs.java b/jdk/test/tools/launcher/Arrrghs.java index de3dbe20112..1db933833ea 100644 --- a/jdk/test/tools/launcher/Arrrghs.java +++ b/jdk/test/tools/launcher/Arrrghs.java @@ -24,7 +24,7 @@ /** * @test * @bug 5030233 6214916 6356475 6571029 6684582 6742159 4459600 6758881 6753938 - * 6894719 + * 6894719 6968053 * @summary Argument parsing validation. * @compile -XDignore.symbol.file Arrrghs.java TestHelper.java * @run main Arrrghs @@ -250,13 +250,11 @@ public class Arrrghs { TestHelper.createJar("MIA", new File("some.jar"), new File("Foo"), (String[])null); tr = TestHelper.doExec(TestHelper.javaCmd, "-jar", "some.jar"); - tr.contains("Error: Could not find main class MIA"); - tr.contains("java.lang.NoClassDefFoundError: MIA"); + tr.contains("Error: Could not find or load main class MIA"); System.out.println(tr); // use classpath to check tr = TestHelper.doExec(TestHelper.javaCmd, "-cp", "some.jar", "MIA"); - tr.contains("Error: Could not find main class MIA"); - tr.contains("java.lang.NoClassDefFoundError: MIA"); + tr.contains("Error: Could not find or load main class MIA"); System.out.println(tr); // incorrect method access @@ -305,12 +303,12 @@ public class Arrrghs { // amongst a potpourri of kindred main methods, is the right one chosen ? TestHelper.createJar(new File("some.jar"), new File("Foo"), - "void main(Object[] args){}", - "int main(Float[] args){return 1;}", - "private void main() {}", - "private static void main(int x) {}", - "public int main(int argc, String[] argv) {return 1;}", - "public static void main(String[] args) {System.out.println(\"THE_CHOSEN_ONE\");}"); + "void main(Object[] args){}", + "int main(Float[] args){return 1;}", + "private void main() {}", + "private static void main(int x) {}", + "public int main(int argc, String[] argv) {return 1;}", + "public static void main(String[] args) {System.out.println(\"THE_CHOSEN_ONE\");}"); tr = TestHelper.doExec(TestHelper.javaCmd, "-jar", "some.jar"); tr.contains("THE_CHOSEN_ONE"); System.out.println(tr); @@ -326,6 +324,30 @@ public class Arrrghs { tr.checkPositive(); System.out.println(tr); } + // tests 6968053, ie. we turn on the -Xdiag (for now) flag and check if + // the suppressed stack traces are exposed. + static void runDiagOptionTests() throws FileNotFoundException { + TestHelper.TestResult tr = null; + // a missing class + TestHelper.createJar("MIA", new File("some.jar"), new File("Foo"), + (String[])null); + tr = TestHelper.doExec(TestHelper.javaCmd, "-Xdiag", "-jar", "some.jar"); + tr.contains("Error: Could not find or load main class MIA"); + tr.contains("java.lang.ClassNotFoundException: MIA"); + System.out.println(tr); + + // use classpath to check + tr = TestHelper.doExec(TestHelper.javaCmd, "-Xdiag", "-cp", "some.jar", "MIA"); + tr.contains("Error: Could not find or load main class MIA"); + tr.contains("java.lang.ClassNotFoundException: MIA"); + System.out.println(tr); + + // a missing class on the classpath + tr = TestHelper.doExec(TestHelper.javaCmd, "-Xdiag", "NonExistentClass"); + tr.contains("Error: Could not find or load main class NonExistentClass"); + tr.contains("java.lang.ClassNotFoundException: NonExistentClass"); + System.out.println(tr); + } static void test6894719() { // test both arguments to ensure they exist @@ -352,6 +374,7 @@ public class Arrrghs { runBasicErrorMessageTests(); runMainMethodTests(); test6894719(); + runDiagOptionTests(); if (TestHelper.testExitValue > 0) { System.out.println("Total of " + TestHelper.testExitValue + " failed"); System.exit(1); From 9a5a2207adbfc164247b521238aee15e233aa1c7 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Fri, 4 Feb 2011 00:33:30 +0000 Subject: [PATCH 46/84] 6989705: ECC security code native code compiler warnings Reviewed-by: alanb, ohair --- .../share/native/sun/security/ec/ECC_JNI.cpp | 6 ++--- .../share/native/sun/security/ec/impl/ec.c | 21 ++++++++---------- .../share/native/sun/security/ec/impl/ec.h | 2 -- .../share/native/sun/security/ec/impl/ec2.h | 2 -- .../native/sun/security/ec/impl/ec2_163.c | 2 -- .../native/sun/security/ec/impl/ec2_193.c | 2 -- .../native/sun/security/ec/impl/ec2_233.c | 2 -- .../native/sun/security/ec/impl/ec2_aff.c | 2 -- .../native/sun/security/ec/impl/ec2_mont.c | 2 -- .../native/sun/security/ec/impl/ec_naf.c | 2 -- .../native/sun/security/ec/impl/ecc_impl.h | 5 ++--- .../native/sun/security/ec/impl/ecdecode.c | 7 +++--- .../native/sun/security/ec/impl/ecl-curve.h | 2 -- .../native/sun/security/ec/impl/ecl-exp.h | 2 -- .../native/sun/security/ec/impl/ecl-priv.h | 15 +++++++++++-- .../share/native/sun/security/ec/impl/ecl.c | 2 -- .../share/native/sun/security/ec/impl/ecl.h | 2 -- .../native/sun/security/ec/impl/ecl_curve.c | 2 -- .../native/sun/security/ec/impl/ecl_gf.c | 18 +++++++-------- .../native/sun/security/ec/impl/ecl_mult.c | 2 -- .../share/native/sun/security/ec/impl/ecp.h | 2 -- .../native/sun/security/ec/impl/ecp_192.c | 14 +++++------- .../native/sun/security/ec/impl/ecp_224.c | 10 ++++----- .../native/sun/security/ec/impl/ecp_256.c | 16 ++++++-------- .../native/sun/security/ec/impl/ecp_384.c | 2 -- .../native/sun/security/ec/impl/ecp_521.c | 6 ++--- .../native/sun/security/ec/impl/ecp_aff.c | 2 -- .../native/sun/security/ec/impl/ecp_jac.c | 2 -- .../native/sun/security/ec/impl/ecp_jm.c | 2 -- .../native/sun/security/ec/impl/ecp_mont.c | 2 -- .../native/sun/security/ec/impl/logtab.h | 2 -- .../sun/security/ec/impl/mp_gf2m-priv.h | 2 -- .../native/sun/security/ec/impl/mp_gf2m.c | 2 -- .../native/sun/security/ec/impl/mp_gf2m.h | 2 -- .../native/sun/security/ec/impl/mpi-config.h | 2 -- .../native/sun/security/ec/impl/mpi-priv.h | 2 -- .../share/native/sun/security/ec/impl/mpi.c | 22 +++++++++---------- .../share/native/sun/security/ec/impl/mpi.h | 2 -- .../native/sun/security/ec/impl/mplogic.c | 2 -- .../native/sun/security/ec/impl/mplogic.h | 2 -- .../native/sun/security/ec/impl/mpmontg.c | 2 -- .../native/sun/security/ec/impl/mpprime.h | 2 -- .../share/native/sun/security/ec/impl/oid.c | 9 ++------ .../native/sun/security/ec/impl/secitem.c | 2 -- .../native/sun/security/ec/impl/secoidt.h | 2 -- 45 files changed, 69 insertions(+), 146 deletions(-) diff --git a/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp b/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp index 457fb058082..249d2e74ed1 100644 --- a/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp +++ b/jdk/src/share/native/sun/security/ec/ECC_JNI.cpp @@ -38,7 +38,7 @@ extern "C" { /* * Throws an arbitrary Java exception. */ -void ThrowException(JNIEnv *env, char *exceptionName) +void ThrowException(JNIEnv *env, const char *exceptionName) { jclass exceptionClazz = env->FindClass(exceptionName); env->ThrowNew(exceptionClazz, NULL); @@ -89,7 +89,7 @@ JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair // Fill a new ECParams using the supplied OID if (EC_DecodeParams(¶ms_item, &ecparams, 0) != SECSuccess) { /* bad curve OID */ - ThrowException(env, (char *) INVALID_ALGORITHM_PARAMETER_EXCEPTION); + ThrowException(env, INVALID_ALGORITHM_PARAMETER_EXCEPTION); goto cleanup; } @@ -101,7 +101,7 @@ JNICALL Java_sun_security_ec_ECKeyPairGenerator_generateECKeyPair // Generate the new keypair (using the supplied seed) if (EC_NewKey(ecparams, &privKey, (unsigned char *) pSeedBuffer, jSeedLength, 0) != SECSuccess) { - ThrowException(env, (char *) KEY_EXCEPTION); + ThrowException(env, KEY_EXCEPTION); goto cleanup; } diff --git a/jdk/src/share/native/sun/security/ec/impl/ec.c b/jdk/src/share/native/sun/security/ec/impl/ec.c index 65a9b388e14..11777de8746 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec.c @@ -51,12 +51,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mplogic.h" #include "ec.h" #include "ecl.h" @@ -67,6 +65,7 @@ #include #ifndef _WIN32 +#include #include #endif /* _WIN32 */ @@ -116,7 +115,7 @@ ec_points_mul(const ECParams *params, const mp_int *k1, const mp_int *k2, ECGroup *group = NULL; SECStatus rv = SECFailure; mp_err err = MP_OKAY; - int len; + unsigned int len; #if EC_DEBUG int i; @@ -278,10 +277,6 @@ ec_NewKey(ECParams *ecParams, ECPrivateKey **privKey, printf("ec_NewKey called\n"); #endif -#ifndef _WIN32 -int printf(); -#endif /* _WIN32 */ - if (!ecParams || !privKey || !privKeyBytes || (privKeyLen < 0)) { PORT_SetError(SEC_ERROR_INVALID_ARGS); return SECFailure; @@ -361,8 +356,9 @@ int printf(); cleanup: mp_clear(&k); - if (rv) + if (rv) { PORT_FreeArena(arena, PR_TRUE); + } #if EC_DEBUG printf("ec_NewKey returning %s\n", @@ -504,7 +500,7 @@ EC_ValidatePublicKey(ECParams *ecParams, SECItem *publicValue, int kmflag) ECGroup *group = NULL; SECStatus rv = SECFailure; mp_err err = MP_OKAY; - int len; + unsigned int len; if (!ecParams || !publicValue) { PORT_SetError(SEC_ERROR_INVALID_ARGS); @@ -778,7 +774,7 @@ ECDSA_SignDigestWithSeed(ECPrivateKey *key, SECItem *signature, /* In the definition of EC signing, digests are truncated * to the length of n in bits. * (see SEC 1 "Elliptic Curve Digit Signature Algorithm" section 4.1.*/ - if (digest->len*8 > ecParams->fieldID.size) { + if (digest->len*8 > (unsigned int)ecParams->fieldID.size) { mpl_rsh(&s,&s,digest->len*8 - ecParams->fieldID.size); } @@ -993,7 +989,8 @@ ECDSA_VerifyDigest(ECPublicKey *key, const SECItem *signature, /* In the definition of EC signing, digests are truncated * to the length of n in bits. * (see SEC 1 "Elliptic Curve Digit Signature Algorithm" section 4.1.*/ - if (digest->len*8 > ecParams->fieldID.size) { /* u1 = HASH(M') */ + /* u1 = HASH(M') */ + if (digest->len*8 > (unsigned int)ecParams->fieldID.size) { mpl_rsh(&u1,&u1,digest->len*8- ecParams->fieldID.size); } diff --git a/jdk/src/share/native/sun/security/ec/impl/ec.h b/jdk/src/share/native/sun/security/ec/impl/ec.h index e8d034ca493..f5f3d356e26 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec.h +++ b/jdk/src/share/native/sun/security/ec/impl/ec.h @@ -57,8 +57,6 @@ #ifndef __ec_h_ #define __ec_h_ -#pragma ident "%Z%%M% %I% %E% SMI" - #define EC_DEBUG 0 #define EC_POINT_FORM_COMPRESSED_Y0 0x02 #define EC_POINT_FORM_COMPRESSED_Y1 0x03 diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2.h b/jdk/src/share/native/sun/security/ec/impl/ec2.h index 6541f039d4c..e297a309218 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec2.h +++ b/jdk/src/share/native/sun/security/ec/impl/ec2.h @@ -57,8 +57,6 @@ #ifndef _EC2_H #define _EC2_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-priv.h" /* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_163.c b/jdk/src/share/native/sun/security/ec/impl/ec2_163.c index 4aadc4e8d37..c1dc55dea35 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec2_163.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec2_163.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mp_gf2m.h" #include "mp_gf2m-priv.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_193.c b/jdk/src/share/native/sun/security/ec/impl/ec2_193.c index ddaf97323f0..aa7f29f0823 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec2_193.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec2_193.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mp_gf2m.h" #include "mp_gf2m-priv.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_233.c b/jdk/src/share/native/sun/security/ec/impl/ec2_233.c index 8e81c81ebb5..485b104ce2a 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec2_233.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec2_233.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mp_gf2m.h" #include "mp_gf2m-priv.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c b/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c index 2865b2826d3..f77eba3f499 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mplogic.h" #include "mp_gf2m.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c b/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c index 3f5faec42b4..eda921f3ff6 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ec2.h" #include "mplogic.h" #include "mp_gf2m.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ec_naf.c b/jdk/src/share/native/sun/security/ec/impl/ec_naf.c index 2827d459b1a..e6307f0d108 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ec_naf.c +++ b/jdk/src/share/native/sun/security/ec/impl/ec_naf.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-priv.h" /* Returns 2^e as an integer. This is meant to be used for small powers of diff --git a/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h b/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h index 7d50aa199bb..23357ae8c42 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecc_impl.h @@ -51,15 +51,13 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ #ifndef _ECC_IMPL_H #define _ECC_IMPL_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -82,6 +80,7 @@ typedef enum { B_FALSE, B_TRUE } boolean_t; typedef unsigned char uint8_t; typedef unsigned long ulong_t; typedef enum boolean { B_FALSE, B_TRUE } boolean_t; +#define strdup _strdup /* Replace POSIX name with ISO C++ name */ #endif /* _WIN32 */ #ifndef _KERNEL diff --git a/jdk/src/share/native/sun/security/ec/impl/ecdecode.c b/jdk/src/share/native/sun/security/ec/impl/ecdecode.c index 19c62403c64..826192161ee 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecdecode.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecdecode.c @@ -55,8 +55,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifndef _WIN32 @@ -90,7 +88,7 @@ hexString2SECItem(PRArenaPool *arena, SECItem *item, const char *str, { int i = 0; int byteval = 0; - int tmp = strlen(str); + int tmp = (int)strlen(str); if ((tmp % 2) != 0) return NULL; @@ -134,7 +132,8 @@ gf_populate_params(ECCurveName name, ECFieldType field_type, ECParams *params, /* 2 ['0'+'4'] + MAX_ECKEY_LEN * 2 [x,y] * 2 [hex string] + 1 ['\0'] */ char genenc[3 + 2 * 2 * MAX_ECKEY_LEN]; - if ((name < ECCurve_noName) || (name > ECCurve_pastLastCurve)) goto cleanup; + if (((int)name < ECCurve_noName) || (name > ECCurve_pastLastCurve)) + goto cleanup; params->name = name; curveParams = ecCurve_map[params->name]; CHECK_OK(curveParams); diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h b/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h index c7683031c4a..865c3d49feb 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h @@ -57,8 +57,6 @@ #ifndef _ECL_CURVE_H #define _ECL_CURVE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-exp.h" #ifndef _KERNEL #include diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl-exp.h b/jdk/src/share/native/sun/security/ec/impl/ecl-exp.h index 4c7698d7b0c..51ed43fdbc2 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl-exp.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecl-exp.h @@ -57,8 +57,6 @@ #ifndef _ECL_EXP_H #define _ECL_EXP_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* Curve field type */ typedef enum { ECField_GFp, diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl-priv.h b/jdk/src/share/native/sun/security/ec/impl/ecl-priv.h index 5b744c0917c..6b032eabecc 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl-priv.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecl-priv.h @@ -58,8 +58,6 @@ #ifndef _ECL_PRIV_H #define _ECL_PRIV_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl.h" #include "mpi.h" #include "mplogic.h" @@ -90,6 +88,10 @@ s = ACCUM(w); \ cout = CARRYOUT(w); } +/* Handle case when carry-in value is zero */ +#define MP_ADD_CARRY_ZERO(a1, a2, s, cout) \ + MP_ADD_CARRY(a1, a2, s, 0, cout); + #define MP_SUB_BORROW(a1, a2, s, bin, bout) \ { mp_word w; \ w = ((mp_word)(a1)) - (a2) - (bin); \ @@ -111,6 +113,15 @@ s = sum += (cin); \ cout = tmp + (sum < (cin)); } +/* Handle case when carry-in value is zero */ +#define MP_ADD_CARRY_ZERO(a1, a2, s, cout) \ + { mp_digit tmp,sum; \ + tmp = (a1); \ + sum = tmp + (a2); \ + tmp = (sum < tmp); /* detect overflow */ \ + s = sum; \ + cout = tmp; } + #define MP_SUB_BORROW(a1, a2, s, bin, bout) \ { mp_digit tmp; \ tmp = (a1); \ diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl.c b/jdk/src/share/native/sun/security/ec/impl/ecl.c index 3c609ead783..79c5467cf07 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecl.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" #include "mplogic.h" #include "ecl.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl.h b/jdk/src/share/native/sun/security/ec/impl/ecl.h index d5143ad6673..ab956d89fbc 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecl.h @@ -57,8 +57,6 @@ #ifndef _ECL_H #define _ECL_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* Although this is not an exported header file, code which uses elliptic * curve point operations will need to include it. */ diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl_curve.c b/jdk/src/share/native/sun/security/ec/impl/ecl_curve.c index f25732a9c46..a253a363f6a 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl_curve.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecl_curve.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl.h" #include "ecl-curve.h" #include "ecl-priv.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl_gf.c b/jdk/src/share/native/sun/security/ec/impl/ecl_gf.c index a478b58236f..46b8dff0295 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl_gf.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecl_gf.c @@ -55,8 +55,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" #include "mp_gf2m.h" #include "ecl-priv.h" @@ -307,7 +305,7 @@ ec_GFp_add_3(const mp_int *a, const mp_int *b, mp_int *r, } #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); #else @@ -394,7 +392,7 @@ ec_GFp_add_4(const mp_int *a, const mp_int *b, mp_int *r, } #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); MP_ADD_CARRY(a3, r3, r3, carry, carry); @@ -491,7 +489,7 @@ ec_GFp_add_5(const mp_int *a, const mp_int *b, mp_int *r, r0 = MP_DIGIT(b,0); } - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); MP_ADD_CARRY(a3, r3, r3, carry, carry); @@ -572,7 +570,7 @@ ec_GFp_add_6(const mp_int *a, const mp_int *b, mp_int *r, r0 = MP_DIGIT(b,0); } - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); MP_ADD_CARRY(a3, r3, r3, carry, carry); @@ -675,7 +673,7 @@ ec_GFp_sub_3(const mp_int *a, const mp_int *b, mp_int *r, b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); #else @@ -766,7 +764,7 @@ ec_GFp_sub_4(const mp_int *a, const mp_int *b, mp_int *r, b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); @@ -850,7 +848,7 @@ ec_GFp_sub_5(const mp_int *a, const mp_int *b, mp_int *r, b2 = MP_DIGIT(&meth->irr,2); b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); @@ -924,7 +922,7 @@ ec_GFp_sub_6(const mp_int *a, const mp_int *b, mp_int *r, b2 = MP_DIGIT(&meth->irr,2); b1 = MP_DIGIT(&meth->irr,1); b0 = MP_DIGIT(&meth->irr,0); - MP_ADD_CARRY(b0, r0, r0, 0, borrow); + MP_ADD_CARRY_ZERO(b0, r0, r0, borrow); MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl_mult.c b/jdk/src/share/native/sun/security/ec/impl/ecl_mult.c index 4393c82fcf3..5c43ae8cf0e 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecl_mult.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecl_mult.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" #include "mplogic.h" #include "ecl.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp.h b/jdk/src/share/native/sun/security/ec/impl/ecp.h index f9d8b01241a..97220f3d39f 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp.h +++ b/jdk/src/share/native/sun/security/ec/impl/ecp.h @@ -57,8 +57,6 @@ #ifndef _ECP_H #define _ECP_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecl-priv.h" /* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_192.c b/jdk/src/share/native/sun/security/ec/impl/ecp_192.c index 23f49eadaf9..dcdd9dbe618 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_192.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_192.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -210,15 +208,15 @@ ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth) /* implement r = (a2,a1,a0)+(a5,a5,a5)+(a4,a4,0)+(0,a3,a3) */ #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(r0, a3, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a3, r0, carry); MP_ADD_CARRY(r1, a3, r1, carry, carry); MP_ADD_CARRY(r2, a4, r2, carry, carry); r3 = carry; - MP_ADD_CARRY(r0, a5, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a5, r0, carry); MP_ADD_CARRY(r1, a5, r1, carry, carry); MP_ADD_CARRY(r2, a5, r2, carry, carry); r3 += carry; - MP_ADD_CARRY(r1, a4, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a4, r1, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); r3 += carry; @@ -251,7 +249,7 @@ ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth) /* reduce out the carry */ while (r3) { #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(r0, r3, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, r3, r0, carry); MP_ADD_CARRY(r1, r3, r1, carry, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); r3 = carry; @@ -335,7 +333,7 @@ ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r, } #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(a0, r0, r0, 0, carry); + MP_ADD_CARRY_ZERO(a0, r0, r0, carry); MP_ADD_CARRY(a1, r1, r1, carry, carry); MP_ADD_CARRY(a2, r2, r2, carry, carry); #else @@ -357,7 +355,7 @@ ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r, ((r1 == MP_DIGIT_MAX) || ((r1 == (MP_DIGIT_MAX-1)) && (r0 == MP_DIGIT_MAX))))) { #ifndef MPI_AMD64_ADD - MP_ADD_CARRY(r0, 1, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, 1, r0, carry); MP_ADD_CARRY(r1, 1, r1, carry, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); #else diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_224.c b/jdk/src/share/native/sun/security/ec/impl/ecp_224.c index 7d802383553..96d775f9e87 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_224.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_224.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -251,10 +249,10 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) +( 0, a6,a5b, 0) -( 0 0, 0|a6b, a6a|a5b ) -( a6b, a6a|a5b, a5a|a4b, a4a|a3b ) */ - MP_ADD_CARRY (r1, a3b, r1, 0, carry); + MP_ADD_CARRY_ZERO (r1, a3b, r1, carry); MP_ADD_CARRY (r2, a4 , r2, carry, carry); MP_ADD_CARRY (r3, a5a, r3, carry, carry); - MP_ADD_CARRY (r1, a5b, r1, 0, carry); + MP_ADD_CARRY_ZERO (r1, a5b, r1, carry); MP_ADD_CARRY (r2, a6 , r2, carry, carry); MP_ADD_CARRY (r3, 0, r3, carry, carry); @@ -275,7 +273,7 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) r3b = (int)(r3 >>32); while (r3b > 0) { r3 &= 0xffffffff; - MP_ADD_CARRY(r1,((mp_digit)r3b) << 32, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1,((mp_digit)r3b) << 32, r1, carry); if (carry) { MP_ADD_CARRY(r2, 0, r2, carry, carry); MP_ADD_CARRY(r3, 0, r3, carry, carry); @@ -290,7 +288,7 @@ ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) } while (r3b < 0) { - MP_ADD_CARRY (r0, 1, r0, 0, carry); + MP_ADD_CARRY_ZERO (r0, 1, r0, carry); MP_ADD_CARRY (r1, MP_DIGIT_MAX <<32, r1, carry, carry); MP_ADD_CARRY (r2, MP_DIGIT_MAX, r2, carry, carry); MP_ADD_CARRY (r3, MP_DIGIT_MAX >> 32, r3, carry, carry); diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_256.c b/jdk/src/share/native/sun/security/ec/impl/ecp_256.c index f8c5720ac85..ef829085663 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_256.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_256.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -303,32 +301,32 @@ ec_GFp_nistp256_mod(const mp_int *a, mp_int *r, const GFMethod *meth) r0 = MP_DIGIT(a,0); /* sum 1 */ - MP_ADD_CARRY(r1, a5h << 32, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a5h << 32, r1, carry); MP_ADD_CARRY(r2, a6, r2, carry, carry); MP_ADD_CARRY(r3, a7, r3, carry, carry); r4 = carry; - MP_ADD_CARRY(r1, a5h << 32, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a5h << 32, r1, carry); MP_ADD_CARRY(r2, a6, r2, carry, carry); MP_ADD_CARRY(r3, a7, r3, carry, carry); r4 += carry; /* sum 2 */ - MP_ADD_CARRY(r1, a6l, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a6l, r1, carry); MP_ADD_CARRY(r2, a6h | a7l, r2, carry, carry); MP_ADD_CARRY(r3, a7h, r3, carry, carry); r4 += carry; - MP_ADD_CARRY(r1, a6l, r1, 0, carry); + MP_ADD_CARRY_ZERO(r1, a6l, r1, carry); MP_ADD_CARRY(r2, a6h | a7l, r2, carry, carry); MP_ADD_CARRY(r3, a7h, r3, carry, carry); r4 += carry; /* sum 3 */ - MP_ADD_CARRY(r0, a4, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a4, r0, carry); MP_ADD_CARRY(r1, a5l >> 32, r1, carry, carry); MP_ADD_CARRY(r2, 0, r2, carry, carry); MP_ADD_CARRY(r3, a7, r3, carry, carry); r4 += carry; /* sum 4 */ - MP_ADD_CARRY(r0, a4h | a5l, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, a4h | a5l, r0, carry); MP_ADD_CARRY(r1, a5h|(a6h<<32), r1, carry, carry); MP_ADD_CARRY(r2, a7, r2, carry, carry); MP_ADD_CARRY(r3, a6h | a4l, r3, carry, carry); @@ -362,7 +360,7 @@ ec_GFp_nistp256_mod(const mp_int *a, mp_int *r, const GFMethod *meth) while (r4 > 0) { mp_digit r4_long = r4; mp_digit r4l = (r4_long << 32); - MP_ADD_CARRY(r0, r4_long, r0, 0, carry); + MP_ADD_CARRY_ZERO(r0, r4_long, r0, carry); MP_ADD_CARRY(r1, -r4l, r1, carry, carry); MP_ADD_CARRY(r2, MP_DIGIT_MAX, r2, carry, carry); MP_ADD_CARRY(r3, r4l-r4_long-1,r3, carry, carry); diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_384.c b/jdk/src/share/native/sun/security/ec/impl/ecp_384.c index c9d9d0f05a2..263fecb888f 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_384.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_384.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_521.c b/jdk/src/share/native/sun/security/ec/impl/ecp_521.c index b76436a43ed..239b1289372 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_521.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_521.c @@ -50,12 +50,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mpi.h" #include "mplogic.h" @@ -74,7 +72,7 @@ ec_GFp_nistp521_mod(const mp_int *a, mp_int *r, const GFMethod *meth) { mp_err res = MP_OKAY; int a_bits = mpl_significant_bits(a); - int i; + unsigned int i; /* m1, m2 are statically-allocated mp_int of exactly the size we need */ mp_int m1; diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_aff.c b/jdk/src/share/native/sun/security/ec/impl/ecp_aff.c index c987a8887d2..a3a97f62570 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_aff.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_aff.c @@ -59,8 +59,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mplogic.h" #ifndef _KERNEL diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_jac.c b/jdk/src/share/native/sun/security/ec/impl/ecp_jac.c index 2ff3e4d57c8..8b35dae8e99 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_jac.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_jac.c @@ -59,8 +59,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "mplogic.h" #ifndef _KERNEL diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_jm.c b/jdk/src/share/native/sun/security/ec/impl/ecp_jm.c index 572ed062800..b85615be7ad 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_jm.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_jm.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "ecp.h" #include "ecl-priv.h" #include "mplogic.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_mont.c b/jdk/src/share/native/sun/security/ec/impl/ecp_mont.c index ff51d90bb88..6519eda7bc0 100644 --- a/jdk/src/share/native/sun/security/ec/impl/ecp_mont.c +++ b/jdk/src/share/native/sun/security/ec/impl/ecp_mont.c @@ -54,8 +54,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* Uses Montgomery reduction for field arithmetic. See mpi/mpmontg.c for * code implementation. */ diff --git a/jdk/src/share/native/sun/security/ec/impl/logtab.h b/jdk/src/share/native/sun/security/ec/impl/logtab.h index bcc13ebb107..f4b40008b4a 100644 --- a/jdk/src/share/native/sun/security/ec/impl/logtab.h +++ b/jdk/src/share/native/sun/security/ec/impl/logtab.h @@ -57,8 +57,6 @@ #ifndef _LOGTAB_H #define _LOGTAB_H -#pragma ident "%Z%%M% %I% %E% SMI" - const float s_logv_2[] = { 0.000000000f, 0.000000000f, 1.000000000f, 0.630929754f, /* 0 1 2 3 */ 0.500000000f, 0.430676558f, 0.386852807f, 0.356207187f, /* 4 5 6 7 */ diff --git a/jdk/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h b/jdk/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h index 7cdacc7751b..889bfd1bed0 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h +++ b/jdk/src/share/native/sun/security/ec/impl/mp_gf2m-priv.h @@ -58,8 +58,6 @@ #ifndef _MP_GF2M_PRIV_H_ #define _MP_GF2M_PRIV_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi-priv.h" extern const mp_digit mp_gf2m_sqr_tb[16]; diff --git a/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.c b/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.c index beb798c10b2..2c021c88a24 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.c +++ b/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.c @@ -55,8 +55,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mp_gf2m.h" #include "mp_gf2m-priv.h" #include "mplogic.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.h b/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.h index dff8094f507..f689ba35358 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.h +++ b/jdk/src/share/native/sun/security/ec/impl/mp_gf2m.h @@ -58,8 +58,6 @@ #ifndef _MP_GF2M_H_ #define _MP_GF2M_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" mp_err mp_badd(const mp_int *a, const mp_int *b, mp_int *c); diff --git a/jdk/src/share/native/sun/security/ec/impl/mpi-config.h b/jdk/src/share/native/sun/security/ec/impl/mpi-config.h index c892fbecf3c..4c2b22b9f12 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpi-config.h +++ b/jdk/src/share/native/sun/security/ec/impl/mpi-config.h @@ -57,8 +57,6 @@ #ifndef _MPI_CONFIG_H #define _MPI_CONFIG_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi-config.h,v 1.5 2004/04/25 15:03:10 gerv%gerv.net Exp $ */ /* diff --git a/jdk/src/share/native/sun/security/ec/impl/mpi-priv.h b/jdk/src/share/native/sun/security/ec/impl/mpi-priv.h index a5fccf153cc..9a80f23d02f 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpi-priv.h +++ b/jdk/src/share/native/sun/security/ec/impl/mpi-priv.h @@ -63,8 +63,6 @@ #ifndef _MPI_PRIV_H #define _MPI_PRIV_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi-priv.h,v 1.20 2005/11/22 07:16:43 relyea%netscape.com Exp $ */ #include "mpi.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/mpi.c b/jdk/src/share/native/sun/security/ec/impl/mpi.c index e3558a26e81..a495b998598 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpi.c +++ b/jdk/src/share/native/sun/security/ec/impl/mpi.c @@ -54,12 +54,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi.c,v 1.45 2006/09/29 20:12:21 alexei.volkov.bugs%sun.com Exp $ */ #include "mpi-priv.h" @@ -1148,7 +1146,7 @@ mp_err mp_expt(mp_int *a, mp_int *b, mp_int *c) mp_int s, x; mp_err res; mp_digit d; - int dig, bit; + unsigned int dig, bit; ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG); @@ -1523,7 +1521,7 @@ mp_err s_mp_exptmod(const mp_int *a, const mp_int *b, const mp_int *m, mp_int *c mp_int s, x, mu; mp_err res; mp_digit d; - int dig, bit; + unsigned int dig, bit; ARGCHK(a != NULL && b != NULL && c != NULL, MP_BADARG); @@ -2057,7 +2055,7 @@ mp_size mp_trailing_zeros(const mp_int *mp) { mp_digit d; mp_size n = 0; - int ix; + unsigned int ix; if (!mp || !MP_DIGITS(mp) || !mp_cmp_z(mp)) return n; @@ -2900,9 +2898,9 @@ void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count) /* Allocate ni records of nb bytes each, and return a pointer to that */ void *s_mp_alloc(size_t nb, size_t ni, int kmflag) { - mp_int *mp; ++mp_allocs; #ifdef _KERNEL + mp_int *mp; mp = kmem_zalloc(nb * ni, kmflag); if (mp != NULL) FLAG(mp) = kmflag; @@ -3112,7 +3110,7 @@ void s_mp_div_2(mp_int *mp) mp_err s_mp_mul_2(mp_int *mp) { mp_digit *pd; - int ix, used; + unsigned int ix, used; mp_digit kin = 0; /* Shift digits leftward by 1 bit */ @@ -4663,7 +4661,7 @@ char s_mp_todigit(mp_digit val, int r, int low) { char ch; - if(val >= r) + if(val >= (unsigned int)r) return 0; ch = s_dmap_1[val]; @@ -4778,7 +4776,7 @@ mp_err mp_to_unsigned_octets(const mp_int *mp, unsigned char *str, mp_size maxlen) { int ix, pos = 0; - int bytes; + unsigned int bytes; ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG); @@ -4810,7 +4808,7 @@ mp_err mp_to_signed_octets(const mp_int *mp, unsigned char *str, mp_size maxlen) { int ix, pos = 0; - int bytes; + unsigned int bytes; ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG); @@ -4850,7 +4848,7 @@ mp_err mp_to_fixlen_octets(const mp_int *mp, unsigned char *str, mp_size length) { int ix, pos = 0; - int bytes; + unsigned int bytes; ARGCHK(mp != NULL && str != NULL && !SIGN(mp), MP_BADARG); diff --git a/jdk/src/share/native/sun/security/ec/impl/mpi.h b/jdk/src/share/native/sun/security/ec/impl/mpi.h index 4933033d571..d80657e5657 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpi.h +++ b/jdk/src/share/native/sun/security/ec/impl/mpi.h @@ -60,8 +60,6 @@ #ifndef _MPI_H #define _MPI_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpi.h,v 1.22 2004/04/27 23:04:36 gerv%gerv.net Exp $ */ #include "mpi-config.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/mplogic.c b/jdk/src/share/native/sun/security/ec/impl/mplogic.c index 531a682a8e4..8de8306ea9e 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mplogic.c +++ b/jdk/src/share/native/sun/security/ec/impl/mplogic.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mplogic.c,v 1.15 2004/04/27 23:04:36 gerv%gerv.net Exp $ */ #include "mpi-priv.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/mplogic.h b/jdk/src/share/native/sun/security/ec/impl/mplogic.h index d384ea7f395..a2f7714bffb 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mplogic.h +++ b/jdk/src/share/native/sun/security/ec/impl/mplogic.h @@ -59,8 +59,6 @@ #ifndef _MPLOGIC_H #define _MPLOGIC_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mplogic.h,v 1.7 2004/04/27 23:04:36 gerv%gerv.net Exp $ */ #include "mpi.h" diff --git a/jdk/src/share/native/sun/security/ec/impl/mpmontg.c b/jdk/src/share/native/sun/security/ec/impl/mpmontg.c index a6713751a29..c1762847a5e 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpmontg.c +++ b/jdk/src/share/native/sun/security/ec/impl/mpmontg.c @@ -56,8 +56,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* $Id: mpmontg.c,v 1.20 2006/08/29 02:41:38 nelson%bolyard.com Exp $ */ /* This file implements moduluar exponentiation using Montgomery's diff --git a/jdk/src/share/native/sun/security/ec/impl/mpprime.h b/jdk/src/share/native/sun/security/ec/impl/mpprime.h index a648b0bbfef..b9012af4b31 100644 --- a/jdk/src/share/native/sun/security/ec/impl/mpprime.h +++ b/jdk/src/share/native/sun/security/ec/impl/mpprime.h @@ -60,8 +60,6 @@ #ifndef _MP_PRIME_H #define _MP_PRIME_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mpi.h" extern const int prime_tab_size; /* number of primes available */ diff --git a/jdk/src/share/native/sun/security/ec/impl/oid.c b/jdk/src/share/native/sun/security/ec/impl/oid.c index 9fc2798f418..e5a76992bf9 100644 --- a/jdk/src/share/native/sun/security/ec/impl/oid.c +++ b/jdk/src/share/native/sun/security/ec/impl/oid.c @@ -50,12 +50,10 @@ * *********************************************************************** */ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifndef _WIN32 @@ -433,8 +431,7 @@ SECOidData * SECOID_FindOID(const SECItem *oid) { SECOidData *po; - SECOidData *ret; - int i; + SECOidData *ret = NULL; if (oid->len == 8) { if (oid->data[6] == 0x00) { @@ -454,8 +451,6 @@ SECOID_FindOID(const SECItem *oid) po = &SECG_oids[oid->data[4]]; if (memcmp(oid->data, po->oid.data, 5) == 0) ret = po; - } else { - ret = NULL; } return(ret); } diff --git a/jdk/src/share/native/sun/security/ec/impl/secitem.c b/jdk/src/share/native/sun/security/ec/impl/secitem.c index 45d255fda74..6cfa5dea4b2 100644 --- a/jdk/src/share/native/sun/security/ec/impl/secitem.c +++ b/jdk/src/share/native/sun/security/ec/impl/secitem.c @@ -53,8 +53,6 @@ * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Support routines for SECItem data structure. * diff --git a/jdk/src/share/native/sun/security/ec/impl/secoidt.h b/jdk/src/share/native/sun/security/ec/impl/secoidt.h index b63df8c4e46..ea5da257ad7 100644 --- a/jdk/src/share/native/sun/security/ec/impl/secoidt.h +++ b/jdk/src/share/native/sun/security/ec/impl/secoidt.h @@ -57,8 +57,6 @@ #ifndef _SECOIDT_H_ #define _SECOIDT_H_ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * secoidt.h - public data structures for ASN.1 OID functions * From 4940eacbf740e011fdb5986149e20e109e513436 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 3 Feb 2011 21:30:08 -0500 Subject: [PATCH 47/84] 7017009: Secondary out of c-heap memory error reporting out of memory Use os::malloc() to allocate buffer to read elf symbols and check for null Reviewed-by: zgu, phh, dsamersoff, dholmes, dcubed --- hotspot/src/share/vm/utilities/elfSymbolTable.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/utilities/elfSymbolTable.cpp b/hotspot/src/share/vm/utilities/elfSymbolTable.cpp index 45f0b73bbc9..22773aa546b 100644 --- a/hotspot/src/share/vm/utilities/elfSymbolTable.cpp +++ b/hotspot/src/share/vm/utilities/elfSymbolTable.cpp @@ -39,13 +39,14 @@ ElfSymbolTable::ElfSymbolTable(FILE* file, Elf_Shdr shdr) { // try to load the string table long cur_offset = ftell(file); if (cur_offset != -1) { - m_symbols = (Elf_Sym*)NEW_C_HEAP_ARRAY(char, shdr.sh_size); + // call malloc so we can back up if memory allocation fails. + m_symbols = (Elf_Sym*)os::malloc(shdr.sh_size); if (m_symbols) { if (fseek(file, shdr.sh_offset, SEEK_SET) || fread((void*)m_symbols, shdr.sh_size, 1, file) != 1 || fseek(file, cur_offset, SEEK_SET)) { m_status = Decoder::file_invalid; - FREE_C_HEAP_ARRAY(char, m_symbols); + os::free(m_symbols); m_symbols = NULL; } } @@ -59,7 +60,7 @@ ElfSymbolTable::ElfSymbolTable(FILE* file, Elf_Shdr shdr) { ElfSymbolTable::~ElfSymbolTable() { if (m_symbols != NULL) { - FREE_C_HEAP_ARRAY(char, m_symbols); + os::free(m_symbols); } if (m_next != NULL) { From e6aca17c499a8df7dc802c09743f822f860384a6 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Fri, 4 Feb 2011 09:52:37 +0000 Subject: [PATCH 48/84] 7017176: Several JNDI tests are mssing GPL header Reviewed-by: alanb --- jdk/test/com/sun/jndi/ldap/LdapName/Case.java | 23 +++++++++++++++++++ .../jndi/ldap/LdapName/EmptyNameSearch.java | 23 +++++++++++++++++++ .../sun/jndi/ldap/LdapName/UnescapeTest.java | 23 +++++++++++++++++++ .../com/sun/jndi/ldap/ReadTimeoutTest.java | 23 +++++++++++++++++++ 4 files changed, 92 insertions(+) diff --git a/jdk/test/com/sun/jndi/ldap/LdapName/Case.java b/jdk/test/com/sun/jndi/ldap/LdapName/Case.java index 774d93bdf29..e37b8d9ff86 100644 --- a/jdk/test/com/sun/jndi/ldap/LdapName/Case.java +++ b/jdk/test/com/sun/jndi/ldap/LdapName/Case.java @@ -1,3 +1,26 @@ +/* + * 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 4278094 diff --git a/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java b/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java index a3ca1bdf2f6..8a69abdc82f 100644 --- a/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java +++ b/jdk/test/com/sun/jndi/ldap/LdapName/EmptyNameSearch.java @@ -1,3 +1,26 @@ +/* + * 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 6997561 diff --git a/jdk/test/com/sun/jndi/ldap/LdapName/UnescapeTest.java b/jdk/test/com/sun/jndi/ldap/LdapName/UnescapeTest.java index a2f2821dd23..75ded9c80cb 100644 --- a/jdk/test/com/sun/jndi/ldap/LdapName/UnescapeTest.java +++ b/jdk/test/com/sun/jndi/ldap/LdapName/UnescapeTest.java @@ -1,3 +1,26 @@ +/* + * 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 4892070 diff --git a/jdk/test/com/sun/jndi/ldap/ReadTimeoutTest.java b/jdk/test/com/sun/jndi/ldap/ReadTimeoutTest.java index bf21c10ad52..b5349da69c2 100644 --- a/jdk/test/com/sun/jndi/ldap/ReadTimeoutTest.java +++ b/jdk/test/com/sun/jndi/ldap/ReadTimeoutTest.java @@ -1,3 +1,26 @@ +/* + * 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 6176036 From 6db39ae8a5c143408e3bcd0584ae496e0d1e5d5b Mon Sep 17 00:00:00 2001 From: Lance Andersen Date: Fri, 4 Feb 2011 09:07:00 -0500 Subject: [PATCH 49/84] 7014095: Broken link in java.sql package specification Reviewed-by: alanb --- jdk/src/share/classes/java/sql/package.html | 38 ++++++++++++++++----- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/jdk/src/share/classes/java/sql/package.html b/jdk/src/share/classes/java/sql/package.html index 88718c85d01..65d906b9a69 100644 --- a/jdk/src/share/classes/java/sql/package.html +++ b/jdk/src/share/classes/java/sql/package.html @@ -2,7 +2,7 @@ - + ${root}/src/share/classes ${root}/src/windows/classes @@ -39,6 +39,6 @@ ${bootstrap.jdk}/jre/lib/rt.jar ${root}/build/${platform}-${arch}/classes ${root}/build/javadoc/${name} - 1.5 + 1.7 diff --git a/jdk/make/netbeans/common/java-data-no-native.ent b/jdk/make/netbeans/common/java-data-no-native.ent index e7717f2d398..fdc06cfca34 100644 --- a/jdk/make/netbeans/common/java-data-no-native.ent +++ b/jdk/make/netbeans/common/java-data-no-native.ent @@ -31,12 +31,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --> - + ${root}/src/share/classes ${bootstrap.jdk}/jre/lib/rt.jar ${root}/build/${platform}-${arch}/classes ${root}/build/javadoc/${name} - 1.5 + 1.7 From 4f8fd33ba86e94674e633cd76d1dafb39635ba49 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Fri, 4 Feb 2011 13:17:30 -0800 Subject: [PATCH 52/84] 7005986: (zipfs) ZipPath.startsWith() fails because of the implementation of getName(index) Updated starsWith/endsWith to be consistent with default file system Reviewed-by: alanb --- .../zipfs/src/com/sun/nio/zipfs/ZipPath.java | 40 +++++++++++-------- jdk/test/demo/zipfs/PathOps.java | 26 +++++++++++- jdk/test/demo/zipfs/basic.sh | 2 +- 3 files changed, 49 insertions(+), 19 deletions(-) diff --git a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java index 0c5c1591bb2..b03ba2929eb 100644 --- a/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java +++ b/jdk/src/share/demo/nio/zipfs/src/com/sun/nio/zipfs/ZipPath.java @@ -265,7 +265,7 @@ public class ZipPath implements Path { @Override public boolean isAbsolute() { - return (this.path[0] == '/'); + return (this.path.length > 0 && path[0] == '/'); } @Override @@ -298,32 +298,40 @@ public class ZipPath implements Path { @Override public boolean startsWith(Path other) { final ZipPath o = checkPath(other); - if (o.isAbsolute() != this.isAbsolute()) + if (o.isAbsolute() != this.isAbsolute() || + o.path.length > this.path.length) return false; - final int oCount = o.getNameCount(); - if (getNameCount() < oCount) - return false; - for (int i = 0; i < oCount; i++) { - if (!o.getName(i).equals(getName(i))) + int olast = o.path.length; + for (int i = 0; i < olast; i++) { + if (o.path[i] != this.path[i]) return false; } - return true; + olast--; + return o.path.length == this.path.length || + o.path[olast] == '/' || + this.path[olast + 1] == '/'; } @Override public boolean endsWith(Path other) { final ZipPath o = checkPath(other); - if (o.isAbsolute()) - return this.isAbsolute() ? this.equals(o) : false; - int i = o.getNameCount(); - int j = this.getNameCount(); - if (j < i) + int olast = o.path.length - 1; + if (olast > 0 && o.path[olast] == '/') + olast--; + int last = this.path.length - 1; + if (last > 0 && this.path[last] == '/') + last--; + if (olast == -1) // o.path.length == 0 + return last == -1; + if ((o.isAbsolute() &&(!this.isAbsolute() || olast != last)) || + (last < olast)) return false; - for (--i, --j; i >= 0; i--, j--) { - if (!o.getName(i).equals(this.getName(j))) + for (; olast >= 0; olast--, last--) { + if (o.path[olast] != this.path[last]) return false; } - return true; + return o.path[olast + 1] == '/' || + last == -1 || this.path[last] == '/'; } @Override diff --git a/jdk/test/demo/zipfs/PathOps.java b/jdk/test/demo/zipfs/PathOps.java index f08ce4f723a..ea097396dbb 100644 --- a/jdk/test/demo/zipfs/PathOps.java +++ b/jdk/test/demo/zipfs/PathOps.java @@ -252,31 +252,41 @@ public class PathOps { .name("foo"); // startsWith + test("") + .starts("") + .notStarts("/"); test("/") .starts("/") .notStarts("/foo"); test("/foo") .starts("/") .starts("/foo") - .notStarts("/f"); + .notStarts("/f") + .notStarts(""); test("/foo/bar") .starts("/") .starts("/foo") + .starts("/foo/") .starts("/foo/bar") .notStarts("/f") .notStarts("foo") - .notStarts("foo/bar"); + .notStarts("foo/bar") + .notStarts(""); test("foo") .starts("foo") .notStarts("f"); test("foo/bar") .starts("foo") + .starts("foo/") .starts("foo/bar") .notStarts("f") .notStarts("/foo") .notStarts("/foo/bar"); // endsWith + test("") + .ends("") + .notEnds("/"); test("/") .ends("/") .notEnds("foo") @@ -288,14 +298,24 @@ public class PathOps { test("/foo/bar") .ends("bar") .ends("foo/bar") + .ends("foo/bar/") + .ends("/foo/bar") + .notEnds("/bar"); + test("/foo/bar/") + .ends("bar") + .ends("foo/bar") + .ends("foo/bar/") .ends("/foo/bar") .notEnds("/bar"); test("foo") .ends("foo"); test("foo/bar") .ends("bar") + .ends("bar/") + .ends("foo/bar/") .ends("foo/bar"); + // elements test("a/b/c") .element(0,"a") @@ -309,6 +329,8 @@ public class PathOps { .absolute(); test("tmp") .notAbsolute(); + test("") + .notAbsolute(); // resolve test("/tmp") diff --git a/jdk/test/demo/zipfs/basic.sh b/jdk/test/demo/zipfs/basic.sh index 6e326d0e8cf..4c4eddac920 100644 --- a/jdk/test/demo/zipfs/basic.sh +++ b/jdk/test/demo/zipfs/basic.sh @@ -21,7 +21,7 @@ # questions. # # @test -# @bug 6990846 7009092 7009085 7015391 7014948 +# @bug 6990846 7009092 7009085 7015391 7014948 7005986 # @summary Test ZipFileSystem demo # @build Basic PathOps ZipFSTester # @run shell basic.sh From b11e82495ac6d661167e1912c11c2eda29913620 Mon Sep 17 00:00:00 2001 From: Vinnie Ryan Date: Mon, 7 Feb 2011 09:11:26 +0000 Subject: [PATCH 53/84] 7017486: Need synchronized access when flushing the LDAP request queue Reviewed-by: alanb --- .../classes/com/sun/jndi/ldap/Connection.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java index dec38eb752d..94067617ae1 100644 --- a/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java +++ b/jdk/src/share/classes/com/sun/jndi/ldap/Connection.java @@ -656,14 +656,17 @@ public final class Connection implements Runnable { } nparent = notifyParent; } - } - if (nparent) { - LdapRequest ldr = pendingRequests; - while (ldr != null) { - ldr.notify(); - ldr = ldr.next; + if (nparent) { + LdapRequest ldr = pendingRequests; + while (ldr != null) { + + synchronized (ldr) { + ldr.notify(); + ldr = ldr.next; + } + } + parent.processConnectionClosure(); } - parent.processConnectionClosure(); } } From bc1f07b5872996aa60d3939ee2efbf61af3566a1 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 7 Feb 2011 13:53:36 +0000 Subject: [PATCH 54/84] 7012823: TEST_BUG: java/nio/MappedByteBuffer tests leave file mappingsthat prevent clean-up (win) Reviewed-by: forax --- jdk/test/java/nio/MappedByteBuffer/Force.java | 21 +++++++++------- .../java/nio/MappedByteBuffer/ZeroMap.java | 25 +++++++++++-------- 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/jdk/test/java/nio/MappedByteBuffer/Force.java b/jdk/test/java/nio/MappedByteBuffer/Force.java index bd66a31ff21..81f908bacee 100644 --- a/jdk/test/java/nio/MappedByteBuffer/Force.java +++ b/jdk/test/java/nio/MappedByteBuffer/Force.java @@ -37,14 +37,17 @@ public class Force { Random random = new Random(); long filesize = random.nextInt(3*1024*1024); int cut = random.nextInt((int)filesize); - File file = new File("Blah"); - RandomAccessFile raf = new RandomAccessFile(file, "rw"); - raf.setLength(filesize); - FileChannel fc = raf.getChannel(); - MappedByteBuffer buf1 = fc.map( - FileChannel.MapMode.READ_WRITE, cut, filesize-cut); - buf1.force(); - fc.close(); - raf.close(); + File file = File.createTempFile("Blah", null); + file.deleteOnExit(); + try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { + raf.setLength(filesize); + FileChannel fc = raf.getChannel(); + MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, cut, filesize-cut); + mbb.force(); + } + + // improve chance that mapped buffer will be unmapped + System.gc(); + Thread.sleep(500); } } diff --git a/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java b/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java index f80e72f803d..81cd3532d13 100644 --- a/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java +++ b/jdk/test/java/nio/MappedByteBuffer/ZeroMap.java @@ -37,16 +37,19 @@ public class ZeroMap { Random random = new Random(); long filesize = random.nextInt(1024*1024); int cut = random.nextInt((int)filesize); - File file = new File("Blah"); - RandomAccessFile raf = new RandomAccessFile(file, "rw"); - raf.setLength(filesize); - FileChannel fc = raf.getChannel(); - MappedByteBuffer buf1 = fc.map( - FileChannel.MapMode.READ_WRITE, cut, 0); - buf1.force(); - buf1.load(); - buf1.isLoaded(); - fc.close(); - raf.close(); + File file = File.createTempFile("Blah", null); + file.deleteOnExit(); + try (RandomAccessFile raf = new RandomAccessFile(file, "rw")) { + raf.setLength(filesize); + FileChannel fc = raf.getChannel(); + MappedByteBuffer mbb = fc.map(FileChannel.MapMode.READ_WRITE, cut, 0); + mbb.force(); + mbb.load(); + mbb.isLoaded(); + } + + // improve chance that mapped buffer will be unmapped + System.gc(); + Thread.sleep(500); } } From 6207a0fa9c00361096bb3474143affe96adbe47c Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 7 Feb 2011 13:55:40 +0000 Subject: [PATCH 55/84] 7003155: (fs) Paths.get() does not handle escaped octets correctly Reviewed-by: sherman --- .../classes/sun/nio/fs/UnixUriUtils.java | 65 +++++++--- .../java/nio/file/Path/UriImportExport.java | 117 ++++++++++++++---- 2 files changed, 139 insertions(+), 43 deletions(-) diff --git a/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java b/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java index d86431efc08..bd1e36a9025 100644 --- a/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java +++ b/jdk/src/solaris/classes/sun/nio/fs/UnixUriUtils.java @@ -25,8 +25,11 @@ package sun.nio.fs; +import java.nio.file.Path; +import java.io.File; import java.net.URI; import java.net.URISyntaxException; +import java.util.Arrays; /** * Unix specific Path <--> URI conversion @@ -38,7 +41,7 @@ class UnixUriUtils { /** * Converts URI to Path */ - static UnixPath fromUri(UnixFileSystem fs, URI uri) { + static Path fromUri(UnixFileSystem fs, URI uri) { if (!uri.isAbsolute()) throw new IllegalArgumentException("URI is not absolute"); if (uri.isOpaque()) @@ -53,22 +56,41 @@ class UnixUriUtils { if (uri.getQuery() != null) throw new IllegalArgumentException("URI has a query component"); - String path = uri.getPath(); - if (path.equals("")) - throw new IllegalArgumentException("URI path component is empty"); - if (path.endsWith("/") && (path.length() > 1)) { - // "/foo/" --> "/foo", but "/" --> "/" - path = path.substring(0, path.length() - 1); - } + // compatability with java.io.File + if (!uri.toString().startsWith("file:///")) + return new File(uri).toPath(); - // preserve bytes - byte[] result = new byte[path.length()]; - for (int i=0; i 1) + len--; + byte[] result = new byte[len]; + int rlen = 0; + int pos = 0; + while (pos < len) { + char c = p.charAt(pos++); + byte b; + if (c == '%') { + assert (pos+2) <= len; + char c1 = p.charAt(pos++); + char c2 = p.charAt(pos++); + b = (byte)((decode(c1) << 4) | decode(c2)); + if (b == 0) + throw new IllegalArgumentException("Nul character not allowed"); + } else { + assert c < 0x80; + b = (byte)c; + } + result[rlen++] = b; } + if (rlen != result.length) + result = Arrays.copyOf(result, rlen); + return new UnixPath(fs, result); } @@ -86,7 +108,7 @@ class UnixUriUtils { } else { sb.append('%'); sb.append(hexDigits[(c >> 4) & 0x0f]); - sb.append(hexDigits[(c >> 0) & 0x0f]); + sb.append(hexDigits[(c) & 0x0f]); } } @@ -164,6 +186,17 @@ class UnixUriUtils { return false; } + // decode + private static int decode(char c) { + if ((c >= '0') && (c <= '9')) + return c - '0'; + if ((c >= 'a') && (c <= 'f')) + return c - 'a' + 10; + if ((c >= 'A') && (c <= 'F')) + return c - 'A' + 10; + throw new AssertionError(); + } + // digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | // "8" | "9" private static final long L_DIGIT = lowMask('0', '9'); diff --git a/jdk/test/java/nio/file/Path/UriImportExport.java b/jdk/test/java/nio/file/Path/UriImportExport.java index c6a9dbf23f4..1db4d85d19e 100644 --- a/jdk/test/java/nio/file/Path/UriImportExport.java +++ b/jdk/test/java/nio/file/Path/UriImportExport.java @@ -22,7 +22,7 @@ */ /* @test - * @bug 4313887 + * @bug 4313887 7003155 * @summary Unit test for java.nio.file.Path */ @@ -36,42 +36,105 @@ public class UriImportExport { static final PrintStream log = System.out; static int failures = 0; - static void test(String fn, String expected) { + /** + * Test Path -> URI -> Path + */ + static void testPath(String s) { + Path path = Paths.get(s); + log.println(path); + URI uri = path.toUri(); + log.println(" --> " + uri); + Path result = Paths.get(uri); + log.println(" --> " + result); + if (!result.equals(path.toAbsolutePath())) { + log.println("FAIL: Expected " + path + ", got " + result); + failures++; + } log.println(); - Path p = Paths.get(fn); - log.println(p); - URI u = p.toUri(); - log.println(" --> " + u); - if (expected != null && !(u.toString().equals(expected))) { - log.println("FAIL: Expected " + expected); - failures++; - return; - } - Path q = Paths.get(u); - log.println(" --> " + q); - if (!p.toAbsolutePath().equals(q)) { - log.println("FAIL: Expected " + p + ", got " + q); - failures++; - return; - } } - static void test(String fn) { - test(fn, null); + /** + * Test Path -> (expected) URI -> Path + */ + static void testPath(String s, String expectedUri) { + Path path = Paths.get(s); + log.println(path); + URI uri = path.toUri(); + log.println(" --> " + uri); + if (!uri.toString().equals(expectedUri)) { + log.println("FAILED: Expected " + expectedUri + ", got " + uri); + failures++; + return; + } + Path result = Paths.get(uri); + log.println(" --> " + result); + if (!result.equals(path.toAbsolutePath())) { + log.println("FAIL: Expected " + path + ", got " + result); + failures++; + } + log.println(); + } + + /** + * Test URI -> Path -> URI + */ + static void testUri(String s) throws Exception { + URI uri = URI.create(s); + log.println(uri); + Path path = Paths.get(uri); + log.println(" --> " + path); + URI result = path.toUri(); + log.println(" --> " + result); + if (!result.equals(uri)) { + log.println("FAIL: Expected " + uri + ", got " + result); + failures++; + } + log.println(); + } + + /** + * Test URI -> Path fails with IllegalArgumentException + */ + static void testBadUri(String s) throws Exception { + URI uri = URI.create(s); + log.println(uri); + try { + Path path = Paths.get(uri); + log.format(" --> %s FAIL: Expected IllegalArgumentException\n", path); + failures++; + } catch (IllegalArgumentException expected) { + log.println(" --> IllegalArgumentException (expected)"); + } + log.println(); } public static void main(String[] args) throws Exception { - test("foo"); - test("/foo"); - test("/foo bar"); + testBadUri("file:foo"); + testBadUri("file:/foo?q"); + testBadUri("file:/foo#f"); String osname = System.getProperty("os.name"); if (osname.startsWith("Windows")) { - test("C:\\foo"); - test("C:foo"); - test("\\\\rialto.dublin.com\\share\\"); - test("\\\\fe80--203-baff-fe5a-749ds1.ipv6-literal.net\\share\\missing", + testPath("C:\\doesnotexist"); + testPath("C:doesnotexist"); + testPath("\\\\server.nowhere.oracle.com\\share\\"); + testPath("\\\\fe80--203-baff-fe5a-749ds1.ipv6-literal.net\\share\\missing", "file://[fe80::203:baff:fe5a:749d%1]/share/missing"); + } else { + testPath("doesnotexist"); + testPath("/doesnotexist"); + testPath("/does not exist"); + testUri("file:///"); + testUri("file:///foo/bar/doesnotexist"); + testUri("file:/foo/bar/doesnotexist"); + + // file:///foo/bar/\u0440\u0443\u0441\u0441\u043A\u0438\u0439 (Russian) + testUri("file:///foo/bar/%D1%80%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9"); + + // invalid + testBadUri("file:foo"); + testBadUri("file://server/foo"); + testBadUri("file:///foo%00"); } if (failures > 0) From a0b7ecd3d1bae05f46cdaee038d675d5d51886b7 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Mon, 7 Feb 2011 14:08:47 +0000 Subject: [PATCH 56/84] 7016898: PlainSocketImpl.fd is null on Windows Reviewed-by: alanb --- .../classes/java/net/PlainSocketImpl.java | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/jdk/src/windows/classes/java/net/PlainSocketImpl.java b/jdk/src/windows/classes/java/net/PlainSocketImpl.java index 3a963627425..cc25c39dc72 100644 --- a/jdk/src/windows/classes/java/net/PlainSocketImpl.java +++ b/jdk/src/windows/classes/java/net/PlainSocketImpl.java @@ -138,6 +138,9 @@ class PlainSocketImpl extends AbstractPlainSocketImpl protected synchronized void create(boolean stream) throws IOException { impl.create(stream); + + // set fd to delegate's fd to be compatible with older releases + this.fd = impl.fd; } protected void connect(String host, int port) @@ -166,7 +169,7 @@ class PlainSocketImpl extends AbstractPlainSocketImpl impl.doConnect(address, port, timeout); } - protected synchronized void bind(InetAddress address, int lport) + protected synchronized void bind(InetAddress address, int lport) throws IOException { impl.bind(address, lport); @@ -174,9 +177,13 @@ class PlainSocketImpl extends AbstractPlainSocketImpl protected synchronized void accept(SocketImpl s) throws IOException { // pass in the real impl not the wrapper. - ((PlainSocketImpl)s).impl.address = new InetAddress(); - ((PlainSocketImpl)s).impl.fd = new FileDescriptor(); - impl.accept(((PlainSocketImpl)s).impl); + SocketImpl delegate = ((PlainSocketImpl)s).impl; + delegate.address = new InetAddress(); + delegate.fd = new FileDescriptor(); + impl.accept(delegate); + + // set fd to delegate's fd to be compatible with older releases + s.fd = delegate.fd; } void setFileDescriptor(FileDescriptor fd) { @@ -208,11 +215,21 @@ class PlainSocketImpl extends AbstractPlainSocketImpl } protected void close() throws IOException { - impl.close(); + try { + impl.close(); + } finally { + // set fd to delegate's fd to be compatible with older releases + this.fd = null; + } } void reset() throws IOException { - impl.reset(); + try { + impl.reset(); + } finally { + // set fd to delegate's fd to be compatible with older releases + this.fd = null; + } } protected void shutdownInput() throws IOException { From 8c1c23cb0a393145b36abd987a208ad203cc6e80 Mon Sep 17 00:00:00 2001 From: Alan Bateman Date: Mon, 7 Feb 2011 18:01:32 +0000 Subject: [PATCH 57/84] 7017454: Residual warnings in sun/nio/** and java/io native code (win64) Reviewed-by: chegar --- jdk/src/share/native/java/io/io_util.c | 12 +++++------ .../native/java/io/WinNTFileSystem_md.c | 20 +++++++++---------- .../windows/native/java/io/canonicalize_md.c | 4 ++-- jdk/src/windows/native/java/io/io_util_md.c | 6 +++--- jdk/src/windows/native/sun/nio/ch/Iocp.c | 5 +++-- .../sun/nio/fs/RegistryFileTypeDetector.c | 2 +- .../sun/nio/fs/WindowsNativeDispatcher.c | 13 ++++++------ 7 files changed, 32 insertions(+), 30 deletions(-) diff --git a/jdk/src/share/native/java/io/io_util.c b/jdk/src/share/native/java/io/io_util.c index 4689ef72afa..68a24bbab53 100644 --- a/jdk/src/share/native/java/io/io_util.c +++ b/jdk/src/share/native/java/io/io_util.c @@ -44,7 +44,7 @@ readSingle(JNIEnv *env, jobject this, jfieldID fid) { JNU_ThrowIOException(env, "Stream Closed"); return -1; } - nread = IO_Read(fd, &ret, 1); + nread = (jint)IO_Read(fd, &ret, 1); if (nread == 0) { /* EOF */ return -1; } else if (nread == JVM_IO_ERR) { /* error */ @@ -108,7 +108,7 @@ readBytes(JNIEnv *env, jobject this, jbyteArray bytes, JNU_ThrowIOException(env, "Stream Closed"); nread = -1; } else { - nread = IO_Read(fd, buf, len); + nread = (jint)IO_Read(fd, buf, len); if (nread > 0) { (*env)->SetByteArrayRegion(env, bytes, off, nread, (jbyte *)buf); } else if (nread == JVM_IO_ERR) { @@ -137,9 +137,9 @@ writeSingle(JNIEnv *env, jobject this, jint byte, jboolean append, jfieldID fid) return; } if (append == JNI_TRUE) { - n = IO_Append(fd, &c, 1); + n = (jint)IO_Append(fd, &c, 1); } else { - n = IO_Write(fd, &c, 1); + n = (jint)IO_Write(fd, &c, 1); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); @@ -190,9 +190,9 @@ writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, break; } if (append == JNI_TRUE) { - n = IO_Append(fd, buf+off, len); + n = (jint)IO_Append(fd, buf+off, len); } else { - n = IO_Write(fd, buf+off, len); + n = (jint)IO_Write(fd, buf+off, len); } if (n == JVM_IO_ERR) { JNU_ThrowIOExceptionWithLastError(env, "Write error"); diff --git a/jdk/src/windows/native/java/io/WinNTFileSystem_md.c b/jdk/src/windows/native/java/io/WinNTFileSystem_md.c index 23ff9e5dfec..566b697eb8f 100644 --- a/jdk/src/windows/native/java/io/WinNTFileSystem_md.c +++ b/jdk/src/windows/native/java/io/WinNTFileSystem_md.c @@ -220,19 +220,19 @@ Java_java_io_WinNTFileSystem_canonicalize0(JNIEnv *env, jobject this, /*we estimate the max length of memory needed as "currentDir. length + pathname.length" */ - int len = wcslen(path); + int len = (int)wcslen(path); len += currentDirLength(path, len); if (len > MAX_PATH_LENGTH - 1) { WCHAR *cp = (WCHAR*)malloc(len * sizeof(WCHAR)); if (cp != NULL) { if (wcanonicalize(path, cp, len) >= 0) { - rv = (*env)->NewString(env, cp, wcslen(cp)); + rv = (*env)->NewString(env, cp, (jsize)wcslen(cp)); } free(cp); } } else if (wcanonicalize(path, canonicalPath, MAX_PATH_LENGTH) >= 0) { - rv = (*env)->NewString(env, canonicalPath, wcslen(canonicalPath)); + rv = (*env)->NewString(env, canonicalPath, (jsize)wcslen(canonicalPath)); } } END_UNICODE_STRING(env, path); if (rv == NULL) { @@ -251,14 +251,14 @@ Java_java_io_WinNTFileSystem_canonicalizeWithPrefix0(JNIEnv *env, jobject this, WCHAR canonicalPath[MAX_PATH_LENGTH]; WITH_UNICODE_STRING(env, canonicalPrefixString, canonicalPrefix) { WITH_UNICODE_STRING(env, pathWithCanonicalPrefixString, pathWithCanonicalPrefix) { - int len = wcslen(canonicalPrefix) + MAX_PATH; + int len = (int)wcslen(canonicalPrefix) + MAX_PATH; if (len > MAX_PATH_LENGTH) { WCHAR *cp = (WCHAR*)malloc(len * sizeof(WCHAR)); if (cp != NULL) { if (wcanonicalizeWithPrefix(canonicalPrefix, pathWithCanonicalPrefix, cp, len) >= 0) { - rv = (*env)->NewString(env, cp, wcslen(cp)); + rv = (*env)->NewString(env, cp, (jsize)wcslen(cp)); } free(cp); } @@ -266,7 +266,7 @@ Java_java_io_WinNTFileSystem_canonicalizeWithPrefix0(JNIEnv *env, jobject this, if (wcanonicalizeWithPrefix(canonicalPrefix, pathWithCanonicalPrefix, canonicalPath, MAX_PATH_LENGTH) >= 0) { - rv = (*env)->NewString(env, canonicalPath, wcslen(canonicalPath)); + rv = (*env)->NewString(env, canonicalPath, (jsize)wcslen(canonicalPath)); } } END_UNICODE_STRING(env, pathWithCanonicalPrefix); } END_UNICODE_STRING(env, canonicalPrefix); @@ -358,7 +358,7 @@ Java_java_io_WinNTFileSystem_getBooleanAttributes(JNIEnv *env, jobject this, } else { /* pagefile.sys is a special case */ if (GetLastError() == ERROR_SHARING_VIOLATION) { rv = java_io_FileSystem_BA_EXISTS; - if ((pathlen = wcslen(pathbuf)) >= SPECIALFILE_NAMELEN && + if ((pathlen = (jint)wcslen(pathbuf)) >= SPECIALFILE_NAMELEN && (_wcsicmp(pathbuf + pathlen - SPECIALFILE_NAMELEN, L"pagefile.sys") == 0) || (_wcsicmp(pathbuf + pathlen - SPECIALFILE_NAMELEN, @@ -625,7 +625,7 @@ Java_java_io_WinNTFileSystem_list(JNIEnv *env, jobject this, jobject file) } /* Remove trailing space chars from directory name */ - len = wcslen(search_path); + len = (int)wcslen(search_path); while (search_path[len-1] == ' ') { len--; } @@ -668,7 +668,7 @@ Java_java_io_WinNTFileSystem_list(JNIEnv *env, jobject this, jobject file) || !wcscmp(find_data.cFileName, L"..")) continue; name = (*env)->NewString(env, find_data.cFileName, - wcslen(find_data.cFileName)); + (jsize)wcslen(find_data.cFileName)); if (name == NULL) return NULL; // error; if (len == maxlen) { @@ -819,7 +819,7 @@ Java_java_io_WinNTFileSystem_getDriveDirectory(JNIEnv *env, jobject this, jchar *pf = p; if (p == NULL) return NULL; if (iswalpha(*p) && (p[1] == L':')) p += 2; - ret = (*env)->NewString(env, p, wcslen(p)); + ret = (*env)->NewString(env, p, (jsize)wcslen(p)); free (pf); return ret; } diff --git a/jdk/src/windows/native/java/io/canonicalize_md.c b/jdk/src/windows/native/java/io/canonicalize_md.c index f829ce3371f..e0eadb6b82f 100644 --- a/jdk/src/windows/native/java/io/canonicalize_md.c +++ b/jdk/src/windows/native/java/io/canonicalize_md.c @@ -479,7 +479,7 @@ wcanonicalize(WCHAR *orig_path, WCHAR *result, int size) assert(*src == L'\\'); /* Invariant */ *p = L'\0'; /* Temporarily clear separator */ - if ((pathlen = wcslen(path)) > MAX_PATH - 1) { + if ((pathlen = (int)wcslen(path)) > MAX_PATH - 1) { pathbuf = getPrefixed(path, pathlen); h = FindFirstFileW(pathbuf, &fd); /* Look up prefix */ free(pathbuf); @@ -538,7 +538,7 @@ wcanonicalizeWithPrefix(WCHAR *canonicalPrefix, WCHAR *pathWithCanonicalPrefix, dend = dst + size; /* Don't go to or past here */ - if ((pathlen=wcslen(pathWithCanonicalPrefix)) > MAX_PATH - 1) { + if ((pathlen=(int)wcslen(pathWithCanonicalPrefix)) > MAX_PATH - 1) { pathbuf = getPrefixed(pathWithCanonicalPrefix, pathlen); h = FindFirstFileW(pathbuf, &fd); /* Look up prefix */ free(pathbuf); diff --git a/jdk/src/windows/native/java/io/io_util_md.c b/jdk/src/windows/native/java/io/io_util_md.c index 3b6723eed6b..81a69392096 100644 --- a/jdk/src/windows/native/java/io/io_util_md.c +++ b/jdk/src/windows/native/java/io/io_util_md.c @@ -104,7 +104,7 @@ currentDirLength(const WCHAR* ps, int pathlen) { else return 0; /* invalid drive name. */ dir = currentDir(di); if (dir != NULL){ - dirlen = wcslen(dir); + dirlen = (int)wcslen(dir); free(dir); } return dirlen; @@ -115,7 +115,7 @@ currentDirLength(const WCHAR* ps, int pathlen) { int dirlen = -1; dir = _wgetcwd(NULL, MAX_PATH); if (dir != NULL) { - curDirLenCached = wcslen(dir); + curDirLenCached = (int)wcslen(dir); free(dir); } } @@ -165,7 +165,7 @@ pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE) { int max_path = 248; /* CreateDirectoryW() has the limit of 248 */ WITH_UNICODE_STRING(env, path, ps) { - pathlen = wcslen(ps); + pathlen = (int)wcslen(ps); if (pathlen != 0) { if (pathlen > 2 && (ps[0] == L'\\' && ps[1] == L'\\' || //UNC diff --git a/jdk/src/windows/native/sun/nio/ch/Iocp.c b/jdk/src/windows/native/sun/nio/ch/Iocp.c index d962c166caa..773a870ca2b 100644 --- a/jdk/src/windows/native/sun/nio/ch/Iocp.c +++ b/jdk/src/windows/native/sun/nio/ch/Iocp.c @@ -72,9 +72,10 @@ JNIEXPORT jlong JNICALL Java_sun_nio_ch_Iocp_createIoCompletionPort(JNIEnv* env, jclass this, jlong handle, jlong existingPort, jint completionKey, jint concurrency) { + ULONG_PTR ck = completionKey; HANDLE port = CreateIoCompletionPort((HANDLE)jlong_to_ptr(handle), (HANDLE)jlong_to_ptr(existingPort), - (DWORD)completionKey, + ck, (DWORD)concurrency); if (port == NULL) { JNU_ThrowIOExceptionWithLastError(env, "CreateIoCompletionPort failed"); @@ -96,7 +97,7 @@ Java_sun_nio_ch_Iocp_getQueuedCompletionStatus(JNIEnv* env, jclass this, jlong completionPort, jobject obj) { DWORD bytesTransferred; - DWORD completionKey; + ULONG_PTR completionKey; OVERLAPPED *lpOverlapped; BOOL res; diff --git a/jdk/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c b/jdk/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c index a07718e480d..6d082271015 100644 --- a/jdk/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c +++ b/jdk/src/windows/native/sun/nio/fs/RegistryFileTypeDetector.c @@ -51,7 +51,7 @@ Java_sun_nio_fs_RegistryFileTypeDetector_queryStringValue(JNIEnv* env, jclass th res = RegQueryValueExW(hKey, lpValueName, NULL, &type, (LPBYTE)&data, &size); if (res == ERROR_SUCCESS) { if (type == REG_SZ) { - jsize len = wcslen((WCHAR*)data); + jsize len = (jsize)wcslen((WCHAR*)data); result = (*env)->NewString(env, (const jchar*)&data, len); } } diff --git a/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c b/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c index 61a63b484e5..d9d8a9d7cb2 100644 --- a/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c +++ b/jdk/src/windows/native/sun/nio/fs/WindowsNativeDispatcher.c @@ -368,7 +368,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstFile0(JNIEnv* env, jclass this, HANDLE handle = FindFirstFileW(lpFileName, &data); if (handle != INVALID_HANDLE_VALUE) { - jstring name = (*env)->NewString(env, data.cFileName, wcslen(data.cFileName)); + jstring name = (*env)->NewString(env, data.cFileName, (jsize)wcslen(data.cFileName)); if (name == NULL) return; (*env)->SetLongField(env, obj, findFirst_handle, ptr_to_jlong(handle)); @@ -401,7 +401,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindNextFile(JNIEnv* env, jclass this, WIN32_FIND_DATAW* data = (WIN32_FIND_DATAW*)jlong_to_ptr(dataAddress); if (FindNextFileW(h, data) != 0) { - return (*env)->NewString(env, data->cFileName, wcslen(data->cFileName)); + return (*env)->NewString(env, data->cFileName, (jsize)wcslen(data->cFileName)); } else { if (GetLastError() != ERROR_NO_MORE_FILES) throwWindowsException(env, GetLastError()); @@ -424,7 +424,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindFirstStream0(JNIEnv* env, jclass thi handle = (*FindFirstStream_func)(lpFileName, FindStreamInfoStandard, &data, 0); if (handle != INVALID_HANDLE_VALUE) { - jstring name = (*env)->NewString(env, data.cStreamName, wcslen(data.cStreamName)); + jstring name = (*env)->NewString(env, data.cStreamName, (jsize)wcslen(data.cStreamName)); if (name == NULL) return; (*env)->SetLongField(env, obj, findStream_handle, ptr_to_jlong(handle)); @@ -452,7 +452,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_FindNextStream(JNIEnv* env, jclass this, } if ((*FindNextStream_func)(h, &data) != 0) { - return (*env)->NewString(env, data.cStreamName, wcslen(data.cStreamName)); + return (*env)->NewString(env, data.cStreamName, (jsize)wcslen(data.cStreamName)); } else { if (GetLastError() != ERROR_HANDLE_EOF) throwWindowsException(env, GetLastError()); @@ -1224,9 +1224,10 @@ JNIEXPORT jlong JNICALL Java_sun_nio_fs_WindowsNativeDispatcher_CreateIoCompletionPort(JNIEnv* env, jclass this, jlong fileHandle, jlong existingPort, jint completionKey) { + ULONG_PTR ck = completionKey; HANDLE port = CreateIoCompletionPort((HANDLE)jlong_to_ptr(fileHandle), (HANDLE)jlong_to_ptr(existingPort), - (DWORD)completionKey, + ck, 0); if (port == NULL) { throwWindowsException(env, GetLastError()); @@ -1239,7 +1240,7 @@ Java_sun_nio_fs_WindowsNativeDispatcher_GetQueuedCompletionStatus0(JNIEnv* env, jlong completionPort, jobject obj) { DWORD bytesTransferred; - DWORD completionKey; + ULONG_PTR completionKey; OVERLAPPED *lpOverlapped; BOOL res; From 4c2196918e0dd7b1cf2ed7db8aa4236a7acacccd Mon Sep 17 00:00:00 2001 From: Alexander Potochkin Date: Mon, 7 Feb 2011 21:15:51 +0300 Subject: [PATCH 58/84] 7016942: Revert a refactoring in TooltipManager to allow reflection hack Reviewed-by: rupashka --- .../share/classes/javax/swing/ToolTipManager.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/ToolTipManager.java b/jdk/src/share/classes/javax/swing/ToolTipManager.java index 4088ac3c2d5..b985254f6fa 100644 --- a/jdk/src/share/classes/javax/swing/ToolTipManager.java +++ b/jdk/src/share/classes/javax/swing/ToolTipManager.java @@ -75,6 +75,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener private MouseMotionListener moveBeforeEnterListener = null; private KeyListener accessibilityKeyListener = null; + private KeyStroke postTip; + private KeyStroke hideTip; + // PENDING(ges) protected boolean lightWeightPopupEnabled = true; protected boolean heavyWeightPopupEnabled = false; @@ -89,6 +92,9 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener moveBeforeEnterListener = new MoveBeforeEnterListener(); accessibilityKeyListener = new AccessibilityKeyListener(); + + postTip = KeyStroke.getKeyStroke(KeyEvent.VK_F1, InputEvent.CTRL_MASK); + hideTip = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); } /** @@ -805,13 +811,13 @@ public class ToolTipManager extends MouseAdapter implements MouseMotionListener public void keyPressed(KeyEvent e) { if (!e.isConsumed()) { JComponent source = (JComponent) e.getComponent(); - if (e.getKeyCode() == KeyEvent.VK_ESCAPE) { + KeyStroke keyStrokeForEvent = KeyStroke.getKeyStrokeForEvent(e); + if (hideTip.equals(keyStrokeForEvent)) { if (tipWindow != null) { hide(source); e.consume(); } - } else if (e.getKeyCode() == KeyEvent.VK_F1 - && e.getModifiers() == Event.CTRL_MASK) { + } else if (postTip.equals(keyStrokeForEvent)) { // Shown tooltip will be hidden ToolTipManager.this.show(source); e.consume(); From 98f1ff044f0b05036e205c0e5bc895f254f9a206 Mon Sep 17 00:00:00 2001 From: Alexander Potochkin Date: Mon, 7 Feb 2011 21:34:31 +0300 Subject: [PATCH 59/84] 6979537: closed/javax/swing/JSplitPane/UnitTest/UnitTest.java fails Reviewed-by: rupashka --- .../javax/swing/plaf/basic/BasicSplitPaneUI.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java index bf97bff882c..e4e82b1bf10 100644 --- a/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java +++ b/jdk/src/share/classes/javax/swing/plaf/basic/BasicSplitPaneUI.java @@ -342,12 +342,10 @@ public class BasicSplitPaneUI extends SplitPaneUI setOrientation(splitPane.getOrientation()); - // This plus 2 here is to provide backwards consistancy. Previously, - // the old size did not include the 2 pixel border around the divider, - // it now does. - Integer dividerSize = (Integer)UIManager.get("SplitPane.dividerSize"); - if (divider == null) dividerSize = 10; - LookAndFeel.installProperty(splitPane, "dividerSize", dividerSize); + // note: don't rename this temp variable to dividerSize + // since it will conflict with "this.dividerSize" field + Integer temp = (Integer)UIManager.get("SplitPane.dividerSize"); + LookAndFeel.installProperty(splitPane, "dividerSize", temp == null? 10: temp); divider.setDividerSize(splitPane.getDividerSize()); dividerSize = divider.getDividerSize(); From c4ddbc7c87061e3c4387531243c2989b1a6ce2f3 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Mon, 7 Feb 2011 14:36:26 -0500 Subject: [PATCH 60/84] 6472925: OutOfMemoryError fails to generate stack trace as it now ought Print an additional message for OOM during stack trace printing Reviewed-by: dholmes, phh, acorn, kamg, dcubed --- hotspot/src/share/vm/runtime/thread.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 93eb9df190f..2d61c80e493 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1611,7 +1611,15 @@ void JavaThread::exit(bool destroy_vm, ExitType exit_type) { uncaught_exception, // Arg 2 THREAD); } - CLEAR_PENDING_EXCEPTION; + if (HAS_PENDING_EXCEPTION) { + ResourceMark rm(this); + jio_fprintf(defaultStream::error_stream(), + "\nException: %s thrown from the UncaughtExceptionHandler" + " in thread \"%s\"\n", + Klass::cast(pending_exception()->klass())->external_name(), + get_thread_name()); + CLEAR_PENDING_EXCEPTION; + } } } From 4b61d914f1ed55e20ba2122ba694feac337944df Mon Sep 17 00:00:00 2001 From: Denis Lila Date: Tue, 8 Feb 2011 09:22:49 -0500 Subject: [PATCH 61/84] 7016856: dashing performance was reduced during latest changes to the OpenJDK rasterizer Optimized dashing, rasterizing, and the flow of transformed coordinates Reviewed-by: flar --- .../classes/sun/java2d/pisces/Curve.java | 88 +- .../classes/sun/java2d/pisces/Dasher.java | 160 ++-- .../classes/sun/java2d/pisces/Helpers.java | 151 ++-- .../sun/java2d/pisces/PiscesCache.java | 2 +- .../java2d/pisces/PiscesRenderingEngine.java | 56 +- .../java2d/pisces/PiscesTileGenerator.java | 2 +- .../classes/sun/java2d/pisces/Renderer.java | 763 ++++++------------ .../classes/sun/java2d/pisces/Stroker.java | 78 +- .../pisces/TransformingPathConsumer2D.java | 204 ++++- 9 files changed, 719 insertions(+), 785 deletions(-) diff --git a/jdk/src/share/classes/sun/java2d/pisces/Curve.java b/jdk/src/share/classes/sun/java2d/pisces/Curve.java index e613a264cbf..0cd59fba3b7 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Curve.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Curve.java @@ -27,7 +27,7 @@ package sun.java2d.pisces; import java.util.Iterator; -class Curve { +final class Curve { float ax, ay, bx, by, cx, cy, dx, dy; float dax, day, dbx, dby; @@ -101,14 +101,6 @@ class Curve { return t * (t * day + dby) + cy; } - private float ddxat(float t) { - return 2 * dax * t + dbx; - } - - private float ddyat(float t) { - return 2 * day * t + dby; - } - int dxRoots(float[] roots, int off) { return Helpers.quadraticRoots(dax, dbx, cx, roots, off); } @@ -131,17 +123,17 @@ class Curve { // finds points where the first and second derivative are // perpendicular. This happens when g(t) = f'(t)*f''(t) == 0 (where // * is a dot product). Unfortunately, we have to solve a cubic. - private int perpendiculardfddf(float[] pts, int off, final float err) { + private int perpendiculardfddf(float[] pts, int off) { assert pts.length >= off + 4; - // these are the coefficients of g(t): + // these are the coefficients of some multiple of g(t) (not g(t), + // because the roots of a polynomial are not changed after multiplication + // by a constant, and this way we save a few multiplications). final float a = 2*(dax*dax + day*day); final float b = 3*(dax*dbx + day*dby); final float c = 2*(dax*cx + day*cy) + dbx*dbx + dby*dby; final float d = dbx*cx + dby*cy; - // TODO: We might want to divide the polynomial by a to make the - // coefficients smaller. This won't change the roots. - return Helpers.cubicRootsInAB(a, b, c, d, pts, off, err, 0f, 1f); + return Helpers.cubicRootsInAB(a, b, c, d, pts, off, 0f, 1f); } // Tries to find the roots of the function ROC(t)-w in [0, 1). It uses @@ -161,7 +153,7 @@ class Curve { // no OOB exception, because by now off<=6, and roots.length >= 10 assert off <= 6 && roots.length >= 10; int ret = off; - int numPerpdfddf = perpendiculardfddf(roots, off, err); + int numPerpdfddf = perpendiculardfddf(roots, off); float t0 = 0, ft0 = ROCsq(t0) - w*w; roots[off + numPerpdfddf] = 1f; // always check interval end points numPerpdfddf++; @@ -189,8 +181,9 @@ class Curve { // A slight modification of the false position algorithm on wikipedia. // This only works for the ROCsq-x functions. It might be nice to have // the function as an argument, but that would be awkward in java6. - // It is something to consider for java7, depending on how closures - // and function objects turn out. Same goes for the newton's method + // TODO: It is something to consider for java8 (or whenever lambda + // expressions make it into the language), depending on how closures + // and turn out. Same goes for the newton's method // algorithm in Helpers.java private float falsePositionROCsqMinusX(float x0, float x1, final float x, final float err) @@ -203,7 +196,7 @@ class Curve { for (int i = 0; i < iterLimit && Math.abs(t - s) > err * Math.abs(t + s); i++) { r = (fs * t - ft * s) / (fs - ft); fr = ROCsq(r) - x; - if (fr * ft > 0) {// have the same sign + if (sameSign(fr, ft)) { ft = fr; t = r; if (side < 0) { fs /= (1 << (-side)); @@ -226,55 +219,65 @@ class Curve { return r; } + private static boolean sameSign(double x, double y) { + // another way is to test if x*y > 0. This is bad for small x, y. + return (x < 0 && y < 0) || (x > 0 && y > 0); + } + // returns the radius of curvature squared at t of this curve // see http://en.wikipedia.org/wiki/Radius_of_curvature_(applications) private float ROCsq(final float t) { - final float dx = dxat(t); - final float dy = dyat(t); - final float ddx = ddxat(t); - final float ddy = ddyat(t); + // dx=xat(t) and dy=yat(t). These calls have been inlined for efficiency + final float dx = t * (t * dax + dbx) + cx; + final float dy = t * (t * day + dby) + cy; + final float ddx = 2 * dax * t + dbx; + final float ddy = 2 * day * t + dby; final float dx2dy2 = dx*dx + dy*dy; final float ddx2ddy2 = ddx*ddx + ddy*ddy; final float ddxdxddydy = ddx*dx + ddy*dy; - float ret = ((dx2dy2*dx2dy2) / (dx2dy2 * ddx2ddy2 - ddxdxddydy*ddxdxddydy))*dx2dy2; - return ret; + return dx2dy2*((dx2dy2*dx2dy2) / (dx2dy2 * ddx2ddy2 - ddxdxddydy*ddxdxddydy)); } - // curve to be broken should be in pts[0] - // this will change the contents of both pts and Ts + // curve to be broken should be in pts + // this will change the contents of pts but not Ts // TODO: There's no reason for Ts to be an array. All we need is a sequence // of t values at which to subdivide. An array statisfies this condition, // but is unnecessarily restrictive. Ts should be an Iterator instead. // Doing this will also make dashing easier, since we could easily make // LengthIterator an Iterator and feed it to this function to simplify // the loop in Dasher.somethingTo. - static Iterator breakPtsAtTs(final float[][] pts, final int type, + static Iterator breakPtsAtTs(final float[] pts, final int type, final float[] Ts, final int numTs) { - assert pts.length >= 2 && pts[0].length >= 8 && numTs <= Ts.length; - return new Iterator() { - int nextIdx = 0; + assert pts.length >= 2*type && numTs <= Ts.length; + return new Iterator() { + // these prevent object creation and destruction during autoboxing. + // Because of this, the compiler should be able to completely + // eliminate the boxing costs. + final Integer i0 = 0; + final Integer itype = type; int nextCurveIdx = 0; + Integer curCurveOff = i0; float prevT = 0; @Override public boolean hasNext() { return nextCurveIdx < numTs + 1; } - @Override public float[] next() { - float[] ret; + @Override public Integer next() { + Integer ret; if (nextCurveIdx < numTs) { float curT = Ts[nextCurveIdx]; float splitT = (curT - prevT) / (1 - prevT); Helpers.subdivideAt(splitT, - pts[nextIdx], 0, - pts[nextIdx], 0, - pts[1-nextIdx], 0, type); - updateTs(Ts, Ts[nextCurveIdx], nextCurveIdx + 1, numTs - nextCurveIdx - 1); - ret = pts[nextIdx]; - nextIdx = 1 - nextIdx; + pts, curCurveOff, + pts, 0, + pts, type, type); + prevT = curT; + ret = i0; + curCurveOff = itype; } else { - ret = pts[nextIdx]; + ret = curCurveOff; } nextCurveIdx++; return ret; @@ -283,12 +286,5 @@ class Curve { @Override public void remove() {} }; } - - // precondition: ts[off]...ts[off+len-1] must all be greater than t. - private static void updateTs(float[] ts, final float t, final int off, final int len) { - for (int i = off; i < off + len; i++) { - ts[i] = (ts[i] - t) / (1 - t); - } - } } diff --git a/jdk/src/share/classes/sun/java2d/pisces/Dasher.java b/jdk/src/share/classes/sun/java2d/pisces/Dasher.java index 0dd75a3c0a9..533375b5fe3 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Dasher.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Dasher.java @@ -38,7 +38,7 @@ import sun.awt.geom.PathConsumer2D; * semantics are unclear. * */ -public class Dasher implements sun.awt.geom.PathConsumer2D { +final class Dasher implements sun.awt.geom.PathConsumer2D { private final PathConsumer2D out; private final float[] dash; @@ -169,7 +169,7 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { float dx = x1 - x0; float dy = y1 - y0; - float len = (float) Math.hypot(dx, dy); + float len = (float) Math.sqrt(dx*dx + dy*dy); if (len == 0) { return; @@ -226,7 +226,7 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { return; } if (li == null) { - li = new LengthIterator(4, 0.0001f); + li = new LengthIterator(4, 0.01f); } li.initializeIterationOnCurve(curCurvepts, type); @@ -237,9 +237,9 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { while ((t = li.next(leftInThisDashSegment)) < 1) { if (t != 0) { Helpers.subdivideAt((t - lastSplitT) / (1 - lastSplitT), - curCurvepts, curCurveoff, - curCurvepts, 0, - curCurvepts, type, type); + curCurvepts, curCurveoff, + curCurvepts, 0, + curCurvepts, type, type); lastSplitT = t; goTo(curCurvepts, 2, type); curCurveoff = type; @@ -307,6 +307,11 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { private int recLevel; private boolean done; + // the lengths of the lines of the control polygon. Only its first + // curveType/2 - 1 elements are valid. This is an optimization. See + // next(float) for more detail. + private float[] curLeafCtrlPolyLengths = new float[3]; + public LengthIterator(int reclimit, float err) { this.limit = reclimit; this.minTincrement = 1f / (1 << limit); @@ -344,11 +349,52 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { this.lastSegLen = 0; } + // 0 == false, 1 == true, -1 == invalid cached value. + private int cachedHaveLowAcceleration = -1; + + private boolean haveLowAcceleration(float err) { + if (cachedHaveLowAcceleration == -1) { + final float len1 = curLeafCtrlPolyLengths[0]; + final float len2 = curLeafCtrlPolyLengths[1]; + // the test below is equivalent to !within(len1/len2, 1, err). + // It is using a multiplication instead of a division, so it + // should be a bit faster. + if (!Helpers.within(len1, len2, err*len2)) { + cachedHaveLowAcceleration = 0; + return false; + } + if (curveType == 8) { + final float len3 = curLeafCtrlPolyLengths[2]; + // if len1 is close to 2 and 2 is close to 3, that probably + // means 1 is close to 3 so the second part of this test might + // not be needed, but it doesn't hurt to include it. + if (!(Helpers.within(len2, len3, err*len3) && + Helpers.within(len1, len3, err*len3))) { + cachedHaveLowAcceleration = 0; + return false; + } + } + cachedHaveLowAcceleration = 1; + return true; + } + + return (cachedHaveLowAcceleration == 1); + } + + // we want to avoid allocations/gc so we keep this array so we + // can put roots in it, + private float[] nextRoots = new float[4]; + + // caches the coefficients of the current leaf in its flattened + // form (see inside next() for what that means). The cache is + // invalid when it's third element is negative, since in any + // valid flattened curve, this would be >= 0. + private float[] flatLeafCoefCache = new float[] {0, 0, -1, 0}; // returns the t value where the remaining curve should be split in // order for the left subdivided curve to have length len. If len // is >= than the length of the uniterated curve, it returns 1. - public float next(float len) { - float targetLength = lenAtLastSplit + len; + public float next(final float len) { + final float targetLength = lenAtLastSplit + len; while(lenAtNextT < targetLength) { if (done) { lastSegLen = lenAtNextT - lenAtLastSplit; @@ -357,8 +403,46 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { goToNextLeaf(); } lenAtLastSplit = targetLength; - float t = binSearchForLen(lenAtLastSplit - lenAtLastT, - recCurveStack[recLevel], curveType, lenAtNextT - lenAtLastT, ERR); + final float leaflen = lenAtNextT - lenAtLastT; + float t = (targetLength - lenAtLastT) / leaflen; + + // cubicRootsInAB is a fairly expensive call, so we just don't do it + // if the acceleration in this section of the curve is small enough. + if (!haveLowAcceleration(0.05f)) { + // We flatten the current leaf along the x axis, so that we're + // left with a, b, c which define a 1D Bezier curve. We then + // solve this to get the parameter of the original leaf that + // gives us the desired length. + + if (flatLeafCoefCache[2] < 0) { + float x = 0+curLeafCtrlPolyLengths[0], + y = x+curLeafCtrlPolyLengths[1]; + if (curveType == 8) { + float z = y + curLeafCtrlPolyLengths[2]; + flatLeafCoefCache[0] = 3*(x - y) + z; + flatLeafCoefCache[1] = 3*(y - 2*x); + flatLeafCoefCache[2] = 3*x; + flatLeafCoefCache[3] = -z; + } else if (curveType == 6) { + flatLeafCoefCache[0] = 0f; + flatLeafCoefCache[1] = y - 2*x; + flatLeafCoefCache[2] = 2*x; + flatLeafCoefCache[3] = -y; + } + } + float a = flatLeafCoefCache[0]; + float b = flatLeafCoefCache[1]; + float c = flatLeafCoefCache[2]; + float d = t*flatLeafCoefCache[3]; + + // we use cubicRootsInAB here, because we want only roots in 0, 1, + // and our quadratic root finder doesn't filter, so it's just a + // matter of convenience. + int n = Helpers.cubicRootsInAB(a, b, c, d, nextRoots, 0, 0, 1); + if (n == 1 && !Float.isNaN(nextRoots[0])) { + t = nextRoots[0]; + } + } // t is relative to the current leaf, so we must make it a valid parameter // of the original curve. t = t * (nextT - lastT) + lastT; @@ -379,36 +463,6 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { return lastSegLen; } - // Returns t such that if leaf is subdivided at t the left - // curve will have length len. leafLen must be the length of leaf. - private static Curve bsc = new Curve(); - private static float binSearchForLen(float len, float[] leaf, int type, - float leafLen, float err) - { - assert len <= leafLen; - bsc.set(leaf, type); - float errBound = err*len; - float left = 0, right = 1; - while (left < right) { - float m = (left + right) / 2; - if (m == left || m == right) { - return m; - } - float x = bsc.xat(m); - float y = bsc.yat(m); - float leftLen = Helpers.linelen(leaf[0], leaf[1], x, y); - if (Math.abs(leftLen - len) < errBound) { - return m; - } - if (leftLen < len) { - left = m; - } else { - right = m; - } - } - return left; - } - // go to the next leaf (in an inorder traversal) in the recursion tree // preconditions: must be on a leaf, and that leaf must not be the root. private void goToNextLeaf() { @@ -437,6 +491,9 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { lenAtLastT = lenAtNextT; nextT += (1 << (limit - recLevel)) * minTincrement; lenAtNextT += len; + // invalidate caches + flatLeafCoefCache[2] = -1; + cachedHaveLowAcceleration = -1; } else { Helpers.subdivide(recCurveStack[recLevel], 0, recCurveStack[recLevel+1], 0, @@ -450,11 +507,24 @@ public class Dasher implements sun.awt.geom.PathConsumer2D { // this is a bit of a hack. It returns -1 if we're not on a leaf, and // the length of the leaf if we are on a leaf. private float onLeaf() { - float polylen = Helpers.polyLineLength(recCurveStack[recLevel], 0, curveType); - float linelen = Helpers.linelen(recCurveStack[recLevel][0], recCurveStack[recLevel][1], - recCurveStack[recLevel][curveType - 2], recCurveStack[recLevel][curveType - 1]); - return (polylen - linelen < ERR || recLevel == limit) ? - (polylen + linelen)/2 : -1; + float[] curve = recCurveStack[recLevel]; + float polyLen = 0; + + float x0 = curve[0], y0 = curve[1]; + for (int i = 2; i < curveType; i += 2) { + final float x1 = curve[i], y1 = curve[i+1]; + final float len = Helpers.linelen(x0, y0, x1, y1); + polyLen += len; + curLeafCtrlPolyLengths[i/2 - 1] = len; + x0 = x1; + y0 = y1; + } + + final float lineLen = Helpers.linelen(curve[0], curve[1], curve[curveType-2], curve[curveType-1]); + if (polyLen - lineLen < ERR || recLevel == limit) { + return (polyLen + lineLen)/2; + } + return -1; } } diff --git a/jdk/src/share/classes/sun/java2d/pisces/Helpers.java b/jdk/src/share/classes/sun/java2d/pisces/Helpers.java index c803f172688..b91bc6a400a 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Helpers.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Helpers.java @@ -26,6 +26,12 @@ package sun.java2d.pisces; import java.util.Arrays; +import static java.lang.Math.PI; +import static java.lang.Math.cos; +import static java.lang.Math.sqrt; +import static java.lang.Math.cbrt; +import static java.lang.Math.acos; + final class Helpers { private Helpers() { @@ -75,100 +81,74 @@ final class Helpers { return ret - off; } - // find the roots of g(t) = a*t^3 + b*t^2 + c*t + d in [A,B) - // We will not use Cardano's method, since it is complicated and - // involves too many square and cubic roots. We will use Newton's method. - // TODO: this should probably return ALL roots. Then the user can do - // his own filtering of roots outside [A,B). - static int cubicRootsInAB(final float a, final float b, - final float c, final float d, - float[] pts, final int off, final float E, + // find the roots of g(t) = d*t^3 + a*t^2 + b*t + c in [A,B) + static int cubicRootsInAB(float d, float a, float b, float c, + float[] pts, final int off, final float A, final float B) { - if (a == 0) { - return quadraticRoots(b, c, d, pts, off); - } - // the coefficients of g'(t). no dc variable because dc=c - // we use these to get the critical points of g(t), which - // we then use to chose starting points for Newton's method. These - // should be very close to the actual roots. - final float da = 3 * a; - final float db = 2 * b; - int numCritPts = quadraticRoots(da, db, c, pts, off+1); - numCritPts = filterOutNotInAB(pts, off+1, numCritPts, A, B) - off - 1; - // need them sorted. - if (numCritPts == 2 && pts[off+1] > pts[off+2]) { - float tmp = pts[off+1]; - pts[off+1] = pts[off+2]; - pts[off+2] = tmp; + if (d == 0) { + int num = quadraticRoots(a, b, c, pts, off); + return filterOutNotInAB(pts, off, num, A, B) - off; } + // From Graphics Gems: + // http://tog.acm.org/resources/GraphicsGems/gems/Roots3And4.c + // (also from awt.geom.CubicCurve2D. But here we don't need as + // much accuracy and we don't want to create arrays so we use + // our own customized version). - int ret = off; + /* normal form: x^3 + ax^2 + bx + c = 0 */ + a /= d; + b /= d; + c /= d; - // we don't actually care much about the extrema themselves. We - // only use them to ensure that g(t) is monotonic in each - // interval [pts[i],pts[i+1] (for i in off...off+numCritPts+1). - // This will allow us to determine intervals containing exactly - // one root. - // The end points of the interval are always local extrema. - pts[off] = A; - pts[off + numCritPts + 1] = B; - numCritPts += 2; + // substitute x = y - A/3 to eliminate quadratic term: + // x^3 +Px + Q = 0 + // + // Since we actually need P/3 and Q/2 for all of the + // calculations that follow, we will calculate + // p = P/3 + // q = Q/2 + // instead and use those values for simplicity of the code. + double sq_A = a * a; + double p = 1.0/3 * (-1.0/3 * sq_A + b); + double q = 1.0/2 * (2.0/27 * a * sq_A - 1.0/3 * a * b + c); - float x0 = pts[off], fx0 = evalCubic(a, b, c, d, x0); - for (int i = off; i < off + numCritPts - 1; i++) { - float x1 = pts[i+1], fx1 = evalCubic(a, b, c, d, x1); - if (fx0 == 0f) { - pts[ret++] = x0; - } else if (fx1 * fx0 < 0f) { // have opposite signs - pts[ret++] = CubicNewton(a, b, c, d, - x0 + fx0 * (x1 - x0) / (fx0 - fx1), E); - } - x0 = x1; - fx0 = fx1; - } - return ret - off; - } + /* use Cardano's formula */ - // precondition: the polynomial to be evaluated must not be 0 at x0. - static float CubicNewton(final float a, final float b, - final float c, final float d, - float x0, final float err) - { - // considering how this function is used, 10 should be more than enough - final int itlimit = 10; - float fx0 = evalCubic(a, b, c, d, x0); - float x1; - int count = 0; - while(true) { - x1 = x0 - (fx0 / evalCubic(0, 3 * a, 2 * b, c, x0)); - if (Math.abs(x1 - x0) < err * Math.abs(x1 + x0) || count == itlimit) { - break; - } - x0 = x1; - fx0 = evalCubic(a, b, c, d, x0); - count++; - } - return x1; - } + double cb_p = p * p * p; + double D = q * q + cb_p; - // fills the input array with numbers 0, INC, 2*INC, ... - static void fillWithIdxes(final float[] data, final int[] idxes) { - if (idxes.length > 0) { - idxes[0] = 0; - for (int i = 1; i < idxes.length; i++) { - idxes[i] = idxes[i-1] + (int)data[idxes[i-1]]; + int num; + if (D < 0) { + // see: http://en.wikipedia.org/wiki/Cubic_function#Trigonometric_.28and_hyperbolic.29_method + final double phi = 1.0/3 * acos(-q / sqrt(-cb_p)); + final double t = 2 * sqrt(-p); + + pts[ off+0 ] = (float)( t * cos(phi)); + pts[ off+1 ] = (float)(-t * cos(phi + PI / 3)); + pts[ off+2 ] = (float)(-t * cos(phi - PI / 3)); + num = 3; + } else { + final double sqrt_D = sqrt(D); + final double u = cbrt(sqrt_D - q); + final double v = - cbrt(sqrt_D + q); + + pts[ off ] = (float)(u + v); + num = 1; + + if (within(D, 0, 1e-8)) { + pts[off+1] = -(pts[off] / 2); + num = 2; } } - } - static void fillWithIdxes(final int[] idxes, final int inc) { - if (idxes.length > 0) { - idxes[0] = 0; - for (int i = 1; i < idxes.length; i++) { - idxes[i] = idxes[i-1] + inc; - } + final float sub = 1.0f/3 * a; + + for (int i = 0; i < num; ++i) { + pts[ off+i ] -= sub; } + + return filterOutNotInAB(pts, off, num, A, B) - off; } // These use a hardcoded factor of 2 for increasing sizes. Perhaps this @@ -182,6 +162,7 @@ final class Helpers { } return Arrays.copyOf(in, 2 * (cursize + numToAdd)); } + static int[] widenArray(int[] in, final int cursize, final int numToAdd) { if (in.length >= cursize + numToAdd) { return in; @@ -208,7 +189,7 @@ final class Helpers { { int ret = off; for (int i = off; i < off + len; i++) { - if (nums[i] > a && nums[i] < b) { + if (nums[i] >= a && nums[i] < b) { nums[ret++] = nums[i]; } } @@ -225,7 +206,9 @@ final class Helpers { } static float linelen(float x1, float y1, float x2, float y2) { - return (float)Math.hypot(x2 - x1, y2 - y1); + final float dx = x2 - x1; + final float dy = y2 - y1; + return (float)Math.sqrt(dx*dx + dy*dy); } static void subdivide(float[] src, int srcoff, float[] left, int leftoff, diff --git a/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java b/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java index 05243190ec9..1620db57041 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java +++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesCache.java @@ -32,7 +32,7 @@ import java.util.Arrays; * * @see PiscesRenderer#render */ -public final class PiscesCache { +final class PiscesCache { final int bboxX0, bboxY0, bboxX1, bboxY1; diff --git a/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java b/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java index 9684edc5023..84b0cad8200 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java +++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesRenderingEngine.java @@ -27,7 +27,6 @@ package sun.java2d.pisces; import java.awt.Shape; import java.awt.BasicStroke; -import java.awt.geom.NoninvertibleTransformException; import java.awt.geom.Path2D; import java.awt.geom.AffineTransform; import java.awt.geom.PathIterator; @@ -250,7 +249,7 @@ public class PiscesRenderingEngine extends RenderingEngine { float dashphase, PathConsumer2D pc2d) { - // We use inat and outat so that in Stroker and Dasher we can work only + // We use strokerat and outat so that in Stroker and Dasher we can work only // with the pre-transformation coordinates. This will repeat a lot of // computations done in the path iterator, but the alternative is to // work with transformed paths and compute untransformed coordinates @@ -265,7 +264,7 @@ public class PiscesRenderingEngine extends RenderingEngine { // transformation after the path processing has been done. // We can't do this if normalization is on, because it isn't a good // idea to normalize before the transformation is applied. - AffineTransform inat = null; + AffineTransform strokerat = null; AffineTransform outat = null; PathIterator pi = null; @@ -284,9 +283,9 @@ public class PiscesRenderingEngine extends RenderingEngine { // again so, nothing can be drawn. // Every path needs an initial moveTo and a pathDone. If these - // aren't there this causes a SIGSEV in libawt.so (at the time + // are not there this causes a SIGSEGV in libawt.so (at the time // of writing of this comment (September 16, 2010)). Actually, - // I'm not sure if the moveTo is necessary to avoid the SIGSEV + // I am not sure if the moveTo is necessary to avoid the SIGSEGV // but the pathDone is definitely needed. pc2d.moveTo(0, 0); pc2d.pathDone(); @@ -313,25 +312,32 @@ public class PiscesRenderingEngine extends RenderingEngine { if (normalize != NormMode.OFF) { pi = new NormalizingPathIterator(pi, normalize); } - // leave inat and outat null. + // by now strokerat == null && outat == null. Input paths to + // stroker (and maybe dasher) will have the full transform at + // applied to them and nothing will happen to the output paths. } else { - // We only need the inverse if normalization is on. Otherwise - // we just don't transform the input paths, do all the stroking - // and then transform out output (instead of making PathIterator - // apply the transformation, us applying the inverse, and then - // us applying the transform again to our output). - outat = at; if (normalize != NormMode.OFF) { - try { - inat = outat.createInverse(); - } catch (NoninvertibleTransformException e) { - // we made sure this can't happen - e.printStackTrace(); - } + strokerat = at; pi = src.getPathIterator(at); pi = new NormalizingPathIterator(pi, normalize); + // by now strokerat == at && outat == null. Input paths to + // stroker (and maybe dasher) will have the full transform at + // applied to them, then they will be normalized, and then + // the inverse of *only the non translation part of at* will + // be applied to the normalized paths. This won't cause problems + // in stroker, because, suppose at = T*A, where T is just the + // translation part of at, and A is the rest. T*A has already + // been applied to Stroker/Dasher's input. Then Ainv will be + // applied. Ainv*T*A is not equal to T, but it is a translation, + // which means that none of stroker's assumptions about its + // input will be violated. After all this, A will be applied + // to stroker's output. } else { + outat = at; pi = src.getPathIterator(null); + // outat == at && strokerat == null. This is because if no + // normalization is done, we can just apply all our + // transformations to stroker's output. } } } else { @@ -343,13 +349,17 @@ public class PiscesRenderingEngine extends RenderingEngine { } } + // by now, at least one of outat and strokerat will be null. Unless at is not + // a constant multiple of an orthogonal transformation, they will both be + // null. In other cases, outat == at if normalization is off, and if + // normalization is on, strokerat == at. pc2d = TransformingPathConsumer2D.transformConsumer(pc2d, outat); + pc2d = TransformingPathConsumer2D.deltaTransformConsumer(pc2d, strokerat); pc2d = new Stroker(pc2d, width, caps, join, miterlimit); if (dashes != null) { pc2d = new Dasher(pc2d, dashes, dashphase); } - pc2d = TransformingPathConsumer2D.transformConsumer(pc2d, inat); - + pc2d = TransformingPathConsumer2D.inverseDeltaTransformConsumer(pc2d, strokerat); pathTo(pi, pc2d); } @@ -588,9 +598,9 @@ public class PiscesRenderingEngine extends RenderingEngine { } Renderer r = new Renderer(3, 3, - clip.getLoX(), clip.getLoY(), - clip.getWidth(), clip.getHeight(), - PathIterator.WIND_EVEN_ODD); + clip.getLoX(), clip.getLoY(), + clip.getWidth(), clip.getHeight(), + PathIterator.WIND_EVEN_ODD); r.moveTo((float) x, (float) y); r.lineTo((float) (x+dx1), (float) (y+dy1)); diff --git a/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java b/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java index e2779b8fe03..ba91edb9819 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java +++ b/jdk/src/share/classes/sun/java2d/pisces/PiscesTileGenerator.java @@ -30,7 +30,7 @@ import java.util.concurrent.ConcurrentHashMap; import sun.java2d.pipe.AATileGenerator; -public final class PiscesTileGenerator implements AATileGenerator { +final class PiscesTileGenerator implements AATileGenerator { public static final int TILE_SIZE = PiscesCache.TILE_SIZE; // perhaps we should be using weak references here, but right now diff --git a/jdk/src/share/classes/sun/java2d/pisces/Renderer.java b/jdk/src/share/classes/sun/java2d/pisces/Renderer.java index 782d9e4f30b..cbfa2897d94 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Renderer.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Renderer.java @@ -25,12 +25,9 @@ package sun.java2d.pisces; -import java.util.Arrays; -import java.util.Iterator; - import sun.awt.geom.PathConsumer2D; -public class Renderer implements PathConsumer2D { +final class Renderer implements PathConsumer2D { private class ScanlineIterator { @@ -39,115 +36,81 @@ public class Renderer implements PathConsumer2D { // crossing bounds. The bounds are not necessarily tight (the scan line // at minY, for example, might have no crossings). The x bounds will // be accumulated as crossings are computed. - private int minY, maxY; + private final int maxY; private int nextY; // indices into the segment pointer lists. They indicate the "active" // sublist in the segment lists (the portion of the list that contains // all the segments that cross the next scan line). - private int elo, ehi; - private final int[] edgePtrs; - private int qlo, qhi; - private final int[] quadPtrs; - private int clo, chi; - private final int[] curvePtrs; + private int edgeCount; + private int[] edgePtrs; private static final int INIT_CROSSINGS_SIZE = 10; private ScanlineIterator() { crossings = new int[INIT_CROSSINGS_SIZE]; - - edgePtrs = new int[numEdges]; - Helpers.fillWithIdxes(edgePtrs, SIZEOF_EDGE); - qsort(edges, edgePtrs, YMIN, 0, numEdges - 1); - - quadPtrs = new int[numQuads]; - Helpers.fillWithIdxes(quadPtrs, SIZEOF_QUAD); - qsort(quads, quadPtrs, YMIN, 0, numQuads - 1); - - curvePtrs = new int[numCurves]; - Helpers.fillWithIdxes(curvePtrs, SIZEOF_CURVE); - qsort(curves, curvePtrs, YMIN, 0, numCurves - 1); + edgePtrs = new int[INIT_CROSSINGS_SIZE]; // We don't care if we clip some of the line off with ceil, since // no scan line crossings will be eliminated (in fact, the ceil is // the y of the first scan line crossing). - nextY = minY = Math.max(boundsMinY, (int)Math.ceil(edgeMinY)); - maxY = Math.min(boundsMaxY, (int)Math.ceil(edgeMaxY)); - - for (elo = 0; elo < numEdges && edges[edgePtrs[elo]+YMAX] <= minY; elo++) - ; - // the active list is *edgePtrs[lo] (inclusive) *edgePtrs[hi] (exclusive) - for (ehi = elo; ehi < numEdges && edges[edgePtrs[ehi]+YMIN] <= minY; ehi++) - edgeSetCurY(edgePtrs[ehi], minY);// TODO: make minY a float to avoid casts - - for (qlo = 0; qlo < numQuads && quads[quadPtrs[qlo]+YMAX] <= minY; qlo++) - ; - for (qhi = qlo; qhi < numQuads && quads[quadPtrs[qhi]+YMIN] <= minY; qhi++) - quadSetCurY(quadPtrs[qhi], minY); - - for (clo = 0; clo < numCurves && curves[curvePtrs[clo]+YMAX] <= minY; clo++) - ; - for (chi = clo; chi < numCurves && curves[curvePtrs[chi]+YMIN] <= minY; chi++) - curveSetCurY(curvePtrs[chi], minY); + final int minY = getFirstScanLineCrossing(); + nextY = minY; + maxY = getScanLineCrossingEnd()-1; + edgeCount = 0; } private int next() { - // we go through the active lists and remove segments that don't cross - // the nextY scanline. - int crossingIdx = 0; - for (int i = elo; i < ehi; i++) { - if (edges[edgePtrs[i]+YMAX] <= nextY) { - edgePtrs[i] = edgePtrs[elo++]; + int cury = nextY++; + int bucket = cury - boundsMinY; + int count = this.edgeCount; + int ptrs[] = this.edgePtrs; + int bucketcount = edgeBucketCounts[bucket]; + if ((bucketcount & 0x1) != 0) { + int newCount = 0; + for (int i = 0; i < count; i++) { + int ecur = ptrs[i]; + if (edges[ecur+YMAX] > cury) { + ptrs[newCount++] = ecur; + } } + count = newCount; } - for (int i = qlo; i < qhi; i++) { - if (quads[quadPtrs[i]+YMAX] <= nextY) { - quadPtrs[i] = quadPtrs[qlo++]; + ptrs = Helpers.widenArray(ptrs, count, bucketcount >> 1); + for (int ecur = edgeBuckets[bucket]; ecur != NULL; ecur = (int)edges[ecur+NEXT]) { + ptrs[count++] = ecur; + // REMIND: Adjust start Y if necessary + } + this.edgePtrs = ptrs; + this.edgeCount = count; +// if ((count & 0x1) != 0) { +// System.out.println("ODD NUMBER OF EDGES!!!!"); +// } + int xings[] = this.crossings; + if (xings.length < count) { + this.crossings = xings = new int[ptrs.length]; + } + for (int i = 0; i < count; i++) { + int ecur = ptrs[i]; + float curx = edges[ecur+CURX]; + int cross = ((int) curx) << 1; + edges[ecur+CURX] = curx + edges[ecur+SLOPE]; + if (edges[ecur+OR] > 0) { + cross |= 1; } - } - for (int i = clo; i < chi; i++) { - if (curves[curvePtrs[i]+YMAX] <= nextY) { - curvePtrs[i] = curvePtrs[clo++]; + int j = i; + while (--j >= 0) { + int jcross = xings[j]; + if (jcross <= cross) { + break; + } + xings[j+1] = jcross; + ptrs[j+1] = ptrs[j]; } + xings[j+1] = cross; + ptrs[j+1] = ecur; } - - crossings = Helpers.widenArray(crossings, 0, ehi-elo+qhi-qlo+chi-clo); - - // Now every edge between lo and hi crosses nextY. Compute it's - // crossing and put it in the crossings array. - for (int i = elo; i < ehi; i++) { - int ptr = edgePtrs[i]; - addCrossing(nextY, (int)edges[ptr+CURX], edges[ptr+OR], crossingIdx); - edgeGoToNextY(ptr); - crossingIdx++; - } - for (int i = qlo; i < qhi; i++) { - int ptr = quadPtrs[i]; - addCrossing(nextY, (int)quads[ptr+CURX], quads[ptr+OR], crossingIdx); - quadGoToNextY(ptr); - crossingIdx++; - } - for (int i = clo; i < chi; i++) { - int ptr = curvePtrs[i]; - addCrossing(nextY, (int)curves[ptr+CURX], curves[ptr+OR], crossingIdx); - curveGoToNextY(ptr); - crossingIdx++; - } - - nextY++; - // Expand active lists to include new edges. - for (; ehi < numEdges && edges[edgePtrs[ehi]+YMIN] <= nextY; ehi++) { - edgeSetCurY(edgePtrs[ehi], nextY); - } - for (; qhi < numQuads && quads[quadPtrs[qhi]+YMIN] <= nextY; qhi++) { - quadSetCurY(quadPtrs[qhi], nextY); - } - for (; chi < numCurves && curves[curvePtrs[chi]+YMIN] <= nextY; chi++) { - curveSetCurY(curvePtrs[chi], nextY); - } - Arrays.sort(crossings, 0, crossingIdx); - return crossingIdx; + return count; } private boolean hasNext() { @@ -157,51 +120,7 @@ public class Renderer implements PathConsumer2D { private int curY() { return nextY - 1; } - - private void addCrossing(int y, int x, float or, int idx) { - x <<= 1; - crossings[idx] = ((or > 0) ? (x | 0x1) : x); - } } - // quicksort implementation for sorting the edge indices ("pointers") - // by increasing y0. first, last are indices into the "pointer" array - // It sorts the pointer array from first (inclusive) to last (inclusive) - private static void qsort(final float[] data, final int[] ptrs, - final int fieldForCmp, int first, int last) - { - if (last > first) { - int p = partition(data, ptrs, fieldForCmp, first, last); - if (first < p - 1) { - qsort(data, ptrs, fieldForCmp, first, p - 1); - } - if (p < last) { - qsort(data, ptrs, fieldForCmp, p, last); - } - } - } - - // i, j are indices into edgePtrs. - private static int partition(final float[] data, final int[] ptrs, - final int fieldForCmp, int i, int j) - { - int pivotValFieldForCmp = ptrs[i]+fieldForCmp; - while (i <= j) { - // edges[edgePtrs[i]+1] is equivalent to (*(edgePtrs[i])).y0 in C - while (data[ptrs[i]+fieldForCmp] < data[pivotValFieldForCmp]) - i++; - while (data[ptrs[j]+fieldForCmp] > data[pivotValFieldForCmp]) - j--; - if (i <= j) { - int tmp = ptrs[i]; - ptrs[i] = ptrs[j]; - ptrs[j] = tmp; - i++; - j--; - } - } - return i; - } -//============================================================================ ////////////////////////////////////////////////////////////////////////////// @@ -209,269 +128,89 @@ public class Renderer implements PathConsumer2D { ////////////////////////////////////////////////////////////////////////////// // TODO(maybe): very tempting to use fixed point here. A lot of opportunities // for shifts and just removing certain operations altogether. -// TODO: it might be worth it to make an EdgeList class. It would probably -// clean things up a bit and not impact performance much. // common to all types of input path segments. - private static final int YMIN = 0; - private static final int YMAX = 1; - private static final int CURX = 2; - // this and OR are meant to be indeces into "int" fields, but arrays must + private static final int YMAX = 0; + private static final int CURX = 1; + // NEXT and OR are meant to be indices into "int" fields, but arrays must // be homogenous, so every field is a float. However floats can represent // exactly up to 26 bit ints, so we're ok. - private static final int CURY = 3; - private static final int OR = 4; - - // for straight lines only: - private static final int SLOPE = 5; - - // for quads and cubics: - private static final int X0 = 5; - private static final int Y0 = 6; - private static final int XL = 7; - private static final int COUNT = 8; - private static final int CURSLOPE = 9; - private static final int DX = 10; - private static final int DY = 11; - private static final int DDX = 12; - private static final int DDY = 13; - - // for cubics only - private static final int DDDX = 14; - private static final int DDDY = 15; + private static final int OR = 2; + private static final int SLOPE = 3; + private static final int NEXT = 4; private float edgeMinY = Float.POSITIVE_INFINITY; private float edgeMaxY = Float.NEGATIVE_INFINITY; private float edgeMinX = Float.POSITIVE_INFINITY; private float edgeMaxX = Float.NEGATIVE_INFINITY; - private static final int SIZEOF_EDGE = 6; + private static final int SIZEOF_EDGE = 5; + // don't just set NULL to -1, because we want NULL+NEXT to be negative. + private static final int NULL = -SIZEOF_EDGE; private float[] edges = null; + private int[] edgeBuckets = null; + private int[] edgeBucketCounts = null; // 2*newedges + (1 if pruning needed) private int numEdges; - // these are static because we need them to be usable from ScanlineIterator - private void edgeSetCurY(final int idx, int y) { - edges[idx+CURX] += (y - edges[idx+CURY]) * edges[idx+SLOPE]; - edges[idx+CURY] = y; - } - private void edgeGoToNextY(final int idx) { - edges[idx+CURY] += 1; - edges[idx+CURX] += edges[idx+SLOPE]; - } - - - private static final int SIZEOF_QUAD = 14; - private float[] quads = null; - private int numQuads; - // This function should be called exactly once, to set the first scanline - // of the curve. Before it is called, the curve should think its first - // scanline is CEIL(YMIN). - private void quadSetCurY(final int idx, final int y) { - assert y < quads[idx+YMAX]; - assert (quads[idx+CURY] > y); - assert (quads[idx+CURY] == Math.ceil(quads[idx+CURY])); - - while (quads[idx+CURY] < ((float)y)) { - quadGoToNextY(idx); - } - } - private void quadGoToNextY(final int idx) { - quads[idx+CURY] += 1; - // this will get overriden if the while executes. - quads[idx+CURX] += quads[idx+CURSLOPE]; - int count = (int)quads[idx+COUNT]; - // this loop should never execute more than once because our - // curve is monotonic in Y. Still we put it in because you can - // never be too sure when dealing with floating point. - while(quads[idx+CURY] >= quads[idx+Y0] && count > 0) { - float x0 = quads[idx+X0], y0 = quads[idx+Y0]; - count = executeQuadAFDIteration(idx); - float x1 = quads[idx+X0], y1 = quads[idx+Y0]; - // our quads are monotonic, so this shouldn't happen, but - // it is conceivable that for very flat quads with different - // y values at their endpoints AFD might give us a horizontal - // segment. - if (y1 == y0) { - continue; - } - quads[idx+CURSLOPE] = (x1 - x0) / (y1 - y0); - quads[idx+CURX] = x0 + (quads[idx+CURY] - y0) * quads[idx+CURSLOPE]; - } - } - - - private static final int SIZEOF_CURVE = 16; - private float[] curves = null; - private int numCurves; - private void curveSetCurY(final int idx, final int y) { - assert y < curves[idx+YMAX]; - assert (curves[idx+CURY] > y); - assert (curves[idx+CURY] == Math.ceil(curves[idx+CURY])); - - while (curves[idx+CURY] < ((float)y)) { - curveGoToNextY(idx); - } - } - private void curveGoToNextY(final int idx) { - curves[idx+CURY] += 1; - // this will get overriden if the while executes. - curves[idx+CURX] += curves[idx+CURSLOPE]; - int count = (int)curves[idx+COUNT]; - // this loop should never execute more than once because our - // curve is monotonic in Y. Still we put it in because you can - // never be too sure when dealing with floating point. - while(curves[idx+CURY] >= curves[idx+Y0] && count > 0) { - float x0 = curves[idx+X0], y0 = curves[idx+Y0]; - count = executeCurveAFDIteration(idx); - float x1 = curves[idx+X0], y1 = curves[idx+Y0]; - // our curves are monotonic, so this shouldn't happen, but - // it is conceivable that for very flat curves with different - // y values at their endpoints AFD might give us a horizontal - // segment. - if (y1 == y0) { - continue; - } - curves[idx+CURSLOPE] = (x1 - x0) / (y1 - y0); - curves[idx+CURX] = x0 + (curves[idx+CURY] - y0) * curves[idx+CURSLOPE]; - } - } - private static final float DEC_BND = 20f; private static final float INC_BND = 8f; + + // each bucket is a linked list. this method adds eptr to the + // start "bucket"th linked list. + private void addEdgeToBucket(final int eptr, final int bucket) { + edges[eptr+NEXT] = edgeBuckets[bucket]; + edgeBuckets[bucket] = eptr; + edgeBucketCounts[bucket] += 2; + } + // Flattens using adaptive forward differencing. This only carries out // one iteration of the AFD loop. All it does is update AFD variables (i.e. // X0, Y0, D*[X|Y], COUNT; not variables used for computing scanline crossings). - private int executeQuadAFDIteration(int idx) { - int count = (int)quads[idx+COUNT]; - float ddx = quads[idx+DDX]; - float ddy = quads[idx+DDY]; - float dx = quads[idx+DX]; - float dy = quads[idx+DY]; - - while (Math.abs(ddx) > DEC_BND || Math.abs(ddy) > DEC_BND) { - ddx = ddx / 4; - ddy = ddy / 4; - dx = (dx - ddx) / 2; - dy = (dy - ddy) / 2; + private void quadBreakIntoLinesAndAdd(float x0, float y0, + final Curve c, + final float x2, final float y2) { + final float QUAD_DEC_BND = 32; + final int countlg = 4; + int count = 1 << countlg; + int countsq = count * count; + float maxDD = Math.max(c.dbx / countsq, c.dby / countsq); + while (maxDD > QUAD_DEC_BND) { + maxDD /= 4; count <<= 1; } - // can only do this on even "count" values, because we must divide count by 2 - while (count % 2 == 0 && Math.abs(dx) <= INC_BND && Math.abs(dy) <= INC_BND) { - dx = 2 * dx + ddx; - dy = 2 * dy + ddy; - ddx = 4 * ddx; - ddy = 4 * ddy; - count >>= 1; - } - count--; - if (count > 0) { - quads[idx+X0] += dx; + + countsq = count * count; + final float ddx = c.dbx / countsq; + final float ddy = c.dby / countsq; + float dx = c.bx / countsq + c.cx / count; + float dy = c.by / countsq + c.cy / count; + + while (count-- > 1) { + float x1 = x0 + dx; dx += ddx; - quads[idx+Y0] += dy; + float y1 = y0 + dy; dy += ddy; - } else { - quads[idx+X0] = quads[idx+XL]; - quads[idx+Y0] = quads[idx+YMAX]; + addLine(x0, y0, x1, y1); + x0 = x1; + y0 = y1; } - quads[idx+COUNT] = count; - quads[idx+DDX] = ddx; - quads[idx+DDY] = ddy; - quads[idx+DX] = dx; - quads[idx+DY] = dy; - return count; - } - private int executeCurveAFDIteration(int idx) { - int count = (int)curves[idx+COUNT]; - float ddx = curves[idx+DDX]; - float ddy = curves[idx+DDY]; - float dx = curves[idx+DX]; - float dy = curves[idx+DY]; - float dddx = curves[idx+DDDX]; - float dddy = curves[idx+DDDY]; - - while (Math.abs(ddx) > DEC_BND || Math.abs(ddy) > DEC_BND) { - dddx /= 8; - dddy /= 8; - ddx = ddx/4 - dddx; - ddy = ddy/4 - dddy; - dx = (dx - ddx) / 2; - dy = (dy - ddy) / 2; - count <<= 1; - } - // can only do this on even "count" values, because we must divide count by 2 - while (count % 2 == 0 && Math.abs(dx) <= INC_BND && Math.abs(dy) <= INC_BND) { - dx = 2 * dx + ddx; - dy = 2 * dy + ddy; - ddx = 4 * (ddx + dddx); - ddy = 4 * (ddy + dddy); - dddx = 8 * dddx; - dddy = 8 * dddy; - count >>= 1; - } - count--; - if (count > 0) { - curves[idx+X0] += dx; - dx += ddx; - ddx += dddx; - curves[idx+Y0] += dy; - dy += ddy; - ddy += dddy; - } else { - curves[idx+X0] = curves[idx+XL]; - curves[idx+Y0] = curves[idx+YMAX]; - } - curves[idx+COUNT] = count; - curves[idx+DDDX] = dddx; - curves[idx+DDDY] = dddy; - curves[idx+DDX] = ddx; - curves[idx+DDY] = ddy; - curves[idx+DX] = dx; - curves[idx+DY] = dy; - return count; + addLine(x0, y0, x2, y2); } - - private void initLine(final int idx, float[] pts, int or) { - edges[idx+SLOPE] = (pts[2] - pts[0]) / (pts[3] - pts[1]); - edges[idx+CURX] = pts[0] + (edges[idx+CURY] - pts[1]) * edges[idx+SLOPE]; - } - - private void initQuad(final int idx, float[] points, int or) { + // x0, y0 and x3,y3 are the endpoints of the curve. We could compute these + // using c.xat(0),c.yat(0) and c.xat(1),c.yat(1), but this might introduce + // numerical errors, and our callers already have the exact values. + // Another alternative would be to pass all the control points, and call c.set + // here, but then too many numbers are passed around. + private void curveBreakIntoLinesAndAdd(float x0, float y0, + final Curve c, + final float x3, final float y3) { final int countlg = 3; - final int count = 1 << countlg; + int count = 1 << countlg; // the dx and dy refer to forward differencing variables, not the last // coefficients of the "points" polynomial - final float ddx, ddy, dx, dy; - c.set(points, 6); - - ddx = c.dbx / (1 << (2 * countlg)); - ddy = c.dby / (1 << (2 * countlg)); - dx = c.bx / (1 << (2 * countlg)) + c.cx / (1 << countlg); - dy = c.by / (1 << (2 * countlg)) + c.cy / (1 << countlg); - - quads[idx+DDX] = ddx; - quads[idx+DDY] = ddy; - quads[idx+DX] = dx; - quads[idx+DY] = dy; - quads[idx+COUNT] = count; - quads[idx+XL] = points[4]; - quads[idx+X0] = points[0]; - quads[idx+Y0] = points[1]; - executeQuadAFDIteration(idx); - float x1 = quads[idx+X0], y1 = quads[idx+Y0]; - quads[idx+CURSLOPE] = (x1 - points[0]) / (y1 - points[1]); - quads[idx+CURX] = points[0] + (quads[idx+CURY] - points[1])*quads[idx+CURSLOPE]; - } - - private void initCurve(final int idx, float[] points, int or) { - final int countlg = 3; - final int count = 1 << countlg; - - // the dx and dy refer to forward differencing variables, not the last - // coefficients of the "points" polynomial - final float dddx, dddy, ddx, ddy, dx, dy; - c.set(points, 8); + float dddx, dddy, ddx, ddy, dx, dy; dddx = 2f * c.dax / (1 << (3 * countlg)); dddy = 2f * c.day / (1 << (3 * countlg)); @@ -480,93 +219,100 @@ public class Renderer implements PathConsumer2D { dx = c.ax / (1 << (3 * countlg)) + c.bx / (1 << (2 * countlg)) + c.cx / (1 << countlg); dy = c.ay / (1 << (3 * countlg)) + c.by / (1 << (2 * countlg)) + c.cy / (1 << countlg); - curves[idx+DDDX] = dddx; - curves[idx+DDDY] = dddy; - curves[idx+DDX] = ddx; - curves[idx+DDY] = ddy; - curves[idx+DX] = dx; - curves[idx+DY] = dy; - curves[idx+COUNT] = count; - curves[idx+XL] = points[6]; - curves[idx+X0] = points[0]; - curves[idx+Y0] = points[1]; - executeCurveAFDIteration(idx); - float x1 = curves[idx+X0], y1 = curves[idx+Y0]; - curves[idx+CURSLOPE] = (x1 - points[0]) / (y1 - points[1]); - curves[idx+CURX] = points[0] + (curves[idx+CURY] - points[1])*curves[idx+CURSLOPE]; - } - - private void addPathSegment(float[] pts, final int type, final int or) { - int idx; - float[] addTo; - switch (type) { - case 4: - idx = numEdges * SIZEOF_EDGE; - addTo = edges = Helpers.widenArray(edges, numEdges*SIZEOF_EDGE, SIZEOF_EDGE); - numEdges++; - break; - case 6: - idx = numQuads * SIZEOF_QUAD; - addTo = quads = Helpers.widenArray(quads, numQuads*SIZEOF_QUAD, SIZEOF_QUAD); - numQuads++; - break; - case 8: - idx = numCurves * SIZEOF_CURVE; - addTo = curves = Helpers.widenArray(curves, numCurves*SIZEOF_CURVE, SIZEOF_CURVE); - numCurves++; - break; - default: - throw new InternalError(); - } - // set the common fields, except CURX, for which we must know the kind - // of curve. NOTE: this must be done before the type specific fields - // are initialized, because those depend on the common ones. - addTo[idx+YMIN] = pts[1]; - addTo[idx+YMAX] = pts[type-1]; - addTo[idx+OR] = or; - addTo[idx+CURY] = (float)Math.ceil(pts[1]); - switch (type) { - case 4: - initLine(idx, pts, or); - break; - case 6: - initQuad(idx, pts, or); - break; - case 8: - initCurve(idx, pts, or); - break; - default: - throw new InternalError(); + // we use x0, y0 to walk the line + float x1 = x0, y1 = y0; + while (count > 0) { + while (Math.abs(ddx) > DEC_BND || Math.abs(ddy) > DEC_BND) { + dddx /= 8; + dddy /= 8; + ddx = ddx/4 - dddx; + ddy = ddy/4 - dddy; + dx = (dx - ddx) / 2; + dy = (dy - ddy) / 2; + count <<= 1; + } + // can only do this on even "count" values, because we must divide count by 2 + while (count % 2 == 0 && Math.abs(dx) <= INC_BND && Math.abs(dy) <= INC_BND) { + dx = 2 * dx + ddx; + dy = 2 * dy + ddy; + ddx = 4 * (ddx + dddx); + ddy = 4 * (ddy + dddy); + dddx = 8 * dddx; + dddy = 8 * dddy; + count >>= 1; + } + count--; + if (count > 0) { + x1 += dx; + dx += ddx; + ddx += dddx; + y1 += dy; + dy += ddy; + ddy += dddy; + } else { + x1 = x3; + y1 = y3; + } + addLine(x0, y0, x1, y1); + x0 = x1; + y0 = y1; } } - // precondition: the curve in pts must be monotonic and increasing in y. - private void somethingTo(float[] pts, final int type, final int or) { - // NOTE: it's very important that we check for or >= 0 below (as - // opposed to or == 1, or or > 0, or anything else). That's - // because if we check for or==1, when the curve being added - // is a horizontal line, or will be 0 so or==1 will be false and - // x0 and y0 will be updated to pts[0] and pts[1] instead of pts[type-2] - // and pts[type-1], which is the correct thing to do. - this.x0 = or >= 0 ? pts[type - 2] : pts[0]; - this.y0 = or >= 0 ? pts[type - 1] : pts[1]; - - float minY = pts[1], maxY = pts[type - 1]; - if (Math.ceil(minY) >= Math.ceil(maxY) || - Math.ceil(minY) >= boundsMaxY || maxY < boundsMinY) - { + // Preconditions: y2 > y1 and the curve must cross some scanline + // i.e.: y1 <= y < y2 for some y such that boundsMinY <= y < boundsMaxY + private void addLine(float x1, float y1, float x2, float y2) { + float or = 1; // orientation of the line. 1 if y increases, 0 otherwise. + if (y2 < y1) { + or = y2; // no need to declare a temp variable. We have or. + y2 = y1; + y1 = or; + or = x2; + x2 = x1; + x1 = or; + or = 0; + } + final int firstCrossing = Math.max((int) Math.ceil(y1), boundsMinY); + final int lastCrossing = Math.min((int)Math.ceil(y2), boundsMaxY); + if (firstCrossing >= lastCrossing) { return; } - if (minY < edgeMinY) { edgeMinY = minY; } - if (maxY > edgeMaxY) { edgeMaxY = maxY; } + if (y1 < edgeMinY) { edgeMinY = y1; } + if (y2 > edgeMaxY) { edgeMaxY = y2; } - int minXidx = (pts[0] < pts[type-2] ? 0 : type - 2); - float minX = pts[minXidx]; - float maxX = pts[type - 2 - minXidx]; - if (minX < edgeMinX) { edgeMinX = minX; } - if (maxX > edgeMaxX) { edgeMaxX = maxX; } - addPathSegment(pts, type, or); + final float slope = (x2 - x1) / (y2 - y1); + + if (slope > 0) { // <==> x1 < x2 + if (x1 < edgeMinX) { edgeMinX = x1; } + if (x2 > edgeMaxX) { edgeMaxX = x2; } + } else { + if (x2 < edgeMinX) { edgeMinX = x2; } + if (x1 > edgeMaxX) { edgeMaxX = x1; } + } + + final int ptr = numEdges * SIZEOF_EDGE; + edges = Helpers.widenArray(edges, ptr, SIZEOF_EDGE); + numEdges++; + edges[ptr+OR] = or; + edges[ptr+CURX] = x1 + (firstCrossing - y1) * slope; + edges[ptr+SLOPE] = slope; + edges[ptr+YMAX] = y2; + final int bucketIdx = firstCrossing - boundsMinY; + addEdgeToBucket(ptr, bucketIdx); + if (lastCrossing < boundsMaxY) { + edgeBucketCounts[lastCrossing - boundsMinY] |= 1; + } + } + + // preconditions: should not be called before the last line has been added + // to the edge list (even though it will return a correct answer at that + // point in time, it's not meant to be used that way). + private int getFirstScanLineCrossing() { + return Math.max(boundsMinY, (int)Math.ceil(edgeMinY)); + } + private int getScanLineCrossingEnd() { + return Math.min(boundsMaxY, (int)Math.ceil(edgeMaxY)); } // END EDGE LIST @@ -619,6 +365,10 @@ public class Renderer implements PathConsumer2D { this.boundsMinY = pix_boundsY * SUBPIXEL_POSITIONS_Y; this.boundsMaxX = (pix_boundsX + pix_boundsWidth) * SUBPIXEL_POSITIONS_X; this.boundsMaxY = (pix_boundsY + pix_boundsHeight) * SUBPIXEL_POSITIONS_Y; + + edgeBuckets = new int[boundsMaxY - boundsMinY]; + java.util.Arrays.fill(edgeBuckets, NULL); + edgeBucketCounts = new int[edgeBuckets.length]; } private float tosubpixx(float pix_x) { @@ -636,74 +386,34 @@ public class Renderer implements PathConsumer2D { this.x0 = tosubpixx(pix_x0); } - public void lineJoin() { /* do nothing */ } - - private final float[][] pts = new float[2][8]; - private final float[] ts = new float[4]; - - private static void invertPolyPoints(float[] pts, int off, int type) { - for (int i = off, j = off + type - 2; i < j; i += 2, j -= 2) { - float tmp = pts[i]; - pts[i] = pts[j]; - pts[j] = tmp; - tmp = pts[i+1]; - pts[i+1] = pts[j+1]; - pts[j+1] = tmp; - } - } - - // return orientation before making the curve upright. - private static int makeMonotonicCurveUpright(float[] pts, int off, int type) { - float y0 = pts[off + 1]; - float y1 = pts[off + type - 1]; - if (y0 > y1) { - invertPolyPoints(pts, off, type); - return -1; - } else if (y0 < y1) { - return 1; - } - return 0; - } - public void lineTo(float pix_x1, float pix_y1) { - pts[0][0] = x0; pts[0][1] = y0; - pts[0][2] = tosubpixx(pix_x1); pts[0][3] = tosubpixy(pix_y1); - int or = makeMonotonicCurveUpright(pts[0], 0, 4); - somethingTo(pts[0], 4, or); + float x1 = tosubpixx(pix_x1); + float y1 = tosubpixy(pix_y1); + addLine(x0, y0, x1, y1); + x0 = x1; + y0 = y1; } Curve c = new Curve(); - private void curveOrQuadTo(int type) { - c.set(pts[0], type); - int numTs = c.dxRoots(ts, 0); - numTs += c.dyRoots(ts, numTs); - numTs = Helpers.filterOutNotInAB(ts, 0, numTs, 0, 1); - Helpers.isort(ts, 0, numTs); - - Iterator it = Curve.breakPtsAtTs(pts, type, ts, numTs); - while(it.hasNext()) { - float[] curCurve = it.next(); - int or = makeMonotonicCurveUpright(curCurve, 0, type); - somethingTo(curCurve, type, or); - } - } - @Override public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) { - pts[0][0] = x0; pts[0][1] = y0; - pts[0][2] = tosubpixx(x1); pts[0][3] = tosubpixy(y1); - pts[0][4] = tosubpixx(x2); pts[0][5] = tosubpixy(y2); - pts[0][6] = tosubpixx(x3); pts[0][7] = tosubpixy(y3); - curveOrQuadTo(8); + final float xe = tosubpixx(x3); + final float ye = tosubpixy(y3); + c.set(x0, y0, tosubpixx(x1), tosubpixy(y1), tosubpixx(x2), tosubpixy(y2), xe, ye); + curveBreakIntoLinesAndAdd(x0, y0, c, xe, ye); + x0 = xe; + y0 = ye; } @Override public void quadTo(float x1, float y1, float x2, float y2) { - pts[0][0] = x0; pts[0][1] = y0; - pts[0][2] = tosubpixx(x1); pts[0][3] = tosubpixy(y1); - pts[0][4] = tosubpixx(x2); pts[0][5] = tosubpixy(y2); - curveOrQuadTo(6); + final float xe = tosubpixx(x2); + final float ye = tosubpixy(y2); + c.set(x0, y0, tosubpixx(x1), tosubpixy(y1), xe, ye); + quadBreakIntoLinesAndAdd(x0, y0, c, xe, ye); + x0 = xe; + y0 = ye; } public void closePath() { @@ -728,9 +438,9 @@ public class Renderer implements PathConsumer2D { // 0x1 if EVEN_ODD, all bits if NON_ZERO int mask = (windingRule == WIND_EVEN_ODD) ? 0x1 : ~0x0; - // add 1 to better deal with the last pixel in a pixel row. - int width = pix_bboxx1 - pix_bboxx0 + 1; - int[] alpha = new int[width+1]; + // add 2 to better deal with the last pixel in a pixel row. + int width = pix_bboxx1 - pix_bboxx0; + int[] alpha = new int[width+2]; int bboxx0 = pix_bboxx0 << SUBPIXEL_LG_POSITIONS_X; int bboxx1 = pix_bboxx1 << SUBPIXEL_LG_POSITIONS_X; @@ -766,7 +476,8 @@ public class Renderer implements PathConsumer2D { for (int i = 0; i < numCrossings; i++) { int curxo = crossings[i]; int curx = curxo >> 1; - int crorientation = ((curxo & 0x1) == 0x1) ? 1 : -1; + // to turn {0, 1} into {-1, 1}, multiply by 2 and subtract 1. + int crorientation = ((curxo & 0x1) << 1) -1; if ((sum & mask) != 0) { int x0 = Math.max(prev, bboxx0); int x1 = Math.min(curx, bboxx1); @@ -811,26 +522,26 @@ public class Renderer implements PathConsumer2D { } public void endRendering() { - final int bminx = boundsMinX >> SUBPIXEL_LG_POSITIONS_X; - final int bmaxx = boundsMaxX >> SUBPIXEL_LG_POSITIONS_X; - final int bminy = boundsMinY >> SUBPIXEL_LG_POSITIONS_Y; - final int bmaxy = boundsMaxY >> SUBPIXEL_LG_POSITIONS_Y; - final int eminx = ((int)Math.floor(edgeMinX)) >> SUBPIXEL_LG_POSITIONS_X; - final int emaxx = ((int)Math.ceil(edgeMaxX)) >> SUBPIXEL_LG_POSITIONS_X; - final int eminy = ((int)Math.floor(edgeMinY)) >> SUBPIXEL_LG_POSITIONS_Y; - final int emaxy = ((int)Math.ceil(edgeMaxY)) >> SUBPIXEL_LG_POSITIONS_Y; + int spminX = Math.max((int)Math.ceil(edgeMinX), boundsMinX); + int spmaxX = Math.min((int)Math.ceil(edgeMaxX), boundsMaxX); + int spminY = Math.max((int)Math.ceil(edgeMinY), boundsMinY); + int spmaxY = Math.min((int)Math.ceil(edgeMaxY), boundsMaxY); - final int minX = Math.max(bminx, eminx); - final int maxX = Math.min(bmaxx, emaxx); - final int minY = Math.max(bminy, eminy); - final int maxY = Math.min(bmaxy, emaxy); - if (minX > maxX || minY > maxY) { - this.cache = new PiscesCache(bminx, bminy, bmaxx, bmaxy); + int pminX = spminX >> SUBPIXEL_LG_POSITIONS_X; + int pmaxX = (spmaxX + SUBPIXEL_MASK_X) >> SUBPIXEL_LG_POSITIONS_X; + int pminY = spminY >> SUBPIXEL_LG_POSITIONS_Y; + int pmaxY = (spmaxY + SUBPIXEL_MASK_Y) >> SUBPIXEL_LG_POSITIONS_Y; + + if (pminX > pmaxX || pminY > pmaxY) { + this.cache = new PiscesCache(boundsMinX >> SUBPIXEL_LG_POSITIONS_X, + boundsMinY >> SUBPIXEL_LG_POSITIONS_Y, + boundsMaxX >> SUBPIXEL_LG_POSITIONS_X, + boundsMaxY >> SUBPIXEL_LG_POSITIONS_Y); return; } - this.cache = new PiscesCache(minX, minY, maxX, maxY); - _endRendering(minX, minY, maxX, maxY); + this.cache = new PiscesCache(pminX, pminY, pmaxX, pmaxY); + _endRendering(pminX, pminY, pmaxX, pmaxY); } public PiscesCache getCache() { diff --git a/jdk/src/share/classes/sun/java2d/pisces/Stroker.java b/jdk/src/share/classes/sun/java2d/pisces/Stroker.java index 7136fd6ef92..b898febc4c2 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/Stroker.java +++ b/jdk/src/share/classes/sun/java2d/pisces/Stroker.java @@ -33,7 +33,7 @@ import sun.awt.geom.PathConsumer2D; // TODO: some of the arithmetic here is too verbose and prone to hard to // debug typos. We should consider making a small Point/Vector class that // has methods like plus(Point), minus(Point), dot(Point), cross(Point)and such -public class Stroker implements PathConsumer2D { +final class Stroker implements PathConsumer2D { private static final int MOVE_TO = 0; private static final int DRAWING_OP_TO = 1; // ie. curve, line, or quad @@ -130,7 +130,7 @@ public class Stroker implements PathConsumer2D { private static void computeOffset(final float lx, final float ly, final float w, final float[] m) { - final float len = (float)Math.hypot(lx, ly); + final float len = (float)Math.sqrt(lx*lx + ly*ly); if (len == 0) { m[0] = m[1] = 0; } else { @@ -758,7 +758,7 @@ public class Stroker implements PathConsumer2D { // This is where the curve to be processed is put. We give it // enough room to store 2 curves: one for the current subdivision, the // other for the rest of the curve. - private float[][] middle = new float[2][8]; + private float[] middle = new float[2*8]; private float[] lp = new float[8]; private float[] rp = new float[8]; private static final int MAX_N_CURVES = 11; @@ -766,55 +766,55 @@ public class Stroker implements PathConsumer2D { private void somethingTo(final int type) { // need these so we can update the state at the end of this method - final float xf = middle[0][type-2], yf = middle[0][type-1]; - float dxs = middle[0][2] - middle[0][0]; - float dys = middle[0][3] - middle[0][1]; - float dxf = middle[0][type - 2] - middle[0][type - 4]; - float dyf = middle[0][type - 1] - middle[0][type - 3]; + final float xf = middle[type-2], yf = middle[type-1]; + float dxs = middle[2] - middle[0]; + float dys = middle[3] - middle[1]; + float dxf = middle[type - 2] - middle[type - 4]; + float dyf = middle[type - 1] - middle[type - 3]; switch(type) { case 6: if ((dxs == 0f && dys == 0f) || (dxf == 0f && dyf == 0f)) { - dxs = dxf = middle[0][4] - middle[0][0]; - dys = dyf = middle[0][5] - middle[0][1]; + dxs = dxf = middle[4] - middle[0]; + dys = dyf = middle[5] - middle[1]; } break; case 8: boolean p1eqp2 = (dxs == 0f && dys == 0f); boolean p3eqp4 = (dxf == 0f && dyf == 0f); if (p1eqp2) { - dxs = middle[0][4] - middle[0][0]; - dys = middle[0][5] - middle[0][1]; + dxs = middle[4] - middle[0]; + dys = middle[5] - middle[1]; if (dxs == 0f && dys == 0f) { - dxs = middle[0][6] - middle[0][0]; - dys = middle[0][7] - middle[0][1]; + dxs = middle[6] - middle[0]; + dys = middle[7] - middle[1]; } } if (p3eqp4) { - dxf = middle[0][6] - middle[0][2]; - dyf = middle[0][7] - middle[0][3]; + dxf = middle[6] - middle[2]; + dyf = middle[7] - middle[3]; if (dxf == 0f && dyf == 0f) { - dxf = middle[0][6] - middle[0][0]; - dyf = middle[0][7] - middle[0][1]; + dxf = middle[6] - middle[0]; + dyf = middle[7] - middle[1]; } } } if (dxs == 0f && dys == 0f) { // this happens iff the "curve" is just a point - lineTo(middle[0][0], middle[0][1]); + lineTo(middle[0], middle[1]); return; } // if these vectors are too small, normalize them, to avoid future // precision problems. if (Math.abs(dxs) < 0.1f && Math.abs(dys) < 0.1f) { - double len = Math.hypot(dxs, dys); - dxs = (float)(dxs / len); - dys = (float)(dys / len); + float len = (float)Math.sqrt(dxs*dxs + dys*dys); + dxs /= len; + dys /= len; } if (Math.abs(dxf) < 0.1f && Math.abs(dyf) < 0.1f) { - double len = Math.hypot(dxf, dyf); - dxf = (float)(dxf / len); - dyf = (float)(dyf / len); + float len = (float)Math.sqrt(dxf*dxf + dyf*dyf); + dxf /= len; + dyf /= len; } computeOffset(dxs, dys, lineWidth2, offset[0]); @@ -822,20 +822,20 @@ public class Stroker implements PathConsumer2D { final float my = offset[0][1]; drawJoin(cdx, cdy, cx0, cy0, dxs, dys, cmx, cmy, mx, my); - int nSplits = findSubdivPoints(middle[0], subdivTs, type,lineWidth2); + int nSplits = findSubdivPoints(middle, subdivTs, type, lineWidth2); int kind = 0; - Iterator it = Curve.breakPtsAtTs(middle, type, subdivTs, nSplits); + Iterator it = Curve.breakPtsAtTs(middle, type, subdivTs, nSplits); while(it.hasNext()) { - float[] curCurve = it.next(); + int curCurveOff = it.next(); kind = 0; switch (type) { case 8: - kind = computeOffsetCubic(curCurve, 0, lp, rp); + kind = computeOffsetCubic(middle, curCurveOff, lp, rp); break; case 6: - kind = computeOffsetQuad(curCurve, 0, lp, rp); + kind = computeOffsetQuad(middle, curCurveOff, lp, rp); break; } if (kind != 0) { @@ -871,8 +871,7 @@ public class Stroker implements PathConsumer2D { // to get good offset curves a distance of w away from the middle curve. // Stores the points in ts, and returns how many of them there were. private static Curve c = new Curve(); - private static int findSubdivPoints(float[] pts, float[] ts, - final int type, final float w) + private static int findSubdivPoints(float[] pts, float[] ts, final int type, final float w) { final float x12 = pts[2] - pts[0]; final float y12 = pts[3] - pts[1]; @@ -919,6 +918,7 @@ public class Stroker implements PathConsumer2D { // now we must subdivide at points where one of the offset curves will have // a cusp. This happens at ts where the radius of curvature is equal to w. ret += c.rootsOfROCMinusW(ts, ret, w, 0.0001f); + ret = Helpers.filterOutNotInAB(ts, 0, ret, 0.0001f, 0.9999f); Helpers.isort(ts, 0, ret); return ret; @@ -928,10 +928,10 @@ public class Stroker implements PathConsumer2D { float x2, float y2, float x3, float y3) { - middle[0][0] = cx0; middle[0][1] = cy0; - middle[0][2] = x1; middle[0][3] = y1; - middle[0][4] = x2; middle[0][5] = y2; - middle[0][6] = x3; middle[0][7] = y3; + middle[0] = cx0; middle[1] = cy0; + middle[2] = x1; middle[3] = y1; + middle[4] = x2; middle[5] = y2; + middle[6] = x3; middle[7] = y3; somethingTo(8); } @@ -940,9 +940,9 @@ public class Stroker implements PathConsumer2D { } @Override public void quadTo(float x1, float y1, float x2, float y2) { - middle[0][0] = cx0; middle[0][1] = cy0; - middle[0][2] = x1; middle[0][3] = y1; - middle[0][4] = x2; middle[0][5] = y2; + middle[0] = cx0; middle[1] = cy0; + middle[2] = x1; middle[3] = y1; + middle[4] = x2; middle[5] = y2; somethingTo(6); } diff --git a/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java b/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java index f88fa5cc948..21192a8c0ae 100644 --- a/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java +++ b/jdk/src/share/classes/sun/java2d/pisces/TransformingPathConsumer2D.java @@ -28,7 +28,7 @@ package sun.java2d.pisces; import sun.awt.geom.PathConsumer2D; import java.awt.geom.AffineTransform; -public class TransformingPathConsumer2D { +final class TransformingPathConsumer2D { public static PathConsumer2D transformConsumer(PathConsumer2D out, AffineTransform at) @@ -50,17 +50,72 @@ public class TransformingPathConsumer2D { return new TranslateFilter(out, Mxt, Myt); } } else { - return new ScaleFilter(out, Mxx, Myy, Mxt, Myt); + if (Mxt == 0f && Myt == 0f) { + return new DeltaScaleFilter(out, Mxx, Myy); + } else { + return new ScaleFilter(out, Mxx, Myy, Mxt, Myt); + } } + } else if (Mxt == 0f && Myt == 0f) { + return new DeltaTransformFilter(out, Mxx, Mxy, Myx, Myy); } else { return new TransformFilter(out, Mxx, Mxy, Mxt, Myx, Myy, Myt); } } - static class TranslateFilter implements PathConsumer2D { - PathConsumer2D out; - float tx; - float ty; + public static PathConsumer2D + deltaTransformConsumer(PathConsumer2D out, + AffineTransform at) + { + if (at == null) { + return out; + } + float Mxx = (float) at.getScaleX(); + float Mxy = (float) at.getShearX(); + float Myx = (float) at.getShearY(); + float Myy = (float) at.getScaleY(); + if (Mxy == 0f && Myx == 0f) { + if (Mxx == 1f && Myy == 1f) { + return out; + } else { + return new DeltaScaleFilter(out, Mxx, Myy); + } + } else { + return new DeltaTransformFilter(out, Mxx, Mxy, Myx, Myy); + } + } + + public static PathConsumer2D + inverseDeltaTransformConsumer(PathConsumer2D out, + AffineTransform at) + { + if (at == null) { + return out; + } + float Mxx = (float) at.getScaleX(); + float Mxy = (float) at.getShearX(); + float Myx = (float) at.getShearY(); + float Myy = (float) at.getScaleY(); + if (Mxy == 0f && Myx == 0f) { + if (Mxx == 1f && Myy == 1f) { + return out; + } else { + return new DeltaScaleFilter(out, 1.0f/Mxx, 1.0f/Myy); + } + } else { + float det = Mxx * Myy - Mxy * Myx; + return new DeltaTransformFilter(out, + Myy / det, + -Mxy / det, + -Myx / det, + Mxx / det); + } + } + + static final class TranslateFilter implements PathConsumer2D { + private final PathConsumer2D out; + private final float tx; + private final float ty; TranslateFilter(PathConsumer2D out, float tx, float ty) @@ -107,12 +162,12 @@ public class TransformingPathConsumer2D { } } - static class ScaleFilter implements PathConsumer2D { - PathConsumer2D out; - float sx; - float sy; - float tx; - float ty; + static final class ScaleFilter implements PathConsumer2D { + private final PathConsumer2D out; + private final float sx; + private final float sy; + private final float tx; + private final float ty; ScaleFilter(PathConsumer2D out, float sx, float sy, float tx, float ty) @@ -161,14 +216,14 @@ public class TransformingPathConsumer2D { } } - static class TransformFilter implements PathConsumer2D { - PathConsumer2D out; - float Mxx; - float Mxy; - float Mxt; - float Myx; - float Myy; - float Myt; + static final class TransformFilter implements PathConsumer2D { + private final PathConsumer2D out; + private final float Mxx; + private final float Mxy; + private final float Mxt; + private final float Myx; + private final float Myy; + private final float Myt; TransformFilter(PathConsumer2D out, float Mxx, float Mxy, float Mxt, @@ -226,4 +281,113 @@ public class TransformingPathConsumer2D { return 0; } } + + static final class DeltaScaleFilter implements PathConsumer2D { + private final float sx, sy; + private final PathConsumer2D out; + + public DeltaScaleFilter(PathConsumer2D out, float Mxx, float Myy) { + sx = Mxx; + sy = Myy; + this.out = out; + } + + public void moveTo(float x0, float y0) { + out.moveTo(x0 * sx, y0 * sy); + } + + public void lineTo(float x1, float y1) { + out.lineTo(x1 * sx, y1 * sy); + } + + public void quadTo(float x1, float y1, + float x2, float y2) + { + out.quadTo(x1 * sx, y1 * sy, + x2 * sx, y2 * sy); + } + + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + out.curveTo(x1 * sx, y1 * sy, + x2 * sx, y2 * sy, + x3 * sx, y3 * sy); + } + + public void closePath() { + out.closePath(); + } + + public void pathDone() { + out.pathDone(); + } + + public long getNativeConsumer() { + return 0; + } + } + + static final class DeltaTransformFilter implements PathConsumer2D { + private PathConsumer2D out; + private final float Mxx; + private final float Mxy; + private final float Myx; + private final float Myy; + + DeltaTransformFilter(PathConsumer2D out, + float Mxx, float Mxy, + float Myx, float Myy) + { + this.out = out; + this.Mxx = Mxx; + this.Mxy = Mxy; + this.Myx = Myx; + this.Myy = Myy; + } + + public void moveTo(float x0, float y0) { + out.moveTo(x0 * Mxx + y0 * Mxy, + x0 * Myx + y0 * Myy); + } + + public void lineTo(float x1, float y1) { + out.lineTo(x1 * Mxx + y1 * Mxy, + x1 * Myx + y1 * Myy); + } + + public void quadTo(float x1, float y1, + float x2, float y2) + { + out.quadTo(x1 * Mxx + y1 * Mxy, + x1 * Myx + y1 * Myy, + x2 * Mxx + y2 * Mxy, + x2 * Myx + y2 * Myy); + } + + public void curveTo(float x1, float y1, + float x2, float y2, + float x3, float y3) + { + out.curveTo(x1 * Mxx + y1 * Mxy, + x1 * Myx + y1 * Myy, + x2 * Mxx + y2 * Mxy, + x2 * Myx + y2 * Myy, + x3 * Mxx + y3 * Mxy, + x3 * Myx + y3 * Myy); + } + + public void closePath() { + out.closePath(); + } + + public void pathDone() { + out.pathDone(); + } + + public long getNativeConsumer() { + return 0; + } + } } From 477c01454f5d4d1178a8d378ca21c8a16b8a570d Mon Sep 17 00:00:00 2001 From: Vladimir Yaroslavskiy Date: Tue, 8 Feb 2011 15:50:30 +0000 Subject: [PATCH 62/84] 7013585: Dual-pivot quicksort improvements for highly structured (nearly sorted) and data with small periods Reviewed-by: mduigou, alanb --- .../classes/java/util/DualPivotQuicksort.java | 1160 +++++++++++++---- jdk/test/java/util/Arrays/Sorting.java | 80 +- 2 files changed, 914 insertions(+), 326 deletions(-) diff --git a/jdk/src/share/classes/java/util/DualPivotQuicksort.java b/jdk/src/share/classes/java/util/DualPivotQuicksort.java index 616ee2e2fe2..2a39dfdd985 100644 --- a/jdk/src/share/classes/java/util/DualPivotQuicksort.java +++ b/jdk/src/share/classes/java/util/DualPivotQuicksort.java @@ -36,7 +36,7 @@ package java.util; * @author Jon Bentley * @author Josh Bloch * - * @version 2010.10.13 m765.827.12i:5\7p + * @version 2011.01.21 m765.827.12i:5\7pm * @since 1.7 */ final class DualPivotQuicksort { @@ -50,6 +50,22 @@ final class DualPivotQuicksort { * Tuning parameters. */ + /** + * The maximum number of runs in merge sort. + */ + private static final int MAX_RUN_COUNT = 67; + + /** + * The maximum length of run in merge sort. + */ + private static final int MAX_RUN_LENGTH = 33; + + /** + * If the length of an array to be sorted is less than this + * constant, Quicksort is used in preference to merge sort. + */ + private static final int QUICKSORT_THRESHOLD = 286; + /** * If the length of an array to be sorted is less than this * constant, insertion sort is used in preference to Quicksort. @@ -78,7 +94,7 @@ final class DualPivotQuicksort { * @param a the array to be sorted */ public static void sort(int[] a) { - sort(a, 0, a.length - 1, true); + sort(a, 0, a.length - 1); } /** @@ -89,7 +105,89 @@ final class DualPivotQuicksort { * @param right the index of the last element, inclusive, to be sorted */ public static void sort(int[] a, int left, int right) { - sort(a, left, right, true); + // Use Quicksort on small arrays + if (right - left < QUICKSORT_THRESHOLD) { + sort(a, left, right, true); + return; + } + + /* + * Index run[i] is the start of i-th run + * (ascending or descending sequence). + */ + int[] run = new int[MAX_RUN_COUNT]; + int count = 0; run[0] = left; + + // Check if the array is nearly sorted + for (int k = left; k < right; run[count] = k) { + if (a[k] < a[k + 1]) { // ascending + while (++k <= right && a[k - 1] <= a[k]); + } else if (a[k] > a[k + 1]) { // descending + while (++k <= right && a[k - 1] >= a[k]); + for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { + int t = a[lo]; a[lo] = a[hi]; a[hi] = t; + } + } else { // equal + for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { + if (--m == 0) { + sort(a, left, right, true); + return; + } + } + } + + /* + * The array is not highly structured, + * use Quicksort instead of merge sort. + */ + if (++count == MAX_RUN_COUNT) { + sort(a, left, right, true); + return; + } + } + + // Check special cases + if (run[count] == right++) { // The last run contains one element + run[++count] = right; + } else if (count == 1) { // The array is already sorted + return; + } + + /* + * Create temporary array, which is used for merging. + * Implementation note: variable "right" is increased by 1. + */ + int[] b; byte odd = 0; + for (int n = 1; (n <<= 1) < count; odd ^= 1); + + if (odd == 0) { + b = a; a = new int[b.length]; + for (int i = left - 1; ++i < right; a[i] = b[i]); + } else { + b = new int[a.length]; + } + + // Merging + for (int last; count > 1; count = last) { + for (int k = (last = 0) + 2; k <= count; k += 2) { + int hi = run[k], mi = run[k - 1]; + for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { + if (q >= hi || p < mi && a[p] <= a[q]) { + b[i] = a[p++]; + } else { + b[i] = a[q++]; + } + } + run[++last] = hi; + } + if ((count & 1) != 0) { + for (int i = right, lo = run[count - 1]; --i >= lo; + b[i] = a[i] + ); + run[++last] = right; + } + int[] t = a; a = b; b = t; + } } /** @@ -103,7 +201,7 @@ final class DualPivotQuicksort { private static void sort(int[] a, int left, int right, boolean leftmost) { int length = right - left + 1; - // Use insertion sort on small arrays + // Use insertion sort on tiny arrays if (length < INSERTION_SORT_THRESHOLD) { if (leftmost) { /* @@ -126,26 +224,24 @@ final class DualPivotQuicksort { * Skip the longest ascending sequence. */ do { - if (left++ >= right) { + if (left >= right) { return; } - } while (a[left - 1] <= a[left]); + } while (a[++left] >= a[left - 1]); /* * Every element from adjoining part plays the role * of sentinel, therefore this allows us to avoid the * left range check on each iteration. Moreover, we use - * the best improved algorithm, so called pair insertion - * sort, which is faster than traditional implementation - * in the context of Dual-Pivot Quicksort. + * the more optimized algorithm, so called pair insertion + * sort, which is faster (in the context of Quicksort) + * than traditional implementation of insertion sort. */ - for (int k = left--; (left += 2) <= right; ) { - int a1, a2; k = left - 1; + for (int k = left; ++left <= right; k = ++left) { + int a1 = a[k], a2 = a[left]; - if (a[k] < a[left]) { - a2 = a[k]; a1 = a[left]; - } else { - a1 = a[k]; a2 = a[left]; + if (a1 < a2) { + a2 = a1; a1 = a[left]; } while (a1 < a[--k]) { a[k + 2] = a[k]; @@ -202,19 +298,19 @@ final class DualPivotQuicksort { } } - /* - * Use the second and fourth of the five sorted elements as pivots. - * These values are inexpensive approximations of the first and - * second terciles of the array. Note that pivot1 <= pivot2. - */ - int pivot1 = a[e2]; - int pivot2 = a[e4]; - // Pointers int less = left; // The index of the first element of center part int great = right; // The index before the first element of right part - if (pivot1 != pivot2) { + if (a[e1] != a[e2] && a[e2] != a[e3] && a[e3] != a[e4] && a[e4] != a[e5]) { + /* + * Use the second and fourth of the five sorted elements as pivots. + * These values are inexpensive approximations of the first and + * second terciles of the array. Note that pivot1 <= pivot2. + */ + int pivot1 = a[e2]; + int pivot2 = a[e4]; + /* * The first and the last elements to be sorted are moved to the * locations formerly occupied by the pivots. When partitioning @@ -259,7 +355,7 @@ final class DualPivotQuicksort { * of "a[i++] = b;" due to performance issue. */ a[less] = ak; - less++; + ++less; } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { if (great-- == k) { @@ -269,7 +365,7 @@ final class DualPivotQuicksort { if (a[great] < pivot1) { // a[great] <= pivot2 a[k] = a[less]; a[less] = a[great]; - less++; + ++less; } else { // pivot1 <= a[great] <= pivot2 a[k] = a[great]; } @@ -278,7 +374,7 @@ final class DualPivotQuicksort { * of "a[i--] = b;" due to performance issue. */ a[great] = ak; - great--; + --great; } } @@ -299,10 +395,11 @@ final class DualPivotQuicksort { * Skip elements, which are equal to pivot values. */ while (a[less] == pivot1) { - less++; + ++less; } + while (a[great] == pivot2) { - great--; + --great; } /* @@ -330,7 +427,7 @@ final class DualPivotQuicksort { if (ak == pivot1) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; + ++less; } else if (ak == pivot2) { // Move a[k] to right part while (a[great] == pivot2) { if (great-- == k) { @@ -348,12 +445,12 @@ final class DualPivotQuicksort { * accurate assignment a[less] = a[great]. */ a[less] = pivot1; - less++; + ++less; } else { // pivot1 < a[great] < pivot2 a[k] = a[great]; } a[great] = ak; - great--; + --great; } } } @@ -361,7 +458,13 @@ final class DualPivotQuicksort { // Sort center part recursively sort(a, less, great, false); - } else { // Pivots are equal + } else { // Partitioning with one pivot + /* + * Use the third of the five sorted elements as pivot. + * This value is inexpensive approximation of the median. + */ + int pivot = a[e3]; + /* * Partitioning degenerates to the traditional 3-way * (or "Dutch National Flag") schema: @@ -383,35 +486,35 @@ final class DualPivotQuicksort { * Pointer k is the first index of ?-part. */ for (int k = less; k <= great; ++k) { - if (a[k] == pivot1) { + if (a[k] == pivot) { continue; } int ak = a[k]; - if (ak < pivot1) { // Move a[k] to left part + if (ak < pivot) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; - } else { // a[k] > pivot1 - Move a[k] to right part - while (a[great] > pivot1) { - great--; + ++less; + } else { // a[k] > pivot - Move a[k] to right part + while (a[great] > pivot) { + --great; } - if (a[great] < pivot1) { // a[great] <= pivot1 + if (a[great] < pivot) { // a[great] <= pivot a[k] = a[less]; a[less] = a[great]; - less++; - } else { // a[great] == pivot1 + ++less; + } else { // a[great] == pivot /* - * Even though a[great] equals to pivot1, the - * assignment a[k] = pivot1 may be incorrect, - * if a[great] and pivot1 are floating-point + * Even though a[great] equals to pivot, the + * assignment a[k] = pivot may be incorrect, + * if a[great] and pivot are floating-point * zeros of different signs. Therefore in float * and double sorting methods we have to use * more accurate assignment a[k] = a[great]. */ - a[k] = pivot1; + a[k] = pivot; } a[great] = ak; - great--; + --great; } } @@ -431,7 +534,7 @@ final class DualPivotQuicksort { * @param a the array to be sorted */ public static void sort(long[] a) { - sort(a, 0, a.length - 1, true); + sort(a, 0, a.length - 1); } /** @@ -442,7 +545,89 @@ final class DualPivotQuicksort { * @param right the index of the last element, inclusive, to be sorted */ public static void sort(long[] a, int left, int right) { - sort(a, left, right, true); + // Use Quicksort on small arrays + if (right - left < QUICKSORT_THRESHOLD) { + sort(a, left, right, true); + return; + } + + /* + * Index run[i] is the start of i-th run + * (ascending or descending sequence). + */ + int[] run = new int[MAX_RUN_COUNT]; + int count = 0; run[0] = left; + + // Check if the array is nearly sorted + for (int k = left; k < right; run[count] = k) { + if (a[k] < a[k + 1]) { // ascending + while (++k <= right && a[k - 1] <= a[k]); + } else if (a[k] > a[k + 1]) { // descending + while (++k <= right && a[k - 1] >= a[k]); + for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { + long t = a[lo]; a[lo] = a[hi]; a[hi] = t; + } + } else { // equal + for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { + if (--m == 0) { + sort(a, left, right, true); + return; + } + } + } + + /* + * The array is not highly structured, + * use Quicksort instead of merge sort. + */ + if (++count == MAX_RUN_COUNT) { + sort(a, left, right, true); + return; + } + } + + // Check special cases + if (run[count] == right++) { // The last run contains one element + run[++count] = right; + } else if (count == 1) { // The array is already sorted + return; + } + + /* + * Create temporary array, which is used for merging. + * Implementation note: variable "right" is increased by 1. + */ + long[] b; byte odd = 0; + for (int n = 1; (n <<= 1) < count; odd ^= 1); + + if (odd == 0) { + b = a; a = new long[b.length]; + for (int i = left - 1; ++i < right; a[i] = b[i]); + } else { + b = new long[a.length]; + } + + // Merging + for (int last; count > 1; count = last) { + for (int k = (last = 0) + 2; k <= count; k += 2) { + int hi = run[k], mi = run[k - 1]; + for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { + if (q >= hi || p < mi && a[p] <= a[q]) { + b[i] = a[p++]; + } else { + b[i] = a[q++]; + } + } + run[++last] = hi; + } + if ((count & 1) != 0) { + for (int i = right, lo = run[count - 1]; --i >= lo; + b[i] = a[i] + ); + run[++last] = right; + } + long[] t = a; a = b; b = t; + } } /** @@ -456,7 +641,7 @@ final class DualPivotQuicksort { private static void sort(long[] a, int left, int right, boolean leftmost) { int length = right - left + 1; - // Use insertion sort on small arrays + // Use insertion sort on tiny arrays if (length < INSERTION_SORT_THRESHOLD) { if (leftmost) { /* @@ -479,26 +664,24 @@ final class DualPivotQuicksort { * Skip the longest ascending sequence. */ do { - if (left++ >= right) { + if (left >= right) { return; } - } while (a[left - 1] <= a[left]); + } while (a[++left] >= a[left - 1]); /* * Every element from adjoining part plays the role * of sentinel, therefore this allows us to avoid the * left range check on each iteration. Moreover, we use - * the best improved algorithm, so called pair insertion - * sort, which is faster than traditional implementation - * in the context of Dual-Pivot Quicksort. + * the more optimized algorithm, so called pair insertion + * sort, which is faster (in the context of Quicksort) + * than traditional implementation of insertion sort. */ - for (int k = left--; (left += 2) <= right; ) { - long a1, a2; k = left - 1; + for (int k = left; ++left <= right; k = ++left) { + long a1 = a[k], a2 = a[left]; - if (a[k] < a[left]) { - a2 = a[k]; a1 = a[left]; - } else { - a1 = a[k]; a2 = a[left]; + if (a1 < a2) { + a2 = a1; a1 = a[left]; } while (a1 < a[--k]) { a[k + 2] = a[k]; @@ -555,19 +738,19 @@ final class DualPivotQuicksort { } } - /* - * Use the second and fourth of the five sorted elements as pivots. - * These values are inexpensive approximations of the first and - * second terciles of the array. Note that pivot1 <= pivot2. - */ - long pivot1 = a[e2]; - long pivot2 = a[e4]; - // Pointers int less = left; // The index of the first element of center part int great = right; // The index before the first element of right part - if (pivot1 != pivot2) { + if (a[e1] != a[e2] && a[e2] != a[e3] && a[e3] != a[e4] && a[e4] != a[e5]) { + /* + * Use the second and fourth of the five sorted elements as pivots. + * These values are inexpensive approximations of the first and + * second terciles of the array. Note that pivot1 <= pivot2. + */ + long pivot1 = a[e2]; + long pivot2 = a[e4]; + /* * The first and the last elements to be sorted are moved to the * locations formerly occupied by the pivots. When partitioning @@ -612,7 +795,7 @@ final class DualPivotQuicksort { * of "a[i++] = b;" due to performance issue. */ a[less] = ak; - less++; + ++less; } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { if (great-- == k) { @@ -622,7 +805,7 @@ final class DualPivotQuicksort { if (a[great] < pivot1) { // a[great] <= pivot2 a[k] = a[less]; a[less] = a[great]; - less++; + ++less; } else { // pivot1 <= a[great] <= pivot2 a[k] = a[great]; } @@ -631,7 +814,7 @@ final class DualPivotQuicksort { * of "a[i--] = b;" due to performance issue. */ a[great] = ak; - great--; + --great; } } @@ -652,10 +835,11 @@ final class DualPivotQuicksort { * Skip elements, which are equal to pivot values. */ while (a[less] == pivot1) { - less++; + ++less; } + while (a[great] == pivot2) { - great--; + --great; } /* @@ -683,7 +867,7 @@ final class DualPivotQuicksort { if (ak == pivot1) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; + ++less; } else if (ak == pivot2) { // Move a[k] to right part while (a[great] == pivot2) { if (great-- == k) { @@ -701,12 +885,12 @@ final class DualPivotQuicksort { * accurate assignment a[less] = a[great]. */ a[less] = pivot1; - less++; + ++less; } else { // pivot1 < a[great] < pivot2 a[k] = a[great]; } a[great] = ak; - great--; + --great; } } } @@ -714,7 +898,13 @@ final class DualPivotQuicksort { // Sort center part recursively sort(a, less, great, false); - } else { // Pivots are equal + } else { // Partitioning with one pivot + /* + * Use the third of the five sorted elements as pivot. + * This value is inexpensive approximation of the median. + */ + long pivot = a[e3]; + /* * Partitioning degenerates to the traditional 3-way * (or "Dutch National Flag") schema: @@ -736,35 +926,35 @@ final class DualPivotQuicksort { * Pointer k is the first index of ?-part. */ for (int k = less; k <= great; ++k) { - if (a[k] == pivot1) { + if (a[k] == pivot) { continue; } long ak = a[k]; - if (ak < pivot1) { // Move a[k] to left part + if (ak < pivot) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; - } else { // a[k] > pivot1 - Move a[k] to right part - while (a[great] > pivot1) { - great--; + ++less; + } else { // a[k] > pivot - Move a[k] to right part + while (a[great] > pivot) { + --great; } - if (a[great] < pivot1) { // a[great] <= pivot1 + if (a[great] < pivot) { // a[great] <= pivot a[k] = a[less]; a[less] = a[great]; - less++; - } else { // a[great] == pivot1 + ++less; + } else { // a[great] == pivot /* - * Even though a[great] equals to pivot1, the - * assignment a[k] = pivot1 may be incorrect, - * if a[great] and pivot1 are floating-point + * Even though a[great] equals to pivot, the + * assignment a[k] = pivot may be incorrect, + * if a[great] and pivot are floating-point * zeros of different signs. Therefore in float * and double sorting methods we have to use * more accurate assignment a[k] = a[great]. */ - a[k] = pivot1; + a[k] = pivot; } a[great] = ak; - great--; + --great; } } @@ -799,9 +989,9 @@ final class DualPivotQuicksort { if (right - left > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) { int[] count = new int[NUM_SHORT_VALUES]; - for (int i = left - 1; ++i <= right; ) { - count[a[i] - Short.MIN_VALUE]++; - } + for (int i = left - 1; ++i <= right; + count[a[i] - Short.MIN_VALUE]++ + ); for (int i = NUM_SHORT_VALUES, k = right + 1; k > left; ) { while (count[--i] == 0); short value = (short) (i + Short.MIN_VALUE); @@ -812,13 +1002,106 @@ final class DualPivotQuicksort { } while (--s > 0); } } else { // Use Dual-Pivot Quicksort on small arrays - sort(a, left, right, true); + doSort(a, left, right); } } /** The number of distinct short values. */ private static final int NUM_SHORT_VALUES = 1 << 16; + /** + * Sorts the specified range of the array. + * + * @param a the array to be sorted + * @param left the index of the first element, inclusive, to be sorted + * @param right the index of the last element, inclusive, to be sorted + */ + private static void doSort(short[] a, int left, int right) { + // Use Quicksort on small arrays + if (right - left < QUICKSORT_THRESHOLD) { + sort(a, left, right, true); + return; + } + + /* + * Index run[i] is the start of i-th run + * (ascending or descending sequence). + */ + int[] run = new int[MAX_RUN_COUNT]; + int count = 0; run[0] = left; + + // Check if the array is nearly sorted + for (int k = left; k < right; run[count] = k) { + if (a[k] < a[k + 1]) { // ascending + while (++k <= right && a[k - 1] <= a[k]); + } else if (a[k] > a[k + 1]) { // descending + while (++k <= right && a[k - 1] >= a[k]); + for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { + short t = a[lo]; a[lo] = a[hi]; a[hi] = t; + } + } else { // equal + for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { + if (--m == 0) { + sort(a, left, right, true); + return; + } + } + } + + /* + * The array is not highly structured, + * use Quicksort instead of merge sort. + */ + if (++count == MAX_RUN_COUNT) { + sort(a, left, right, true); + return; + } + } + + // Check special cases + if (run[count] == right++) { // The last run contains one element + run[++count] = right; + } else if (count == 1) { // The array is already sorted + return; + } + + /* + * Create temporary array, which is used for merging. + * Implementation note: variable "right" is increased by 1. + */ + short[] b; byte odd = 0; + for (int n = 1; (n <<= 1) < count; odd ^= 1); + + if (odd == 0) { + b = a; a = new short[b.length]; + for (int i = left - 1; ++i < right; a[i] = b[i]); + } else { + b = new short[a.length]; + } + + // Merging + for (int last; count > 1; count = last) { + for (int k = (last = 0) + 2; k <= count; k += 2) { + int hi = run[k], mi = run[k - 1]; + for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { + if (q >= hi || p < mi && a[p] <= a[q]) { + b[i] = a[p++]; + } else { + b[i] = a[q++]; + } + } + run[++last] = hi; + } + if ((count & 1) != 0) { + for (int i = right, lo = run[count - 1]; --i >= lo; + b[i] = a[i] + ); + run[++last] = right; + } + short[] t = a; a = b; b = t; + } + } + /** * Sorts the specified range of the array by Dual-Pivot Quicksort. * @@ -827,10 +1110,10 @@ final class DualPivotQuicksort { * @param right the index of the last element, inclusive, to be sorted * @param leftmost indicates if this part is the leftmost in the range */ - private static void sort(short[] a, int left, int right,boolean leftmost) { + private static void sort(short[] a, int left, int right, boolean leftmost) { int length = right - left + 1; - // Use insertion sort on small arrays + // Use insertion sort on tiny arrays if (length < INSERTION_SORT_THRESHOLD) { if (leftmost) { /* @@ -853,26 +1136,24 @@ final class DualPivotQuicksort { * Skip the longest ascending sequence. */ do { - if (left++ >= right) { + if (left >= right) { return; } - } while (a[left - 1] <= a[left]); + } while (a[++left] >= a[left - 1]); /* * Every element from adjoining part plays the role * of sentinel, therefore this allows us to avoid the * left range check on each iteration. Moreover, we use - * the best improved algorithm, so called pair insertion - * sort, which is faster than traditional implementation - * in the context of Dual-Pivot Quicksort. + * the more optimized algorithm, so called pair insertion + * sort, which is faster (in the context of Quicksort) + * than traditional implementation of insertion sort. */ - for (int k = left--; (left += 2) <= right; ) { - short a1, a2; k = left - 1; + for (int k = left; ++left <= right; k = ++left) { + short a1 = a[k], a2 = a[left]; - if (a[k] < a[left]) { - a2 = a[k]; a1 = a[left]; - } else { - a1 = a[k]; a2 = a[left]; + if (a1 < a2) { + a2 = a1; a1 = a[left]; } while (a1 < a[--k]) { a[k + 2] = a[k]; @@ -929,19 +1210,19 @@ final class DualPivotQuicksort { } } - /* - * Use the second and fourth of the five sorted elements as pivots. - * These values are inexpensive approximations of the first and - * second terciles of the array. Note that pivot1 <= pivot2. - */ - short pivot1 = a[e2]; - short pivot2 = a[e4]; - // Pointers int less = left; // The index of the first element of center part int great = right; // The index before the first element of right part - if (pivot1 != pivot2) { + if (a[e1] != a[e2] && a[e2] != a[e3] && a[e3] != a[e4] && a[e4] != a[e5]) { + /* + * Use the second and fourth of the five sorted elements as pivots. + * These values are inexpensive approximations of the first and + * second terciles of the array. Note that pivot1 <= pivot2. + */ + short pivot1 = a[e2]; + short pivot2 = a[e4]; + /* * The first and the last elements to be sorted are moved to the * locations formerly occupied by the pivots. When partitioning @@ -986,7 +1267,7 @@ final class DualPivotQuicksort { * of "a[i++] = b;" due to performance issue. */ a[less] = ak; - less++; + ++less; } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { if (great-- == k) { @@ -996,7 +1277,7 @@ final class DualPivotQuicksort { if (a[great] < pivot1) { // a[great] <= pivot2 a[k] = a[less]; a[less] = a[great]; - less++; + ++less; } else { // pivot1 <= a[great] <= pivot2 a[k] = a[great]; } @@ -1005,7 +1286,7 @@ final class DualPivotQuicksort { * of "a[i--] = b;" due to performance issue. */ a[great] = ak; - great--; + --great; } } @@ -1026,10 +1307,11 @@ final class DualPivotQuicksort { * Skip elements, which are equal to pivot values. */ while (a[less] == pivot1) { - less++; + ++less; } + while (a[great] == pivot2) { - great--; + --great; } /* @@ -1057,7 +1339,7 @@ final class DualPivotQuicksort { if (ak == pivot1) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; + ++less; } else if (ak == pivot2) { // Move a[k] to right part while (a[great] == pivot2) { if (great-- == k) { @@ -1075,12 +1357,12 @@ final class DualPivotQuicksort { * accurate assignment a[less] = a[great]. */ a[less] = pivot1; - less++; + ++less; } else { // pivot1 < a[great] < pivot2 a[k] = a[great]; } a[great] = ak; - great--; + --great; } } } @@ -1088,7 +1370,13 @@ final class DualPivotQuicksort { // Sort center part recursively sort(a, less, great, false); - } else { // Pivots are equal + } else { // Partitioning with one pivot + /* + * Use the third of the five sorted elements as pivot. + * This value is inexpensive approximation of the median. + */ + short pivot = a[e3]; + /* * Partitioning degenerates to the traditional 3-way * (or "Dutch National Flag") schema: @@ -1110,35 +1398,35 @@ final class DualPivotQuicksort { * Pointer k is the first index of ?-part. */ for (int k = less; k <= great; ++k) { - if (a[k] == pivot1) { + if (a[k] == pivot) { continue; } short ak = a[k]; - if (ak < pivot1) { // Move a[k] to left part + if (ak < pivot) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; - } else { // a[k] > pivot1 - Move a[k] to right part - while (a[great] > pivot1) { - great--; + ++less; + } else { // a[k] > pivot - Move a[k] to right part + while (a[great] > pivot) { + --great; } - if (a[great] < pivot1) { // a[great] <= pivot1 + if (a[great] < pivot) { // a[great] <= pivot a[k] = a[less]; a[less] = a[great]; - less++; - } else { // a[great] == pivot1 + ++less; + } else { // a[great] == pivot /* - * Even though a[great] equals to pivot1, the - * assignment a[k] = pivot1 may be incorrect, - * if a[great] and pivot1 are floating-point + * Even though a[great] equals to pivot, the + * assignment a[k] = pivot may be incorrect, + * if a[great] and pivot are floating-point * zeros of different signs. Therefore in float * and double sorting methods we have to use * more accurate assignment a[k] = a[great]. */ - a[k] = pivot1; + a[k] = pivot; } a[great] = ak; - great--; + --great; } } @@ -1173,9 +1461,9 @@ final class DualPivotQuicksort { if (right - left > COUNTING_SORT_THRESHOLD_FOR_SHORT_OR_CHAR) { int[] count = new int[NUM_CHAR_VALUES]; - for (int i = left - 1; ++i <= right; ) { - count[a[i]]++; - } + for (int i = left - 1; ++i <= right; + count[a[i]]++ + ); for (int i = NUM_CHAR_VALUES, k = right + 1; k > left; ) { while (count[--i] == 0); char value = (char) i; @@ -1186,13 +1474,106 @@ final class DualPivotQuicksort { } while (--s > 0); } } else { // Use Dual-Pivot Quicksort on small arrays - sort(a, left, right, true); + doSort(a, left, right); } } /** The number of distinct char values. */ private static final int NUM_CHAR_VALUES = 1 << 16; + /** + * Sorts the specified range of the array. + * + * @param a the array to be sorted + * @param left the index of the first element, inclusive, to be sorted + * @param right the index of the last element, inclusive, to be sorted + */ + private static void doSort(char[] a, int left, int right) { + // Use Quicksort on small arrays + if (right - left < QUICKSORT_THRESHOLD) { + sort(a, left, right, true); + return; + } + + /* + * Index run[i] is the start of i-th run + * (ascending or descending sequence). + */ + int[] run = new int[MAX_RUN_COUNT]; + int count = 0; run[0] = left; + + // Check if the array is nearly sorted + for (int k = left; k < right; run[count] = k) { + if (a[k] < a[k + 1]) { // ascending + while (++k <= right && a[k - 1] <= a[k]); + } else if (a[k] > a[k + 1]) { // descending + while (++k <= right && a[k - 1] >= a[k]); + for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { + char t = a[lo]; a[lo] = a[hi]; a[hi] = t; + } + } else { // equal + for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { + if (--m == 0) { + sort(a, left, right, true); + return; + } + } + } + + /* + * The array is not highly structured, + * use Quicksort instead of merge sort. + */ + if (++count == MAX_RUN_COUNT) { + sort(a, left, right, true); + return; + } + } + + // Check special cases + if (run[count] == right++) { // The last run contains one element + run[++count] = right; + } else if (count == 1) { // The array is already sorted + return; + } + + /* + * Create temporary array, which is used for merging. + * Implementation note: variable "right" is increased by 1. + */ + char[] b; byte odd = 0; + for (int n = 1; (n <<= 1) < count; odd ^= 1); + + if (odd == 0) { + b = a; a = new char[b.length]; + for (int i = left - 1; ++i < right; a[i] = b[i]); + } else { + b = new char[a.length]; + } + + // Merging + for (int last; count > 1; count = last) { + for (int k = (last = 0) + 2; k <= count; k += 2) { + int hi = run[k], mi = run[k - 1]; + for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { + if (q >= hi || p < mi && a[p] <= a[q]) { + b[i] = a[p++]; + } else { + b[i] = a[q++]; + } + } + run[++last] = hi; + } + if ((count & 1) != 0) { + for (int i = right, lo = run[count - 1]; --i >= lo; + b[i] = a[i] + ); + run[++last] = right; + } + char[] t = a; a = b; b = t; + } + } + /** * Sorts the specified range of the array by Dual-Pivot Quicksort. * @@ -1204,7 +1585,7 @@ final class DualPivotQuicksort { private static void sort(char[] a, int left, int right, boolean leftmost) { int length = right - left + 1; - // Use insertion sort on small arrays + // Use insertion sort on tiny arrays if (length < INSERTION_SORT_THRESHOLD) { if (leftmost) { /* @@ -1227,26 +1608,24 @@ final class DualPivotQuicksort { * Skip the longest ascending sequence. */ do { - if (left++ >= right) { + if (left >= right) { return; } - } while (a[left - 1] <= a[left]); + } while (a[++left] >= a[left - 1]); /* * Every element from adjoining part plays the role * of sentinel, therefore this allows us to avoid the * left range check on each iteration. Moreover, we use - * the best improved algorithm, so called pair insertion - * sort, which is faster than traditional implementation - * in the context of Dual-Pivot Quicksort. + * the more optimized algorithm, so called pair insertion + * sort, which is faster (in the context of Quicksort) + * than traditional implementation of insertion sort. */ - for (int k = left--; (left += 2) <= right; ) { - char a1, a2; k = left - 1; + for (int k = left; ++left <= right; k = ++left) { + char a1 = a[k], a2 = a[left]; - if (a[k] < a[left]) { - a2 = a[k]; a1 = a[left]; - } else { - a1 = a[k]; a2 = a[left]; + if (a1 < a2) { + a2 = a1; a1 = a[left]; } while (a1 < a[--k]) { a[k + 2] = a[k]; @@ -1303,19 +1682,19 @@ final class DualPivotQuicksort { } } - /* - * Use the second and fourth of the five sorted elements as pivots. - * These values are inexpensive approximations of the first and - * second terciles of the array. Note that pivot1 <= pivot2. - */ - char pivot1 = a[e2]; - char pivot2 = a[e4]; - // Pointers int less = left; // The index of the first element of center part int great = right; // The index before the first element of right part - if (pivot1 != pivot2) { + if (a[e1] != a[e2] && a[e2] != a[e3] && a[e3] != a[e4] && a[e4] != a[e5]) { + /* + * Use the second and fourth of the five sorted elements as pivots. + * These values are inexpensive approximations of the first and + * second terciles of the array. Note that pivot1 <= pivot2. + */ + char pivot1 = a[e2]; + char pivot2 = a[e4]; + /* * The first and the last elements to be sorted are moved to the * locations formerly occupied by the pivots. When partitioning @@ -1360,7 +1739,7 @@ final class DualPivotQuicksort { * of "a[i++] = b;" due to performance issue. */ a[less] = ak; - less++; + ++less; } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { if (great-- == k) { @@ -1370,7 +1749,7 @@ final class DualPivotQuicksort { if (a[great] < pivot1) { // a[great] <= pivot2 a[k] = a[less]; a[less] = a[great]; - less++; + ++less; } else { // pivot1 <= a[great] <= pivot2 a[k] = a[great]; } @@ -1379,7 +1758,7 @@ final class DualPivotQuicksort { * of "a[i--] = b;" due to performance issue. */ a[great] = ak; - great--; + --great; } } @@ -1400,10 +1779,11 @@ final class DualPivotQuicksort { * Skip elements, which are equal to pivot values. */ while (a[less] == pivot1) { - less++; + ++less; } + while (a[great] == pivot2) { - great--; + --great; } /* @@ -1431,7 +1811,7 @@ final class DualPivotQuicksort { if (ak == pivot1) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; + ++less; } else if (ak == pivot2) { // Move a[k] to right part while (a[great] == pivot2) { if (great-- == k) { @@ -1449,12 +1829,12 @@ final class DualPivotQuicksort { * accurate assignment a[less] = a[great]. */ a[less] = pivot1; - less++; + ++less; } else { // pivot1 < a[great] < pivot2 a[k] = a[great]; } a[great] = ak; - great--; + --great; } } } @@ -1462,7 +1842,13 @@ final class DualPivotQuicksort { // Sort center part recursively sort(a, less, great, false); - } else { // Pivots are equal + } else { // Partitioning with one pivot + /* + * Use the third of the five sorted elements as pivot. + * This value is inexpensive approximation of the median. + */ + char pivot = a[e3]; + /* * Partitioning degenerates to the traditional 3-way * (or "Dutch National Flag") schema: @@ -1484,35 +1870,35 @@ final class DualPivotQuicksort { * Pointer k is the first index of ?-part. */ for (int k = less; k <= great; ++k) { - if (a[k] == pivot1) { + if (a[k] == pivot) { continue; } char ak = a[k]; - if (ak < pivot1) { // Move a[k] to left part + if (ak < pivot) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; - } else { // a[k] > pivot1 - Move a[k] to right part - while (a[great] > pivot1) { - great--; + ++less; + } else { // a[k] > pivot - Move a[k] to right part + while (a[great] > pivot) { + --great; } - if (a[great] < pivot1) { // a[great] <= pivot1 + if (a[great] < pivot) { // a[great] <= pivot a[k] = a[less]; a[less] = a[great]; - less++; - } else { // a[great] == pivot1 + ++less; + } else { // a[great] == pivot /* - * Even though a[great] equals to pivot1, the - * assignment a[k] = pivot1 may be incorrect, - * if a[great] and pivot1 are floating-point + * Even though a[great] equals to pivot, the + * assignment a[k] = pivot may be incorrect, + * if a[great] and pivot are floating-point * zeros of different signs. Therefore in float * and double sorting methods we have to use * more accurate assignment a[k] = a[great]. */ - a[k] = pivot1; + a[k] = pivot; } a[great] = ak; - great--; + --great; } } @@ -1550,9 +1936,9 @@ final class DualPivotQuicksort { if (right - left > COUNTING_SORT_THRESHOLD_FOR_BYTE) { int[] count = new int[NUM_BYTE_VALUES]; - for (int i = left - 1; ++i <= right; ) { - count[a[i] - Byte.MIN_VALUE]++; - } + for (int i = left - 1; ++i <= right; + count[a[i] - Byte.MIN_VALUE]++ + ); for (int i = NUM_BYTE_VALUES, k = right + 1; k > left; ) { while (count[--i] == 0); byte value = (byte) (i + Byte.MIN_VALUE); @@ -1597,21 +1983,21 @@ final class DualPivotQuicksort { * Phase 1: Move NaNs to the end of the array. */ while (left <= right && Float.isNaN(a[right])) { - right--; + --right; } for (int k = right; --k >= left; ) { float ak = a[k]; if (ak != ak) { // a[k] is NaN a[k] = a[right]; a[right] = ak; - right--; + --right; } } /* * Phase 2: Sort everything except NaNs (which are already in place). */ - sort(a, left, right, true); + doSort(a, left, right); /* * Phase 3: Place negative zeros before positive zeros. @@ -1636,7 +2022,7 @@ final class DualPivotQuicksort { * Skip the last negative value (if any) or all leading negative zeros. */ while (left <= right && Float.floatToRawIntBits(a[left]) < 0) { - left++; + ++left; } /* @@ -1672,6 +2058,99 @@ final class DualPivotQuicksort { } } + /** + * Sorts the specified range of the array. + * + * @param a the array to be sorted + * @param left the index of the first element, inclusive, to be sorted + * @param right the index of the last element, inclusive, to be sorted + */ + private static void doSort(float[] a, int left, int right) { + // Use Quicksort on small arrays + if (right - left < QUICKSORT_THRESHOLD) { + sort(a, left, right, true); + return; + } + + /* + * Index run[i] is the start of i-th run + * (ascending or descending sequence). + */ + int[] run = new int[MAX_RUN_COUNT]; + int count = 0; run[0] = left; + + // Check if the array is nearly sorted + for (int k = left; k < right; run[count] = k) { + if (a[k] < a[k + 1]) { // ascending + while (++k <= right && a[k - 1] <= a[k]); + } else if (a[k] > a[k + 1]) { // descending + while (++k <= right && a[k - 1] >= a[k]); + for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { + float t = a[lo]; a[lo] = a[hi]; a[hi] = t; + } + } else { // equal + for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { + if (--m == 0) { + sort(a, left, right, true); + return; + } + } + } + + /* + * The array is not highly structured, + * use Quicksort instead of merge sort. + */ + if (++count == MAX_RUN_COUNT) { + sort(a, left, right, true); + return; + } + } + + // Check special cases + if (run[count] == right++) { // The last run contains one element + run[++count] = right; + } else if (count == 1) { // The array is already sorted + return; + } + + /* + * Create temporary array, which is used for merging. + * Implementation note: variable "right" is increased by 1. + */ + float[] b; byte odd = 0; + for (int n = 1; (n <<= 1) < count; odd ^= 1); + + if (odd == 0) { + b = a; a = new float[b.length]; + for (int i = left - 1; ++i < right; a[i] = b[i]); + } else { + b = new float[a.length]; + } + + // Merging + for (int last; count > 1; count = last) { + for (int k = (last = 0) + 2; k <= count; k += 2) { + int hi = run[k], mi = run[k - 1]; + for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { + if (q >= hi || p < mi && a[p] <= a[q]) { + b[i] = a[p++]; + } else { + b[i] = a[q++]; + } + } + run[++last] = hi; + } + if ((count & 1) != 0) { + for (int i = right, lo = run[count - 1]; --i >= lo; + b[i] = a[i] + ); + run[++last] = right; + } + float[] t = a; a = b; b = t; + } + } + /** * Sorts the specified range of the array by Dual-Pivot Quicksort. * @@ -1680,10 +2159,10 @@ final class DualPivotQuicksort { * @param right the index of the last element, inclusive, to be sorted * @param leftmost indicates if this part is the leftmost in the range */ - private static void sort(float[] a, int left, int right,boolean leftmost) { + private static void sort(float[] a, int left, int right, boolean leftmost) { int length = right - left + 1; - // Use insertion sort on small arrays + // Use insertion sort on tiny arrays if (length < INSERTION_SORT_THRESHOLD) { if (leftmost) { /* @@ -1706,26 +2185,24 @@ final class DualPivotQuicksort { * Skip the longest ascending sequence. */ do { - if (left++ >= right) { + if (left >= right) { return; } - } while (a[left - 1] <= a[left]); + } while (a[++left] >= a[left - 1]); /* * Every element from adjoining part plays the role * of sentinel, therefore this allows us to avoid the * left range check on each iteration. Moreover, we use - * the best improved algorithm, so called pair insertion - * sort, which is faster than traditional implementation - * in the context of Dual-Pivot Quicksort. + * the more optimized algorithm, so called pair insertion + * sort, which is faster (in the context of Quicksort) + * than traditional implementation of insertion sort. */ - for (int k = left--; (left += 2) <= right; ) { - float a1, a2; k = left - 1; + for (int k = left; ++left <= right; k = ++left) { + float a1 = a[k], a2 = a[left]; - if (a[k] < a[left]) { - a2 = a[k]; a1 = a[left]; - } else { - a1 = a[k]; a2 = a[left]; + if (a1 < a2) { + a2 = a1; a1 = a[left]; } while (a1 < a[--k]) { a[k + 2] = a[k]; @@ -1782,19 +2259,19 @@ final class DualPivotQuicksort { } } - /* - * Use the second and fourth of the five sorted elements as pivots. - * These values are inexpensive approximations of the first and - * second terciles of the array. Note that pivot1 <= pivot2. - */ - float pivot1 = a[e2]; - float pivot2 = a[e4]; - // Pointers int less = left; // The index of the first element of center part int great = right; // The index before the first element of right part - if (pivot1 != pivot2) { + if (a[e1] != a[e2] && a[e2] != a[e3] && a[e3] != a[e4] && a[e4] != a[e5]) { + /* + * Use the second and fourth of the five sorted elements as pivots. + * These values are inexpensive approximations of the first and + * second terciles of the array. Note that pivot1 <= pivot2. + */ + float pivot1 = a[e2]; + float pivot2 = a[e4]; + /* * The first and the last elements to be sorted are moved to the * locations formerly occupied by the pivots. When partitioning @@ -1839,7 +2316,7 @@ final class DualPivotQuicksort { * of "a[i++] = b;" due to performance issue. */ a[less] = ak; - less++; + ++less; } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { if (great-- == k) { @@ -1849,7 +2326,7 @@ final class DualPivotQuicksort { if (a[great] < pivot1) { // a[great] <= pivot2 a[k] = a[less]; a[less] = a[great]; - less++; + ++less; } else { // pivot1 <= a[great] <= pivot2 a[k] = a[great]; } @@ -1858,7 +2335,7 @@ final class DualPivotQuicksort { * of "a[i--] = b;" due to performance issue. */ a[great] = ak; - great--; + --great; } } @@ -1879,10 +2356,11 @@ final class DualPivotQuicksort { * Skip elements, which are equal to pivot values. */ while (a[less] == pivot1) { - less++; + ++less; } + while (a[great] == pivot2) { - great--; + --great; } /* @@ -1910,7 +2388,7 @@ final class DualPivotQuicksort { if (ak == pivot1) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; + ++less; } else if (ak == pivot2) { // Move a[k] to right part while (a[great] == pivot2) { if (great-- == k) { @@ -1928,12 +2406,12 @@ final class DualPivotQuicksort { * accurate assignment a[less] = a[great]. */ a[less] = a[great]; - less++; + ++less; } else { // pivot1 < a[great] < pivot2 a[k] = a[great]; } a[great] = ak; - great--; + --great; } } } @@ -1941,7 +2419,13 @@ final class DualPivotQuicksort { // Sort center part recursively sort(a, less, great, false); - } else { // Pivots are equal + } else { // Partitioning with one pivot + /* + * Use the third of the five sorted elements as pivot. + * This value is inexpensive approximation of the median. + */ + float pivot = a[e3]; + /* * Partitioning degenerates to the traditional 3-way * (or "Dutch National Flag") schema: @@ -1963,27 +2447,27 @@ final class DualPivotQuicksort { * Pointer k is the first index of ?-part. */ for (int k = less; k <= great; ++k) { - if (a[k] == pivot1) { + if (a[k] == pivot) { continue; } float ak = a[k]; - if (ak < pivot1) { // Move a[k] to left part + if (ak < pivot) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; - } else { // a[k] > pivot1 - Move a[k] to right part - while (a[great] > pivot1) { - great--; + ++less; + } else { // a[k] > pivot - Move a[k] to right part + while (a[great] > pivot) { + --great; } - if (a[great] < pivot1) { // a[great] <= pivot1 + if (a[great] < pivot) { // a[great] <= pivot a[k] = a[less]; a[less] = a[great]; - less++; - } else { // a[great] == pivot1 + ++less; + } else { // a[great] == pivot /* - * Even though a[great] equals to pivot1, the - * assignment a[k] = pivot1 may be incorrect, - * if a[great] and pivot1 are floating-point + * Even though a[great] equals to pivot, the + * assignment a[k] = pivot may be incorrect, + * if a[great] and pivot are floating-point * zeros of different signs. Therefore in float * and double sorting methods we have to use * more accurate assignment a[k] = a[great]. @@ -1991,7 +2475,7 @@ final class DualPivotQuicksort { a[k] = a[great]; } a[great] = ak; - great--; + --great; } } @@ -2026,21 +2510,21 @@ final class DualPivotQuicksort { * Phase 1: Move NaNs to the end of the array. */ while (left <= right && Double.isNaN(a[right])) { - right--; + --right; } for (int k = right; --k >= left; ) { double ak = a[k]; if (ak != ak) { // a[k] is NaN a[k] = a[right]; a[right] = ak; - right--; + --right; } } /* * Phase 2: Sort everything except NaNs (which are already in place). */ - sort(a, left, right, true); + doSort(a, left, right); /* * Phase 3: Place negative zeros before positive zeros. @@ -2065,7 +2549,7 @@ final class DualPivotQuicksort { * Skip the last negative value (if any) or all leading negative zeros. */ while (left <= right && Double.doubleToRawLongBits(a[left]) < 0) { - left++; + ++left; } /* @@ -2101,6 +2585,99 @@ final class DualPivotQuicksort { } } + /** + * Sorts the specified range of the array. + * + * @param a the array to be sorted + * @param left the index of the first element, inclusive, to be sorted + * @param right the index of the last element, inclusive, to be sorted + */ + private static void doSort(double[] a, int left, int right) { + // Use Quicksort on small arrays + if (right - left < QUICKSORT_THRESHOLD) { + sort(a, left, right, true); + return; + } + + /* + * Index run[i] is the start of i-th run + * (ascending or descending sequence). + */ + int[] run = new int[MAX_RUN_COUNT]; + int count = 0; run[0] = left; + + // Check if the array is nearly sorted + for (int k = left; k < right; run[count] = k) { + if (a[k] < a[k + 1]) { // ascending + while (++k <= right && a[k - 1] <= a[k]); + } else if (a[k] > a[k + 1]) { // descending + while (++k <= right && a[k - 1] >= a[k]); + for (int lo = run[count] - 1, hi = k; ++lo < --hi; ) { + double t = a[lo]; a[lo] = a[hi]; a[hi] = t; + } + } else { // equal + for (int m = MAX_RUN_LENGTH; ++k <= right && a[k - 1] == a[k]; ) { + if (--m == 0) { + sort(a, left, right, true); + return; + } + } + } + + /* + * The array is not highly structured, + * use Quicksort instead of merge sort. + */ + if (++count == MAX_RUN_COUNT) { + sort(a, left, right, true); + return; + } + } + + // Check special cases + if (run[count] == right++) { // The last run contains one element + run[++count] = right; + } else if (count == 1) { // The array is already sorted + return; + } + + /* + * Create temporary array, which is used for merging. + * Implementation note: variable "right" is increased by 1. + */ + double[] b; byte odd = 0; + for (int n = 1; (n <<= 1) < count; odd ^= 1); + + if (odd == 0) { + b = a; a = new double[b.length]; + for (int i = left - 1; ++i < right; a[i] = b[i]); + } else { + b = new double[a.length]; + } + + // Merging + for (int last; count > 1; count = last) { + for (int k = (last = 0) + 2; k <= count; k += 2) { + int hi = run[k], mi = run[k - 1]; + for (int i = run[k - 2], p = i, q = mi; i < hi; ++i) { + if (q >= hi || p < mi && a[p] <= a[q]) { + b[i] = a[p++]; + } else { + b[i] = a[q++]; + } + } + run[++last] = hi; + } + if ((count & 1) != 0) { + for (int i = right, lo = run[count - 1]; --i >= lo; + b[i] = a[i] + ); + run[++last] = right; + } + double[] t = a; a = b; b = t; + } + } + /** * Sorts the specified range of the array by Dual-Pivot Quicksort. * @@ -2109,10 +2686,10 @@ final class DualPivotQuicksort { * @param right the index of the last element, inclusive, to be sorted * @param leftmost indicates if this part is the leftmost in the range */ - private static void sort(double[] a, int left,int right,boolean leftmost) { + private static void sort(double[] a, int left, int right, boolean leftmost) { int length = right - left + 1; - // Use insertion sort on small arrays + // Use insertion sort on tiny arrays if (length < INSERTION_SORT_THRESHOLD) { if (leftmost) { /* @@ -2135,26 +2712,24 @@ final class DualPivotQuicksort { * Skip the longest ascending sequence. */ do { - if (left++ >= right) { + if (left >= right) { return; } - } while (a[left - 1] <= a[left]); + } while (a[++left] >= a[left - 1]); /* * Every element from adjoining part plays the role * of sentinel, therefore this allows us to avoid the * left range check on each iteration. Moreover, we use - * the best improved algorithm, so called pair insertion - * sort, which is faster than traditional implementation - * in the context of Dual-Pivot Quicksort. + * the more optimized algorithm, so called pair insertion + * sort, which is faster (in the context of Quicksort) + * than traditional implementation of insertion sort. */ - for (int k = left--; (left += 2) <= right; ) { - double a1, a2; k = left - 1; + for (int k = left; ++left <= right; k = ++left) { + double a1 = a[k], a2 = a[left]; - if (a[k] < a[left]) { - a2 = a[k]; a1 = a[left]; - } else { - a1 = a[k]; a2 = a[left]; + if (a1 < a2) { + a2 = a1; a1 = a[left]; } while (a1 < a[--k]) { a[k + 2] = a[k]; @@ -2211,19 +2786,19 @@ final class DualPivotQuicksort { } } - /* - * Use the second and fourth of the five sorted elements as pivots. - * These values are inexpensive approximations of the first and - * second terciles of the array. Note that pivot1 <= pivot2. - */ - double pivot1 = a[e2]; - double pivot2 = a[e4]; - // Pointers int less = left; // The index of the first element of center part int great = right; // The index before the first element of right part - if (pivot1 != pivot2) { + if (a[e1] != a[e2] && a[e2] != a[e3] && a[e3] != a[e4] && a[e4] != a[e5]) { + /* + * Use the second and fourth of the five sorted elements as pivots. + * These values are inexpensive approximations of the first and + * second terciles of the array. Note that pivot1 <= pivot2. + */ + double pivot1 = a[e2]; + double pivot2 = a[e4]; + /* * The first and the last elements to be sorted are moved to the * locations formerly occupied by the pivots. When partitioning @@ -2268,7 +2843,7 @@ final class DualPivotQuicksort { * of "a[i++] = b;" due to performance issue. */ a[less] = ak; - less++; + ++less; } else if (ak > pivot2) { // Move a[k] to right part while (a[great] > pivot2) { if (great-- == k) { @@ -2278,7 +2853,7 @@ final class DualPivotQuicksort { if (a[great] < pivot1) { // a[great] <= pivot2 a[k] = a[less]; a[less] = a[great]; - less++; + ++less; } else { // pivot1 <= a[great] <= pivot2 a[k] = a[great]; } @@ -2287,7 +2862,7 @@ final class DualPivotQuicksort { * of "a[i--] = b;" due to performance issue. */ a[great] = ak; - great--; + --great; } } @@ -2308,10 +2883,11 @@ final class DualPivotQuicksort { * Skip elements, which are equal to pivot values. */ while (a[less] == pivot1) { - less++; + ++less; } + while (a[great] == pivot2) { - great--; + --great; } /* @@ -2339,7 +2915,7 @@ final class DualPivotQuicksort { if (ak == pivot1) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; + ++less; } else if (ak == pivot2) { // Move a[k] to right part while (a[great] == pivot2) { if (great-- == k) { @@ -2357,12 +2933,12 @@ final class DualPivotQuicksort { * accurate assignment a[less] = a[great]. */ a[less] = a[great]; - less++; + ++less; } else { // pivot1 < a[great] < pivot2 a[k] = a[great]; } a[great] = ak; - great--; + --great; } } } @@ -2370,7 +2946,13 @@ final class DualPivotQuicksort { // Sort center part recursively sort(a, less, great, false); - } else { // Pivots are equal + } else { // Partitioning with one pivot + /* + * Use the third of the five sorted elements as pivot. + * This value is inexpensive approximation of the median. + */ + double pivot = a[e3]; + /* * Partitioning degenerates to the traditional 3-way * (or "Dutch National Flag") schema: @@ -2392,27 +2974,27 @@ final class DualPivotQuicksort { * Pointer k is the first index of ?-part. */ for (int k = less; k <= great; ++k) { - if (a[k] == pivot1) { + if (a[k] == pivot) { continue; } double ak = a[k]; - if (ak < pivot1) { // Move a[k] to left part + if (ak < pivot) { // Move a[k] to left part a[k] = a[less]; a[less] = ak; - less++; - } else { // a[k] > pivot1 - Move a[k] to right part - while (a[great] > pivot1) { - great--; + ++less; + } else { // a[k] > pivot - Move a[k] to right part + while (a[great] > pivot) { + --great; } - if (a[great] < pivot1) { // a[great] <= pivot1 + if (a[great] < pivot) { // a[great] <= pivot a[k] = a[less]; a[less] = a[great]; - less++; - } else { // a[great] == pivot1 + ++less; + } else { // a[great] == pivot /* - * Even though a[great] equals to pivot1, the - * assignment a[k] = pivot1 may be incorrect, - * if a[great] and pivot1 are floating-point + * Even though a[great] equals to pivot, the + * assignment a[k] = pivot may be incorrect, + * if a[great] and pivot are floating-point * zeros of different signs. Therefore in float * and double sorting methods we have to use * more accurate assignment a[k] = a[great]. @@ -2420,7 +3002,7 @@ final class DualPivotQuicksort { a[k] = a[great]; } a[great] = ak; - great--; + --great; } } diff --git a/jdk/test/java/util/Arrays/Sorting.java b/jdk/test/java/util/Arrays/Sorting.java index a2c4ed98e04..e5c132b64a2 100644 --- a/jdk/test/java/util/Arrays/Sorting.java +++ b/jdk/test/java/util/Arrays/Sorting.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6880672 6896573 6899694 6976036 + * @bug 6880672 6896573 6899694 6976036 7013585 * @summary Exercise Arrays.sort * @build Sorting * @run main Sorting -shortrun @@ -546,13 +546,19 @@ public class Sorting { private static void prepareSubArray(int[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - a[i] = 0xBABA; + a[i] = 0xDEDA; } - for (int i = fromIndex; i < toIndex; i++) { - a[i] = -i + m; + int middle = (fromIndex + toIndex) >>> 1; + int k = 0; + + for (int i = fromIndex; i < middle; i++) { + a[i] = k++; + } + for (int i = middle; i < toIndex; i++) { + a[i] = k--; } for (int i = toIndex; i < a.length; i++) { - a[i] = 0xDEDA; + a[i] = 0xBABA; } } @@ -1518,9 +1524,9 @@ public class Sorting { private static void checkSubArray(Integer[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i].intValue() != 0xBABA) { + if (a[i].intValue() != 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1531,18 +1537,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i].intValue() != 0xDEDA) { + if (a[i].intValue() != 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(int[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != 0xBABA) { + if (a[i] != 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1553,18 +1559,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != 0xDEDA) { + if (a[i] != 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(byte[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (byte) 0xBABA) { + if (a[i] != (byte) 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1575,18 +1581,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (byte) 0xDEDA) { + if (a[i] != (byte) 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(long[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (long) 0xBABA) { + if (a[i] != (long) 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1597,18 +1603,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (long) 0xDEDA) { + if (a[i] != (long) 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(char[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (char) 0xBABA) { + if (a[i] != (char) 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1619,18 +1625,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (char) 0xDEDA) { + if (a[i] != (char) 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(short[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (short) 0xBABA) { + if (a[i] != (short) 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1641,18 +1647,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (short) 0xDEDA) { + if (a[i] != (short) 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(float[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (float) 0xBABA) { + if (a[i] != (float) 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1663,18 +1669,18 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (float) 0xDEDA) { + if (a[i] != (float) 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } private static void checkSubArray(double[] a, int fromIndex, int toIndex, int m) { for (int i = 0; i < fromIndex; i++) { - if (a[i] != (double) 0xBABA) { + if (a[i] != (double) 0xDEDA) { failed("Range sort changes left element on position " + i + - ": " + a[i] + ", must be " + 0xBABA); + ": " + a[i] + ", must be " + 0xDEDA); } } @@ -1685,9 +1691,9 @@ public class Sorting { } for (int i = toIndex; i < a.length; i++) { - if (a[i] != (double) 0xDEDA) { + if (a[i] != (double) 0xBABA) { failed("Range sort changes right element on position " + i + - ": " + a[i] + ", must be " + 0xDEDA); + ": " + a[i] + ", must be " + 0xBABA); } } } From 47a983f28a8ae837351f070ec22c7fe1e3938a98 Mon Sep 17 00:00:00 2001 From: Naoto Sato Date: Tue, 8 Feb 2011 09:04:30 -0800 Subject: [PATCH 63/84] 7015500: Locale.toLanguageTag() uses "und" as lang subtag for private use only Locale Reviewed-by: srl --- jdk/src/share/classes/java/util/Locale.java | 9 +++++-- .../classes/sun/util/locale/LanguageTag.java | 18 +++++++++---- .../java/util/Locale/LocaleEnhanceTest.java | 25 ++++++++++++++++--- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/jdk/src/share/classes/java/util/Locale.java b/jdk/src/share/classes/java/util/Locale.java index 1f0fbba1eae..efe200ed0db 100644 --- a/jdk/src/share/classes/java/util/Locale.java +++ b/jdk/src/share/classes/java/util/Locale.java @@ -1265,7 +1265,9 @@ public final class Locale implements Cloneable, Serializable { StringBuilder buf = new StringBuilder(); String subtag = tag.getLanguage(); - buf.append(LanguageTag.canonicalizeLanguage(subtag)); + if (subtag.length() > 0) { + buf.append(LanguageTag.canonicalizeLanguage(subtag)); + } subtag = tag.getScript(); if (subtag.length() > 0) { @@ -1294,7 +1296,10 @@ public final class Locale implements Cloneable, Serializable { subtag = tag.getPrivateuse(); if (subtag.length() > 0) { - buf.append(LanguageTag.SEP).append(LanguageTag.PRIVATEUSE).append(LanguageTag.SEP); + if (buf.length() > 0) { + buf.append(LanguageTag.SEP); + } + buf.append(LanguageTag.PRIVATEUSE).append(LanguageTag.SEP); // preserve casing buf.append(subtag); } diff --git a/jdk/src/share/classes/sun/util/locale/LanguageTag.java b/jdk/src/share/classes/sun/util/locale/LanguageTag.java index 653bb8e05fb..cf35e18e144 100644 --- a/jdk/src/share/classes/sun/util/locale/LanguageTag.java +++ b/jdk/src/share/classes/sun/util/locale/LanguageTag.java @@ -421,11 +421,11 @@ public class LanguageTag { String region = baseLocale.getRegion(); String variant = baseLocale.getVariant(); + boolean hasSubtag = false; + String privuseVar = null; // store ill-formed variant subtags - if (language.length() == 0 || !isLanguage(language)) { - tag._language = UNDETERMINED; - } else { + if (language.length() > 0 && isLanguage(language)) { // Convert a deprecated language code used by Java to // a new code if (language.equals("iw")) { @@ -440,10 +440,12 @@ public class LanguageTag { if (script.length() > 0 && isScript(script)) { tag._script = canonicalizeScript(script); + hasSubtag = true; } if (region.length() > 0 && isRegion(region)) { tag._region = canonicalizeRegion(region); + hasSubtag = true; } // Special handling for no_NO_NY - use nn_NO for language tag @@ -468,6 +470,7 @@ public class LanguageTag { } if (variants != null) { tag._variants = variants; + hasSubtag = true; } if (!varitr.isDone()) { // ill-formed variant subtags @@ -508,6 +511,7 @@ public class LanguageTag { if (extensions != null) { tag._extensions = extensions; + hasSubtag = true; } // append ill-formed variant subtags to private use @@ -521,8 +525,12 @@ public class LanguageTag { if (privateuse != null) { tag._privateuse = privateuse; - } else if (tag._language.length() == 0) { - // use "und" if neither language nor privateuse is available + } + + if (tag._language.length() == 0 && (hasSubtag || privateuse == null)) { + // use lang "und" when 1) no language is available AND + // 2) any of other subtags other than private use are available or + // no private use tag is available tag._language = UNDETERMINED; } diff --git a/jdk/test/java/util/Locale/LocaleEnhanceTest.java b/jdk/test/java/util/Locale/LocaleEnhanceTest.java index f7ed5ab3dfb..5d816bc2eee 100644 --- a/jdk/test/java/util/Locale/LocaleEnhanceTest.java +++ b/jdk/test/java/util/Locale/LocaleEnhanceTest.java @@ -478,6 +478,23 @@ public class LocaleEnhanceTest extends LocaleTestFmwk { Locale locale = new Locale(test[0], test[1], test[2]); assertEquals("case " + i, test[3], locale.toLanguageTag()); } + + // test locales created from forLanguageTag + String[][] tests1 = { + // case is normalized during the round trip + { "EN-us", "en-US" }, + { "en-Latn-US", "en-Latn-US" }, + // reordering Unicode locale extensions + { "de-u-co-phonebk-ca-gregory", "de-u-ca-gregory-co-phonebk" }, + // private use only language tag is preserved (no extra "und") + { "x-elmer", "x-elmer" }, + { "x-lvariant-JP", "x-lvariant-JP" }, + }; + for (String[] test : tests1) { + Locale locale = Locale.forLanguageTag(test[0]); + assertEquals("case " + test[0], test[1], locale.toLanguageTag()); + } + } public void testForLanguageTag() { @@ -488,9 +505,9 @@ public class LocaleEnhanceTest extends LocaleTestFmwk { String[][] tests = { // private use tags only - { "x-abc", "und-x-abc" }, - { "x-a-b-c", "und-x-a-b-c" }, - { "x-a-12345678", "und-x-a-12345678" }, + { "x-abc", "x-abc" }, + { "x-a-b-c", "x-a-b-c" }, + { "x-a-12345678", "x-a-12345678" }, // grandfathered tags with preferred mappings { "i-ami", "ami" }, @@ -517,7 +534,7 @@ public class LocaleEnhanceTest extends LocaleTestFmwk { // grandfathered irregular tags, no preferred mappings, drop illegal fields // from end. If no subtag is mappable, fallback to 'und' { "i-default", "en-x-i-default" }, - { "i-enochian", "und-x-i-enochian" }, + { "i-enochian", "x-i-enochian" }, { "i-mingo", "see-x-i-mingo" }, { "en-GB-oed", "en-GB-x-oed" }, { "zh-min", "nan-x-zh-min" }, From 9eecf686c54b91eaa09e2aacb796b56222fe19ac Mon Sep 17 00:00:00 2001 From: Mandy Chung Date: Tue, 8 Feb 2011 09:11:37 -0800 Subject: [PATCH 64/84] 7017673: Remove setting of the sun.jkernel.DownloadManager as a boot classloader hook Reviewed-by: alanb, dcubed, coleenp --- hotspot/src/share/vm/classfile/vmSymbols.hpp | 1 - hotspot/src/share/vm/runtime/thread.cpp | 22 -------------------- 2 files changed, 23 deletions(-) diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 69670aa9322..d149e3f05b9 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -108,7 +108,6 @@ template(java_lang_AssertionStatusDirectives, "java/lang/AssertionStatusDirectives") \ template(sun_jkernel_DownloadManager, "sun/jkernel/DownloadManager") \ template(getBootClassPathEntryForClass_name, "getBootClassPathEntryForClass") \ - template(setBootClassLoaderHook_name, "setBootClassLoaderHook") \ template(sun_misc_PostVMInitHook, "sun/misc/PostVMInitHook") \ \ /* class file format tags */ \ diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index 93eb9df190f..4b2f6b5a16d 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -962,22 +962,6 @@ static void call_initializeSystemClass(TRAPS) { vmSymbols::void_method_signature(), CHECK); } -#ifdef KERNEL -static void set_jkernel_boot_classloader_hook(TRAPS) { - klassOop k = SystemDictionary::sun_jkernel_DownloadManager_klass(); - instanceKlassHandle klass (THREAD, k); - - if (k == NULL) { - // sun.jkernel.DownloadManager may not present in the JDK; just return - return; - } - - JavaValue result(T_VOID); - JavaCalls::call_static(&result, klass, vmSymbols::setBootClassLoaderHook_name(), - vmSymbols::void_method_signature(), CHECK); -} -#endif // KERNEL - // General purpose hook into Java code, run once when the VM is initialized. // The Java library method itself may be changed independently from the VM. static void call_postVMInitHook(TRAPS) { @@ -3284,12 +3268,6 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION)); } -#ifdef KERNEL - if (JDK_Version::is_gte_jdk17x_version()) { - set_jkernel_boot_classloader_hook(THREAD); - } -#endif // KERNEL - #ifndef SERIALGC // Support for ConcurrentMarkSweep. This should be cleaned up // and better encapsulated. The ugly nested if test would go away From aa6f495fbe1bff117db437d94867de03d5ad64e3 Mon Sep 17 00:00:00 2001 From: Dmitry Nadezhin Date: Tue, 8 Feb 2011 19:31:44 +0000 Subject: [PATCH 65/84] 4421494: infinite loop while parsing double literal Reviewed-by: darcy, alanb --- .../classes/sun/misc/FloatingDecimal.java | 2 +- jdk/test/java/lang/Double/ParseDouble.java | 41 ++++++++++++++++++- 2 files changed, 40 insertions(+), 3 deletions(-) diff --git a/jdk/src/share/classes/sun/misc/FloatingDecimal.java b/jdk/src/share/classes/sun/misc/FloatingDecimal.java index 3ef35ed3edc..fedca65e760 100644 --- a/jdk/src/share/classes/sun/misc/FloatingDecimal.java +++ b/jdk/src/share/classes/sun/misc/FloatingDecimal.java @@ -1547,7 +1547,7 @@ public class FloatingDecimal{ if ( (cmpResult = bigB.cmp( bigD ) ) > 0 ){ overvalue = true; // our candidate is too big. diff = bigB.sub( bigD ); - if ( (bigIntNBits == 1) && (bigIntExp > -expBias) ){ + if ( (bigIntNBits == 1) && (bigIntExp > -expBias+1) ){ // candidate is a normalized exact power of 2 and // is too big. We will be subtracting. // For our purposes, ulp is the ulp of the diff --git a/jdk/test/java/lang/Double/ParseDouble.java b/jdk/test/java/lang/Double/ParseDouble.java index 161177a5faa..669d078c029 100644 --- a/jdk/test/java/lang/Double/ParseDouble.java +++ b/jdk/test/java/lang/Double/ParseDouble.java @@ -23,11 +23,12 @@ /* * @test - * @bug 4160406 4705734 4707389 4826774 4895911 + * @bug 4160406 4705734 4707389 4826774 4895911 4421494 * @summary Test for Double.parseDouble method and acceptance regex */ import java.util.regex.*; +import java.math.BigDecimal; public class ParseDouble { @@ -416,7 +417,15 @@ public class ParseDouble { "0x00100p1", "0x00.100p1", - "0x001.100p1" + "0x001.100p1", + + // Limits + + "1.7976931348623157E308", // Double.MAX_VALUE + "4.9e-324", // Double.MIN_VALUE + "2.2250738585072014e-308", // Double.MIN_NORMAL + + "2.2250738585072012e-308", // near Double.MIN_NORMAL }; static String paddedBadStrings[]; @@ -546,6 +555,32 @@ public class ParseDouble { } + /** + * For each subnormal power of two, test at boundaries of + * region that should convert to that value. + */ + private static void testSubnormalPowers() { + BigDecimal TWO = BigDecimal.valueOf(2); + // An ulp is the same for all subnormal values + BigDecimal ulp_BD = new BigDecimal(Double.MIN_VALUE); + + // Test subnormal powers of two + for(int i = -1074; i <= -1022; i++) { + double d = Math.scalb(1.0, i); + + /* + * The region [d - ulp/2, d + ulp/2] should round to d. + */ + BigDecimal d_BD = new BigDecimal(d); + + BigDecimal lowerBound = d_BD.subtract(ulp_BD.divide(TWO)); + BigDecimal upperBound = d_BD.add(ulp_BD.divide(TWO)); + + double convertedLowerBound = Double.parseDouble(lowerBound.toString()); + double convertedUpperBound = Double.parseDouble(upperBound.toString()); + } + } + public static void main(String[] args) throws Exception { rudimentaryTest(); @@ -558,5 +593,7 @@ public class ParseDouble { testRegex(paddedGoodStrings, false); testRegex(badStrings, true); testRegex(paddedBadStrings, true); + + testSubnormalPowers(); } } From 50ef3f8522e4bf3f0f6865d2ff585379dc6c0d75 Mon Sep 17 00:00:00 2001 From: Xueming Shen Date: Tue, 8 Feb 2011 13:30:30 -0800 Subject: [PATCH 66/84] 7017840: (zipfs) test/demo/zipfs/basic.sh needs to be updated due to 7013420 Updated try-with-resourcse usage in test/demo code Reviewed-by: alanb --- jdk/src/share/demo/nio/zipfs/Demo.java | 5 ++--- jdk/test/demo/zipfs/ZipFSTester.java | 10 +++++----- jdk/test/demo/zipfs/basic.sh | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/jdk/src/share/demo/nio/zipfs/Demo.java b/jdk/src/share/demo/nio/zipfs/Demo.java index 9f83633d128..dfe77b877ed 100644 --- a/jdk/src/share/demo/nio/zipfs/Demo.java +++ b/jdk/src/share/demo/nio/zipfs/Demo.java @@ -156,7 +156,6 @@ public class Demo { if (action == Action.create) env.put("create", "true"); try (FileSystem fs = provider.newFileSystem(Paths.get(args[1]), env)) { - FileSystem fs2; Path path, src, dst; boolean isRename = false; switch (action) { @@ -201,12 +200,12 @@ public class Demo { Files.copy(src, dst, COPY_ATTRIBUTES); break; case zzmove: - try (fs2 = provider.newFileSystem(Paths.get(args[2]), env)) { + try (FileSystem fs2 = provider.newFileSystem(Paths.get(args[2]), env)) { z2zmove(fs, fs2, args[3]); } break; case zzcopy: - try (fs2 = provider.newFileSystem(Paths.get(args[2]), env)) { + try (FileSystem fs2 = provider.newFileSystem(Paths.get(args[2]), env)) { z2zcopy(fs, fs2, args[3]); } break; diff --git a/jdk/test/demo/zipfs/ZipFSTester.java b/jdk/test/demo/zipfs/ZipFSTester.java index 71dfa8d26a2..14aebbdf685 100644 --- a/jdk/test/demo/zipfs/ZipFSTester.java +++ b/jdk/test/demo/zipfs/ZipFSTester.java @@ -72,7 +72,7 @@ public class ZipFSTester { } } - static void test1(FileSystem fs) + static void test1(FileSystem fs0) throws Exception { Random rdm = new Random(); @@ -80,11 +80,11 @@ public class ZipFSTester { Path tmpfsPath = getTempPath(); Map env = new HashMap(); env.put("create", "true"); - FileSystem fs0 = newZipFileSystem(tmpfsPath, env); - z2zcopy(fs, fs0, "/", 0); - fs0.close(); // sync to file + try (FileSystem copy = newZipFileSystem(tmpfsPath, env)) { + z2zcopy(fs0, copy, "/", 0); + } - try (fs = newZipFileSystem(tmpfsPath, new HashMap())) { + try (FileSystem fs = newZipFileSystem(tmpfsPath, new HashMap())) { FileSystemProvider provider = fs.provider(); // newFileSystem(path...) should not throw exception diff --git a/jdk/test/demo/zipfs/basic.sh b/jdk/test/demo/zipfs/basic.sh index 4c4eddac920..832a75d4fb4 100644 --- a/jdk/test/demo/zipfs/basic.sh +++ b/jdk/test/demo/zipfs/basic.sh @@ -21,7 +21,7 @@ # questions. # # @test -# @bug 6990846 7009092 7009085 7015391 7014948 7005986 +# @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 # @summary Test ZipFileSystem demo # @build Basic PathOps ZipFSTester # @run shell basic.sh From 9acb43fa6df255541ced56d71682ecb17f320de0 Mon Sep 17 00:00:00 2001 From: Keith McGuigan Date: Tue, 8 Feb 2011 17:20:45 -0500 Subject: [PATCH 67/84] 7003401: Implement VM error-reporting functionality on erroneous termination Add support for distribution-specific error reporting Reviewed-by: coleenp, phh, jcoomes, ohair --- hotspot/make/Makefile | 5 +- hotspot/make/altsrc.make | 92 ++++++++++ hotspot/make/closed.make | 59 ------- hotspot/make/linux/makefiles/adlc.make | 7 +- hotspot/make/linux/makefiles/buildtree.make | 48 ++++-- hotspot/make/linux/makefiles/rules.make | 4 +- hotspot/make/linux/makefiles/top.make | 6 +- hotspot/make/linux/makefiles/vm.make | 29 +++- hotspot/make/solaris/makefiles/adlc.make | 6 +- hotspot/make/solaris/makefiles/buildtree.make | 51 ++++-- hotspot/make/solaris/makefiles/rules.make | 2 + hotspot/make/solaris/makefiles/top.make | 6 +- hotspot/make/solaris/makefiles/vm.make | 27 ++- hotspot/make/windows/create_obj_files.sh | 45 ++++- hotspot/make/windows/makefiles/vm.make | 162 ++++++++++++++---- hotspot/src/share/vm/runtime/globals.hpp | 6 + hotspot/src/share/vm/runtime/vm_version.cpp | 4 + hotspot/src/share/vm/runtime/vm_version.hpp | 1 + .../src/share/vm/utilities/errorReporter.cpp | 32 ++++ .../src/share/vm/utilities/errorReporter.hpp | 39 +++++ hotspot/src/share/vm/utilities/ostream.cpp | 24 +++ hotspot/src/share/vm/utilities/ostream.hpp | 7 + hotspot/src/share/vm/utilities/vmError.cpp | 21 ++- 23 files changed, 518 insertions(+), 165 deletions(-) create mode 100644 hotspot/make/altsrc.make delete mode 100644 hotspot/make/closed.make create mode 100644 hotspot/src/share/vm/utilities/errorReporter.cpp create mode 100644 hotspot/src/share/vm/utilities/errorReporter.hpp diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index c07f286e4bc..fd46aeef087 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -73,7 +73,7 @@ else include defs.make endif -include $(GAMMADIR)/make/closed.make +include $(GAMMADIR)/make/altsrc.make ifneq ($(ALT_OUTPUTDIR),) ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR) @@ -362,7 +362,8 @@ $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/code/% $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/prims/% $(install-file) -$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC) +HS_JNI_ARCH_SRC=$(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h) +$(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h: $(HS_JNI_ARCH_SRC) $(install-file) $(EXPORT_INCLUDE_DIR)/%: $(HS_SRC_DIR)/share/vm/services/% diff --git a/hotspot/make/altsrc.make b/hotspot/make/altsrc.make new file mode 100644 index 00000000000..a86b8326812 --- /dev/null +++ b/hotspot/make/altsrc.make @@ -0,0 +1,92 @@ +# +# 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. +# +# + +# This file defines variables and macros which are used in the makefiles to +# allow distributions to augment or replace common hotspot code with +# distribution-specific source files. + +# Requires: GAMMADIR +# Provides: +# variables: HS_COMMON_SRC, HS_ALT_SRC, HS_COMMON_SRC_REL, and HS_ALT_SRC_REL +# functions: altsrc-equiv, if-has-altsrc, altsrc, altsrc-replace + +HS_COMMON_SRC_REL=src + +# This needs to be changed to a more generic location, but we keep it as this +# for now for compatibility +HS_ALT_SRC_REL=src/closed + +HS_COMMON_SRC=$(GAMMADIR)/$(HS_COMMON_SRC_REL) +HS_ALT_SRC=$(GAMMADIR)/$(HS_ALT_SRC_REL) + + +## altsrc-equiv +# +# Convert a common source path to an alternative source path +# +# Parameter: An absolute path into the common sources +# Result: The matching path to the alternate-source location +# +altsrc-equiv=$(subst $(HS_COMMON_SRC)/,$(HS_ALT_SRC)/,$(1)) + + +## if-has-altsrc +# +# Conditional macro to test for the existence of an alternate source path +# +# Parameter: An absolute path into the common sources +# Parameter: Result if the alternative-source location exists +# Parameter: Result if the alternative-source location does not exist +# Result: expands to parameter 2 or 3 depending on existence of alternate source +# +if-has-altsrc=$(if $(wildcard $(call altsrc-equiv,$(1))),$(2),$(3)) + + +## altsrc +# +# Converts common source path to alternate source path if the alternate +# path exists, otherwise evaluates to nul (empty string) +# +# Parameter: An absolute path into the common sources +# Result: The equivalent path to the alternate-source location, if such a +# location exists on the filesystem. Otherwise it expands to empty. +# +altsrc=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1))) + +## commonsrc +# +# Returns parameter. +# +commonsrc=$(1) + + +## altsrc-replace +# +# Converts a common source path to an alternate source path if the alternate +# source path exists. Otherwise it evaluates to the input common source path. +# +# Parameter: An absolute path into the common sources +# Result: A path to either the common or alternate sources +# +altsrc-replace=$(call if-has-altsrc,$(1),$(call altsrc-equiv,$(1)),$(1)) diff --git a/hotspot/make/closed.make b/hotspot/make/closed.make deleted file mode 100644 index df4a45af53d..00000000000 --- a/hotspot/make/closed.make +++ /dev/null @@ -1,59 +0,0 @@ -# -# 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. -# -# - -# Support for setting HS_CLOSED_PATH, required GAMMADIR and SRCARCH - -CLOSED_DIR_EXISTS := $(shell \ - if [ -d $(GAMMADIR)/src/closed ] ; then \ - echo true; \ - else \ - echo false; \ - fi) - -CLOSED_SRCARCH_DIR_EXISTS := $(shell \ - if [ -d $(GAMMADIR)/src/closed/cpu/$(SRCARCH)/vm ] ; then \ - echo true; \ - else \ - echo false; \ - fi) - -ifeq ($(CLOSED_SRCARCH_DIR_EXISTS), true) - HS_CLOSED_PATH=closed/ -endif - -# Support for setting HS_JNI_ARCH_SRC, requires HS_SRC_DIR and HS_ARCH - -CLOSED_HS_ARCH_DIR_EXISTS := $(shell \ - if [ -d $(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm ] ; then \ - echo true; \ - else \ - echo false; \ - fi) - -ifeq ($(CLOSED_HS_ARCH_DIR_EXISTS), true) - HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/closed/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h -else - HS_JNI_ARCH_SRC=$(HS_SRC_DIR)/cpu/$(HS_ARCH)/vm/jni_$(HS_ARCH).h -endif - diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make index 821cfa74ad2..84ff8f88c58 100644 --- a/hotspot/make/linux/makefiles/adlc.make +++ b/hotspot/make/linux/makefiles/adlc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 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 @@ -39,8 +39,9 @@ OS = $(Platform_os_family) SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad -SOURCES.AD = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ - $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad +SOURCES.AD = \ + $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \ + $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad) EXEC = $(OUTDIR)/adlc diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make index 279e210aed4..becd97477c9 100644 --- a/hotspot/make/linux/makefiles/buildtree.make +++ b/hotspot/make/linux/makefiles/buildtree.make @@ -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 @@ -56,7 +56,7 @@ # having to read the dependency files for the vm. include $(GAMMADIR)/make/scm.make -include $(GAMMADIR)/make/closed.make +include $(GAMMADIR)/make/altsrc.make # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. @@ -148,7 +148,7 @@ endif # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro # or make/hotspot_distro. ifndef HOTSPOT_VM_DISTRO - ifeq ($(CLOSED_DIR_EXISTS), true) + ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) include $(GAMMADIR)/make/hotspot_distro else include $(GAMMADIR)/make/openjdk_distro @@ -173,6 +173,11 @@ $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE $(SIMPLE_DIRS): $(QUIETLY) mkdir -p $@ +# Convenience macro which takes a source relative path, applies $(1) to the +# absolute path, and then replaces $(GAMMADIR) in the result with a +# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. +gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2))) + flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst @echo Creating $@ ... $(QUIETLY) ( \ @@ -204,16 +209,28 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo; \ echo "Src_Dirs_V = \\"; \ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ - echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \ + echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ echo; \ echo "Src_Dirs_I = \\"; \ - echo "\$$(GAMMADIR)/src/share/vm \\"; \ - echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ - echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(SRCARCH)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm"; \ + echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \ + echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \ + echo "$(call gamma-path,altsrc,share/vm) \\"; \ + echo "$(call gamma-path,commonsrc,share/vm) \\"; \ + echo "$(call gamma-path,altsrc,cpu/$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,cpu/$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(SRCARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ @@ -237,9 +254,14 @@ flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst ../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm @echo Creating directory list $@ - $(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \ + $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \ + find $(HS_ALT_SRC)/share/vm/* -prune \ + -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \ + fi; + $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \ -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ - \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@ + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@ Makefile: $(BUILDTREE_MAKE) @echo Creating $@ ... diff --git a/hotspot/make/linux/makefiles/rules.make b/hotspot/make/linux/makefiles/rules.make index 603037efa26..4237597e986 100644 --- a/hotspot/make/linux/makefiles/rules.make +++ b/hotspot/make/linux/makefiles/rules.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2010, 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 @@ -146,7 +146,7 @@ ifndef LP64 include $(GAMMADIR)/make/pic.make endif -include $(GAMMADIR)/make/closed.make +include $(GAMMADIR)/make/altsrc.make # The non-PIC object files are only generated for 32 bit platforms. ifdef LP64 diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index 688ba373a43..41c50940d25 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -39,7 +39,7 @@ # Instead, use "gmake" (or "gnumake") from the command line. --Rose #MAKE = gmake -include $(GAMMADIR)/make/closed.make +include $(GAMMADIR)/make/altsrc.make TOPDIR = $(shell echo `pwd`) GENERATED = $(TOPDIR)/../generated @@ -59,8 +59,8 @@ Cached_plat = $(GENERATED)/platform.current AD_Dir = $(GENERATED)/adfiles ADLC = $(AD_Dir)/adlc -AD_Spec = $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad -AD_Src = $(GAMMADIR)/src/share/vm/adlc +AD_Spec = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad) +AD_Src = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc) AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp AD_Files = $(AD_Names:%=$(AD_Dir)/%) diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index c772c6ff597..d564055c539 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -28,6 +28,7 @@ # Common build rules. MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles include $(MAKEFILES_DIR)/rules.make +include $(GAMMADIR)/make/altsrc.make default: build @@ -119,17 +120,27 @@ JVM = jvm LIBJVM = lib$(JVM).so LIBJVM_G = lib$(JVM)$(G_SUFFIX).so -CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) -CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm -CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)cpu/$(Platform_arch)/vm -CORE_PATHS += $(GAMMADIR)/src/$(HS_CLOSED_PATH)os_cpu/$(Platform_os_arch)/vm -CORE_PATHS += $(GENERATED)/jvmtifiles +SPECIAL_PATHS:=adlc c1 gc_implementation opto shark libadt -COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 +SOURCE_PATHS=\ + $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \ + \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \)) +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm +SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm +SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm -COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto -COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt -COMPILER2_PATHS += $(GENERATED)/adfiles +CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path)) +CORE_PATHS+=$(GENERATED)/jvmtifiles + +COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1) +COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1 + +COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto) +COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt) +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt +COMPILER2_PATHS += $(GENERATED)/adfiles # Include dirs per type. Src_Dirs/CORE := $(CORE_PATHS) diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make index 7fc55b9d39e..981e187f729 100644 --- a/hotspot/make/solaris/makefiles/adlc.make +++ b/hotspot/make/solaris/makefiles/adlc.make @@ -27,6 +27,7 @@ # It knows how to compile, link, and run the adlc. include $(GAMMADIR)/make/$(Platform_os_family)/makefiles/rules.make +include $(GAMMADIR)/make/altsrc.make # ######################################################################### @@ -39,8 +40,9 @@ OS = $(Platform_os_family) SOURCE.AD = $(OUTDIR)/$(OS)_$(Platform_arch_model).ad -SOURCES.AD = $(GAMMADIR)/src/cpu/$(ARCH)/vm/$(Platform_arch_model).ad \ - $(GAMMADIR)/src/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad +SOURCES.AD = \ + $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(ARCH)/vm/$(Platform_arch_model).ad) \ + $(call altsrc-replace,$(HS_COMMON_SRC)/os_cpu/$(OS)_$(ARCH)/vm/$(OS)_$(Platform_arch_model).ad) EXEC = $(OUTDIR)/adlc diff --git a/hotspot/make/solaris/makefiles/buildtree.make b/hotspot/make/solaris/makefiles/buildtree.make index 08224ef1103..8cca8a07ebb 100644 --- a/hotspot/make/solaris/makefiles/buildtree.make +++ b/hotspot/make/solaris/makefiles/buildtree.make @@ -56,6 +56,7 @@ # having to read the dependency files for the vm. include $(GAMMADIR)/make/scm.make +include $(GAMMADIR)/make/altsrc.make # 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details. QUIETLY$(MAKE_VERBOSE) = @ @@ -139,13 +140,7 @@ endif # Define HOTSPOT_VM_DISTRO based on settings in make/openjdk_distro # or make/hotspot_distro. ifndef HOTSPOT_VM_DISTRO - CLOSED_DIR_EXISTS := $(shell \ - if [ -d $(GAMMADIR)/src/closed ] ; then \ - echo true; \ - else \ - echo false; \ - fi) - ifeq ($(CLOSED_DIR_EXISTS), true) + ifeq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true) include $(GAMMADIR)/make/hotspot_distro else include $(GAMMADIR)/make/openjdk_distro @@ -170,6 +165,11 @@ $(SUBMAKE_DIRS): $(SIMPLE_DIRS) FORCE $(SIMPLE_DIRS): $(QUIETLY) mkdir -p $@ +# Convenience macro which takes a source relative path, applies $(1) to the +# absolute path, and then replaces $(GAMMADIR) in the result with a +# literal "$(GAMMADIR)/" suitable for inclusion in a Makefile. +gamma-path=$(subst $(GAMMADIR),\$$(GAMMADIR),$(call $(1),$(HS_COMMON_SRC)/$(2))) + flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst @echo Creating $@ ... $(QUIETLY) ( \ @@ -202,16 +202,28 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst echo; \ echo "Src_Dirs_V = \\"; \ sed 's/$$/ \\/;s|$(GAMMADIR)|$$(GAMMADIR)|' ../shared_dirs.lst; \ - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ echo; \ echo "Src_Dirs_I = \\"; \ - echo "\$$(GAMMADIR)/src/share/vm \\"; \ - echo "\$$(GAMMADIR)/src/share/vm/prims \\"; \ - echo "\$$(GAMMADIR)/src/cpu/$(ARCH)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os/$(OS_FAMILY)/vm \\"; \ - echo "\$$(GAMMADIR)/src/os_cpu/$(OS_FAMILY)_$(ARCH)/vm"; \ + echo "$(call gamma-path,altsrc,share/vm/prims) \\"; \ + echo "$(call gamma-path,commonsrc,share/vm/prims) \\"; \ + echo "$(call gamma-path,altsrc,share/vm) \\"; \ + echo "$(call gamma-path,commonsrc,share/vm) \\"; \ + echo "$(call gamma-path,altsrc,cpu/$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,cpu/$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os_cpu/$(OS_FAMILY)_$(ARCH)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/$(OS_FAMILY)/vm) \\"; \ + echo "$(call gamma-path,altsrc,os/posix/vm) \\"; \ + echo "$(call gamma-path,commonsrc,os/posix/vm)"; \ [ -n "$(CFLAGS_BROWSE)" ] && \ echo && echo "CFLAGS_BROWSE = $(CFLAGS_BROWSE)"; \ [ -n "$(HOTSPOT_EXTRA_SYSDEFS)" ] && \ @@ -235,9 +247,14 @@ flags_vm.make: $(BUILDTREE_MAKE) ../shared_dirs.lst ../shared_dirs.lst: $(BUILDTREE_MAKE) $(GAMMADIR)/src/share/vm @echo Creating directory list $@ - $(QUIETLY) find $(GAMMADIR)/src/share/vm/* -prune \ + $(QUIETLY) if [ -d $(HS_ALT_SRC)/share/vm ]; then \ + find $(HS_ALT_SRC)/share/vm/* -prune \ + -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@; \ + fi; + $(QUIETLY) find $(HS_COMMON_SRC)/share/vm/* -prune \ -type d \! \( $(TOPLEVEL_EXCLUDE_DIRS) \) -exec find {} \ - \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; > $@ + \( $(ALWAYS_EXCLUDE_DIRS) \) -prune -o -type d -print \; >> $@ Makefile: $(BUILDTREE_MAKE) @echo Creating $@ ... diff --git a/hotspot/make/solaris/makefiles/rules.make b/hotspot/make/solaris/makefiles/rules.make index baafe9c4fd0..4f2cc860805 100644 --- a/hotspot/make/solaris/makefiles/rules.make +++ b/hotspot/make/solaris/makefiles/rules.make @@ -146,6 +146,8 @@ ifndef LP64 include $(GAMMADIR)/make/pic.make endif +include $(GAMMADIR)/make/altsrc.make + # Sun compiler for 64 bit Solaris does not support building non-PIC object files. ifdef LP64 %.o: %.cpp diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make index b0505e77aae..893e9c00cab 100644 --- a/hotspot/make/solaris/makefiles/top.make +++ b/hotspot/make/solaris/makefiles/top.make @@ -39,6 +39,8 @@ # Instead, use "gmake" (or "gnumake") from the command line. --Rose #MAKE = gmake +include $(GAMMADIR)/make/altsrc.make + GENERATED = ../generated VM = $(GAMMADIR)/src/share/vm Plat_File = $(Platform_file) @@ -48,8 +50,8 @@ Cached_plat = $(GENERATED)/platform.current AD_Dir = $(GENERATED)/adfiles ADLC = $(AD_Dir)/adlc -AD_Spec = $(GAMMADIR)/src/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad -AD_Src = $(GAMMADIR)/src/share/vm/adlc +AD_Spec = $(call altsrc-replace,$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm/$(Platform_arch_model).ad) +AD_Src = $(call altsrc-replace,$(HS_COMMON_SRC)/share/vm/adlc) AD_Names = ad_$(Platform_arch_model).hpp ad_$(Platform_arch_model).cpp AD_Files = $(AD_Names:%=$(AD_Dir)/%) diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index 9728b1dc43c..5ad02c00c53 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -28,6 +28,7 @@ # Common build rules. MAKEFILES_DIR=$(GAMMADIR)/make/$(Platform_os_family)/makefiles include $(MAKEFILES_DIR)/rules.make +include $(GAMMADIR)/make/altsrc.make default: build @@ -139,16 +140,26 @@ JVM = jvm LIBJVM = lib$(JVM).so LIBJVM_G = lib$(JVM)$(G_SUFFIX).so -CORE_PATHS := $(shell find $(GAMMADIR)/src/share/vm/* -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)) -CORE_PATHS += $(GAMMADIR)/src/os/$(Platform_os_family)/vm -CORE_PATHS += $(GAMMADIR)/src/cpu/$(Platform_arch)/vm -CORE_PATHS += $(GAMMADIR)/src/os_cpu/$(Platform_os_arch)/vm -CORE_PATHS += $(GENERATED)/jvmtifiles +SPECIAL_PATHS:=adlc c1 dist gc_implementation opto shark libadt -COMPILER1_PATHS := $(GAMMADIR)/src/share/vm/c1 +SOURCE_PATHS=\ + $(shell find $(HS_COMMON_SRC)/share/vm/* -type d \! \ + \( -name DUMMY $(foreach dir,$(SPECIAL_PATHS),-o -name $(dir)) \)) +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/$(Platform_os_family)/vm +SOURCE_PATHS+=$(HS_COMMON_SRC)/os/posix/vm +SOURCE_PATHS+=$(HS_COMMON_SRC)/cpu/$(Platform_arch)/vm +SOURCE_PATHS+=$(HS_COMMON_SRC)/os_cpu/$(Platform_os_arch)/vm -COMPILER2_PATHS := $(GAMMADIR)/src/share/vm/opto -COMPILER2_PATHS += $(GAMMADIR)/src/share/vm/libadt +CORE_PATHS=$(foreach path,$(SOURCE_PATHS),$(call altsrc,$(path)) $(path)) +CORE_PATHS+=$(GENERATED)/jvmtifiles + +COMPILER1_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/c1) +COMPILER1_PATHS += $(HS_COMMON_SRC)/share/vm/c1 + +COMPILER2_PATHS := $(call altsrc,$(HS_COMMON_SRC)/share/vm/opto) +COMPILER2_PATHS += $(call altsrc,$(HS_COMMON_SRC)/share/vm/libadt) +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/opto +COMPILER2_PATHS += $(HS_COMMON_SRC)/share/vm/libadt COMPILER2_PATHS += $(GENERATED)/adfiles # Include dirs per type. diff --git a/hotspot/make/windows/create_obj_files.sh b/hotspot/make/windows/create_obj_files.sh index 52ae0bb785c..0c8276962e6 100644 --- a/hotspot/make/windows/create_obj_files.sh +++ b/hotspot/make/windows/create_obj_files.sh @@ -51,21 +51,48 @@ Platform_os_arch=windows_$Platform_arch WorkSpace=$4 GENERATED=$5 -BASE_PATHS="` $FIND ${WorkSpace}/src/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`" -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/share/vm/gc_implementation/shared" -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os/${Platform_os_family}/vm" -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/cpu/${Platform_arch}/vm" -BASE_PATHS="${BASE_PATHS} ${WorkSpace}/src/os_cpu/${Platform_os_arch}/vm" +COMMONSRC_REL=src +ALTSRC_REL=src/closed # Change this to pick up alt sources from somewhere else + +COMMONSRC=${WorkSpace}/${COMMONSRC_REL} +ALTSRC=${WorkSpace}/${ALTSRC_REL} + +BASE_PATHS="`if [ -d ${ALTSRC}/share/vm ]; then $FIND ${ALTSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \); fi`" +BASE_PATHS="${BASE_PATHS} ` $FIND ${COMMONSRC}/share/vm ! -name vm -prune -type d \! \( -name adlc -o -name c1 -o -name gc_implementation -o -name opto -o -name shark -o -name libadt \)`" + +for sd in \ + share/vm/gc_implementation/shared \ + os/${Platform_os_family}/vm \ + cpu/${Platform_arch}/vm \ + os_cpu/${Platform_os_arch}/vm; do + if [ -d "${ALTSRC}/${sd}" ]; then + BASE_PATHS="${BASE_PATHS} ${ALTSRC}/${sd}" + fi + BASE_PATHS="${BASE_PATHS} ${COMMONSRC}/${sd}" +done + BASE_PATHS="${BASE_PATHS} ${GENERATED}/jvmtifiles" CORE_PATHS="${BASE_PATHS}" # shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS. -CORE_PATHS="${CORE_PATHS} `$FIND ${WorkSpace}/src/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" +if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then + CORE_PATHS="${CORE_PATHS} `$FIND ${ALTSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" +fi +CORE_PATHS="${CORE_PATHS} `$FIND ${COMMONSRC}/share/vm/gc_implementation ! -name gc_implementation -prune -type d \! -name shared`" -COMPILER1_PATHS="${WorkSpace}/src/share/vm/c1" +if [ -d "${ALTSRC}/share/vm/c1" ]; then + COMPILER1_PATHS="${ALTSRC}/share/vm/c1" +fi +COMPILER1_PATHS="${COMPILER1_PATHS} ${COMMONSRC}/share/vm/c1" -COMPILER2_PATHS="${WorkSpace}/src/share/vm/opto" -COMPILER2_PATHS="${COMPILER2_PATHS} ${WorkSpace}/src/share/vm/libadt" +if [ -d "${ALTSRC}/share/vm/opto" ]; then + COMPILER2_PATHS="${ALTSRC}/share/vm/opto" +fi +COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/opto" +if [ -d "${ALTSRC}/share/vm/libadt" ]; then + COMPILER2_PATHS="${COMPILER2_PATHS} ${ALTSRC}/share/vm/libadt" +fi +COMPILER2_PATHS="${COMPILER2_PATHS} ${COMMONSRC}/share/vm/libadt" COMPILER2_PATHS="${COMPILER2_PATHS} ${GENERATED}/adfiles" # Include dirs per type. diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make index 69ff1a7e780..4bcdd4a3bbe 100644 --- a/hotspot/make/windows/makefiles/vm.make +++ b/hotspot/make/windows/makefiles/vm.make @@ -27,6 +27,9 @@ Res_Files=.\version.res !include ..\generated\objfiles.make +COMMONSRC=$(WorkSpace)\src +ALTSRC=$(WorkSpace)\src\closed + !ifdef RELEASE !ifdef DEVELOP CPP_FLAGS=$(CPP_FLAGS) /D "DEBUG" @@ -111,13 +114,30 @@ LINK_FLAGS=$(LINK_FLAGS) $(STACK_SIZE) /subsystem:windows /dll /base:0x8000000 \ /export:JVM_GetThreadStateValues \ /export:JVM_InitAgentProperties -CPP_INCLUDE_DIRS=\ - /I "..\generated" \ - /I "$(WorkSpace)\src\share\vm" \ - /I "$(WorkSpace)\src\share\vm\prims" \ - /I "$(WorkSpace)\src\os\windows\vm" \ - /I "$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm" \ - /I "$(WorkSpace)\src\cpu\$(Platform_arch)\vm" +CPP_INCLUDE_DIRS=/I "..\generated" + +!if exists($(ALTSRC)\share\vm) +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\share\vm" +!endif + +!if exists($(ALTSRC)\os\windows\vm) +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\os\windows\vm" +!endif + +!if exists($(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm) +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm" +!endif + +!if exists($(ALTSRC)\cpu\$(Platform_arch)\vm) +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) /I "$(ALTSRC)\cpu\$(Platform_arch)\vm" +!endif + +CPP_INCLUDE_DIRS=$(CPP_INCLUDE_DIRS) \ + /I "$(COMMONSRC)\share\vm" \ + /I "$(COMMONSRC)\share\vm\prims" \ + /I "$(COMMONSRC)\os\windows\vm" \ + /I "$(COMMONSRC)\os_cpu\windows_$(Platform_arch)\vm" \ + /I "$(COMMONSRC)\cpu\$(Platform_arch)\vm" CPP_DONT_USE_PCH=/D DONT_USE_PRECOMPILED_HEADER @@ -127,7 +147,7 @@ CPP_USE_PCH=/Fp"vm.pch" /Yu"precompiled.hpp" CPP_USE_PCH=$(CPP_DONT_USE_PCH) !endif -# Where to find the source code for the virtual machine +# Where to find the source code for the virtual machine (is this used?) VM_PATH=../generated VM_PATH=$(VM_PATH);../generated/adfiles VM_PATH=$(VM_PATH);../generated/jvmtifiles @@ -188,81 +208,157 @@ bytecodeInterpreterWithChecks.obj: ..\generated\jvmtifiles\bytecodeInterpreterWi $(CPP) $(CPP_FLAGS) $(CPP_DONT_USE_PCH) /c ..\generated\jvmtifiles\bytecodeInterpreterWithChecks.cpp # Default rules for the Virtual Machine -{$(WorkSpace)\src\share\vm\c1}.cpp.obj:: +{$(COMMONSRC)\share\vm\c1}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\compiler}.cpp.obj:: +{$(COMMONSRC)\share\vm\compiler}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\code}.cpp.obj:: +{$(COMMONSRC)\share\vm\code}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\interpreter}.cpp.obj:: +{$(COMMONSRC)\share\vm\interpreter}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\ci}.cpp.obj:: +{$(COMMONSRC)\share\vm\ci}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\classfile}.cpp.obj:: +{$(COMMONSRC)\share\vm\classfile}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\gc_implementation\parallelScavenge}.cpp.obj:: +{$(COMMONSRC)\share\vm\gc_implementation\parallelScavenge}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\gc_implementation\shared}.cpp.obj:: +{$(COMMONSRC)\share\vm\gc_implementation\shared}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\gc_implementation\parNew}.cpp.obj:: +{$(COMMONSRC)\share\vm\gc_implementation\parNew}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj:: +{$(COMMONSRC)\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\gc_implementation\g1}.cpp.obj:: +{$(COMMONSRC)\share\vm\gc_implementation\g1}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\gc_interface}.cpp.obj:: +{$(COMMONSRC)\share\vm\gc_interface}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\asm}.cpp.obj:: +{$(COMMONSRC)\share\vm\asm}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\memory}.cpp.obj:: +{$(COMMONSRC)\share\vm\memory}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\oops}.cpp.obj:: +{$(COMMONSRC)\share\vm\oops}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\prims}.cpp.obj:: +{$(COMMONSRC)\share\vm\prims}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\runtime}.cpp.obj:: +{$(COMMONSRC)\share\vm\runtime}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\services}.cpp.obj:: +{$(COMMONSRC)\share\vm\services}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\utilities}.cpp.obj:: +{$(COMMONSRC)\share\vm\utilities}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\libadt}.cpp.obj:: +{$(COMMONSRC)\share\vm\libadt}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\share\vm\opto}.cpp.obj:: +{$(COMMONSRC)\share\vm\opto}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\os\windows\vm}.cpp.obj:: +{$(COMMONSRC)\os\windows\vm}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< # This guy should remain a single colon rule because # otherwise we can't specify the output filename. -{$(WorkSpace)\src\os\windows\vm}.rc.res: +{$(COMMONSRC)\os\windows\vm}.rc.res: @$(RC) $(RC_FLAGS) /fo"$@" $< -{$(WorkSpace)\src\cpu\$(Platform_arch)\vm}.cpp.obj:: +{$(COMMONSRC)\cpu\$(Platform_arch)\vm}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< -{$(WorkSpace)\src\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj:: +{$(COMMONSRC)\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\c1}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\compiler}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\code}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\interpreter}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\ci}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\classfile}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\gc_implementation\parallelScavenge}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\gc_implementation\shared}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\gc_implementation\parNew}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\gc_implementation\concurrentMarkSweep}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\gc_implementation\g1}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\gc_interface}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\asm}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\memory}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\oops}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\prims}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\runtime}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\services}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\utilities}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\libadt}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\share\vm\opto}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\os\windows\vm}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +# otherwise we can't specify the output filename. +{$(ALTSRC)\os\windows\vm}.rc.res: + @$(RC) $(RC_FLAGS) /fo"$@" $< + +{$(ALTSRC)\cpu\$(Platform_arch)\vm}.cpp.obj:: + $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< + +{$(ALTSRC)\os_cpu\windows_$(Platform_arch)\vm}.cpp.obj:: $(CPP) $(CPP_FLAGS) $(CPP_USE_PCH) /c $< {..\generated\incls}.cpp.obj:: diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 4a83a419537..95a522b2c29 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -3655,6 +3655,12 @@ class CommandLineFlags { manageable(bool, PrintConcurrentLocks, false, \ "Print java.util.concurrent locks in thread dump") \ \ + diagnostic(bool, TransmitErrorReport, false, \ + "Enable error report transmission on erroneous termination") \ + \ + diagnostic(ccstr, ErrorReportServer, NULL, \ + "Override built-in error report server address") \ + \ /* Shared spaces */ \ \ product(bool, UseSharedSpaces, true, \ diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp index 11db0c39ab3..4afc8cea3b9 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -245,6 +245,10 @@ const char* Abstract_VM_Version::internal_vm_info_string() { " by " XSTR(HOTSPOT_BUILD_USER) " with " HOTSPOT_BUILD_COMPILER; } +const char *Abstract_VM_Version::vm_build_user() { + return HOTSPOT_BUILD_USER; +} + unsigned int Abstract_VM_Version::jvm_version() { return ((Abstract_VM_Version::vm_major_version() & 0xFF) << 24) | ((Abstract_VM_Version::vm_minor_version() & 0xFF) << 16) | diff --git a/hotspot/src/share/vm/runtime/vm_version.hpp b/hotspot/src/share/vm/runtime/vm_version.hpp index 6c2dfb7acfd..28b243f41ba 100644 --- a/hotspot/src/share/vm/runtime/vm_version.hpp +++ b/hotspot/src/share/vm/runtime/vm_version.hpp @@ -59,6 +59,7 @@ class Abstract_VM_Version: AllStatic { static const char* vm_info_string(); static const char* vm_release(); static const char* vm_platform_string(); + static const char* vm_build_user(); static int vm_major_version() { assert(_initialized, "not initialized"); return _vm_major_version; } static int vm_minor_version() { assert(_initialized, "not initialized"); return _vm_minor_version; } diff --git a/hotspot/src/share/vm/utilities/errorReporter.cpp b/hotspot/src/share/vm/utilities/errorReporter.cpp new file mode 100644 index 00000000000..9d10453948d --- /dev/null +++ b/hotspot/src/share/vm/utilities/errorReporter.cpp @@ -0,0 +1,32 @@ +/* + * 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. + * + */ + +#include "precompiled.hpp" +#include "utilities/errorReporter.hpp" + +ErrorReporter::ErrorReporter() {} + +void ErrorReporter::call(FILE* fd, char* buffer, int length) { +} + diff --git a/hotspot/src/share/vm/utilities/errorReporter.hpp b/hotspot/src/share/vm/utilities/errorReporter.hpp new file mode 100644 index 00000000000..e7fae5fba22 --- /dev/null +++ b/hotspot/src/share/vm/utilities/errorReporter.hpp @@ -0,0 +1,39 @@ +/* + * 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. + * + */ + +#ifndef SHARE_VM_UTILITIES_ERRORREPORTER_HPP +#define SHARE_VM_UTILITIES_ERRORREPORTER_HPP + +#include "utilities/globalDefinitions.hpp" + +class ErrorReporter : public StackObj { + +public: + ErrorReporter(); + ~ErrorReporter(){}; + + void call(FILE* fd, char *buffer, int length); +}; + +#endif // ndef SHARE_VM_UTILITIES_ERRORREPORTER_HPP diff --git a/hotspot/src/share/vm/utilities/ostream.cpp b/hotspot/src/share/vm/utilities/ostream.cpp index acad5fda1e4..897dba137ac 100644 --- a/hotspot/src/share/vm/utilities/ostream.cpp +++ b/hotspot/src/share/vm/utilities/ostream.cpp @@ -314,6 +314,11 @@ fileStream::fileStream(const char* file_name) { _need_close = true; } +fileStream::fileStream(const char* file_name, const char* opentype) { + _file = fopen(file_name, opentype); + _need_close = true; +} + void fileStream::write(const char* s, size_t len) { if (_file != NULL) { // Make an unused local variable to avoid warning from gcc 4.x compiler. @@ -322,6 +327,25 @@ void fileStream::write(const char* s, size_t len) { update_position(s, len); } +long fileStream::fileSize() { + long size = -1; + if (_file != NULL) { + long pos = ::ftell(_file); + if (::fseek(_file, 0, SEEK_END) == 0) { + size = ::ftell(_file); + } + ::fseek(_file, pos, SEEK_SET); + } + return size; +} + +char* fileStream::readln(char *data, int count ) { + char * ret = ::fgets(data, count, _file); + //Get rid of annoying \n char + data[::strlen(data)-1] = '\0'; + return ret; +} + fileStream::~fileStream() { if (_file != NULL) { if (_need_close) fclose(_file); diff --git a/hotspot/src/share/vm/utilities/ostream.hpp b/hotspot/src/share/vm/utilities/ostream.hpp index fd86a8da9e7..1776a5b98e7 100644 --- a/hotspot/src/share/vm/utilities/ostream.hpp +++ b/hotspot/src/share/vm/utilities/ostream.hpp @@ -159,10 +159,17 @@ class fileStream : public outputStream { bool _need_close; public: fileStream(const char* file_name); + fileStream(const char* file_name, const char* opentype); fileStream(FILE* file) { _file = file; _need_close = false; } ~fileStream(); bool is_open() const { return _file != NULL; } + void set_need_close(bool b) { _need_close = b;} virtual void write(const char* c, size_t len); + size_t read(void *data, size_t size, size_t count) { return ::fread(data, size, count, _file); } + char* readln(char *data, int count); + int eof() { return feof(_file); } + long fileSize(); + void rewind() { ::rewind(_file); } void flush(); }; diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index 662e5a7c91a..af05eed8a60 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -35,6 +35,7 @@ #include "utilities/debug.hpp" #include "utilities/decoder.hpp" #include "utilities/defaultStream.hpp" +#include "utilities/errorReporter.hpp" #include "utilities/top.hpp" #include "utilities/vmError.hpp" @@ -769,6 +770,7 @@ void VMError::report_and_die() { // then save detailed information in log file (verbose = true). static bool out_done = false; // done printing to standard out static bool log_done = false; // done saving error log + static bool transmit_report_done = false; // done error reporting static fdStream log; // error log if (SuppressFatalErrorMessage) { @@ -859,7 +861,7 @@ void VMError::report_and_die() { bool copy_ok = Arguments::copy_expand_pid(ErrorFile, strlen(ErrorFile), buffer, sizeof(buffer)); if (copy_ok) { - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); + fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); } } @@ -870,7 +872,7 @@ void VMError::report_and_die() { // so use the default name in the current directory jio_snprintf(&buffer[len], sizeof(buffer)-len, "%shs_err_pid%u.log", os::file_separator(), os::current_process_id()); - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); + fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); } if (fd == -1) { @@ -879,7 +881,7 @@ void VMError::report_and_die() { if (tmpdir != NULL && tmpdir[0] != '\0') { jio_snprintf(buffer, sizeof(buffer), "%s%shs_err_pid%u.log", tmpdir, os::file_separator(), os::current_process_id()); - fd = open(buffer, O_WRONLY | O_CREAT | O_TRUNC, 0666); + fd = open(buffer, O_RDWR | O_CREAT | O_TRUNC, 0666); } } @@ -892,6 +894,9 @@ void VMError::report_and_die() { } else { out.print_raw_cr("# Can not save log file, dump to screen.."); log.set_fd(defaultStream::output_fd()); + /* Error reporting currently needs dumpfile. + * Maybe implement direct streaming in the future.*/ + transmit_report_done = true; } } @@ -900,6 +905,16 @@ void VMError::report_and_die() { first_error->_current_step = 0; // reset current_step first_error->_current_step_info = ""; // reset current_step string + // Run error reporting to determine whether or not to report the crash. + if (!transmit_report_done && should_report_bug(first_error->_id)) { + transmit_report_done = true; + FILE* hs_err = ::fdopen(log.fd(), "r"); + if (NULL != hs_err) { + ErrorReporter er; + er.call(hs_err, buffer, O_BUFLEN); + } + } + if (log.fd() != defaultStream::output_fd()) { close(log.fd()); } From 71a1558a6740b8032d3d12e4ae843049574cd7d6 Mon Sep 17 00:00:00 2001 From: Chris Hegarty Date: Wed, 9 Feb 2011 09:53:07 +0000 Subject: [PATCH 68/84] 7013961: Threads attached via JNI attach prevent daemon ThreadGroups from being destroyed Reviewed-by: dholmes --- jdk/src/share/classes/java/lang/Thread.java | 2 +- .../share/classes/java/lang/ThreadGroup.java | 21 ++++++------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java index 3e258e6cdf0..d35e082b844 100644 --- a/jdk/src/share/classes/java/lang/Thread.java +++ b/jdk/src/share/classes/java/lang/Thread.java @@ -690,7 +690,7 @@ class Thread implements Runnable { /* Notify the group that this thread is about to be started * so that it can be added to the group's list of threads * and the group's unstarted count can be decremented. */ - group.threadStarting(this); + group.add(this); boolean started = false; try { diff --git a/jdk/src/share/classes/java/lang/ThreadGroup.java b/jdk/src/share/classes/java/lang/ThreadGroup.java index 945dfe20175..e27f17550a0 100644 --- a/jdk/src/share/classes/java/lang/ThreadGroup.java +++ b/jdk/src/share/classes/java/lang/ThreadGroup.java @@ -867,21 +867,6 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler { } } - /** - * Notifies the group that the thread {@code t} is about to be - * started and adds the thread to this thread group. - * - * The thread is now a fully fledged member of the group, even though - * it hasn't been started yet. It will prevent the group from being - * destroyed so the unstarted Threads count is decremented. - */ - void threadStarting(Thread t) { - synchronized (this) { - add(t); - nUnstartedThreads--; - } - } - /** * Adds the specified thread to this thread group. * @@ -910,6 +895,12 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler { // This is done last so it doesn't matter in case the // thread is killed nthreads++; + + // The thread is now a fully fledged member of the group, even + // though it may, or may not, have been started yet. It will prevent + // the group from being destroyed so the unstarted Threads count is + // decremented. + nUnstartedThreads--; } } From 237866941a412a09ca2c78bab254766beb0f65a4 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Wed, 9 Feb 2011 11:08:10 +0100 Subject: [PATCH 69/84] 7014918: Improve core/minidump handling in Hotspot Added Minidump support on Windows, enabled large page core dumps when coredump_filter is present and writing out path/rlimit for core dumps. Reviewed-by: poonam, dsamersoff, sla, coleenp --- hotspot/src/os/linux/vm/os_linux.cpp | 42 ++++++++++- hotspot/src/os/posix/vm/os_posix.cpp | 61 +++++++++++++++ hotspot/src/os/windows/vm/os_windows.cpp | 88 ++++++++++++++++++++-- hotspot/src/os/windows/vm/os_windows.hpp | 6 +- hotspot/src/share/vm/runtime/globals.hpp | 5 +- hotspot/src/share/vm/runtime/os.hpp | 5 +- hotspot/src/share/vm/utilities/vmError.cpp | 23 +++++- hotspot/src/share/vm/utilities/vmError.hpp | 13 +++- 8 files changed, 232 insertions(+), 11 deletions(-) create mode 100644 hotspot/src/os/posix/vm/os_posix.cpp diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index ace16e3fec9..6bdcdd2165c 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 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 @@ -131,6 +131,7 @@ #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) #define SEC_IN_NANOSECS 1000000000LL +#define LARGEPAGES_BIT (1 << 6) //////////////////////////////////////////////////////////////////////////////// // global variables julong os::Linux::_physical_memory = 0; @@ -2817,6 +2818,43 @@ bool os::unguard_memory(char* addr, size_t size) { return linux_mprotect(addr, size, PROT_READ|PROT_WRITE); } +/* +* Set the coredump_filter bits to include largepages in core dump (bit 6) +* +* From the coredump_filter documentation: +* +* - (bit 0) anonymous private memory +* - (bit 1) anonymous shared memory +* - (bit 2) file-backed private memory +* - (bit 3) file-backed shared memory +* - (bit 4) ELF header pages in file-backed private memory areas (it is +* effective only if the bit 2 is cleared) +* - (bit 5) hugetlb private memory +* - (bit 6) hugetlb shared memory +*/ +static void set_coredump_filter(void) { + FILE *f; + long cdm; + + if ((f = fopen("/proc/self/coredump_filter", "r+")) == NULL) { + return; + } + + if (fscanf(f, "%lx", &cdm) != 1) { + fclose(f); + return; + } + + rewind(f); + + if ((cdm & LARGEPAGES_BIT) == 0) { + cdm |= LARGEPAGES_BIT; + fprintf(f, "%#lx", cdm); + } + + fclose(f); +} + // Large page support static size_t _large_page_size = 0; @@ -2874,6 +2912,8 @@ bool os::large_page_init() { _page_sizes[2] = 0; } + set_coredump_filter(); + // Large page support is available on 2.6 or newer kernel, some vendors // (e.g. Redhat) have backported it to their 2.4 based distributions. // We optimistically assume the support is available. If later it turns out diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp new file mode 100644 index 00000000000..079fa7bc0b2 --- /dev/null +++ b/hotspot/src/os/posix/vm/os_posix.cpp @@ -0,0 +1,61 @@ +/* +* Copyright (c) 1999, 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. +* +*/ + +#include "prims/jvm.h" +#include "runtime/os.hpp" +#include "utilities/vmError.hpp" + +#include +#include + +// Check core dump limit and report possible place where core can be found +void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { + struct rlimit rlim; + static char cwd[O_BUFLEN]; + bool success; + + get_current_directory(cwd, sizeof(cwd)); + + if (getrlimit(RLIMIT_CORE, &rlim) != 0) { + jio_snprintf(buffer, bufferSize, "%s/core or core.%d (may not exist)", cwd, current_process_id()); + success = true; + } else { + switch(rlim.rlim_cur) { + case RLIM_INFINITY: + jio_snprintf(buffer, bufferSize, "%s/core or core.%d", cwd, current_process_id()); + success = true; + break; + case 0: + jio_snprintf(buffer, bufferSize, "Core dumps have been disabled. To enable core dumping, try \"ulimit -c unlimited\" before starting Java again"); + success = false; + break; + default: + jio_snprintf(buffer, bufferSize, "%s/core or core.%d (max size %lu kB). To ensure a full core dump, try \"ulimit -c unlimited\" before starting Java again", cwd, current_process_id(), (unsigned long)(rlim.rlim_cur >> 10)); + success = true; + break; + } + } + VMError::report_coredump_status(buffer, success); +} + diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 2eeb3d33392..50018200d9f 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1,5 +1,5 @@ /* - * CopyrighT (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -915,6 +915,80 @@ void os::shutdown() { } } + +static BOOL (WINAPI *_MiniDumpWriteDump) ( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION, + PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION); + +void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize) { + HINSTANCE dbghelp; + EXCEPTION_POINTERS ep; + MINIDUMP_EXCEPTION_INFORMATION mei; + HANDLE hProcess = GetCurrentProcess(); + DWORD processId = GetCurrentProcessId(); + HANDLE dumpFile; + MINIDUMP_TYPE dumpType; + static const char* cwd; + + // If running on a client version of Windows and user has not explicitly enabled dumping + if (!os::win32::is_windows_server() && !CreateMinidumpOnCrash) { + VMError::report_coredump_status("Minidumps are not enabled by default on client versions of Windows", false); + return; + // If running on a server version of Windows and user has explictly disabled dumping + } else if (os::win32::is_windows_server() && !FLAG_IS_DEFAULT(CreateMinidumpOnCrash) && !CreateMinidumpOnCrash) { + VMError::report_coredump_status("Minidump has been disabled from the command line", false); + return; + } + + dbghelp = LoadLibrary("DBGHELP.DLL"); + + if (dbghelp == NULL) { + VMError::report_coredump_status("Failed to load dbghelp.dll", false); + return; + } + + _MiniDumpWriteDump = CAST_TO_FN_PTR( + BOOL(WINAPI *)( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION, + PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION), + GetProcAddress(dbghelp, "MiniDumpWriteDump")); + + if (_MiniDumpWriteDump == NULL) { + VMError::report_coredump_status("Failed to find MiniDumpWriteDump() in module dbghelp.dll", false); + return; + } + + dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithFullMemoryInfo | + MiniDumpWithHandleData | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules); + + + cwd = get_current_directory(NULL, 0); + jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp",cwd, current_process_id()); + dumpFile = CreateFile(buffer, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); + + if (dumpFile == INVALID_HANDLE_VALUE) { + VMError::report_coredump_status("Failed to create file for dumping", false); + return; + } + + ep.ContextRecord = (PCONTEXT) contextRecord; + ep.ExceptionRecord = (PEXCEPTION_RECORD) exceptionRecord; + + mei.ThreadId = GetCurrentThreadId(); + mei.ExceptionPointers = &ep; + + // Older versions of dbghelp.dll (the one shipped with Win2003 for example) may not support all + // the dump types we really want. If first call fails, lets fall back to just use MiniDumpWithFullMemory then. + if (_MiniDumpWriteDump(hProcess, processId, dumpFile, dumpType, &mei, NULL, NULL) == false && + _MiniDumpWriteDump(hProcess, processId, dumpFile, (MINIDUMP_TYPE)MiniDumpWithFullMemory, &mei, NULL, NULL) == false) { + VMError::report_coredump_status("Call to MiniDumpWriteDump() failed", false); + } else { + VMError::report_coredump_status(buffer, true); + } + + CloseHandle(dumpFile); +} + + + void os::abort(bool dump_core) { os::shutdown(); @@ -3274,7 +3348,7 @@ volatile intx os::win32::_os_thread_count = 0; bool os::win32::_is_nt = false; bool os::win32::_is_windows_2003 = false; - +bool os::win32::_is_windows_server = false; void os::win32::initialize_system_info() { SYSTEM_INFO si; @@ -3293,9 +3367,9 @@ void os::win32::initialize_system_info() { GlobalMemoryStatusEx(&ms); _physical_memory = ms.ullTotalPhys; - OSVERSIONINFO oi; - oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&oi); + OSVERSIONINFOEX oi; + oi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + GetVersionEx((OSVERSIONINFO*)&oi); switch(oi.dwPlatformId) { case VER_PLATFORM_WIN32_WINDOWS: _is_nt = false; break; case VER_PLATFORM_WIN32_NT: @@ -3305,6 +3379,10 @@ void os::win32::initialize_system_info() { if (os_vers == 5002) { _is_windows_2003 = true; } + if (oi.wProductType == VER_NT_DOMAIN_CONTROLLER || + oi.wProductType == VER_NT_SERVER) { + _is_windows_server = true; + } } break; default: fatal("Unknown platform"); diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp index ddc7e203657..5576f0bc38d 100644 --- a/hotspot/src/os/windows/vm/os_windows.hpp +++ b/hotspot/src/os/windows/vm/os_windows.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -38,6 +38,7 @@ class win32 { static size_t _default_stack_size; static bool _is_nt; static bool _is_windows_2003; + static bool _is_windows_server; public: // Windows-specific interface: @@ -64,6 +65,9 @@ class win32 { // Tells whether the platform is NT or Windown95 static bool is_nt() { return _is_nt; } + // Tells whether this is a server version of Windows + static bool is_windows_server() { return _is_windows_server; } + // Tells whether the platform is Windows 2003 static bool is_windows_2003() { return _is_windows_2003; } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 95a522b2c29..e900b6ce8e2 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -790,6 +790,9 @@ class CommandLineFlags { product(bool, ShowMessageBoxOnError, false, \ "Keep process alive on VM fatal error") \ \ + product(bool, CreateMinidumpOnCrash, false, \ + "Create minidump on VM fatal error") \ + \ product_pd(bool, UseOSErrorReporting, \ "Let VM fatal error propagate to the OS (ie. WER on Windows)") \ \ diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index c7f03462d54..90ca497df55 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 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 @@ -614,6 +614,9 @@ class os: AllStatic { // Structured OS Exception support static void os_exception_wrapper(java_call_t f, JavaValue* value, methodHandle* method, JavaCallArguments* args, Thread* thread); + // On Windows this will create an actual minidump, on Linux/Solaris it will simply check core dump limits + static void check_or_create_dump(void* exceptionRecord, void* contextRecord, char* buffer, size_t bufferSize); + // JVMTI & JVM monitoring and management support // The thread_cpu_time() and current_thread_cpu_time() are only // supported if is_thread_cpu_time_supported() returns true. diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp index af05eed8a60..9785d649d08 100644 --- a/hotspot/src/share/vm/utilities/vmError.cpp +++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -201,6 +201,15 @@ static void print_bug_submit_message(outputStream *out, Thread *thread) { out->print_raw_cr("#"); } +bool VMError::coredump_status; +char VMError::coredump_message[O_BUFLEN]; + +void VMError::report_coredump_status(const char* message, bool status) { + coredump_status = status; + strncpy(coredump_message, message, sizeof(coredump_message)); + coredump_message[sizeof(coredump_message)-1] = 0; +} + // Return a string to describe the error char* VMError::error_string(char* buf, int buflen) { @@ -454,6 +463,15 @@ void VMError::report(outputStream* st) { st->cr(); st->print_cr("#"); } + STEP(63, "(printing core file information)") + st->print("# "); + if (coredump_status) { + st->print("Core dump written. Default location: %s", coredump_message); + } else { + st->print("Failed to write core dump. %s", coredump_message); + } + st->print_cr(""); + st->print_cr("#"); STEP(65, "(printing bug submit message)") @@ -792,6 +810,9 @@ void VMError::report_and_die() { ShowMessageBoxOnError = false; } + // Write a minidump on Windows, check core dump limits on Linux/Solaris + os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer)); + // reset signal handlers or exception filter; make sure recursive crashes // are handled properly. reset_signal_handlers(); diff --git a/hotspot/src/share/vm/utilities/vmError.hpp b/hotspot/src/share/vm/utilities/vmError.hpp index e9d60b3a121..28f486940a4 100644 --- a/hotspot/src/share/vm/utilities/vmError.hpp +++ b/hotspot/src/share/vm/utilities/vmError.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, 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 @@ -67,6 +67,14 @@ class VMError : public StackObj { static VMError* volatile first_error; static volatile jlong first_error_tid; + // Core dump status, false if we have been unable to write a core/minidump for some reason + static bool coredump_status; + + // When coredump_status is set to true this will contain the name/path to the core/minidump, + // if coredump_status if false, this will (hopefully) contain a useful error explaining why + // no core/minidump has been written to disk + static char coredump_message[O_BUFLEN]; + // used by reporting about OOM size_t _size; @@ -106,6 +114,9 @@ public: // return a string to describe the error char *error_string(char* buf, int buflen); + // Report status of core/minidump + static void report_coredump_status(const char* message, bool status); + // main error reporting function void report_and_die(); From a0b7ff83694de1c1c18acf9d605c11ff792795d8 Mon Sep 17 00:00:00 2001 From: Andy Herrick Date: Wed, 9 Feb 2011 09:19:33 -0500 Subject: [PATCH 70/84] 7016724: Remove sun.jkernel.* classes in JDK 7 Remove sun.jkernel.* classes in JDK 7 Reviewed-by: ohair, alanb, mchung --- jdk/make/modules/modules.config | 5 - jdk/make/sun/Makefile | 3 +- jdk/make/sun/jkernel/FILES_c_windows.gmk | 42 - jdk/make/sun/jkernel/FILES_java.gmk | 41 - jdk/make/sun/jkernel/Makefile | 94 - .../classes/java/awt/color/ICC_Profile.java | 7 - .../share/classes/java/util/zip/ZipEntry.java | 14 +- .../sun/jkernel/BackgroundDownloader.java | 209 -- jdk/src/share/classes/sun/jkernel/Bundle.java | 922 --------- .../classes/sun/jkernel/BundleCheck.java | 330 --- .../sun/jkernel/ByteArrayToFromHexDigits.java | 138 -- .../sun/jkernel/DigestOutputStream.java | 255 --- .../classes/sun/jkernel/DownloadManager.java | 1786 ----------------- .../classes/sun/jkernel/KernelError.java | 48 - jdk/src/share/classes/sun/jkernel/Mutex.java | 86 - .../jkernel/StandaloneByteArrayAccess.java | 155 -- .../sun/jkernel/StandaloneMessageDigest.java | 395 ---- .../classes/sun/jkernel/StandaloneSHA.java | 190 -- .../sun/jvmstat/monitor/MonitoredVmUtil.java | 14 - .../classes/sun/misc/BootClassLoaderHook.java | 5 +- .../tools/attach/HotSpotAttachProvider.java | 9 +- jdk/src/windows/bin/java_md.c | 66 - .../native/sun/jkernel/DownloadDialog.cpp | 894 --------- .../native/sun/jkernel/DownloadDialog.h | 329 --- .../native/sun/jkernel/DownloadHelper.cpp | 655 ------ .../native/sun/jkernel/DownloadHelper.h | 80 - .../native/sun/jkernel/graphics/bullet.bmp | Bin 68 -> 0 bytes .../sun/jkernel/graphics/cautionshield32.bmp | Bin 2080 -> 0 bytes .../native/sun/jkernel/graphics/java-icon.ico | Bin 29926 -> 0 bytes .../native/sun/jkernel/graphics/masthead.bmp | Bin 33336 -> 0 bytes .../sun/jkernel/graphics/warningmasthead.bmp | Bin 2704 -> 0 bytes jdk/src/windows/native/sun/jkernel/kernel.cpp | 1621 --------------- jdk/src/windows/native/sun/jkernel/kernel.def | 28 - jdk/src/windows/native/sun/jkernel/kernel.h | 25 - jdk/src/windows/native/sun/jkernel/kernel.rc | 210 -- .../windows/native/sun/jkernel/kernel_de.rc | 121 -- .../windows/native/sun/jkernel/kernel_en.rc | 122 -- .../windows/native/sun/jkernel/kernel_es.rc | 121 -- .../windows/native/sun/jkernel/kernel_fr.rc | 120 -- .../windows/native/sun/jkernel/kernel_it.rc | 120 -- .../windows/native/sun/jkernel/kernel_ja.rc | 120 -- .../windows/native/sun/jkernel/kernel_ko.rc | 120 -- .../native/sun/jkernel/kernel_pt_BR.rc | 120 -- .../windows/native/sun/jkernel/kernel_sv.rc | 120 -- .../windows/native/sun/jkernel/kernel_zh.rc | 120 -- .../native/sun/jkernel/kernel_zh_TW.rc | 120 -- jdk/src/windows/native/sun/jkernel/resource.h | 105 - jdk/src/windows/native/sun/jkernel/stdafx.cpp | 37 - jdk/src/windows/native/sun/jkernel/stdafx.h | 56 - jdk/src/windows/native/sun/jkernel/version.rc | 73 - 50 files changed, 5 insertions(+), 10246 deletions(-) delete mode 100644 jdk/make/sun/jkernel/FILES_c_windows.gmk delete mode 100644 jdk/make/sun/jkernel/FILES_java.gmk delete mode 100644 jdk/make/sun/jkernel/Makefile delete mode 100644 jdk/src/share/classes/sun/jkernel/BackgroundDownloader.java delete mode 100644 jdk/src/share/classes/sun/jkernel/Bundle.java delete mode 100644 jdk/src/share/classes/sun/jkernel/BundleCheck.java delete mode 100644 jdk/src/share/classes/sun/jkernel/ByteArrayToFromHexDigits.java delete mode 100644 jdk/src/share/classes/sun/jkernel/DigestOutputStream.java delete mode 100644 jdk/src/share/classes/sun/jkernel/DownloadManager.java delete mode 100644 jdk/src/share/classes/sun/jkernel/KernelError.java delete mode 100644 jdk/src/share/classes/sun/jkernel/Mutex.java delete mode 100644 jdk/src/share/classes/sun/jkernel/StandaloneByteArrayAccess.java delete mode 100644 jdk/src/share/classes/sun/jkernel/StandaloneMessageDigest.java delete mode 100644 jdk/src/share/classes/sun/jkernel/StandaloneSHA.java delete mode 100644 jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp delete mode 100644 jdk/src/windows/native/sun/jkernel/DownloadDialog.h delete mode 100644 jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp delete mode 100644 jdk/src/windows/native/sun/jkernel/DownloadHelper.h delete mode 100644 jdk/src/windows/native/sun/jkernel/graphics/bullet.bmp delete mode 100644 jdk/src/windows/native/sun/jkernel/graphics/cautionshield32.bmp delete mode 100644 jdk/src/windows/native/sun/jkernel/graphics/java-icon.ico delete mode 100644 jdk/src/windows/native/sun/jkernel/graphics/masthead.bmp delete mode 100644 jdk/src/windows/native/sun/jkernel/graphics/warningmasthead.bmp delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel.cpp delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel.def delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel.h delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_de.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_en.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_es.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_fr.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_it.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_ja.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_ko.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_sv.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_zh.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/kernel_zh_TW.rc delete mode 100644 jdk/src/windows/native/sun/jkernel/resource.h delete mode 100644 jdk/src/windows/native/sun/jkernel/stdafx.cpp delete mode 100644 jdk/src/windows/native/sun/jkernel/stdafx.h delete mode 100644 jdk/src/windows/native/sun/jkernel/version.rc diff --git a/jdk/make/modules/modules.config b/jdk/make/modules/modules.config index f7910378ab5..2d5d785bf46 100644 --- a/jdk/make/modules/modules.config +++ b/jdk/make/modules/modules.config @@ -771,12 +771,7 @@ module client { /**************************************************************************/ -module jkernel { - include sun.jkernel.*; -} - module deploy { - include jkernel; // For now, all plugin and JNLP include com.sun.java.browser.**, diff --git a/jdk/make/sun/Makefile b/jdk/make/sun/Makefile index 0e8bb3e4220..cac9b8781d6 100644 --- a/jdk/make/sun/Makefile +++ b/jdk/make/sun/Makefile @@ -74,8 +74,7 @@ SUBDIRS_desktop = audio $(RENDER_SUBDIR) image \ $(HEADLESS_SUBDIR) $(DGA_SUBDIR) \ jawt font jpeg cmm applet beans SUBDIRS_management = management -SUBDIRS_misc = jkernel $(ORG_SUBDIR) \ - rmi $(JDBC_SUBDIR) tracing +SUBDIRS_misc = $(ORG_SUBDIR) rmi $(JDBC_SUBDIR) tracing SUBDIRS_tools = native2ascii serialver tools jconsole include $(BUILDDIR)/common/Subdirs.gmk diff --git a/jdk/make/sun/jkernel/FILES_c_windows.gmk b/jdk/make/sun/jkernel/FILES_c_windows.gmk deleted file mode 100644 index 08592254123..00000000000 --- a/jdk/make/sun/jkernel/FILES_c_windows.gmk +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FILES_cpp = \ - stdafx.cpp \ - kernel.cpp \ - DownloadDialog.cpp \ - DownloadHelper.cpp \ - DownloadHelper.cpp - - -FILES_rc = kernel.rc - -# FILES_export definitions for Win32 - -FILES_export = \ - sun/jkernel/DownloadManager.java \ - sun/jkernel/Mutex.java \ - sun/jkernel/Bundle.java \ - sun/jkernel/BackgroundDownloader.java \ diff --git a/jdk/make/sun/jkernel/FILES_java.gmk b/jdk/make/sun/jkernel/FILES_java.gmk deleted file mode 100644 index 2bdc8c9e69f..00000000000 --- a/jdk/make/sun/jkernel/FILES_java.gmk +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# - -FILES_java = \ - $(TARGDIR)sun/jkernel/BackgroundDownloader.java \ - $(TARGDIR)sun/jkernel/Bundle.java \ - $(TARGDIR)sun/jkernel/ByteArrayToFromHexDigits.java \ - $(TARGDIR)sun/jkernel/BundleCheck.java \ - $(TARGDIR)sun/jkernel/DownloadManager.java \ - $(TARGDIR)sun/jkernel/Mutex.java \ - $(TARGDIR)sun/jkernel/StandaloneByteArrayAccess.java \ - $(TARGDIR)sun/jkernel/StandaloneMessageDigest.java \ - $(TARGDIR)sun/jkernel/StandaloneSHA.java \ - -FILES_export = \ - sun/jkernel/DownloadManager.java \ - sun/jkernel/Mutex.java \ - sun/jkernel/Bundle.java \ - sun/jkernel/BackgroundDownloader.java diff --git a/jdk/make/sun/jkernel/Makefile b/jdk/make/sun/jkernel/Makefile deleted file mode 100644 index a75ac1bf074..00000000000 --- a/jdk/make/sun/jkernel/Makefile +++ /dev/null @@ -1,94 +0,0 @@ -# -# Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute it and/or modify it -# 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. -# - -BUILDDIR = ../.. -MODULE = jkernel -PACKAGE = sun.jkernel -LIBRARY = jkernel -PRODUCT = sun - -include $(BUILDDIR)/common/Defs.gmk - -# -# Use highest optimization level -# -_OPT = $(CC_HIGHEST_OPT) - -# -# Java source files -# -include FILES_java.gmk -AUTO_FILES_JAVA_DIRS = sun/jkernel - -LOCALE_SUFFIXES = $(JDK_LOCALES) - -# -# Native source files -# - -ifeq ($(ARCH_DATA_MODEL), 32) - -ifeq ($(PLATFORM), windows) - -# If this is the VS Express compiler it will lack vc/atlmfc/ -ATL_MFC_DIR :=$(call DirExists,$(COMPILER_PATH)/../atlmfc,,) - -ifneq ($(ATL_MFC_DIR),) - -include FILES_c_windows.gmk - -vpath %.cpp $(PLATFORM_SRC)/native/sun/jkernel - - -VERSIONINFO_RESOURCE = $(PLATFORM_SRC)/native/sun/jkernel/kernel.rc - -LDLIBS += urlmon.lib wininet.lib shlwapi.lib version.lib comctl32.lib gdi32.lib -def:$(PLATFORM_SRC)/native/sun/jkernel/kernel.def - -include $(BUILDDIR)/common/Library.gmk - -endif - -endif - -endif - -# -# Resources -# -include $(TOPDIR)/make/common/internal/Resources.gmk - -# -# Rules -# -include $(BUILDDIR)/common/Classes.gmk - -# If extra compression is going to be available in the deploy build enable -# its use here by defining the JRE-relative pathname of the shared library - -ifeq ($(PLATFORM), windows) - ifdef EXTRA_COMP_INSTALL_PATH - CPPFLAGS += -DEXTRA_COMP_INSTALL_PATH=$(EXTRA_COMP_INSTALL_PATH) - endif -endif diff --git a/jdk/src/share/classes/java/awt/color/ICC_Profile.java b/jdk/src/share/classes/java/awt/color/ICC_Profile.java index ae68a35df9e..e7076203adc 100644 --- a/jdk/src/share/classes/java/awt/color/ICC_Profile.java +++ b/jdk/src/share/classes/java/awt/color/ICC_Profile.java @@ -1856,13 +1856,6 @@ public class ICC_Profile implements Serializable { File.separatorChar + "lib" + File.separatorChar + "cmm"; String fullPath = dir + File.separatorChar + fileName; File f = new File(fullPath); - if (!f.isFile()) { - //make sure file was installed in the kernel mode - BootClassLoaderHook hook = BootClassLoaderHook.getHook(); - if (hook != null) { - hook.prefetchFile("lib/cmm/"+fileName); - } - } return (f.isFile() && isChildOf(f, dir)) ? f : null; } diff --git a/jdk/src/share/classes/java/util/zip/ZipEntry.java b/jdk/src/share/classes/java/util/zip/ZipEntry.java index 952bad0931f..0a86f2d447d 100644 --- a/jdk/src/share/classes/java/util/zip/ZipEntry.java +++ b/jdk/src/share/classes/java/util/zip/ZipEntry.java @@ -110,19 +110,7 @@ class ZipEntry implements ZipConstants, Cloneable { * @see #getTime() */ public void setTime(long time) { - // Same value as defined in sun.jkernel.DownloadManager.KERNEL_STATIC_MODTIME - // to avoid direct reference to DownoadManager class. Need to revisit - // if this is needed any more (see comment in the DownloadManager class) - final int KERNEL_STATIC_MODTIME = 10000000; - BootClassLoaderHook hook = BootClassLoaderHook.getHook(); - if (hook != null && hook.isCurrentThreadPrefetching()) { - // fix for bug 6625963: we bypass time calculations while Kernel is - // downloading bundles, since they aren't necessary and would cause - // the Kernel core to depend upon the (very large) time zone data - this.time = KERNEL_STATIC_MODTIME; - } else { - this.time = javaToDosTime(time); - } + this.time = javaToDosTime(time); } /** diff --git a/jdk/src/share/classes/sun/jkernel/BackgroundDownloader.java b/jdk/src/share/classes/sun/jkernel/BackgroundDownloader.java deleted file mode 100644 index eb8d16da88d..00000000000 --- a/jdk/src/share/classes/sun/jkernel/BackgroundDownloader.java +++ /dev/null @@ -1,209 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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.jkernel; - -import java.io.*; - -/** - * Invoked by DownloadManager to begin (in a new JRE) the process of downloading - * all remaining JRE components in the background. A mutex is used to ensure - * that only one BackgroundDownloader can be active at a time. - * - */ -public class BackgroundDownloader { - public static final String BACKGROUND_DOWNLOAD_PROPERTY = "kernel.background.download"; - // relative to the bundle directory - public static final String PID_PATH = "tmp" + File.separator + "background.pid"; - - // Time to wait before beginning to download components. Gives the JRE - // which spawned this one a chance to get its downloads going. - private static final int WAIT_TIME = 10000; - - private static Mutex backgroundMutex; - - static synchronized Mutex getBackgroundMutex() { - if (backgroundMutex == null) - backgroundMutex = Mutex.create(DownloadManager.MUTEX_PREFIX + "background"); - return backgroundMutex; - } - - private static void doBackgroundDownloads() { - if (DownloadManager.isJREComplete()) - return; - if (getBackgroundMutex().acquire(0)) { // give up and exit immediately if we can't acquire mutex - try { - writePid(); - Thread.sleep(WAIT_TIME); - DownloadManager.doBackgroundDownloads(false); - DownloadManager.performCompletionIfNeeded(); - } - catch (InterruptedException e) { - } - finally { - getBackgroundMutex().release(); - } - } - else { - System.err.println("Unable to acquire background download mutex."); - System.exit(1); - } - } - - - /** - * Writes the current process ID to a file, so that the uninstaller can - * find and kill this process if needed. - */ - private static void writePid() { - try { - File pid = new File(DownloadManager.getBundlePath(), PID_PATH); - pid.getParentFile().mkdirs(); - PrintStream out = new PrintStream(new FileOutputStream(pid)); - pid.deleteOnExit(); - out.println(DownloadManager.getCurrentProcessId()); - out.close(); - } - catch (IOException e) { - e.printStackTrace(); - System.exit(1); - } - } - - - /** - * Reads from an InputStream until exhausted, writing all data to the - * specified OutputStream. - */ - private static void send(InputStream in, OutputStream out) - throws IOException { - int c; - byte[] buffer = new byte[2048]; - while ((c = in.read(buffer)) > 0) - out.write(buffer, 0, c); - } - - /* - * Returns the value of the BACKGROUND_DOWNLOAD_PROPERTY. - * Checks if system property has been set first - * then checks if registry key to disable background download - * has been set. - */ - public static boolean getBackgroundDownloadProperty(){ - /* - * Check registry key value - */ - boolean bgDownloadEnabled = getBackgroundDownloadKey(); - - /* - * Check system property - it should override the registry - * key value. - */ - if (System.getProperty(BACKGROUND_DOWNLOAD_PROPERTY) != null){ - bgDownloadEnabled = Boolean.valueOf( - System.getProperty(BACKGROUND_DOWNLOAD_PROPERTY)); - } - return bgDownloadEnabled; - - } - - // This method is to retrieve the value of registry key - // that disables background download. - static native boolean getBackgroundDownloadKey(); - - - static void startBackgroundDownloads() { - if (!getBackgroundDownloadProperty()){ - // If getBackgroundDownloadProperty() returns false - // we're doing the downloads from this VM; we don't want to - // spawn another one - return; - } - - // if System.err isn't initialized yet, it means the charsets aren't - // available yet and we're going to run into trouble down below. Wait - // until it's ready. - while (System.err == null) { - try { - Thread.sleep(1000); - } - catch (InterruptedException e) { - return; - } - } - - try { - String args = "-D" + BACKGROUND_DOWNLOAD_PROPERTY + "=false -Xmx256m"; - String backgroundDownloadURL = DownloadManager.getBaseDownloadURL(); - - // only set KERNEL_DOWNLOAD_URL_PROPERTY if we override - // the default download url - if (backgroundDownloadURL != null && - backgroundDownloadURL.equals( - DownloadManager.DEFAULT_DOWNLOAD_URL) == false) { - args += " -D" + DownloadManager.KERNEL_DOWNLOAD_URL_PROPERTY + - "=" + backgroundDownloadURL; - }; - args += " sun.jkernel.BackgroundDownloader"; - final Process jvm = Runtime.getRuntime().exec("\"" + new File(System.getProperty("java.home"), "bin" + - File.separator + "java.exe") + "\" " + args); - Thread outputReader = new Thread("kernelOutputReader") { - public void run() { - try { - InputStream in = jvm.getInputStream(); - send(in, new PrintStream(new ByteArrayOutputStream())); - } - catch (IOException e) { - e.printStackTrace(); - } - } - }; - outputReader.setDaemon(true); - outputReader.start(); - - Thread errorReader = new Thread("kernelErrorReader") { - public void run() { - try { - InputStream in = jvm.getErrorStream(); - send(in, new PrintStream(new ByteArrayOutputStream())); - } - catch (IOException e) { - e.printStackTrace(); - } - } - }; - errorReader.setDaemon(true); - errorReader.start(); - } - catch (Exception e) { - e.printStackTrace(); - // TODO: error handling - } - } - - - public static void main(String[] arg) { - doBackgroundDownloads(); - } -} diff --git a/jdk/src/share/classes/sun/jkernel/Bundle.java b/jdk/src/share/classes/sun/jkernel/Bundle.java deleted file mode 100644 index b8a587251dc..00000000000 --- a/jdk/src/share/classes/sun/jkernel/Bundle.java +++ /dev/null @@ -1,922 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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.jkernel; - -import java.io.*; -import java.net.HttpRetryException; -import java.util.*; -import java.util.concurrent.*; -import java.util.jar.*; -import java.util.zip.GZIPInputStream; - -/** - * Represents a bundle which may or may not currently be installed. - * - *@author Ethan Nicholas - */ -public class Bundle { - static { - if (!DownloadManager.jkernelLibLoaded) { - // This code can be invoked directly by the deploy build. - System.loadLibrary("jkernel"); - } - } - /** - * Compress file sourcePath with "extra" algorithm (e.g. 7-Zip LZMA) - * if available, put the uncompressed data into file destPath and - * return true. If not available return false and do nothing with destPath. - * - * @param srcPath path to existing uncompressed file - * @param destPath path for the compressed file to be created - * @returns true if extra algorithm used, false if not - * @throws IOException if the extra compression code should be available - * but cannot be located or linked to, the destination file already - * exists or cannot be opened for writing, or the compression fails - */ - public static native boolean extraCompress(String srcPath, - String destPath) throws IOException; - - /** - * Decompress file sourcePath with "extra" algorithm (e.g. 7-Zip LZMA) - * if available, put the uncompressed data into file destPath and - * return true. If not available return false and do nothing with - * destPath. - * @param srcPath path to existing compressed file - * @param destPath path to uncompressed file to be created - * @returns true if extra algorithm used, false if not - * @throws IOException if the extra uncompression code should be available - * but cannot be located or linked to, the destination file already - * exists or cannot be opened for writing, or the uncompression fails - */ - public static native boolean extraUncompress(String srcPath, - String destPath) throws IOException; - - private static final String BUNDLE_JAR_ENTRY_NAME = "classes.jar"; - - /** The bundle is not present. */ - protected static final int NOT_DOWNLOADED = 0; - - /** - * The bundle is in the download queue but has not finished downloading. - */ - protected static final int QUEUED = 1; - - /** The bundle has finished downloading but is not installed. */ - protected static final int DOWNLOADED = 2; - - /** The bundle is fully installed and functional. */ - protected static final int INSTALLED = 3; - - /** Thread pool used to manage dependency downloads. */ - private static ExecutorService threadPool; - - /** Size of thread pool. */ - static final int THREADS; - - static { - String downloads = System.getProperty( - DownloadManager.KERNEL_SIMULTANEOUS_DOWNLOADS_PROPERTY); - if (downloads != null) - THREADS = Integer.parseInt(downloads.trim()); - else - THREADS = 1; - } - - /** Mutex used to safely access receipts file. */ - private static Mutex receiptsMutex; - - /** Maps bundle names to known bundle instances. */ - private static Map bundles = - new HashMap(); - - /** Contains the names of currently-installed bundles. */ - static Set receipts = new HashSet(); - - private static int bytesDownloaded; - - /** Path where bundle receipts are written. */ - private static File receiptPath = new File(DownloadManager.getBundlePath(), - "receipts"); - - /** The size of the receipts file the last time we saw it. */ - private static int receiptsSize; - - /** The bundle name, e.g. "java_awt". */ - private String name; - - /** The path to which we are saving the downloaded bundle file. */ - private File localPath; - - /** - * The path of the extracted JAR file containing the bundle's classes. - */ - private File jarPath; - - // for vista IE7 protected mode - private File lowJarPath; - private File lowJavaPath = null; - - /** The current state (DOWNLOADED, INSTALLED, etc.). */ - protected int state; - - /** - * True if we should delete the downloaded bundle after installing it. - */ - protected boolean deleteOnInstall = true; - - private static Mutex getReceiptsMutex() { - if (receiptsMutex == null) - receiptsMutex = Mutex.create(DownloadManager.MUTEX_PREFIX + - "receipts"); - return receiptsMutex; - } - - - /** - * Reads the receipts file in order to seed the list of currently - * installed bundles. - */ - static synchronized void loadReceipts() { - getReceiptsMutex().acquire(); - try { - if (receiptPath.exists()) { - int size = (int) receiptPath.length(); - if (size != receiptsSize) { // ensure that it has actually - // been modified - DataInputStream in = null; - try { - receipts.clear(); - for (String bundleName : DownloadManager.getBundleNames()) { - if ("true".equals(DownloadManager.getBundleProperty(bundleName, - DownloadManager.INSTALL_PROPERTY))) - receipts.add(bundleName); - } - if (receiptPath.exists()) { - in = new DataInputStream(new BufferedInputStream( - new FileInputStream(receiptPath))); - String line; - while ((line = in.readLine()) != null) { - receipts.add(line.trim()); - } - } - receiptsSize = size; - } - catch (IOException e) { - DownloadManager.log(e); - // safe to continue, as the worst that happens is - // we re-download existing bundles - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException ioe) { - DownloadManager.log(ioe); - } - } - } - } - } - } - finally { - getReceiptsMutex().release(); - } - } - - - /** Returns the bundle corresponding to the specified name. */ - public static synchronized Bundle getBundle(String bundleId) - throws IOException { - Bundle result =(Bundle) bundles.get(bundleId); - if (result == null && (bundleId.equals("merged") || - Arrays.asList(DownloadManager.getBundleNames()).contains(bundleId))) { - result = new Bundle(); - result.name = bundleId; - - if (DownloadManager.isWindowsVista()) { - result.localPath = - new File(DownloadManager.getLocalLowTempBundlePath(), - bundleId + ".zip"); - result.lowJavaPath = new File( - DownloadManager.getLocalLowKernelJava() + bundleId); - } else { - result.localPath = new File(DownloadManager.getBundlePath(), - bundleId + ".zip"); - } - - String jarPath = DownloadManager.getBundleProperty(bundleId, - DownloadManager.JAR_PATH_PROPERTY); - if (jarPath != null) { - if (DownloadManager.isWindowsVista()) { - result.lowJarPath = new File( - DownloadManager.getLocalLowKernelJava() + bundleId, - jarPath); - } - result.jarPath = new File(DownloadManager.JAVA_HOME, - jarPath); - - } else { - - if (DownloadManager.isWindowsVista()) { - result.lowJarPath = new File( - DownloadManager.getLocalLowKernelJava() + bundleId + - "\\lib\\bundles", - bundleId + ".jar"); - } - - result.jarPath = new File(DownloadManager.getBundlePath(), - bundleId + ".jar"); - - } - - bundles.put(bundleId, result); - } - return result; - } - - - /** - * Returns the name of this bundle. The name is typically defined by - * the bundles.xml file. - */ - public String getName() { - return name; - } - - - /** - * Sets the name of this bundle. - */ - public void setName(String name) { - this.name = name; - } - - - /** - * Returns the path to the bundle file on the local filesystem. The file - * will only exist if the bundle has already been downloaded; otherwise - * it will be created when download() is called. - */ - public File getLocalPath() { - return localPath; - } - - - /** - * Sets the location of the bundle file on the local filesystem. If the - * file already exists, the bundle will be considered downloaded; - * otherwise the file will be created when download() is called. - */ - public void setLocalPath(File localPath) { - this.localPath = localPath; - } - - - /** - * Returns the path to the extracted JAR file containing this bundle's - * classes. This file should only exist after the bundle has been - * installed. - */ - public File getJarPath() { - return jarPath; - } - - - /** - * Sets the path to the extracted JAR file containing this bundle's - * classes. This file will be created as part of installing the bundle. - */ - public void setJarPath(File jarPath) { - this.jarPath = jarPath; - } - - - /** - * Returns the size of the bundle download in bytes. - */ - public int getSize() { - return Integer.valueOf(DownloadManager.getBundleProperty(getName(), - DownloadManager.SIZE_PROPERTY)); - } - - - /** - * Returns true if the bundle file (getLocalPath()) should be deleted - * when the bundle is successfully installed. Defaults to true. - */ - public boolean getDeleteOnInstall() { - return deleteOnInstall; - } - - - /** - * Sets whether the bundle file (getLocalPath()) should be deleted - * when the bundle is successfully installed. Defaults to true. - */ - public void setDeleteOnInstall(boolean deleteOnInstall) { - this.deleteOnInstall = deleteOnInstall; - } - - - /** Sets the current state of this bundle to match reality. */ - protected void updateState() { - synchronized(Bundle.class) { - loadReceipts(); - if (receipts.contains(name) || - "true".equals(DownloadManager.getBundleProperty(name, - DownloadManager.INSTALL_PROPERTY))) - state = Bundle.INSTALLED; - else if (localPath.exists()) - state = Bundle.DOWNLOADED; - } - } - - - private String getURL(boolean showUI) throws IOException { - Properties urls = DownloadManager.getBundleURLs(showUI); - String result = urls.getProperty(name + ".zip"); - if (result == null) { - result = urls.getProperty(name); - if (result == null) { - DownloadManager.log("Unable to determine bundle URL for " + this); - DownloadManager.log("Bundle URLs: " + urls); - DownloadManager.sendErrorPing(DownloadManager.ERROR_NO_SUCH_BUNDLE); - - throw new NullPointerException("Unable to determine URL " + - "for bundle: " + this); - } - } - return result; - } - - - /** - * Downloads the bundle. This method blocks until the download is - * complete. - * - *@param showProgress true to display a progress dialog - */ - private void download(boolean showProgress) { - if (DownloadManager.isJREComplete()) - return; - Mutex mutex = Mutex.create(DownloadManager.MUTEX_PREFIX + name + - ".download"); - mutex.acquire(); - try { - long start = System.currentTimeMillis(); - - boolean retry; - - do { - retry = false; - updateState(); - if (state == DOWNLOADED || state == INSTALLED) { - return; - } - File tmp = null; - try { - tmp = new File(localPath + ".tmp"); - - // tmp.deleteOnExit(); - - if (DownloadManager.getBaseDownloadURL().equals( - DownloadManager.RESOURCE_URL)) { - // RESOURCE_URL is used during build process, to - // avoid actual network traffic. This is called in - // the SplitJRE DownloadTest to determine which - // classes are needed to support downloads, but we - // bypass the actual HTTP download to simplify the - // build process (it's all native code, so from - // DownloadTest's standpoint it doesn't matter if we - // really call it or not). - String path = "/" + name + ".zip"; - InputStream in = - getClass().getResourceAsStream(path); - if (in == null) - throw new IOException("could not locate " + - "resource: " + path); - FileOutputStream out = new FileOutputStream(tmp); - DownloadManager.send(in, out); - in.close(); - out.close(); - } - else { - try { - String bundleURL = getURL(showProgress); - DownloadManager.log("Downloading from: " + - bundleURL); - DownloadManager.downloadFromURL(bundleURL, tmp, - name.replace('_', '.'), showProgress); - } - catch (HttpRetryException e) { - // Akamai returned a 403, get new URL - DownloadManager.flushBundleURLs(); - String bundleURL = getURL(showProgress); - DownloadManager.log("Retrying at new " + - "URL: " + bundleURL); - DownloadManager.downloadFromURL(bundleURL, tmp, - name.replace('_', '.'), - showProgress); - // we intentionally don't do a 403 retry - // again, to avoid infinite retries - } - } - if (!tmp.exists() || tmp.length() == 0) { - if (showProgress) { - // since showProgress = true, native code should - // have offered to retry. Since we ended up here, - // we conclude that download failed & user opted to - // cancel. Set complete to true to stop bugging - // him in the future (if one bundle fails, the - // rest are virtually certain to). - DownloadManager.complete = true; - } - DownloadManager.fatalError(DownloadManager.ERROR_UNSPECIFIED); - } - - /** - * Bundle security - * - * Check for corruption/spoofing - */ - - - /* Create a bundle check from the tmp file */ - BundleCheck gottenCheck = BundleCheck.getInstance(tmp); - - /* Get the check expected for the Bundle */ - BundleCheck expectedCheck = BundleCheck.getInstance(name); - - // Do they match? - - if (expectedCheck.equals(gottenCheck)) { - - // Security check OK, uncompress the bundle file - // into the local path - - long uncompressedLength = tmp.length(); - localPath.delete(); - - File uncompressedPath = new File(tmp.getPath() + - ".jar0"); - if (! extraUncompress(tmp.getPath(), - uncompressedPath.getPath())) { - // Extra uncompression not available, fall - // back to alternative if it is enabled. - if (DownloadManager.debug) { - DownloadManager.log("Uncompressing with GZIP"); - } - GZIPInputStream in = new GZIPInputStream( new - BufferedInputStream(new FileInputStream(tmp), - DownloadManager.BUFFER_SIZE)); - BufferedOutputStream out = new BufferedOutputStream( - new FileOutputStream(uncompressedPath), - DownloadManager.BUFFER_SIZE); - DownloadManager.send(in,out); - in.close(); - out.close(); - if (! uncompressedPath.renameTo(localPath)) { - throw new IOException("unable to rename " + - uncompressedPath + " to " + localPath); - } - } else { - if (DownloadManager.debug) { - DownloadManager.log("Uncompressing with LZMA"); - } - if (! uncompressedPath.renameTo(localPath)) { - throw new IOException("unable to rename " + - uncompressedPath + " to " + localPath); - } - } - state = DOWNLOADED; - bytesDownloaded += uncompressedLength; - long time = (System.currentTimeMillis() - - start); - DownloadManager.log("Downloaded " + name + - " in " + time + "ms. Downloaded " + - bytesDownloaded + " bytes this session."); - - // Normal completion - } else { - - // Security check not OK: remove the temp file - // and consult the user - - tmp.delete(); - - DownloadManager.log( - "DownloadManager: Security check failed for " + - "bundle " + name); - - // only show dialog if we are not in silent mode - if (showProgress) { - retry = DownloadManager.askUserToRetryDownloadOrQuit( - DownloadManager.ERROR_UNSPECIFIED); - } - - if (!retry) { - // User wants to give up - throw new RuntimeException( - "Failed bundle security check and user " + - "canceled"); - } - } - } - catch (IOException e) { - // Look for "out of space" using File.getUsableSpace() - // here when downloadFromURL starts throwing IOException - // (or preferably a distinct exception for this case). - DownloadManager.log(e); - } - } while (retry); - } finally { - mutex.release(); - } - } - - - /** - * Calls {@link #queueDownload()} on all of this bundle's dependencies. - */ - void queueDependencies(boolean showProgress) { - try { - String dependencies = - DownloadManager.getBundleProperty(name, - DownloadManager.DEPENDENCIES_PROPERTY); - if (dependencies != null) { - StringTokenizer st = new StringTokenizer(dependencies, - " ,"); - while (st.hasMoreTokens()) { - Bundle b = getBundle(st.nextToken()); - if (b != null && !b.isInstalled()) { - if (DownloadManager.debug) { - DownloadManager.log("Queueing " + b.name + - " as a dependency of " + name + "..."); - } - b.install(showProgress, true, false); - } - } - } - } catch (IOException e) { - // shouldn't happen - DownloadManager.log(e); - } - } - - - static synchronized ExecutorService getThreadPool() { - if (threadPool == null) { - threadPool = Executors.newFixedThreadPool(THREADS, - new ThreadFactory () { - public Thread newThread(Runnable r) { - Thread result = new Thread(r); - result.setDaemon(true); - return result; - } - } - ); - } - return threadPool; - } - - - private void unpackBundle() throws IOException { - File useJarPath = null; - if (DownloadManager.isWindowsVista()) { - useJarPath = lowJarPath; - File jarDir = useJarPath.getParentFile(); - if (jarDir != null) { - jarDir.mkdirs(); - } - } else { - useJarPath = jarPath; - } - - DownloadManager.log("Unpacking " + this + " to " + useJarPath); - - InputStream rawStream = new FileInputStream(localPath); - JarInputStream in = new JarInputStream(rawStream) { - public void close() throws IOException { - // prevent any sub-processes here from actually closing the - // input stream; we'll use rawsStream.close() when we're - // done with it - } - }; - - try { - File jarTmp = null; - JarEntry entry; - while ((entry = in.getNextJarEntry()) != null) { - String entryName = entry.getName(); - if (entryName.equals("classes.pack")) { - File packTmp = new File(useJarPath + ".pack"); - packTmp.getParentFile().mkdirs(); - DownloadManager.log("Writing temporary .pack file " + packTmp); - OutputStream tmpOut = new FileOutputStream(packTmp); - try { - DownloadManager.send(in, tmpOut); - } finally { - tmpOut.close(); - } - // we unpack to a temporary file and then, towards the end - // of this method, use a (hopefully atomic) rename to put it - // into its final location; this should avoid the problem of - // partially-completed downloads. Doing the rename last - // allows us to check for the presence of the JAR file to - // see whether the bundle has in fact been downloaded. - jarTmp = new File(useJarPath + ".tmp"); - DownloadManager.log("Writing temporary .jar file " + jarTmp); - unpack(packTmp, jarTmp); - packTmp.delete(); - } else if (!entryName.startsWith("META-INF")) { - File dest; - if (DownloadManager.isWindowsVista()) { - dest = new File(lowJavaPath, - entryName.replace('/', File.separatorChar)); - } else { - dest = new File(DownloadManager.JAVA_HOME, - entryName.replace('/', File.separatorChar)); - } - if (entryName.equals(BUNDLE_JAR_ENTRY_NAME)) - dest = useJarPath; - File destTmp = new File(dest + ".tmp"); - boolean exists = dest.exists(); - if (!exists) { - DownloadManager.log(dest + ".mkdirs()"); - dest.getParentFile().mkdirs(); - } - try { - DownloadManager.log("Using temporary file " + destTmp); - FileOutputStream out = - new FileOutputStream(destTmp); - try { - byte[] buffer = new byte[2048]; - int c; - while ((c = in.read(buffer)) > 0) - out.write(buffer, 0, c); - } finally { - out.close(); - } - if (exists) - dest.delete(); - DownloadManager.log("Renaming from " + destTmp + " to " + dest); - if (!destTmp.renameTo(dest)) { - throw new IOException("unable to rename " + - destTmp + " to " + dest); - } - - } catch (IOException e) { - if (!exists) - throw e; - // otherwise the file already existed and the fact - // that we failed to re-write it probably just - // means that it was in use - } - } - } - - // rename the temporary jar into its final location - if (jarTmp != null) { - if (useJarPath.exists()) - jarTmp.delete(); - else if (!jarTmp.renameTo(useJarPath)) { - throw new IOException("unable to rename " + jarTmp + - " to " + useJarPath); - } - } - if (DownloadManager.isWindowsVista()) { - // move bundle to real location - DownloadManager.log("Using broker to move " + name); - if (!DownloadManager.moveDirWithBroker( - DownloadManager.getKernelJREDir() + name)) { - throw new IOException("unable to create " + name); - } - DownloadManager.log("Broker finished " + name); - } - DownloadManager.log("Finished unpacking " + this); - } finally { - rawStream.close(); - } - if (deleteOnInstall) { - localPath.delete(); - } - - } - - - public static void unpack(File pack, File jar) throws IOException { - Process p = Runtime.getRuntime().exec(DownloadManager.JAVA_HOME + File.separator + - "bin" + File.separator + "unpack200 -Hoff \"" + pack + "\" \"" + jar + "\""); - try { - p.waitFor(); - } - catch (InterruptedException e) { - } - } - - - /** - * Unpacks and installs the bundle. The bundle's classes are not - * immediately added to the boot class path; this happens when the VM - * attempts to load a class and calls getBootClassPathEntryForClass(). - */ - public void install() throws IOException { - install(true, false, true); - } - - - /** - * Unpacks and installs the bundle, optionally hiding the progress - * indicator. The bundle's classes are not immediately added to the - * boot class path; this happens when the VM attempts to load a class - * and calls getBootClassPathEntryForClass(). - * - *@param showProgress true to display a progress dialog - *@param downloadOnly true to download but not install - *@param block true to wait until the operation is complete before returning - */ - public synchronized void install(final boolean showProgress, - final boolean downloadOnly, boolean block) throws IOException { - if (DownloadManager.isJREComplete()) - return; - if (state == NOT_DOWNLOADED || state == QUEUED) { - // we allow an already-queued bundle to be placed into the queue - // again, to handle the case where the bundle is queued with - // downloadOnly true and then we try to queue it again with - // downloadOnly false -- the second queue entry will actually - // install it. - if (state != QUEUED) { - DownloadManager.addToTotalDownloadSize(getSize()); - state = QUEUED; - } - if (getThreadPool().isShutdown()) { - if (state == NOT_DOWNLOADED || state == QUEUED) - doInstall(showProgress, downloadOnly); - } - else { - Future task = getThreadPool().submit(new Runnable() { - public void run() { - try { - if (state == NOT_DOWNLOADED || state == QUEUED || - (!downloadOnly && state == DOWNLOADED)) { - doInstall(showProgress, downloadOnly); - } - } - catch (IOException e) { - // ignore - } - } - }); - queueDependencies(showProgress); - if (block) { - try { - task.get(); - } - catch (Exception e) { - throw new Error(e); - } - } - } - } - else if (state == DOWNLOADED && !downloadOnly) - doInstall(showProgress, false); - } - - - private void doInstall(boolean showProgress, boolean downloadOnly) - throws IOException { - Mutex mutex = Mutex.create(DownloadManager.MUTEX_PREFIX + name + - ".install"); - DownloadManager.bundleInstallStart(); - try { - mutex.acquire(); - updateState(); - if (state == NOT_DOWNLOADED || state == QUEUED) { - download(showProgress); - } - - if (state == DOWNLOADED && downloadOnly) { - return; - } - - if (state == INSTALLED) { - return; - } - if (state != DOWNLOADED) { - DownloadManager.fatalError(DownloadManager.ERROR_UNSPECIFIED); - } - - DownloadManager.log("Calling unpackBundle for " + this); - unpackBundle(); - DownloadManager.log("Writing receipt for " + this); - writeReceipt(); - updateState(); - DownloadManager.log("Finished installing " + this + ", state=" + state); - } finally { - if (lowJavaPath != null) { - lowJavaPath.delete(); - } - mutex.release(); - DownloadManager.bundleInstallComplete(); - } - } - - - synchronized void setState(int state) { - this.state = state; - } - - - /** Returns true if this bundle has been installed. */ - public boolean isInstalled() { - synchronized (Bundle.class) { - updateState(); - return state == INSTALLED; - } - } - - - /** - * Adds an entry to the receipts file indicating that this bundle has - * been successfully downloaded. - */ - private void writeReceipt() { - getReceiptsMutex().acquire(); - File useReceiptPath = null; - try { - - try { - - receipts.add(name); - - if (DownloadManager.isWindowsVista()) { - // write out receipts to locallow - useReceiptPath = new File( - DownloadManager.getLocalLowTempBundlePath(), - "receipts"); - - if (receiptPath.exists()) { - // copy original file to locallow location - DownloadManager.copyReceiptFile(receiptPath, - useReceiptPath); - } - - // update receipt in locallow path - // only append if original receipt path exists - FileOutputStream out = new FileOutputStream(useReceiptPath, - receiptPath.exists()); - out.write((name + System.getProperty("line.separator")).getBytes("utf-8")); - out.close(); - - // use broker to move back to real path - if (!DownloadManager.moveFileWithBroker( - DownloadManager.getKernelJREDir() - + "-bundles" + File.separator + "receipts")) { - throw new IOException("failed to write receipts"); - } - } else { - useReceiptPath = receiptPath; - FileOutputStream out = new FileOutputStream(useReceiptPath, - true); - out.write((name + System.getProperty("line.separator")).getBytes("utf-8")); - out.close(); - } - - - } catch (IOException e) { - DownloadManager.log(e); - // safe to continue, as the worst that happens is we - // re-download existing bundles - } - } - finally { - getReceiptsMutex().release(); - } - } - - - public String toString() { - return "Bundle[" + name + "]"; - } -} diff --git a/jdk/src/share/classes/sun/jkernel/BundleCheck.java b/jdk/src/share/classes/sun/jkernel/BundleCheck.java deleted file mode 100644 index 4e99b30bac3..00000000000 --- a/jdk/src/share/classes/sun/jkernel/BundleCheck.java +++ /dev/null @@ -1,330 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -/* - * - * The Java Kernel Bundle security check. - * - * This class is responsible for detail of creating, storing, dispensing, and - * updating bundle security checks and security checks for all the files - * extracted from a bundle. Security checks are cryptographic - * hashcodes that make it impractical to counterfeit a file. The security - * check algorithm is defined by peer class StandaloneMessageDigest. The - * cryptographic - * hashcodes are held in instances of this class as byte arrays and externally - * as hexidecimal string values for Bundle name Property keys. The properties - * are a resource in the Java Kernel core JRE rt.jar and accessed after a - * real or simulated bundle download by peer classes DownloadManager and - * Bundle. Build-time deployment class SplitJRE uses this class to create file - * security checks directly and via a special execution of DownloadManager. - * The main method of this class can be used to create a - * new set of security codes and updated properties for a given JRE path - * and set of bundle names (CWD assume to contain bundle files as .zip). - * - * This is a Sun internal class defined by the Sun implementation and - * intended for JRE/JDK release deployment. - * - * @see sun.jkernel.DownloadManager - * @see sun.jkernel.Bundle - * @see sun.jkernel.StandaloneSHA - * @see sun.jkernel.ByteArrayToFromHexDigits - * See also deploy/src/kernel/share/classes/sun/kernel/SplitJRE.java - */ - -package sun.jkernel; - -import java.io.File; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.util.Properties; - - -public class BundleCheck { - - /* File buffer size */ - - private static final int DIGEST_STREAM_BUFFER_SIZE = 2048; - - /* The bundle filename suffix */ - - private static final String BUNDLE_SUFFIX = ".zip"; - - /* Mutable static state. */ - - /* Properties (Bundle name/check hex String pairs) for a set of Bundles. - Guarded by this class' object. */ - - private static volatile Properties properties; - - /* Mutable instance state. */ - - /** - * The bytes of the check value. Guarded by the bundle Mutex (in - * sun.jkernel.DownloadManager) or the fact that sun.kernel.SplitJRE - * and/or DownloadManager with "-download all" runs a single thread. - */ - - private byte[] checkBytes; - - /* Prevent instantiation by default constructor */ - - private BundleCheck(){} - - /** - * Store the bundle check values as properties to the path specified. - * Only invoked by SplitJRE. - */ - - public static void storeProperties(String fullPath) { - - try { - File f = new File(fullPath); - f.getParentFile().mkdirs(); - OutputStream out = new FileOutputStream(f); - properties.store(out, null); - out.close(); - } catch (Exception e) { - throw new RuntimeException( - "BundleCheck: storing properties threw: " + e); - } - } - - /** - * Fetch the check value properties as a DownloadManager resource. - */ - - private static void loadProperties() { - properties = new Properties(); - try { - InputStream in = new BufferedInputStream( - DownloadManager.class.getResourceAsStream( - DownloadManager.CHECK_VALUES_FILE)); - if (in == null) - throw new RuntimeException("BundleCheck: unable to locate " + - DownloadManager.CHECK_VALUES_FILE + " as resource"); - properties.load(in); - in.close(); - } catch (Exception e) { - throw new RuntimeException("BundleCheck: loadProperties threw " + - e); - } - } - - /* Get the check value Properties object */ - - private synchronized static Properties getProperties() { - if (properties == null) { - // If this fails it means addProperty has been used inappropriately - loadProperties(); - } - return properties; - } - - /* Reset the properties with an empty Properties object */ - - public static void resetProperties() { - properties = null; - } - - /* The BundleCheck expressed as a String */ - - public String toString() { - return ByteArrayToFromHexDigits.bytesToHexString(checkBytes); - } - - /* Add the given BundleCheck as a property to bundleCheckvalueProperties */ - - private void addProperty(String name) { - // When first called by SplitJRE just start with empty object - // rather than allowing a load to happen, as it does at install time. - if (properties == null) { - properties = new Properties(); - } - getProperties().put(name, toString()); - } - - /* private ctor for creating/initializing a BundleCheck */ - - private BundleCheck(byte[] checkBytes) { - this.checkBytes = checkBytes; - } - - /* private ctor for creating a BundleCheck with a given name and known - Property value. */ - - private BundleCheck(String name) { - String hexString = getProperties().getProperty(name); - if (hexString == null) { - throw new RuntimeException( - "BundleCheck: no check property for bundle: " + name); - } - this.checkBytes = ByteArrayToFromHexDigits.hexStringToBytes(hexString); - } - - /* Make a BundleCheck from the contents of the given file or a Bundle - name. Save the new object's value as a property if saveProperty is - true. Behavior is only defined for name or file being null, but not - both, and for saveProperty to be true only when both name and file - are not null. - Any IO or other exception implies an unexpected and fatal internal - error and results in a RuntimeException. */ - - private static BundleCheck getInstance(String name, - File file, boolean saveProperty) { - if (file == null ) { - return new BundleCheck(name); - - } else { - StandaloneMessageDigest checkDigest = null; - try { - FileInputStream checkFileStream = new FileInputStream(file); - checkDigest = StandaloneMessageDigest.getInstance("SHA-1"); - - // Compute a check code across all of the file bytes. - // NOTE that every time a bundle is created, even from - // the "same bits", it may be different wrt to the security - // code because of slight variations build to build. For - // example, the JVM build normally contains an - // auto-incrementing build number, built archives might have - // timestamps, etc. - - int readCount; - byte[] messageStreamBuff = - new byte[DIGEST_STREAM_BUFFER_SIZE]; - do { - readCount = checkFileStream.read(messageStreamBuff); - if (readCount > 0) { - checkDigest.update(messageStreamBuff,0,readCount); - } - } while (readCount != -1); - checkFileStream.close(); - - } catch (Exception e) { - throw new RuntimeException( - "BundleCheck.addProperty() caught: " + e); - } - BundleCheck bc = new BundleCheck(checkDigest.digest()); - if (saveProperty) { - bc.addProperty(name); - } - return bc; - } - } - - /* Create a BundleCheck from the given file */ - - public static BundleCheck getInstance(File file) { - return getInstance(null, file, false); - } - - /* Create a BundleCheck from the given bundle name */ - - static BundleCheck getInstance(String name) { - return getInstance(name, null, false); - } - - /* Create a BundleCheck from the given bundle name and file and - use it to make and save a security check Property value. */ - - public static void addProperty(String name, File file) { - getInstance(name, file, true); - } - - /* Create a bundlecheck from the given bundle name and file and - add a Property value for it. */ - - static void add(String name, File file) { - getInstance(name, file, true).addProperty(name); - } - - /* Compare two BundkCheck instances for equal check values */ - - boolean equals(BundleCheck b) { - if ((checkBytes == null) || (b.checkBytes == null)) { - return false; - } - if (checkBytes.length != b.checkBytes.length) { - return false; - } - for (int i = 0; i < checkBytes.length; i++) { - if (checkBytes[i] != b.checkBytes[i]) { - if (DownloadManager.debug) { - System.out.println( - "BundleCheck.equals mismatch between this: " + - toString() + " and param: " + b.toString()); - } - return false; - } - } - return true; - } - - /* After SplitJRE is used to restructure the JRE into a "core JRE" and - a set of Java Kernel "bundles", if extra compression is available - the bundles are extracted and rearchived with zero compression by - deploy build make steps. The newly compressed bundle names are then - passed to this main with the path of the kernel core JRE to have new - bundle security check values computed and the corresponding properties - updated in rt.jar. If extra compression isn't available then this main is - never used and the default jar/zip bundle compression and security - codes created by SplitJRE are left in place and ready to use. */ - - public static void main(String[] args) { - if (args.length < 2) { - System.err.println("Usage: java BundleCheck " + - " ... "); - return; - } - - // Make a security check code for each bundle file - for (int arg = 1; arg < args.length; arg++) { - BundleCheck.addProperty(args[arg], - new File(args[arg] + BUNDLE_SUFFIX)); - } - - // Store the new check code properties below the current directory - BundleCheck.storeProperties(DownloadManager.CHECK_VALUES_DIR); - - // Now swap the new properties file into the core rt.jar - try { - int status = Runtime.getRuntime().exec( - "jar uf " + args[0] + "\\lib\\rt.jar " + - DownloadManager.CHECK_VALUES_DIR).waitFor(); - if (status != 0) { - System.err.println( - "BundleCheck: exec of jar uf gave nonzero status"); - return; - } - } catch (Exception e) { - System.err.println("BundleCheck: exec of jar uf threw: " + e); - return; - } - } // main -} diff --git a/jdk/src/share/classes/sun/jkernel/ByteArrayToFromHexDigits.java b/jdk/src/share/classes/sun/jkernel/ByteArrayToFromHexDigits.java deleted file mode 100644 index f1583345311..00000000000 --- a/jdk/src/share/classes/sun/jkernel/ByteArrayToFromHexDigits.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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.jkernel; - -/** - * TODO: The JRE and deploy build code (SplitJRE) can be made a bit smarter - * then cryto hashcode byte arrays can be used directly, eliminating the need - * for this class altogether. So just leave this alone until it can be removed. - * TODO: Change "Digits" to "String" for uniformity and more intuitive names. - * A lightweight class to provide convert between hex digits and - * byte[]. - *

- * TODO: Try to get this built without the -source 1.3 -target -1.3 options, - * which prevent use of java.text.Format, assuming this wouldn't bloat the - * JK rt.jar. Also, there still might be equivalent code hiding in the JDK - * already, but preliminary searches havn't found it. - */ - -public final class ByteArrayToFromHexDigits { - - private static final char [] chars = new char[] - {'0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F'}; - - private static final boolean debug = false; - - /** - * Converts the byte[] b into a String of - * hex digits representing the integer values of all the bytes. - * - * @param b byte array to be converted - * @return String representing b in hexadecimal - * @throws IllegalArgumentException if b is null or zero length - */ - public static String bytesToHexString(byte[] b) { - if (debug ) { - System.out.print("I: "); - for(int i=0;i> 4) & 0xf]); - buff.insert(i*2+1,chars[b[i] & 0xf]); - } - if (debug ) { - System.out.println("O: " + buff.toString()); - } - return buff.toString(); - } - - // Convert one hex character to a 4 bit byte value - - private static byte hexCharToByte(char c) throws IllegalArgumentException { - if ((c < '0') || - ( ((c < 'A') && (c > 'F')) && ((c < 'a') && (c > 'f'))) ) { - - throw new IllegalArgumentException("not a hex digit"); - } - - if (c > '9') { - if (c > 'F') { - return (byte) ((c - 'a' + 10) & 0xf); - } else { - return (byte) ((c - 'A' + 10) & 0xf); - } - } else { - return (byte) ((c - '0') & 0xf); - } - - } - - /** - * Converts the String d assumed to contain a sequence - * of hexadecimal digit characters into a byte[]. - * - * @param d String to be converted - * @return byte array representing the hex string - * @throws IllegalArgumentException if d is odd length, - * contains a character outside the ranges of 0-9, a-f, and A-F, - * or is zero length or null - */ - - public static byte[] hexStringToBytes(String d) throws IllegalArgumentException { - if (d == null) { - throw new IllegalArgumentException( - "parameter cannot be null"); - } - - if (d.length() == 0) { - throw new IllegalArgumentException( - "parameter cannot be zero length"); - } - - if ((d.length() & 1) != 0) { - throw new IllegalArgumentException( - "odd length string"); - } - - byte[] b = new byte[d.length() / 2]; - - // TODO Might be code in the JK initial bundle to do this better (i.e. - // method that tests for a hex char?) - - for (int i=0;iFilterOutputStream, - * and accumulates a check value as bytes are written to - * it. The check value is available by method getCheckValue. - *

- * Operations on the public out field of this class should be - * avoided to prevent an invalid check code being generated. - * - * TODO: The javadoc HTML hasn't been generated and eyeballed for yet. - * TODO: There is a javadoc trick to cause the parent class javadoc to be - * automagically used: try to take advantage of this. - * TODO: Add javadoc links instead of API where it would be useful. - * TODO: Go visit the Docs style guide again and get the periods right and - * consistent for all sun.* classes. - * @author Pete Soper - * @see java.lang.FilterOutputStream - * @see getCheckValue - */ - -public class DigestOutputStream extends FilterOutputStream { - private static final String DEFAULT_ALGORITHM = "SHA-1"; - - private final boolean debug = false; - - private StandaloneMessageDigest smd = null; - - private void initDigest(String algorithm) throws NoSuchAlgorithmException { - smd = StandaloneMessageDigest.getInstance(algorithm); - } - - // The underlying stream. - - protected volatile OutputStream out; - - /** - * Creates a DigestOutputStream with stream s - * to be checked with using algorithm. - *

- * If algorithm is not supported then - * NoSuchAlgorithm is thrown. - *

- * See {linkplain sun.security.provider.StandaloneMessageDigest} for an - * implementation-specific list of supported algorithms. - * - * @throws NoSuchAlgorithm if algorithm is not supported - * @see sun.security.provider.StandaloneMessageDigest - */ - - /** - * Creates an output stream filter built on top of - * underlying output stream out for checking with - * algorithm algorithm. - *

- * If algorithm is not supported then - * NoSuchAlgorithm is thrown. - *

- * See {linkplain sun.security.provider.StandaloneMessageDigest} for an - * implementation-specific list of supported algorithms. - * - * @param out the underlying output stream to be assigned to - * the field this.out for later use, or - * null if this instance is to be - * created without an underlying stream. - * @param algorithm the check algorithm to use. - * @throws NoSuchAlgorithm if algorithm is not supported - * @see sun.security.provider.StandaloneMessageDigest - * @see DigestInputStream(InputStream, String) - */ - - public DigestOutputStream(OutputStream out, String algorithm) throws NoSuchAlgorithmException { - super(out); - initDigest(algorithm); - this.out = out; - } - - /** - * Creates an output stream filter built on top of - * underlying output stream out for the default checking - * algorithm. - *

- * This implemention provides "SHA-1" as the default checking algorithm. - * - * @param out the underlying output stream to be assigned to - * the field this.out for later use, or - * null if this instance is to be - * created without an underlying stream. - * @see DigestInputStream(InputStream) - */ - - public DigestOutputStream(OutputStream out) { - super(out); - try { - initDigest(DEFAULT_ALGORITHM); - } catch (NoSuchAlgorithmException e) { - // Impossible to get here, but stranger things have happened... - throw new RuntimeException("DigestOutputStream() unknown algorithm"); - } - // superstition from a test failure this.out = out; - } - - /** - * Writes a byte specified by v to this stream - * and updates the check information. - * - * - * @param v the byte to be written. - * @throws IOException if an I/O error occurs. - */ - public void write(int v) throws IOException { - super.write(v); - // TODO Could create this array once - byte[] b = new byte[] {(byte) (v & 0xff)}; - smd.update(b,0,1); - } - - /** - * Writes the bytes in array data - * to this stream and updates the check information. - * - * @param data the data. - * @throws IOException if an I/O error occurs. - * @throws NullPointerException if data is null - */ - public void write(byte[] data) throws IOException { - write(data,0,data.length); - } - - /** - * Writes a sub array as a sequence of bytes to this output stream and - * updates the check information. - * @param data the data to be written - * @param ofs the start offset in the data - * @param len the number of bytes that are written - * @throws IOException If an I/O error has occurred. - * @throws NullPointerException if data is null - * @throws IndexOutOfBoundsException If ofs is negative, - * len is negative, or len is greater than - * b.length - ofs - */ - public void write(byte[] data, int ofs, int len) throws IOException { - if (debug) { - System.out.print("DigestOutputStream.write: "); - for (int i=ofs; i<(len - ofs); i++) { - System.out.format("%02X",data[i]); - } - System.out.println(); - } - if (data == null) { - throw new NullPointerException("null array in DigestOutputStream.write"); - } else if (ofs < 0 || len < 0 || len > data.length - ofs) { - throw new IndexOutOfBoundsException(); - } - //super.write(data,ofs,len); - // WATCH OUT: FilterOutputStream does a byte at a time write(byte) - // TODO: Will this work all the time, or is there another caveat - // to publish - out.write(data,ofs,len); - if (debug) { - System.out.println("DigestOutputStream.write before"); - } - smd.update(data,ofs,len); - if (debug) { - System.out.println("DigestOutputStream.write after"); - } - } - - /** - * Closes this file output stream and releases any system resources - * associated with this stream and makes the check value for the stream - * available via getCheckValue. This file output stream may - * no longer be used for writing bytes. - * - * @throws IOException if an I/O error occurs. - * @see getCheckValue - */ - public void close() throws IOException { - super.close(); - } - - /** - * Return the check value computed for the stream and reset the state of - * check value generation. - * - * @return the check value bytes - */ - public byte[] getCheckValue() { - byte[] b = smd.digest(); - if (debug) { - System.out.print("DigestOutputStream.getCheckValue: "); - for (int i=0; i0 means the current thread is downloading or - // installing a bundle. - static ThreadLocal downloading = new ThreadLocal() { - protected Integer initialValue() { - return 0; - } - }; - - private static File[] additionalBootStrapPaths = { }; - - private static String[] bundleNames; - private static String[] criticalBundleNames; - - private static String downloadURL; - - private static boolean visitorIdDetermined; - private static String visitorId; - - /** - * File and path where the Check value properties are gotten from - */ - public static String CHECK_VALUES_FILE = "check_value.properties"; - static String CHECK_VALUES_DIR = "sun/jkernel/"; - static String CHECK_VALUES_PATH = CHECK_VALUES_DIR + CHECK_VALUES_FILE; - - /** - * The contents of the bundle.properties file, which contains various - * information about individual bundles. - */ - private static Map> bundleProperties; - - - /** - * The contents of the resource_map file, which maps resources - * to their respective bundles. - */ - private static Map resourceMap; - - - /** - * The contents of the file_map file, which maps files - * to their respective bundles. - */ - private static Map fileMap; - - private static boolean extDirDetermined; - private static boolean extDirIncluded; - - static { - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - if (debug) - println("DownloadManager startup"); - - // this mutex is global and will apply to all different - // version of java kernel installed on the local machine - MUTEX_PREFIX = "jkernel"; - boolean downloadEnabled = !"false".equals( - System.getProperty(KERNEL_DOWNLOAD_ENABLED_PROPERTY)); - complete = !getBundlePath().exists() || - !downloadEnabled; - - // only load jkernel.dll if we are not "complete". - // DownloadManager will be loaded during build time, before - // jkernel.dll is built. We only need to load jkernel.dll - // when DownloadManager needs to download something, which is - // not necessary during build time - if (!complete) { - loadJKernelLibrary(); - log("Log opened"); - - if (isWindowsVista()) { - getLocalLowTempBundlePath().mkdirs(); - } - - new Thread() { - public void run() { - startBackgroundDownloads(); - } - }.start(); - - try { - String dummyPath; - if (isWindowsVista()) { - dummyPath = USER_HOME + - "\\appdata\\locallow\\dummy.kernel"; - } else { - dummyPath = USER_HOME + "\\dummy.kernel"; - } - - File f = new File(dummyPath); - FileOutputStream out = new FileOutputStream(f, true); - out.close(); - f.deleteOnExit(); - - } catch (IOException e) { - log(e); - } - // end of warm up code - - new Thread("BundleDownloader") { - public void run() { - downloadRequestedBundles(); - } - }.start(); - } - return null; - } - }); - } - - - static synchronized void loadJKernelLibrary() { - if (!jkernelLibLoaded) { - try { - System.loadLibrary("jkernel"); - jkernelLibLoaded = true; - debug = getDebugProperty(); - } catch (Exception e) { - throw new Error(e); - } - } - } - - static String appendTransactionId(String url) { - StringBuilder result = new StringBuilder(url); - String visitorId = DownloadManager.getVisitorId(); - if (visitorId != null) { - if (url.indexOf("?") == -1) - result.append('?'); - else - result.append('&'); - result.append("transactionId="); - result.append(DownloadManager.getVisitorId()); - } - return result.toString(); - } - - - /** - * Returns the URL for the directory from which bundles should be - * downloaded. - */ - static synchronized String getBaseDownloadURL() { - if (downloadURL == null) { - log("Determining download URL..."); - loadJKernelLibrary(); - - /* - * First check if system property has been set - system - * property should take over registry key setting. - */ - downloadURL = System.getProperty( - DownloadManager.KERNEL_DOWNLOAD_URL_PROPERTY); - log("System property kernel.download.url = " + downloadURL); - - /* - * Now check if registry key has been set - */ - if (downloadURL == null){ - downloadURL = getUrlFromRegistry(); - log("getUrlFromRegistry = " + downloadURL); - } - - /* - * Use default download url - */ - if (downloadURL == null) - downloadURL = DEFAULT_DOWNLOAD_URL; - log("Final download URL: " + downloadURL); - } - return downloadURL; - } - - - /** - * Loads a file representing a node tree. The format is described in - * SplitJRE.writeTreeMap(). The node paths (such as - * core/java/lang/Object.class) are interpreted with the root node as the - * value and the remaining nodes as - * the key, so the mapping for this entry would be java/lang/Object.class = - * core. - */ - static Map readTreeMap(InputStream rawIn) - throws IOException { - // "token level" refers to the 0-31 byte that occurs prior to every - // token in the stream, and would be e.g. <0> core <1> java <2> lang - // <3> Object.class <3> String.class, which gives us two mappings: - // java/lang/Object.class = core, and java/lang/String.class = core. - // See the format description in SplitJRE.writeTreeMap for more details. - Map result = new HashMap(); - InputStream in = new BufferedInputStream(rawIn); - // holds the current token sequence, - // e.g. {"core", "java", "lang", "Object.class"} - List tokens = new ArrayList(); - StringBuilder currentToken = new StringBuilder(); - for (;;) { - int c = in.read(); - if (c == -1) // eof - break; - if (c < 32) { // new token level - if (tokens.size() > 0) { - // replace the null at the end of the list with the token - // we just finished reading - tokens.set(tokens.size() - 1, currentToken.toString()); - } - - currentToken.setLength(0); - - if (c > tokens.size()) { - // can't increase by more than one token level at a step - throw new InternalError("current token level is " + - (tokens.size() - 1) + " but encountered token " + - "level " + c); - } - else if (c == tokens.size()) { - // token level increased by 1; this means we are still - // adding tokens for the current mapping -- e.g. we have - // read "core", "java", "lang" and are just about to read - // "Object.class" - // add a placeholder for the new token - tokens.add(null); - } - else { - // we just stayed at the same level or backed up one or more - // token levels; this means that the current sequence is - // complete and needs to be added to the result map - StringBuilder key = new StringBuilder(); - // combine all tokens except the first into a single string - for (int i = 1; i < tokens.size(); i++) { - if (i > 1) - key.append('/'); - key.append(tokens.get(i)); - } - // map the combined string to the first token, e.g. - // java/lang/Object.class = core - result.put(key.toString(), tokens.get(0)); - // strip off tokens until we get back to the current token - // level - while (c < tokens.size()) - tokens.remove(c); - // placeholder for upcoming token - tokens.add(null); - } - } - else if (c < 254) // character - currentToken.append((char) c); - else if (c == 255) - currentToken.append(".class"); - else { // out-of-band value - throw new InternalError("internal error processing " + - "resource_map (can't-happen error)"); - } - } - if (tokens.size() > 0) // add token we just finished reading - tokens.set(tokens.size() - 1, currentToken.toString()); - StringBuilder key = new StringBuilder(); - // add the last entry to the map - for (int i = 1; i < tokens.size(); i++) { - if (i > 1) - key.append('/'); - key.append(tokens.get(i)); - } - if (!tokens.isEmpty()) - result.put(key.toString(), tokens.get(0)); - in.close(); - return Collections.unmodifiableMap(result); - } - - - /** - * Returns the contents of the resource_map file, which maps - * resources names to their respective bundles. - */ - public static Map getResourceMap() throws IOException { - if (resourceMap == null) { - InputStream in = DownloadManager.class.getResourceAsStream("resource_map"); - if (in != null) { - in = new BufferedInputStream(in); - try { - resourceMap = readTreeMap(in); - in.close(); - } - catch (IOException e) { - // turns out we can be returned a broken stream instead of - // just null - resourceMap = new HashMap(); - complete = true; - log("Can't find resource_map, forcing complete to true"); - } - in.close(); - } - else { - resourceMap = new HashMap(); - complete = true; - log("Can't find resource_map, forcing complete to true"); - } - - for (int i = 1; ; i++) { // run through the numbered custom bundles - String name = CUSTOM_PREFIX + i; - File customPath = new File(getBundlePath(), name + ".jar"); - if (customPath.exists()) { - JarFile custom = new JarFile(customPath); - Enumeration entries = custom.entries(); - while (entries.hasMoreElements()) { - JarEntry entry = (JarEntry) entries.nextElement(); - if (!entry.isDirectory()) - resourceMap.put(entry.getName(), name); - } - } - else - break; - } - } - return resourceMap; - } - - - /** - * Returns the contents of the file_map file, which maps - * file names to their respective bundles. - */ - public static Map getFileMap() throws IOException { - if (fileMap == null) { - InputStream in = DownloadManager.class.getResourceAsStream("file_map"); - if (in != null) { - in = new BufferedInputStream(in); - try { - fileMap = readTreeMap(in); - in.close(); - } - catch (IOException e) { - // turns out we can be returned a broken stream instead of - // just null - fileMap = new HashMap(); - complete = true; - log("Can't find file_map, forcing complete to true"); - } - in.close(); - } - else { - fileMap = new HashMap(); - complete = true; - log("Can't find file_map, forcing complete to true"); - } - } - return fileMap; - } - - - /** - * Returns the contents of the bundle.properties file, which maps - * bundle names to a pipe-separated list of their properties. Properties - * include: - * jarpath - By default, the JAR files (unpacked from classes.pack in the - * bundle) are stored under lib/bundles. The jarpath property - * overrides this default setting, causing the JAR to be unpacked - * at the specified location. This is used to preserve the - * identity of JRE JAR files such as lib/deploy.jar. - * size - The size of the download in bytes. - */ - private static synchronized Map> getBundleProperties() - throws IOException { - if (bundleProperties == null) { - InputStream in = DownloadManager.class.getResourceAsStream("bundle.properties"); - if (in == null) { - complete = true; - log("Can't find bundle.properties, forcing complete to true"); - return null; - } - in = new BufferedInputStream(in); - Properties tmp = new Properties(); - tmp.load(in); - bundleProperties = new HashMap>(); - for (Map.Entry e : tmp.entrySet()) { - String key = (String) e.getKey(); - String[] properties = ((String) e.getValue()).split("\\|"); - Map map = new HashMap(); - for (String entry : properties) { - int equals = entry.indexOf("="); - if (equals == -1) - throw new InternalError("error parsing bundle.properties: " + - entry); - map.put(entry.substring(0, equals).trim(), - entry.substring(equals + 1).trim()); - } - bundleProperties.put(key, map); - } - in.close(); - } - return bundleProperties; - } - - - /** - * Returns a single bundle property value loaded from the bundle.properties - * file. - */ - static String getBundleProperty(String bundleName, String property) { - try { - Map> props = getBundleProperties(); - Map/**/ map = props != null ? props.get(bundleName) : null; - return map != null ? (String) map.get(property) : null; - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - - /** Returns an array of all supported bundle names. */ - static String[] getBundleNames() throws IOException { - if (bundleNames == null) { - Set result = new HashSet(); - Map resourceMap = getResourceMap(); - if (resourceMap != null) - result.addAll(resourceMap.values()); - Map fileMap = getFileMap(); - if (fileMap != null) - result.addAll(fileMap.values()); - bundleNames = result.toArray(new String[result.size()]); - } - return bundleNames; - } - - - /** - * Returns an array of all "critical" (must be downloaded prior to - * completion) bundle names. - */ - private static String[] getCriticalBundleNames() throws IOException { - if (criticalBundleNames == null) { - Set result = new HashSet(); - Map fileMap = getFileMap(); - if (fileMap != null) - result.addAll(fileMap.values()); - criticalBundleNames = result.toArray(new String[result.size()]); - } - return criticalBundleNames; - } - - - public static void send(InputStream in, OutputStream out) - throws IOException { - byte[] buffer = new byte[BUFFER_SIZE]; - int c; - while ((c = in.read(buffer)) > 0) - out.write(buffer, 0, c); - } - - - /** - * Determine whether all bundles have been downloaded, and if so create - * the merged jars that will eventually replace rt.jar and resoures.jar. - * IMPORTANT: this method should only be called from the background - * download process. - */ - static void performCompletionIfNeeded() { - if (debug) - log("DownloadManager.performCompletionIfNeeded: checking (" + - complete + ", " + System.getProperty(KERNEL_NOMERGE_PROPERTY) - + ")"); - if (complete || - "true".equals(System.getProperty(KERNEL_NOMERGE_PROPERTY))) - return; - Bundle.loadReceipts(); - try { - if (debug) { - List critical = new ArrayList(Arrays.asList(getCriticalBundleNames())); - critical.removeAll(Bundle.receipts); - log("DownloadManager.performCompletionIfNeeded: still need " + - critical.size() + " bundles (" + critical + ")"); - } - if (Bundle.receipts.containsAll(Arrays.asList(getCriticalBundleNames()))) { - log("DownloadManager.performCompletionIfNeeded: running"); - // all done! - new Thread("JarMerger") { - public void run() { - createMergedJars(); - } - }.start(); - } - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - - - /** - * Returns the bundle corresponding to a given resource path (e.g. - * "java/lang/Object.class"). If the resource does not appear in a bundle, - * null is returned. - */ - public static Bundle getBundleForResource(String resource) - throws IOException { - String bundleName = getResourceMap().get(resource); - return bundleName != null ? Bundle.getBundle(bundleName) : null; - } - - - /** - * Returns the bundle corresponding to a given JRE file path (e.g. - * "bin/awt.dll"). If the file does not appear in a bundle, null is - * returned. - */ - private static Bundle getBundleForFile(String file) throws IOException { - String bundleName = getFileMap().get(file); - return bundleName != null ? Bundle.getBundle(bundleName) : null; - } - - - /** - * Returns the path to the lib/bundles directory. - */ - static File getBundlePath() { - return new File(JAVA_HOME, "lib" + File.separatorChar + "bundles"); - } - - private static String getAppDataLocalLow() { - return USER_HOME + "\\appdata\\locallow\\"; - } - - public static String getKernelJREDir() { - return "kerneljre" + JAVA_VERSION; - } - - static File getLocalLowTempBundlePath() { - return new File(getLocalLowKernelJava() + "-bundles"); - } - - static String getLocalLowKernelJava() { - return getAppDataLocalLow() + getKernelJREDir(); - } - - // To be revisited: - // How DownloadManager maintains its bootstrap class path. - // sun.misc.Launcher.getBootstrapClassPath() returns - // DownloadManager.getBootstrapClassPath() instead. - // - // So should no longer need to lock the Launcher.class. - // In addition, additionalBootStrapPaths is not really needed - // if it obtains the initial bootclasspath during DownloadManager's - // initialization. - private static void addEntryToBootClassPath(File path) { - // Must acquire these locks in this order - synchronized(Launcher.class) { - synchronized(DownloadManager.class) { - File[] newBootStrapPaths = new File[ - additionalBootStrapPaths.length + 1]; - System.arraycopy(additionalBootStrapPaths, 0, newBootStrapPaths, - 0, additionalBootStrapPaths.length); - newBootStrapPaths[newBootStrapPaths.length - 1] = path; - additionalBootStrapPaths = newBootStrapPaths; - if (bootstrapClassPath != null) - bootstrapClassPath.addURL(getFileURL(path)); - } - } - } - - /** - * Returns the kernel's bootstrap class path which includes the additional - * JARs downloaded - */ - private static URLClassPath bootstrapClassPath = null; - private synchronized static - URLClassPath getBootClassPath(URLClassPath bcp, - URLStreamHandlerFactory factory) - { - if (bootstrapClassPath == null) { - bootstrapClassPath = new URLClassPath(bcp.getURLs(), factory); - for (File path : additionalBootStrapPaths) { - bootstrapClassPath.addURL(getFileURL(path)); - } - } - return bootstrapClassPath; - } - - private static URL getFileURL(File file) { - try { - file = file.getCanonicalFile(); - } catch (IOException e) {} - - try { - return ParseUtil.fileToEncodedURL(file); - } catch (MalformedURLException e) { - // Should never happen since we specify the protocol... - throw new InternalError(); - } - } - - /** - * Scan through java.ext.dirs to see if the lib/ext directory is included. - * If not, we shouldn't be "finding" lib/ext jars for download. - */ - private static synchronized boolean extDirIsIncluded() { - if (!extDirDetermined) { - extDirDetermined = true; - String raw = System.getProperty("java.ext.dirs"); - String ext = JAVA_HOME + File.separator + "lib" + File.separator + "ext"; - int index = 0; - while (index < raw.length()) { - int newIndex = raw.indexOf(File.pathSeparator, index); - if (newIndex == -1) - newIndex = raw.length(); - String path = raw.substring(index, newIndex); - if (path.equals(ext)) { - extDirIncluded = true; - break; - } - index = newIndex + 1; - } - } - return extDirIncluded; - } - - - private static String doGetBootClassPathEntryForResource( - String resourceName) { - boolean retry = false; - do { - Bundle bundle = null; - try { - bundle = getBundleForResource(resourceName); - if (bundle != null) { - File path = bundle.getJarPath(); - boolean isExt = path.getParentFile().getName().equals("ext"); - if (isExt && !extDirIsIncluded()) // this is a lib/ext jar, but - return null; // lib/ext isn't in the path - if (getBundleProperty(bundle.getName(), JAR_PATH_PROPERTY) == null) { - // if the bundle doesn't have its own JAR path, that means it's - // going to be merged into rt.jar. If we already have the - // merged rt.jar, we can simply point to that. - Bundle merged = Bundle.getBundle("merged"); - if (merged != null && merged.isInstalled()) { - File jar; - if (resourceName.endsWith(".class")) - jar = merged.getJarPath(); - else - jar = new File(merged.getJarPath().getPath().replaceAll("merged-rt.jar", - "merged-resources.jar")); - addEntryToBootClassPath(jar); - return jar.getPath(); - } - } - if (!bundle.isInstalled()) { - bundle.queueDependencies(true); - log("On-demand downloading " + - bundle.getName() + " for resource " + - resourceName + "..."); - bundle.install(); - log(bundle + " install finished."); - } - log("Double-checking " + bundle + " state..."); - if (!bundle.isInstalled()) { - throw new IllegalStateException("Expected state of " + - bundle + " to be INSTALLED"); - } - if (isExt) { - // don't add lib/ext entries to the boot class path, add - // them to the extension classloader instead - Launcher.addURLToExtClassLoader(path.toURL()); - return null; - } - - if ("javaws".equals(bundle.getName())) { - Launcher.addURLToAppClassLoader(path.toURL()); - log("Returning null for javaws"); - return null; - } - - if ("core".equals(bundle.getName())) - return null; - - // else add to boot class path - addEntryToBootClassPath(path); - - return path.getPath(); - } - return null; // not one of the JRE's classes - } - catch (Throwable e) { - retry = handleException(e); - log("Error downloading bundle for " + - resourceName + ":"); - log(e); - if (e instanceof IOException) { - // bundle did not get installed correctly, remove incomplete - // bundle files - if (bundle != null) { - if (bundle.getJarPath() != null) { - File packTmp = new File(bundle.getJarPath() + ".pack"); - packTmp.delete(); - bundle.getJarPath().delete(); - } - if (bundle.getLocalPath() != null) { - bundle.getLocalPath().delete(); - } - bundle.setState(Bundle.NOT_DOWNLOADED); - } - } - } - } while (retry); - sendErrorPing(ERROR_RETRY_CANCELLED); // bundle failed to install, user cancelled - - return null; // failed, user chose not to retry - } - - static synchronized void sendErrorPing(int code) { - try { - File bundlePath; - if (isWindowsVista()) { - bundlePath = getLocalLowTempBundlePath(); - } else { - bundlePath = getBundlePath(); - } - File tmp = new File(bundlePath, "tmp"); - File errors = new File(tmp, "errors"); - String errorString = String.valueOf(code); - if (errors.exists()) { - BufferedReader in = new BufferedReader(new FileReader(errors)); - String line = in.readLine(); - while (line != null) { - if (line.equals(errorString)) - return; // we have already pinged this error - line = in.readLine(); - } - } - tmp.mkdirs(); - Writer out = new FileWriter(errors, true); - out.write(errorString + System.getProperty("line.separator")); - out.close(); - postDownloadError(code); - } - catch (IOException e) { - e.printStackTrace(); - } - } - - - - /** - * Displays an error dialog and prompts the user to retry or cancel. - * Returns true if the user chose to retry, false if he chose to cancel. - */ - static boolean handleException(Throwable e) { - if (e instanceof IOException) { - // I don't know of a better method to determine the root cause of - // the exception, unfortunately... - int code = ERROR_UNSPECIFIED; - if (e.getMessage().indexOf("not enough space") != -1) - code = ERROR_DISK_FULL; - return askUserToRetryDownloadOrQuit(code); - } - else - return false; - } - - - static synchronized void flushBundleURLs() { - bundleURLs = null; - } - - - static synchronized Properties getBundleURLs(boolean showUI) - throws IOException { - if (bundleURLs == null) { - log("Entering DownloadManager.getBundleURLs"); - String base = getBaseDownloadURL(); - String url = appendTransactionId(base); - // use PID instead of createTempFile or other random filename so as - // to avoid dependencies on the random number generator libraries - File bundlePath = null; - // write temp file to locallow directory on vista - if (isWindowsVista()) { - bundlePath = getLocalLowTempBundlePath(); - } else { - bundlePath = getBundlePath(); - } - File tmp = new File(bundlePath, "urls." + getCurrentProcessId() + - ".properties"); - try { - log("Downloading from " + url + " to " + tmp); - downloadFromURL(url, tmp, "", showUI); - bundleURLs = new Properties(); - if (tmp.exists()) { - addToTotalDownloadSize((int) tmp.length()); // better late than never - InputStream in = new FileInputStream(tmp); - in = new BufferedInputStream(in); - bundleURLs.load(in); - in.close(); - if (bundleURLs.isEmpty()) { - fatalError(ERROR_MALFORMED_BUNDLE_PROPERTIES); - } - } else { - fatalError(ERROR_DOWNLOADING_BUNDLE_PROPERTIES); - } - } finally { - // delete the temp file - if (!debug) - tmp.delete(); - } - log("Leaving DownloadManager.getBundleURLs"); - // else an error occurred and user chose not to retry; leave - // bundleURLs empty so we don't continually try to re-download it - } - return bundleURLs; - } - - /** - * Checks to see if the specified resource is part of a bundle, and if so - * downloads it. Returns either a string which should be added to the boot - * class path (the newly-downloaded JAR's location), or null to indicate - * that it isn't one of the JRE's resources or could not be downloaded. - */ - public static String getBootClassPathEntryForResource( - final String resourceName) { - if (debug) - log("Entering getBootClassPathEntryForResource(" + resourceName + ")"); - if (isJREComplete() || downloading == null || - resourceName.startsWith("sun/jkernel")) { - if (debug) - log("Bailing: " + isJREComplete() + ", " + (downloading == null)); - return null; - } - incrementDownloadCount(); - try { - String result = (String) AccessController.doPrivileged( - new PrivilegedAction() { - public Object run() { - return (String) doGetBootClassPathEntryForResource( - resourceName); - } - } - ); - log("getBootClassPathEntryForResource(" + resourceName + ") == " + result); - return result; - } - finally { - decrementDownloadCount(); - } - } - - - /** - * Called by the boot class loader when it encounters a class it can't find. - * This method will check to see if the class is part of a bundle, and if so - * download it. Returns either a string which should be added to the boot - * class path (the newly-downloaded JAR's location), or null to indicate - * that it isn't one of the JRE's classes or could not be downloaded. - */ - public static String getBootClassPathEntryForClass(final String className) { - return getBootClassPathEntryForResource(className.replace('.', '/') + - ".class"); - } - - - private static boolean doDownloadFile(String relativePath) - throws IOException { - Bundle bundle = getBundleForFile(relativePath); - if (bundle != null) { - bundle.queueDependencies(true); - log("On-demand downloading " + bundle.getName() + - " for file " + relativePath + "..."); - bundle.install(); - return true; - } - return false; - } - - - /** - * Locates the bundle for the specified JRE file (e.g. "bin/awt.dll") and - * installs it. Returns true if the file is indeed part of the JRE and has - * now been installed, false if the file is not part of the JRE, and throws - * an IOException if the file is part of the JRE but could not be - * downloaded. - */ - public static boolean downloadFile(final String relativePath) - throws IOException { - if (isJREComplete() || downloading == null) - return false; - - incrementDownloadCount(); - try { - Object result = - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - File path = new File(JAVA_HOME, - relativePath.replace('/', File.separatorChar)); - if (path.exists()) - return true; - try { - return new Boolean(doDownloadFile(relativePath)); - } - catch (IOException e) { - return e; - } - } - }); - if (result instanceof Boolean) - return ((Boolean) result).booleanValue(); - else - throw (IOException) result; - } - finally { - decrementDownloadCount(); - } - } - - - // increments the counter that tracks whether the current thread is involved - // in any download-related activities. A non-zero count indicates that the - // thread is currently downloading or installing a bundle. - static void incrementDownloadCount() { - downloading.set(downloading.get() + 1); - } - - - // increments the counter that tracks whether the current thread is involved - // in any download-related activities. A non-zero count indicates that the - // thread is currently downloading or installing a bundle. - static void decrementDownloadCount() { - // will generate an exception if incrementDownloadCount() hasn't been - // called first, this is intentional - downloading.set(downloading.get() - 1); - } - - - /** - * Returns true if the current thread is in the process of - * downloading a bundle. This is called by DownloadManager.loadLibrary() - * that is called by System.loadLibrary(), so - * that when we run into a library required by the download process itself, - * we don't call back into DownloadManager in an attempt to download it - * (which would lead to infinite recursion). - * - * All classes and libraries required to download classes must by - * definition already be present. So if this method returns true, we are - * currently in the middle of performing a download, and the class or - * library load must be happening due to the download itself. We can - * immediately abort such requests -- the class or library should already - * be present. If it isn't, we're not going to be able to download it, - * since we have just established that it is required to perform a - * download, and we might as well just let the NoClassDefFoundError / - * UnsatisfiedLinkError occur. - */ - public static boolean isCurrentThreadDownloading() { - return downloading != null ? downloading.get() > 0 : false; - } - - - /** - * Returns true if everything is downloaded and the JRE has been - * reconstructed. Also returns true if kernel functionality is disabled - * for any other reason. - */ - public static boolean isJREComplete() { - return complete; - } - - - // called by BackgroundDownloader - static void doBackgroundDownloads(boolean showProgress) { - if (!complete) { - if (!showProgress && !debug) - reportErrors = false; - try { - // install swing first for ergonomic reasons - Bundle swing = Bundle.getBundle("javax_swing_core"); - if (!swing.isInstalled()) - swing.install(showProgress, false, false); - // install remaining bundles - for (String name : getCriticalBundleNames()) { - Bundle bundle = Bundle.getBundle(name); - if (!bundle.isInstalled()) { - bundle.install(showProgress, false, true); - } - } - shutdown(); - } - catch (IOException e) { - log(e); - } - } - } - - // copy receipt file to destination path specified - static void copyReceiptFile(File from, File to) throws IOException { - DataInputStream in = new DataInputStream( - new BufferedInputStream(new FileInputStream(from))); - OutputStream out = new FileOutputStream(to); - String line = in.readLine(); - while (line != null) { - out.write((line + '\n').getBytes("utf-8")); - line = in.readLine(); - } - in.close(); - out.close(); - } - - - private static void downloadRequestedBundles() { - log("Checking for requested bundles..."); - try { - File list = new File(JAVA_HOME, REQUESTED_BUNDLES_PATH); - if (list.exists()) { - FileInputStream in = new FileInputStream(list); - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - send(in, buffer); - in.close(); - - // split string manually to avoid relying on regexes or - // StringTokenizer - String raw = new String(buffer.toByteArray(), "utf-8"); - List/**/ bundles = new ArrayList/**/(); - StringBuilder token = new StringBuilder(); - for (int i = 0; i < raw.length(); i++) { - char c = raw.charAt(i); - if (c == ',' || Character.isWhitespace(c)) { - if (token.length() > 0) { - bundles.add(token.toString()); - token.setLength(0); - } - } - else - token.append(c); - } - if (token.length() > 0) - bundles.add(token.toString()); - log("Requested bundles: " + bundles); - for (int i = 0; i < bundles.size(); i++) { - Bundle bundle = Bundle.getBundle((String) bundles.get(i)); - if (bundle != null && !bundle.isInstalled()) { - log("Downloading " + bundle + " due to requested.list"); - bundle.install(true, false, false); - } - } - } - } - catch (IOException e) { - log(e); - } - } - - - static void fatalError(int code) { - fatalError(code, null); - } - - - /** - * Called to cleanly shut down the VM when a fatal download error has - * occurred. Calls System.exit() if outside of the Java Plug-In, otherwise - * throws an error. - */ - static void fatalError(int code, String arg) { - sendErrorPing(code); - - for (int i = 0; i < Bundle.THREADS; i++) - bundleInstallComplete(); - if (reportErrors) - displayError(code, arg); - // inPlugIn check isn't 100% reliable but should be close enough. - // headless is for the browser side of things in the out-of-process - // plug-in - boolean inPlugIn = (Boolean.getBoolean("java.awt.headless") || - System.getProperty("javaplugin.version") != null); - KernelError error = new KernelError("Java Kernel bundle download failed"); - if (inPlugIn) - throw error; - else { - log(error); - System.exit(1); - } - } - - - // start the background download process using the jbroker broker process - // the method will first launch the broker process, if it is not already - // running - // it will then send the command necessary to start the background download - // process to the broker process - private static void startBackgroundDownloadWithBroker() { - - if (!BackgroundDownloader.getBackgroundDownloadProperty()) { - // If getBackgroundDownloadProperty() returns false - // we're doing the downloads from this VM; we don't want to - // spawn another one - return; - } - - // launch broker process if necessary - if (!launchBrokerProcess()) { - return; - } - - - String kernelDownloadURLProperty = getBaseDownloadURL(); - - String kernelDownloadURL; - - // only set KERNEL_DOWNLOAD_URL_PROPERTY if we override - // the default download url - if (kernelDownloadURLProperty == null || - kernelDownloadURLProperty.equals(DEFAULT_DOWNLOAD_URL)) { - kernelDownloadURL = " "; - } else { - kernelDownloadURL = kernelDownloadURLProperty; - } - - startBackgroundDownloadWithBrokerImpl(kernelDownloadURLProperty); - } - - private static void startBackgroundDownloads() { - if (!complete) { - if (BackgroundDownloader.getBackgroundMutex().acquire(0)) { - // we don't actually need to hold the mutex -- it was just a - // quick check to see if there is any point in even attempting - // to start the background downloader - BackgroundDownloader.getBackgroundMutex().release(); - if (isWindowsVista()) { - // use broker process to start background download - // at high integrity - startBackgroundDownloadWithBroker(); - } else { - BackgroundDownloader.startBackgroundDownloads(); - } - } - } - } - - - /** - * Increases the total download size displayed in the download progress - * dialog. - */ - static native void addToTotalDownloadSize(int size); - - - /** - * Displays a progress dialog while downloading from the specified URL. - * - *@param url the URL string from which to download - *@param file the destination path - *@param name the user-visible name of the component we are downloading - */ - static void downloadFromURL(String url, File file, String name, - boolean showProgress) { - // do not show download dialog if kernel.download.dialog is false - downloadFromURLImpl(url, file, name, - disableDownloadDialog ? false : showProgress); - } - - private static native void downloadFromURLImpl(String url, File file, - String name, boolean showProgress); - - // This is for testing purposes only - allows to specify URL - // to download kernel bundles from through the registry key. - static native String getUrlFromRegistry(); - - static native String getVisitorId0(); - - static native void postDownloadComplete(); - - static native void postDownloadError(int code); - - // Returns the visitor ID set by the installer, will be sent to the server - // during bundle downloads for logging purposes. - static synchronized String getVisitorId() { - if (!visitorIdDetermined) { - visitorIdDetermined = true; - visitorId = getVisitorId0(); - } - return visitorId; - } - - // display an error message using a native dialog - public static native void displayError(int code, String arg); - - // prompt user whether to retry download, or quit - // returns true if the user chose to retry - public static native boolean askUserToRetryDownloadOrQuit(int code); - - // returns true if we are running Windows Vista; false otherwise - static native boolean isWindowsVista(); - - private static native void startBackgroundDownloadWithBrokerImpl( - String command); - - private static int isJBrokerStarted() { - if (_isJBrokerStarted == -1) { - // initialize state of jbroker - _isJBrokerStarted = isJBrokerRunning() ? 1 : 0; - } - return _isJBrokerStarted; - } - - // returns true if broker process (jbroker) is running; false otherwise - private static native boolean isJBrokerRunning(); - - // returns true if we are running in IE protected mode; false otherwise - private static native boolean isIEProtectedMode(); - - private static native boolean launchJBroker(String jbrokerPath); - - static native void bundleInstallStart(); - - static native void bundleInstallComplete(); - - private static native boolean moveFileWithBrokerImpl(String fromPath, - String userHome); - - private static native boolean moveDirWithBrokerImpl(String fromPath, - String userHome); - - static boolean moveFileWithBroker(String fromPath) { - // launch jbroker if necessary - if (!launchBrokerProcess()) { - return false; - } - - return moveFileWithBrokerImpl(fromPath, USER_HOME); - } - - static boolean moveDirWithBroker(String fromPath) { - // launch jbroker if necessary - if (!launchBrokerProcess()) { - return false; - } - - return moveDirWithBrokerImpl(fromPath, USER_HOME); - } - - private static synchronized boolean launchBrokerProcess() { - // launch jbroker if necessary - if (isJBrokerStarted() == 0) { - // launch jbroker if needed - boolean ret = launchJBroker(JAVA_HOME); - // set state of jbroker - _isJBrokerStarted = ret ? 1 : 0; - return ret; - } - return true; - } - - private static class StreamMonitor implements Runnable { - private InputStream istream; - public StreamMonitor(InputStream stream) { - istream = new BufferedInputStream(stream); - new Thread(this).start(); - } - public void run() { - byte[] buffer = new byte[4096]; - try { - int ret = istream.read(buffer); - while (ret != -1) { - ret = istream.read(buffer); - } - } catch (IOException e) { - try { - istream.close(); - } catch (IOException e2) { - } // Should allow clean exit when process shuts down - } - } - } - - - /** Copy a file tree, excluding certain named files. */ - private static void copyAll(File src, File dest, Set/**/ excludes) - throws IOException { - if (!excludes.contains(src.getName())) { - if (src.isDirectory()) { - File[] children = src.listFiles(); - if (children != null) { - for (int i = 0; i < children.length; i++) - copyAll(children[i], - new File(dest, children[i].getName()), - excludes); - } - } - else { - dest.getParentFile().mkdirs(); - FileInputStream in = new FileInputStream(src); - FileOutputStream out = new FileOutputStream(dest); - send(in, out); - in.close(); - out.close(); - } - } - } - - - public static void dumpOutput(final Process p) { - Thread outputReader = new Thread("outputReader") { - public void run() { - try { - InputStream in = p.getInputStream(); - DownloadManager.send(in, System.out); - } catch (IOException e) { - log(e); - } - } - }; - outputReader.start(); - Thread errorReader = new Thread("errorReader") { - public void run() { - try { - InputStream in = p.getErrorStream(); - DownloadManager.send(in, System.err); - } catch (IOException e) { - log(e); - } - } - }; - errorReader.start(); - } - - - /** - * Creates the merged rt.jar and resources.jar files. - */ - private static void createMergedJars() { - log("DownloadManager.createMergedJars"); - File bundlePath; - if (isWindowsVista()) { - bundlePath = getLocalLowTempBundlePath(); - } else { - bundlePath = getBundlePath(); - } - File tmp = new File(bundlePath, "tmp"); - // explicitly check the final location, not the (potentially) local-low - // location -- a local-low finished isn't good enough to call it done - if (new File(getBundlePath(), "tmp" + File.separator + "finished").exists()) - return; // already done - log("DownloadManager.createMergedJars: running"); - tmp.mkdirs(); - boolean retry = false; - do { - try { - Bundle.getBundle("merged").install(false, false, true); - postDownloadComplete(); - // done, write an empty "finished" file to flag completion - File finished = new File(tmp, "finished"); - new FileOutputStream(finished).close(); - if (isWindowsVista()) { - if (!moveFileWithBroker(getKernelJREDir() + - "-bundles\\tmp\\finished")) { - throw new IOException("unable to create 'finished' file"); - } - } - log("DownloadManager.createMergedJars: created " + finished); - // next JRE startup will move these files into their final - // locations, as long as no other JREs are running - - // clean up the local low bundle directory on vista - if (isWindowsVista()) { - File tmpDir = getLocalLowTempBundlePath(); - File[] list = tmpDir.listFiles(); - if (list != null) { - for (int i = 0; i < list.length; i++) { - list[i].delete(); - } - } - tmpDir.delete(); - log("Finished cleanup, " + tmpDir + ".exists(): " + tmpDir.exists()); - } - } - catch (IOException e) { - log(e); - } - } - while (retry); - log("DownloadManager.createMergedJars: finished"); - } - - - private static void shutdown() { - try { - ExecutorService e = Bundle.getThreadPool(); - e.shutdown(); - e.awaitTermination(60 * 60 * 24, TimeUnit.SECONDS); - } - catch (InterruptedException e) { - } - } - - - // returns the registry key for kernel.debug - static native boolean getDebugKey(); - - - // returns the final value for the kernel debug property - public static boolean getDebugProperty(){ - /* - * Check registry key value - */ - boolean debugEnabled = getDebugKey(); - - /* - * Check system property - it should override the registry - * key value. - */ - if (System.getProperty(KERNEL_DEBUG_PROPERTY) != null) { - debugEnabled = Boolean.valueOf( - System.getProperty(KERNEL_DEBUG_PROPERTY)); - } - return debugEnabled; - - } - - - /** - * Outputs to the error stream even when System.err has not yet been - * initialized. - */ - static void println(String msg) { - if (System.err != null) - System.err.println(msg); - else { - try { - if (errorStream == null) - errorStream = new FileOutputStream(FileDescriptor.err); - errorStream.write((msg + - System.getProperty("line.separator")).getBytes("utf-8")); - } - catch (IOException e) { - throw new RuntimeException(e); - } - } - } - - - static void log(String msg) { - if (debug) { - println(msg); - try { - if (logStream == null) { - loadJKernelLibrary(); - File path = isWindowsVista() ? getLocalLowTempBundlePath() : - getBundlePath(); - path = new File(path, "kernel." + getCurrentProcessId() + ".log"); - logStream = new FileOutputStream(path); - } - logStream.write((msg + - System.getProperty("line.separator")).getBytes("utf-8")); - logStream.flush(); - } - catch (IOException e) { - // ignore - } - } - } - - - static void log(Throwable e) { - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); - PrintStream p = new PrintStream(buffer); - e.printStackTrace(p); - p.close(); - log(buffer.toString(0)); - } - - - /** Dump the contents of a map to System.out. */ - private static void printMap(Map/**/ map) { - int size = 0; - Set identityHashes = new HashSet(); - Iterator/*>*/ i = map.entrySet().iterator(); - while (i.hasNext()) { - Map.Entry/**/ e = (Map.Entry) i.next(); - String key = (String) e.getKey(); - String value = (String) e.getValue(); - System.out.println(key + ": " + value); - Integer keyHash = Integer.valueOf(System.identityHashCode(key)); - if (!identityHashes.contains(keyHash)) { - identityHashes.add(keyHash); - size += key.length(); - } - Integer valueHash = Integer.valueOf(System.identityHashCode(value)); - if (!identityHashes.contains(valueHash)) { - identityHashes.add(valueHash); - size += value.length(); - } - } - System.out.println(size + " bytes"); - } - - - /** Process the "-dumpmaps" command-line argument. */ - private static void dumpMaps() throws IOException { - System.out.println("Resources:"); - System.out.println("----------"); - printMap(getResourceMap()); - System.out.println(); - System.out.println("Files:"); - System.out.println("----------"); - printMap(getFileMap()); - } - - - /** Process the "-download" command-line argument. */ - private static void processDownload(String bundleName) throws IOException { - if (bundleName.equals("all")) { - debug = true; - doBackgroundDownloads(true); - performCompletionIfNeeded(); - } - else { - Bundle bundle = Bundle.getBundle(bundleName); - if (bundle == null) { - println("Unknown bundle: " + bundleName); - System.exit(1); - } - else - bundle.install(); - } - } - - - static native int getCurrentProcessId(); - - private DownloadManager() { - } - - // Invoked by jkernel VM after the VM is initialized - static void setBootClassLoaderHook() { - if (!isJREComplete()) { - sun.misc.BootClassLoaderHook.setHook(new DownloadManager()); - } - } - - // Implementation of the BootClassLoaderHook interface - public String loadBootstrapClass(String name) { - // Check for download before we look for it. If - // DownloadManager ends up downloading it, it will add it to - // our search path before we proceed to the findClass(). - return DownloadManager.getBootClassPathEntryForClass(name); - } - - public boolean loadLibrary(String name) { - try { - if (!DownloadManager.isJREComplete() && - !DownloadManager.isCurrentThreadDownloading()) { - return DownloadManager.downloadFile("bin/" + - System.mapLibraryName(name)); - // it doesn't matter if the downloadFile call returns false -- - // it probably just means that this is a user library, as - // opposed to a JRE library - } - } catch (IOException e) { - throw new UnsatisfiedLinkError("Error downloading library " + - name + ": " + e); - } catch (NoClassDefFoundError e) { - // This happens while Java itself is being compiled; DownloadManager - // isn't accessible when this code is first invoked. It isn't an - // issue, as if we can't find DownloadManager, we can safely assume - // that additional code is not available for download. - } - return false; - } - - public boolean prefetchFile(String name) { - try { - return sun.jkernel.DownloadManager.downloadFile(name); - } catch (IOException ioe) { - return false; - } - } - - public String getBootstrapResource(String name) { - try { - // If this is a known JRE resource, ensure that its bundle is - // downloaded. If it isn't known, we just ignore the download - // failure and check to see if we can find the resource anyway - // (which is possible if the boot class path has been modified). - return DownloadManager.getBootClassPathEntryForResource(name); - } catch (NoClassDefFoundError e) { - // This happens while Java itself is being compiled; DownloadManager - // isn't accessible when this code is first invoked. It isn't an - // issue, as if we can't find DownloadManager, we can safely assume - // that additional code is not available for download. - return null; - } - } - - public URLClassPath getBootstrapClassPath(URLClassPath bcp, - URLStreamHandlerFactory factory) - { - return DownloadManager.getBootClassPath(bcp, factory); - } - - public boolean isCurrentThreadPrefetching() { - return DownloadManager.isCurrentThreadDownloading(); - } - - public static void main(String[] arg) throws Exception { - AccessController.checkPermission(new AllPermission()); - - boolean valid = false; - if (arg.length == 2 && arg[0].equals("-install")) { - valid = true; - Bundle bundle = new Bundle() { - protected void updateState() { - // the bundle path was provided on the command line, so we - // just claim it has already been "downloaded" to the local - // filesystem - state = DOWNLOADED; - } - }; - - File jarPath; - int index = 0; - do { - index++; - jarPath = new File(getBundlePath(), - CUSTOM_PREFIX + index + ".jar"); - } - while (jarPath.exists()); - bundle.setName(CUSTOM_PREFIX + index); - bundle.setLocalPath(new File(arg[1])); - bundle.setJarPath(jarPath); - bundle.setDeleteOnInstall(false); - bundle.install(); - } - else if (arg.length == 2 && arg[0].equals("-download")) { - valid = true; - processDownload(arg[1]); - } - else if (arg.length == 1 && arg[0].equals("-dumpmaps")) { - valid = true; - dumpMaps(); - } - else if (arg.length == 2 && arg[0].equals("-sha1")) { - valid = true; - System.out.println(BundleCheck.getInstance(new File(arg[1]))); - } - else if (arg.length == 1 && arg[0].equals("-downloadtest")) { - valid = true; - File file = File.createTempFile("download", ".test"); - for (;;) { - file.delete(); - downloadFromURL(getBaseDownloadURL(), file, "URLS", true); - System.out.println("Downloaded " + file.length() + " bytes"); - } - } - if (!valid) { - System.out.println("usage: DownloadManager -install .zip |"); - System.out.println(" DownloadManager -download " + - " |"); - System.out.println(" DownloadManager -dumpmaps"); - System.exit(1); - } - } -} diff --git a/jdk/src/share/classes/sun/jkernel/KernelError.java b/jdk/src/share/classes/sun/jkernel/KernelError.java deleted file mode 100644 index 53db1fab4c2..00000000000 --- a/jdk/src/share/classes/sun/jkernel/KernelError.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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.jkernel; - -/** - * Thrown to indicate that Java Kernel is unable to install a required bundle - * and the JRE is therefore not adhering to specifications. - */ -public class KernelError extends VirtualMachineError { - /** - * Constructs a KernelError with no detail message. - */ - public KernelError() { - super(); - } - - /** - * Constructs a KernelError with the specified - * detail message. - * - * @param s the detail message. - */ - public KernelError(String s) { - super(s); - } -} diff --git a/jdk/src/share/classes/sun/jkernel/Mutex.java b/jdk/src/share/classes/sun/jkernel/Mutex.java deleted file mode 100644 index 6f7247dcb84..00000000000 --- a/jdk/src/share/classes/sun/jkernel/Mutex.java +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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.jkernel; - -/** - * A mutex which works even between different processes. Currently implemented - * only on Win32. - * - *@author Ethan Nicholas - */ -public class Mutex { - static { - try { - System.loadLibrary("jkernel"); - } - catch (Exception e) { - throw new Error(e); - } - } - - private String uniqueId; - private long handle; - - public static Mutex create(String uniqueId) { - return new Mutex(uniqueId); - } - - - private Mutex(String uniqueId) { - this.uniqueId = uniqueId; - this.handle = createNativeMutex(uniqueId); - } - - - private static native long createNativeMutex(String uniqueId); - - - public native void acquire(); - - - public native boolean acquire(int timeout); - - - public native void release(); - - - public native void destroyNativeMutex(); - - - public void dispose() { - destroyNativeMutex(); - handle = 0; - } - - - public void finalize() { - dispose(); - } - - - public String toString() { - return "Mutex[" + uniqueId + "]"; - } -} diff --git a/jdk/src/share/classes/sun/jkernel/StandaloneByteArrayAccess.java b/jdk/src/share/classes/sun/jkernel/StandaloneByteArrayAccess.java deleted file mode 100644 index 1749e567db8..00000000000 --- a/jdk/src/share/classes/sun/jkernel/StandaloneByteArrayAccess.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * This is a pure subset of package-private class - * sun.security.provider.ByteArrayAccess. The subset consists of only the simple - * shift and boolean operations needed for the one current client of this - * class (sun.jkernel.StandaloneSHA) and omits optimization code and comments - * not relevant to the subset. No semantic changes have been made. - * A few long lines were broken to conform to JDK coding style. - * Pete Soper, August, 2007. - */ - -package sun.jkernel; - -/** - * Methods for converting between byte[] and int[]/long[]. - * - * @since 1.6 - * @version 1.1, 05/26/06 - * @author Andreas Sterbenz - */ -final class StandaloneByteArrayAccess { - - private StandaloneByteArrayAccess() { - // empty - } - - /** - * byte[] to int[] conversion, little endian byte order. - */ - static void b2iLittle(byte[] in, int inOfs, int[] out, int outOfs, - int len) { - len += inOfs; - while (inOfs < len) { - out[outOfs++] = ((in[inOfs ] & 0xff) ) - | ((in[inOfs + 1] & 0xff) << 8) - | ((in[inOfs + 2] & 0xff) << 16) - | ((in[inOfs + 3] ) << 24); - inOfs += 4; - } - } - - /** - * int[] to byte[] conversion, little endian byte order. - */ - static void i2bLittle(int[] in, int inOfs, byte[] out, int outOfs, - int len) { - len += outOfs; - while (outOfs < len) { - int i = in[inOfs++]; - out[outOfs++] = (byte)(i ); - out[outOfs++] = (byte)(i >> 8); - out[outOfs++] = (byte)(i >> 16); - out[outOfs++] = (byte)(i >> 24); - } - } - - /** - * byte[] to int[] conversion, big endian byte order. - */ - static void b2iBig(byte[] in, int inOfs, int[] out, int outOfs, int len) { - len += inOfs; - while (inOfs < len) { - out[outOfs++] = ((in[inOfs + 3] & 0xff) ) - | ((in[inOfs + 2] & 0xff) << 8) - | ((in[inOfs + 1] & 0xff) << 16) - | ((in[inOfs ] ) << 24); - inOfs += 4; - } - } - - /** - * int[] to byte[] conversion, big endian byte order. - */ - static void i2bBig(int[] in, int inOfs, byte[] out, int outOfs, int len) { - len += outOfs; - while (outOfs < len) { - int i = in[inOfs++]; - out[outOfs++] = (byte)(i >> 24); - out[outOfs++] = (byte)(i >> 16); - out[outOfs++] = (byte)(i >> 8); - out[outOfs++] = (byte)(i ); - } - } - - // Store one 32-bit value into out[outOfs..outOfs+3] in big endian order. - static void i2bBig4(int val, byte[] out, int outOfs) { - out[outOfs ] = (byte)(val >> 24); - out[outOfs + 1] = (byte)(val >> 16); - out[outOfs + 2] = (byte)(val >> 8); - out[outOfs + 3] = (byte)(val ); - } - - /** - * byte[] to long[] conversion, big endian byte order. - */ - static void b2lBig(byte[] in, int inOfs, long[] out, int outOfs, int len) { - len += inOfs; - while (inOfs < len) { - int i1 = ((in[inOfs + 3] & 0xff) ) - | ((in[inOfs + 2] & 0xff) << 8) - | ((in[inOfs + 1] & 0xff) << 16) - | ((in[inOfs ] ) << 24); - inOfs += 4; - int i2 = ((in[inOfs + 3] & 0xff) ) - | ((in[inOfs + 2] & 0xff) << 8) - | ((in[inOfs + 1] & 0xff) << 16) - | ((in[inOfs ] ) << 24); - out[outOfs++] = ((long)i1 << 32) | (i2 & 0xffffffffL); - inOfs += 4; - } - } - - /** - * long[] to byte[] conversion - */ - static void l2bBig(long[] in, int inOfs, byte[] out, int outOfs, int len) { - len += outOfs; - while (outOfs < len) { - long i = in[inOfs++]; - out[outOfs++] = (byte)(i >> 56); - out[outOfs++] = (byte)(i >> 48); - out[outOfs++] = (byte)(i >> 40); - out[outOfs++] = (byte)(i >> 32); - out[outOfs++] = (byte)(i >> 24); - out[outOfs++] = (byte)(i >> 16); - out[outOfs++] = (byte)(i >> 8); - out[outOfs++] = (byte)(i ); - } - } - -} diff --git a/jdk/src/share/classes/sun/jkernel/StandaloneMessageDigest.java b/jdk/src/share/classes/sun/jkernel/StandaloneMessageDigest.java deleted file mode 100644 index fc4e94d0f5c..00000000000 --- a/jdk/src/share/classes/sun/jkernel/StandaloneMessageDigest.java +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright (c) 2008, 2009, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * This is a combination and adaptation of subsets of - * java.security.MessageDigest and - * sun.security.provider.DigestBase to provide a class offering - * most of the same public methods of MessageDigest while not - * depending on the Java Security Framework. - *

- * One algorithm is currently supported: "SHA-1". - *

- * NOTE If java.security.MessageDigest, - * sun.security.provider.DigestBase or - * sun.security.provider.SHA are modified, review of those - * modifications should be done to determine any possible implications for this - * class and StandaloneSHA. - */ - -package sun.jkernel; - -import java.security.DigestException; -import java.security.ProviderException; -import java.security.NoSuchAlgorithmException; - -/** - * (Adapted from the sun.security.provider.DigestBase doc). - * This is a simple subset of the Common base message digest implementation - * for the Sun provider. - * It implements most of the JCA methods as suitable for a Java message - * digest - * implementation of an algorithm based on a compression function (as all - * commonly used algorithms are). The individual digest subclasses only need to - * implement the following methods: - * - * . abstract void implCompress(byte[] b, int ofs); - * . abstract void implDigest(byte[] out, int ofs); - * . abstract void implReset(); - *

- * No support for a clone() method is provided. - *

- * See the inline documentation for details. - * - * @since 1.5 - * @version 1.3, 08/08/07 - * @author Andreas Sterbenz (MessageDigest) - * @author Pete Soper (this derived class) - */ -public abstract class StandaloneMessageDigest { - - public static final boolean debug = false; - - /* - * (Copied/adapted from java.security.MessageDigest - * - * This is a subset/simplification java.security.MessageDigest - * that supports a fixed set of hashcode mechanisms (currently just - * SHA-1) while preserving the following MessageDigest methods: - * - * public MessageDigest getInstance(String algorithm) - * public final int getDigestLength() - * public void reset() - * public byte[] digest() - * public void update(byte[] input, int offset, int len) - * public final String getAlgorithm() - *

- * NOTE that the clone() method is not provided. - */ - - /** - * Prevent direct instantiation except via the factory method. - */ - - private StandaloneMessageDigest() { - // Keep javac happy. - digestLength = 0; - blockSize = 0; - algorithm = null; - buffer = null; - } - - private String algorithm; - - // The state of this digest - private static final int INITIAL = 0; - private static final int IN_PROGRESS = 1; - private int state = INITIAL; - - /** - * Returns a StandaloneMessageDigest object that implements the specified - * digest algorithm. - * - *

This method returns a new StandaloneMessageDigest for a single - * algorithm provider. - * - * @param algorithm the name of the algorithm requested. - * - * @return a standalone Message Digest object that implements the specified algorithm. - * - * @exception NoSuchAlgorithmException if algorithm not supported - * - */ - public static StandaloneMessageDigest getInstance(String algorithm) - throws NoSuchAlgorithmException { - if (! algorithm.equals("SHA-1")) { - throw new NoSuchAlgorithmException(algorithm + " not found"); - } else { - return new StandaloneSHA(); - } - } - - /** - * Updates the digest using the specified array of bytes, starting - * at the specified offset. - * - * @param input the array of bytes. - * - * @param offset the offset to start from in the array of bytes. - * - * @param len the number of bytes to use, starting at - * offset. - */ - public void update(byte[] input, int offset, int len) { - if (debug) { - System.out.println("StandaloneMessageDigest.update"); - (new Exception()).printStackTrace(); - } - if (input == null) { - throw new IllegalArgumentException("No input buffer given"); - } - if (input.length - offset < len) { - throw new IllegalArgumentException("Input buffer too short"); - } - // No need to check for negative offset: engineUpdate does this - - engineUpdate(input, offset, len); - state = IN_PROGRESS; - } - - /** - * Completes the hash computation by performing final operations - * such as padding. The digest is reset after this call is made. - * - * @return the array of bytes for the resulting hash value. - */ - public byte[] digest() { - if (debug) { - System.out.println("StandaloneMessageDigest.digest"); - } - /* Resetting is the responsibility of implementors. */ - byte[] result = engineDigest(); - state = INITIAL; - return result; - } - - /** - * Compares two digests for equality. Does a simple byte compare. - * - * @param digesta one of the digests to compare. - * - * @param digestb the other digest to compare. - * - * @return true if the digests are equal, false otherwise. - */ - public static boolean isEqual(byte digesta[], byte digestb[]) { - if (digesta.length != digestb.length) - return false; - - for (int i = 0; i < digesta.length; i++) { - if (digesta[i] != digestb[i]) { - return false; - } - } - return true; - } - - /** - * Resets the digest for further use. - */ - public void reset() { - if (debug) { - System.out.println("StandaloneMessageDigest.reset"); - } - engineReset(); - state = INITIAL; - } - - /** - * Returns a string that identifies the algorithm, independent of - * implementation details. The name should be a standard - * Java Security name (such as "SHA", "MD5", and so on). - * See Appendix A in the - * Java Cryptography Architecture API Specification & Reference - * for information about standard algorithm names. - * - * @return the name of the algorithm - */ - public final String getAlgorithm() { - return this.algorithm; - } - - /** - * Returns the length of the digest in bytes. - * - * @return the digest length in bytes. - * - * @since 1.2 - */ - public final int getDigestLength() { - return engineGetDigestLength(); - } - - //* End of copied/adapted java.security.MessageDigest - - // Start of copied/adapted sun.security.provider.DigestBase - - // one element byte array, temporary storage for update(byte) - private byte[] oneByte; - - // length of the message digest in bytes - private final int digestLength; - - // size of the input to the compression function in bytes - private final int blockSize; - // buffer to store partial blocks, blockSize bytes large - // Subclasses should not access this array directly except possibly in their - // implDigest() method. See MD5.java as an example. - final byte[] buffer; - // offset into buffer - private int bufOfs; - - // number of bytes processed so far. subclasses should not modify - // this value. - // also used as a flag to indicate reset status - // -1: need to call engineReset() before next call to update() - // 0: is already reset - long bytesProcessed; - - /** - * Main constructor. - */ - StandaloneMessageDigest(String algorithm, int digestLength, int blockSize) { - // super(); - this.algorithm = algorithm; - this.digestLength = digestLength; - this.blockSize = blockSize; - buffer = new byte[blockSize]; - } - - // return digest length. See JCA doc. - protected final int engineGetDigestLength() { - return digestLength; - } - - // single byte update. See JCA doc. - protected final void engineUpdate(byte b) { - if (oneByte == null) { - oneByte = new byte[1]; - } - oneByte[0] = b; - engineUpdate(oneByte, 0, 1); - } - - // array update. See JCA doc. - protected final void engineUpdate(byte[] b, int ofs, int len) { - if (len == 0) { - return; - } - if ((ofs < 0) || (len < 0) || (ofs > b.length - len)) { - throw new ArrayIndexOutOfBoundsException(); - } - if (bytesProcessed < 0) { - engineReset(); - } - bytesProcessed += len; - // if buffer is not empty, we need to fill it before proceeding - if (bufOfs != 0) { - int n = Math.min(len, blockSize - bufOfs); - System.arraycopy(b, ofs, buffer, bufOfs, n); - bufOfs += n; - ofs += n; - len -= n; - if (bufOfs >= blockSize) { - // compress completed block now - implCompress(buffer, 0); - bufOfs = 0; - } - } - // compress complete blocks - while (len >= blockSize) { - implCompress(b, ofs); - len -= blockSize; - ofs += blockSize; - } - // copy remainder to buffer - if (len > 0) { - System.arraycopy(b, ofs, buffer, 0, len); - bufOfs = len; - } - } - - // reset this object. See JCA doc. - protected final void engineReset() { - if (bytesProcessed == 0) { - // already reset, ignore - return; - } - implReset(); - bufOfs = 0; - bytesProcessed = 0; - } - - // return the digest. See JCA doc. - protected final byte[] engineDigest() throws ProviderException { - byte[] b = new byte[digestLength]; - try { - engineDigest(b, 0, b.length); - } catch (DigestException e) { - throw (ProviderException) - new ProviderException("Internal error").initCause(e); - } - return b; - } - - // return the digest in the specified array. See JCA doc. - protected final int engineDigest(byte[] out, int ofs, int len) - throws DigestException { - if (len < digestLength) { - throw new DigestException("Length must be at least " - + digestLength + " for " + algorithm + "digests"); - } - if ((ofs < 0) || (len < 0) || (ofs > out.length - len)) { - throw new DigestException("Buffer too short to store digest"); - } - if (bytesProcessed < 0) { - engineReset(); - } - implDigest(out, ofs); - bytesProcessed = -1; - return digestLength; - } - - /** - * Core compression function. Processes blockSize bytes at a time - * and updates the state of this object. - */ - abstract void implCompress(byte[] b, int ofs); - - /** - * Return the digest. Subclasses do not need to reset() themselves, - * StandaloneMessageDigest calls implReset() when necessary. - */ - abstract void implDigest(byte[] out, int ofs); - - /** - * Reset subclass specific state to their initial values. StandaloneMessageDigest - * calls this method when necessary. - */ - abstract void implReset(); - - // padding used for the MD5, and SHA-* message digests - static final byte[] padding; - - static { - // we need 128 byte padding for SHA-384/512 - // and an additional 8 bytes for the high 8 bytes of the 16 - // byte bit counter in SHA-384/512 - padding = new byte[136]; - padding[0] = (byte)0x80; - } - -} diff --git a/jdk/src/share/classes/sun/jkernel/StandaloneSHA.java b/jdk/src/share/classes/sun/jkernel/StandaloneSHA.java deleted file mode 100644 index c59c76c386e..00000000000 --- a/jdk/src/share/classes/sun/jkernel/StandaloneSHA.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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.jkernel; - -import static sun.jkernel.StandaloneByteArrayAccess.*; - -/** - * This is a slightly modified subset of the - * sun.security.provider.SHA class that - * is not dependent on the regular Java Security framework classes. It - * implements the Secure Hash Algorithm (SHA-1) developed by - * the National Institute of Standards and Technology along with the - * National Security Agency. This is the updated version of SHA - * fip-180 as superseded by fip-180-1. - *

- * The sun.security.provider.SHA.clonde() method is not - * implemented and other, formerly public methods, are package private. - * - */ -final class StandaloneSHA extends StandaloneMessageDigest { - - static final boolean debug = false; - - // Buffer of int's and count of characters accumulated - // 64 bytes are included in each hash block so the low order - // bits of count are used to know how to pack the bytes into ints - // and to know when to compute the block and start the next one. - private final int[] W; - - // state of this - private final int[] state; - - /** - * Creates a new StandaloneSHA object. - */ - StandaloneSHA() { - super("SHA-1", 20, 64); - state = new int[5]; - W = new int[80]; - implReset(); - } - - /** - * Resets the buffers and hash value to start a new hash. - */ - void implReset() { - if (debug) { - System.out.print("StandaloneSHA.implR: " ); - } - state[0] = 0x67452301; - state[1] = 0xefcdab89; - state[2] = 0x98badcfe; - state[3] = 0x10325476; - state[4] = 0xc3d2e1f0; - } - - /** - * Computes the final hash and copies the 20 bytes to the output array. - */ - void implDigest(byte[] out, int ofs) { - if (debug) { - System.out.print("StandaloneSHA.implD: " ); - } - long bitsProcessed = bytesProcessed << 3; - - int index = (int)bytesProcessed & 0x3f; - int padLen = (index < 56) ? (56 - index) : (120 - index); - - engineUpdate(padding, 0, padLen); - - // System.out.println("Inserting: " + bitsProcessed); - StandaloneByteArrayAccess.i2bBig4((int)(bitsProcessed >>> 32), buffer, 56); - StandaloneByteArrayAccess.i2bBig4((int)bitsProcessed, buffer, 60); - implCompress(buffer, 0); - - StandaloneByteArrayAccess.i2bBig(state, 0, out, ofs, 20); - } - - // Constants for each round - private final static int round1_kt = 0x5a827999; - private final static int round2_kt = 0x6ed9eba1; - private final static int round3_kt = 0x8f1bbcdc; - private final static int round4_kt = 0xca62c1d6; - - /** - * Compute a the hash for the current block. - * - * This is in the same vein as Peter Gutmann's algorithm listed in - * the back of Applied Cryptography, Compact implementation of - * "old" NIST Secure Hash Algorithm. - */ - void implCompress(byte[] buf, int ofs) { - - if (debug) { - System.out.print("StandaloneSHA.implC: " ); - for (int i=ofs; i>> 31); - } - - int a = state[0]; - int b = state[1]; - int c = state[2]; - int d = state[3]; - int e = state[4]; - - // Round 1 - for (int i = 0; i < 20; i++) { - int 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++) { - int 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++) { - int 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++) { - int 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; - } - state[0] += a; - state[1] += b; - state[2] += c; - state[3] += d; - state[4] += e; - } - -} diff --git a/jdk/src/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java b/jdk/src/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java index 3644777a420..9e9614bb09b 100644 --- a/jdk/src/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java +++ b/jdk/src/share/classes/sun/jvmstat/monitor/MonitoredVmUtil.java @@ -179,18 +179,4 @@ public class MonitoredVmUtil { } } - /** - * Returns true if the target VM is a kernel VM - * - * @param vm the target MonitoredVm - */ - public static boolean isKernelVM(MonitoredVm vm) throws MonitorException { - StringMonitor jvmCapabilities = - (StringMonitor)vm.findByName("sun.rt.jvmCapabilities"); - if (jvmCapabilities == null) { - return false; - } else { - return jvmCapabilities.stringValue().charAt(IS_KERNEL_VM) == '1'; - } - } } diff --git a/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java b/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java index d0e2e4eb842..0df465c3e66 100644 --- a/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java +++ b/jdk/src/share/classes/sun/misc/BootClassLoaderHook.java @@ -34,10 +34,7 @@ import sun.misc.URLClassPath; * BootClassLoaderHook defines an interface for a hook to inject * into the bootstrap class loader. * - * In jkernel build, the sun.jkernel.DownloadManager is set as - * a BootClassLoaderHook by the jkernel VM after the VM is initialized. - * - * In other JDK builds, no hook is set. + * With jkernel now removed, no hook is set */ public abstract class BootClassLoaderHook { private static BootClassLoaderHook bootLoaderHook = null; diff --git a/jdk/src/share/classes/sun/tools/attach/HotSpotAttachProvider.java b/jdk/src/share/classes/sun/tools/attach/HotSpotAttachProvider.java index 313936db6ce..1511590abb7 100644 --- a/jdk/src/share/classes/sun/tools/attach/HotSpotAttachProvider.java +++ b/jdk/src/share/classes/sun/tools/attach/HotSpotAttachProvider.java @@ -138,7 +138,6 @@ public abstract class HotSpotAttachProvider extends AttachProvider { */ void testAttachable(String id) throws AttachNotSupportedException { MonitoredVm mvm = null; - boolean isKernelVM = false; try { VmIdentifier vmid = new VmIdentifier(id); MonitoredHost host = MonitoredHost.getMonitoredHost(vmid); @@ -148,7 +147,6 @@ public abstract class HotSpotAttachProvider extends AttachProvider { // it's attachable; so return false return; } - isKernelVM = MonitoredVmUtil.isKernelVM(mvm); } catch (Throwable t) { if (t instanceof ThreadDeath) { ThreadDeath td = (ThreadDeath)t; @@ -163,11 +161,8 @@ public abstract class HotSpotAttachProvider extends AttachProvider { } // we're sure it's not attachable; throw exception - if (isKernelVM) { - throw new AttachNotSupportedException("Kernel VM does not support the attach mechanism"); - } else { - throw new AttachNotSupportedException("The VM does not support the attach mechanism"); - } + throw new AttachNotSupportedException( + "The VM does not support the attach mechanism"); } diff --git a/jdk/src/windows/bin/java_md.c b/jdk/src/windows/bin/java_md.c index 97e4a803657..dfa50ac8af8 100644 --- a/jdk/src/windows/bin/java_md.c +++ b/jdk/src/windows/bin/java_md.c @@ -49,7 +49,6 @@ static jboolean GetPublicJREHome(char *path, jint pathsize); static jboolean GetJVMPath(const char *jrepath, const char *jvmtype, char *jvmpath, jint jvmpathsize); static jboolean GetJREPath(char *path, jint pathsize); -static void EnsureJreInstallation(const char *jrepath); /* We supports warmup for UI stack that is performed in parallel * to VM initialization. @@ -201,9 +200,6 @@ CreateExecutionEnvironment(int *pargc, char ***pargv, exit(2); } - /* Do this before we read jvm.cfg and after jrepath is initialized */ - EnsureJreInstallation(jrepath); - /* Find the specified JVM type */ if (ReadKnownVMs(jrepath, (char*)GetArch(), JNI_FALSE) < 1) { JLI_ReportErrorMessage(CFG_ERROR7); @@ -296,68 +292,6 @@ LoadMSVCRT() return JNI_TRUE; } -/* - * The preJVMStart is a function in the jkernel.dll, which - * performs the final step of synthesizing back the decomposed - * modules (partial install) to the full JRE. Any tool which - * uses the JRE must peform this step to ensure the complete synthesis. - * The EnsureJreInstallation function calls preJVMStart based on - * the conditions outlined below, noting that the operation - * will fail silently if any of conditions are not met. - * NOTE: this call must be made before jvm.dll is loaded, or jvm.cfg - * is read, since jvm.cfg will be modified by the preJVMStart. - * 1. Are we on a supported platform. - * 2. Find the location of the JRE or the Kernel JRE. - * 3. check existence of JREHOME/lib/bundles - * 4. check jkernel.dll and invoke the entry-point - */ -typedef VOID (WINAPI *PREJVMSTART)(); - -static void -EnsureJreInstallation(const char* jrepath) -{ - HINSTANCE handle; - char tmpbuf[MAXPATHLEN]; - PREJVMSTART PreJVMStart; - struct stat s; - - /* Make sure the jrepath contains something */ - if ((void*)jrepath[0] == NULL) { - return; - } - /* 32 bit windows only please */ - if (JLI_StrCmp(GetArch(), "i386") != 0 ) { - return; - } - /* Does our bundle directory exist ? */ - JLI_Snprintf(tmpbuf, sizeof(tmpbuf), "%s\\lib\\bundles", jrepath); - JLI_TraceLauncher("EnsureJreInstallation: %s\n", tmpbuf); - if (stat(tmpbuf, &s) != 0) { - return; - } - /* Does our jkernel dll exist ? */ - JLI_Snprintf(tmpbuf, sizeof(tmpbuf), "%s\\bin\\jkernel.dll", jrepath); - if (stat(tmpbuf, &s) != 0) { - return; - } - /* The Microsoft C Runtime Library needs to be loaded first. */ - if (!LoadMSVCRT()) { - return; - } - /* Load the jkernel.dll */ - if ((handle = LoadLibrary(tmpbuf)) == 0) { - return; - } - /* Get the function address */ - PreJVMStart = (PREJVMSTART)GetProcAddress(handle, "preJVMStart"); - if (PreJVMStart == NULL) { - FreeLibrary(handle); - return; - } - PreJVMStart(); - FreeLibrary(handle); - return; -} /* * Find path to JRE based on .exe's location or registry settings. diff --git a/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp b/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp deleted file mode 100644 index fabcd0468b8..00000000000 --- a/jdk/src/windows/native/sun/jkernel/DownloadDialog.cpp +++ /dev/null @@ -1,894 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - */ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define STRICT -#ifndef _WIN32_WINNT -/* REMIND : 0x500 means Windows 2000 .. seems like we can update - * for Windows XP when we move the SDK and build platform - */ -#define _WIN32_WINNT 0x0500 -#endif -#define _ATL_APARTMENT_THREADED - -#include -//You may derive a class from CComModule and use it if you want to override -//something, but do not change the name of _Module -extern CComModule _Module; -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "DownloadDialog.h" - -#define UPDATE_INTERVAL 500 -#define INITIAL_DELAY 2000 -#define POST_DELAY 1000 - -///////////////////////////////////////////////////////////////////////////// -// CDownloadDialog - -typedef BOOL (WINAPI * InitCommonControlsType)(); - -CDownloadDialog::CDownloadDialog() -{ - m_numDownloadThreadsRunning = 0; - - m_destroyWindowTimerStarted = FALSE; - m_pszFileName = NULL; - m_jvm = NULL; - - m_ulProgress = 0; - m_ulProgressMax = 0; - m_iProgressFactor = 0; - m_iMaxProgressFactor = 1; - - - m_hCancelEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); - m_hDownloadThreadExitEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); - m_hDialogInitializedEvent = ::CreateEvent(NULL, TRUE, FALSE, NULL); - - // Load up commctrl.dll - // Loading dll dynamically we can use latest available version - // (i.e. latest native components and extended API) - HMODULE hModComCtl32 = ::LoadLibrary(TEXT("comctl32.dll")); - if (hModComCtl32 != NULL) { - /* Initialize controls to ensure proper appearance */ - InitCommonControlsType fn_InitCommonControls = (InitCommonControlsType) - ::GetProcAddress(hModComCtl32, "InitCommonControls"); - fn_InitCommonControls(); - - /* MessageBox replacement introduced in Vista */ - taskDialogFn = (TaskDialogIndirectFn) - ::GetProcAddress(hModComCtl32, "TaskDialogIndirect"); - } -} - - -CDownloadDialog::~CDownloadDialog() -{ - ::CloseHandle(m_hCancelEvent); - ::CloseHandle(m_hDownloadThreadExitEvent); - ::CloseHandle(m_hDialogInitializedEvent); -} - -void CDownloadDialog::addToTotalContentLength(DWORD contentLength) { - __try - { - m_csDownload.Lock(); - if (m_ulProgressMax == 0) { - // first download this session, initialize start time - time(&m_startTime); - } - - m_ulProgressMax = m_ulProgressMax + contentLength; - logProgress(); - } - __finally - { - m_csDownload.Unlock(); - } -} - - - -void CDownloadDialog::initDialogText(LPCTSTR downloadURL, LPCTSTR bundleName) { - - // reset status text - HWND hStatusWnd = GetDlgItem(IDC_TIME_REMAINING); - ::SetWindowText(hStatusWnd, ""); - - // reset progress bar - HWND hProgressWnd = GetDlgItem(IDC_DOWNLOAD_PROGRESS); - - ::PostMessage(hProgressWnd, PBM_SETPOS, (WPARAM) 0, NULL); - - m_hMastheadFont = NULL; - m_hDialogFont = NULL; - m_hSixPointFont = NULL; - - m_hMemDC = NULL; - - TCHAR szDownloadText[BUFFER_SIZE]; - - HWND hWndDownloadText = GetDlgItem(IDC_DOWNLOAD_TEXT); - ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD_TEXT, szDownloadText, BUFFER_SIZE); - ::SetWindowText(hWndDownloadText, szDownloadText); - - TCHAR szMasthead[BUFFER_SIZE]; - - HWND hWndMastheadText = GetDlgItem(IDC_MASTHEAD_TEXT); - ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD, szMasthead, BUFFER_SIZE); - ::SetWindowText(hWndMastheadText, szMasthead); - - -} - -BOOL CDownloadDialog::isDownloading() { - return m_numDownloadThreadsRunning > 0; -} - - -void CDownloadDialog::bundleInstallStart() { - __try - { - m_csNumDownloadThreads.Lock(); - m_numDownloadThreadsRunning++; - // another download request has came in, kill the destroyWindowTimer - KillTimer(destroyWindowTimerID); - m_destroyWindowTimerStarted = FALSE; - } - __finally - { - m_csNumDownloadThreads.Unlock(); - } -} - -void CDownloadDialog::bundleInstallComplete() { - __try - { - m_csNumDownloadThreads.Lock(); - m_numDownloadThreadsRunning = max(m_numDownloadThreadsRunning - 1, 0); - if (m_numDownloadThreadsRunning == 0) { - m_ulProgress = m_ulProgressMax; - logProgress(); - } - // Signal main thread - ::SetEvent(m_hDownloadThreadExitEvent); - } - __finally - { - m_csNumDownloadThreads.Unlock(); - } -} - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::OnInitDialog -//=--------------------------------------------------------------------------= -// Message handler for WM_INITDIALOG -// -// Parameters: -// uMsg Windows Message -// wParam WPARAM -// lParam LPARAM -// bHandled FALSE if not handled -// -// Output: -// LRESULT -// -// Notes: -// -LRESULT CDownloadDialog::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - __try - { - m_csDownload.Lock(); - } - __finally - { - m_csDownload.Unlock(); - } - // Set timer - SetTimer(iTimerID, UPDATE_INTERVAL); - - m_hMastheadFont = NULL; - m_hDialogFont = NULL; - m_hSixPointFont = NULL; - m_feedbackOnCancel = TRUE; - - m_hMemDC = NULL; - - TCHAR szDownloadText[BUFFER_SIZE]; - - HWND hWndDownloadText = GetDlgItem(IDC_DOWNLOAD_TEXT); - ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD_TEXT, szDownloadText, BUFFER_SIZE); - ::SetWindowText(hWndDownloadText, szDownloadText); - - TCHAR szMasthead[BUFFER_SIZE]; - - HWND hWndMastheadText = GetDlgItem(IDC_MASTHEAD_TEXT); - ::LoadString(_Module.GetModuleInstance(), IDS_DOWNLOAD, szMasthead, BUFFER_SIZE); - ::SetWindowText(hWndMastheadText, szMasthead); - - HICON javaCupIcon = ::LoadIcon(_Module.GetModuleInstance(), MAKEINTRESOURCE(IDI_JAVA)); - SetIcon(javaCupIcon, FALSE); - - ::SetEvent(m_hDialogInitializedEvent); - - return 0; // do not set initial focus to cancel button -} - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::OnOK -//=--------------------------------------------------------------------------= -// Message handler for WM_COMMAND with IDOK -// -// Parameters: -// wNotifyCode Notify Code -// wID ID of control -// hWndCtl HWND of control -// bHandled FALSE if not handled -// -// Output: -// LRESULT -// -// Notes: -// -LRESULT CDownloadDialog::OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - // do nothing for now - return 0; -} - - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::OnCancel -//=--------------------------------------------------------------------------= -// Message handler for WM_COMMAND with IDCANCEL -// -// Parameters: -// wNotifyCode Notify Code -// wID ID of control -// hWndCtl HWND of control -// bHandled FALSE if not handled -// -// Output: -// LRESULT -// -// Notes: -// -LRESULT CDownloadDialog::OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) -{ - // Disable window first to avoid any keyboard input - EnableWindow(FALSE); - - if (m_feedbackOnCancel) { - int r = SafeMessageBox(IDS_DOWNLOAD_CANCEL_MESSAGE, - IDS_DOWNLOAD_CANCEL_INSTRUCTION, - IDS_DOWNLOAD_CANCEL_CAPTION, - DIALOG_WARNING_CANCELOK, - NULL, NULL); - if (!::IsWindow(hWndCtl)) { - /* It is possible that download was finished and download - window hidden by the time user close this message box. - If such case we should simply return. */ - return 0; - } - if (r == IDCANCEL) { - EnableWindow(TRUE); - return 0; - } - } - - __try - { - m_csDownload.Lock(); - // if we are downloading, signal download thread to stop downloading - if (m_numDownloadThreadsRunning > 0) { - SetEvent(m_hCancelEvent); - } - } - __finally - { - m_csDownload.Unlock(); - } - - // Kill timer - KillTimer(iTimerID); - KillTimer(destroyWindowTimerID); - - FreeGDIResources(); - - // Destroy dialog - EndDialog(wID); - - return 0; -} - -void CDownloadDialog::destroyDialog() { - m_feedbackOnCancel = FALSE; - ::PostMessage(m_hWnd, WM_COMMAND, IDCANCEL, NULL); -} - - -void CDownloadDialog::delayedDoModal() { - __try - { - __try - { - m_csMessageBox.Lock(); - m_dialogUp = true; - Sleep(INITIAL_DELAY); - } - __finally - { - m_csMessageBox.Unlock(); - } - - if (isDownloading()) - DoModal(); - } - __finally - { - m_dialogUp = false; - } -} - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::SafeMessageBox -//=--------------------------------------------------------------------------= -// Helper method that uses best availble API to show native error/information -// dialog. In particular, it uses TaskDialog if availble (Vista specific) -// and MessageBox otherwise. -// -// It also ensures that the message box is always displayed on top of -// the progress dialog instead of underneath -// - -//helper structures to define XP vs Vista style differences -static TASKDIALOG_COMMON_BUTTON_FLAGS vistaDialogButtons[] = { - TDCBF_RETRY_BUTTON | TDCBF_CANCEL_BUTTON, - TDCBF_OK_BUTTON | TDCBF_CANCEL_BUTTON -}; -static PCWSTR vistaIcons[] = { - TD_ERROR_ICON, - TD_WARNING_ICON -}; - -static UINT xpStyle[] = { - MB_ICONERROR | MB_RETRYCANCEL, - MB_ICONWARNING | MB_OKCANCEL | MB_DEFBUTTON2 -}; - -int CDownloadDialog::SafeMessageBox(UINT details, UINT mainInstruction, UINT caption, DialogType type, LPCWSTR instructionArg, LPCWSTR detailsArg) { - WCHAR textCaption[BUFFER_SIZE+1]; - WCHAR textDetails[BUFFER_SIZE+1]; - WCHAR textInstruction[BUFFER_SIZE+1]; - WCHAR tmpBuffer[BUFFER_SIZE+1]; - - /* make sure buffers are terminated */ - textCaption[BUFFER_SIZE] = textDetails[BUFFER_SIZE] = 0; - textInstruction[BUFFER_SIZE] = tmpBuffer[BUFFER_SIZE] = 0; - - if (detailsArg != NULL) { - ::LoadStringW(_Module.GetResourceInstance(), - details, - tmpBuffer, - BUFFER_SIZE); - _snwprintf(textDetails, BUFFER_SIZE, tmpBuffer, detailsArg); - } else { - ::LoadStringW(_Module.GetResourceInstance(), - details, - textDetails, - BUFFER_SIZE); - } - - if (instructionArg != NULL) { - ::LoadStringW(_Module.GetResourceInstance(), - mainInstruction, - tmpBuffer, - BUFFER_SIZE); - _snwprintf(textInstruction, BUFFER_SIZE, tmpBuffer, instructionArg); - } else { - ::LoadStringW(_Module.GetResourceInstance(), - mainInstruction, - textInstruction, - BUFFER_SIZE); - } - - ::LoadStringW(_Module.GetResourceInstance(), - caption, - textCaption, - BUFFER_SIZE); - - __try - { - m_csMessageBox.Lock(); - if (m_dialogUp) { - waitUntilInitialized(); - } - /* If TaskDialog availble - use it! */ - if (taskDialogFn != NULL) { - TASKDIALOGCONFIG tc = { 0 }; - int nButton; - - tc.cbSize = sizeof(tc); - tc.hwndParent = ::IsWindow(m_hWnd) ? m_hWnd : NULL; - tc.dwCommonButtons = vistaDialogButtons[type]; - tc.pszWindowTitle = textCaption; - tc.pszMainInstruction = textInstruction; - tc.pszContent = textDetails; - tc.pszMainIcon = vistaIcons[type]; - /* workaround: we need to make sure Cancel is default - for this type of Dialog */ - if (type == DIALOG_WARNING_CANCELOK) { - tc.nDefaultButton = IDCANCEL; - } - - taskDialogFn(&tc, &nButton, NULL, NULL); - return nButton; - } else { /* default: use MessageBox */ - /* Note that MessageBox API expects content as single string - and therefore we need to concatenate instruction - and details as 2 paragraphs. - - The only exception is empty instruction. */ - if (wcslen(textInstruction) > 0) { - wcsncat(textInstruction, L"\n\n", - BUFFER_SIZE - wcslen(textInstruction)); - } - wcsncat(textInstruction, textDetails, - BUFFER_SIZE - wcslen(textInstruction)); - - return ::MessageBoxW(::IsWindow(m_hWnd) ? m_hWnd : NULL, - textInstruction, textCaption, xpStyle[type]); - } - } - __finally - { - m_csMessageBox.Unlock(); - } -} - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::OnTimer -//=--------------------------------------------------------------------------= -// Message handler for WM_TIMER -// -// Parameters: -// uMsg Windows Message -// wParam WPARAM -// lParam LPARAM -// bHandled FALSE if not handled -// -// Output: -// LRESULT -// -// Notes: -// -LRESULT CDownloadDialog::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - if (destroyWindowTimerID == (int)wParam) { - KillTimer(destroyWindowTimerID); - m_destroyWindowTimerStarted = FALSE; - m_ulProgressMax = max(0, m_ulProgressMax - m_ulProgress); - logProgress(); - m_ulProgress = 0; - logProgress(); - m_feedbackOnCancel = FALSE; - ::PostMessage(m_hWnd, WM_COMMAND, IDCANCEL, NULL); - } - - if (iTimerID == (int)wParam) - { - - __try - { - m_csDownload.Lock(); - - HWND hStatusWnd = GetDlgItem(IDC_TIME_REMAINING); - HWND hProgressWnd = GetDlgItem(IDC_DOWNLOAD_PROGRESS); - - if (m_ulProgress && m_ulProgressMax) - { - ::PostMessage(hProgressWnd, PBM_SETPOS, - (WPARAM) (m_ulProgress * 100 - / m_ulProgressMax), NULL); - - time_t currentTime; - time(¤tTime); - - double elapsed_time = difftime(currentTime, m_startTime); - double remain_time = (elapsed_time / m_ulProgress) * - (m_ulProgressMax - m_ulProgress); - int hr = 0, min = 0; - - if (remain_time > 60 * 60) - { - hr = int(remain_time / (60 * 60)); - remain_time = remain_time - hr * 60 * 60; - } - - if (remain_time > 60) - { - min = int(remain_time / 60); - remain_time = remain_time - min * 60; - } - - TCHAR szBuffer[BUFFER_SIZE]; - TCHAR szTimeBuffer[BUFFER_SIZE]; - - if (hr > 0) - { - if (hr > 1) - LoadString(_Module.GetResourceInstance(), IDS_HOURSMINUTESECOND, - szTimeBuffer, BUFFER_SIZE); - else - LoadString(_Module.GetResourceInstance(), IDS_HOURMINUTESECOND, - szTimeBuffer, BUFFER_SIZE); - - sprintf(szBuffer, szTimeBuffer, hr, min, remain_time); - } - else - { - if (min > 0) - { - LoadString(_Module.GetResourceInstance(), IDS_MINUTESECOND, - szTimeBuffer, BUFFER_SIZE); - sprintf(szBuffer, szTimeBuffer, min, remain_time); - - } - else - { - LoadString(_Module.GetResourceInstance(), IDS_SECOND, - szTimeBuffer, BUFFER_SIZE); - sprintf(szBuffer, szTimeBuffer, remain_time); - - } - } - - if (m_ulProgress == m_ulProgressMax) { - // download is done, unpacking bundle now, and waiting - // for another download to take place - ::LoadString(_Module.GetResourceInstance(), - IDS_DOWNLOAD_UNPACKING, szBuffer, BUFFER_SIZE); - __try - { - m_csNumDownloadThreads.Lock(); - // both download and unpacking is done, start - // timer to destroy the progress window in 500ms - if (!m_destroyWindowTimerStarted && - m_numDownloadThreadsRunning == 0) { - SetTimer(destroyWindowTimerID, POST_DELAY); - m_destroyWindowTimerStarted = TRUE; - } - } - __finally - { - m_csNumDownloadThreads.Unlock(); - } - } - - // Update status message - ::SetWindowText(hStatusWnd, szBuffer); - } - } - __finally - { - m_csDownload.Unlock(); - } - } - - return 0; -} - -// Message handler for WM_ONCTLCOLORSTATIC. -// this message is sent each time a static control is drawn. -// we get the Control ID and then set background color and font -// as appropriate for that control. -LRESULT CDownloadDialog::OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) -{ - HDC hdc = (HDC) wParam; - HWND hwnd = (HWND) lParam; - - int DlgCtrlID = ::GetDlgCtrlID(hwnd); - - if (DlgCtrlID == IDC_DOWNLOAD_TEXT ) - { - if (m_hDialogFont == NULL) - { - m_hDialogFont = CreateDialogFont(hdc, TEXT("MS Shell Dlg"), 8); - } - - ::SelectObject(hdc, m_hDialogFont); - return 0; - } - else if (DlgCtrlID == IDC_TIME_REMAINING) - { - if (m_hSixPointFont == NULL) - { - m_hSixPointFont = CreateDialogFont(hdc, TEXT("MS Shell Dlg"), 8); - } - - ::SelectObject(hdc, m_hSixPointFont); - return 0; - } - else if (DlgCtrlID == IDC_MASTHEAD_TEXT) - { - if (m_hMastheadFont == NULL) - { - m_hMastheadFont = CreateDialogFont(hdc, TEXT("MS Shell Dlg"), 12, 1); - } - - ::SelectObject(hdc, m_hMastheadFont); - return (LRESULT) GetStockObject(WHITE_BRUSH); - } - else if (DlgCtrlID == IDC_DOWNLOAD_MASTHEAD) - { - if (m_hMemDC == NULL) - { - m_hBitmap = LoadBitmap(_Module.GetModuleInstance(), - MAKEINTRESOURCE(IDI_MASTHEAD)); - GetObject(m_hBitmap, sizeof(BITMAP), &m_bmMasthead); - m_hMemDC = CreateCompatibleDC(NULL); - SelectObject(m_hMemDC, m_hBitmap); - } - - RECT rect; - ::GetClientRect(hwnd, &rect); - - StretchBlt(hdc, rect.left, rect.top, (rect.right - rect.left), (rect.bottom - rect.top), - m_hMemDC, 0, 0, m_bmMasthead.bmWidth, m_bmMasthead.bmHeight, SRCCOPY); - - return (LRESULT) GetStockObject(NULL_BRUSH); - } - - - return 0; -} - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::OnStartBinding -//=--------------------------------------------------------------------------= -// Called when download is started -// -// Parameters: -// -// Output: -// HRESULT -// -// Notes: -// -STDMETHODIMP CDownloadDialog::OnStartBinding() -{ - __try - { - m_csDownload.Lock(); - time(&m_startTime); - } - __finally - { - m_csDownload.Unlock(); - } - - return S_OK; -} - - -//=--------------------------------------------------------------------------= -// CDownloadDialog::OnProgress -//=--------------------------------------------------------------------------= -// Called when download is in progress -// -// Parameters: ULONG ulProgress -// -// Output: -// HRESULT -// -// Notes: -// -STDMETHODIMP CDownloadDialog::OnProgress(ULONG ulProgress) -{ - __try - { - m_csDownload.Lock(); - m_ulProgress = m_ulProgress + ulProgress; - logProgress(); - - } - __finally - { - m_csDownload.Unlock(); - } - - return S_OK; -} - -void CDownloadDialog::decrementProgressMax(ULONG contentLength, ULONG readSoFar) { - __try - { - m_csDownload.Lock(); - m_ulProgressMax = m_ulProgressMax - contentLength; - m_ulProgress = m_ulProgress - readSoFar; - logProgress(); - } - __finally - { - m_csDownload.Unlock(); - } - -} - -void CDownloadDialog::waitUntilInitialized() { - // wait until download progress dialog is initialized and ready to show - WaitForSingleObject(m_hDialogInitializedEvent, INFINITE); - ResetEvent(m_hDialogInitializedEvent); - -} - -// Check if download has been cancelled -BOOL CDownloadDialog::isDownloadCancelled() { - if (WAIT_OBJECT_0 == WaitForSingleObject(m_hCancelEvent, 0)) { - return TRUE; - } - return FALSE; -} - - - -// Create the fonts we need for the download and -// install UE -HFONT CDownloadDialog::CreateDialogFont(HDC hdc, LPCTSTR lpszFaceName, int ptSize, int isBold) -{ - POINT pt; - FLOAT cxDPI, cyDPI; - HFONT hFont; - LOGFONT lf; - - int iDeciPtWidth = 0; - int iDeciPtHeight = 10 * ptSize; - - int iSavedDC = SaveDC(hdc); - - SetGraphicsMode (hdc, GM_ADVANCED); - ModifyWorldTransform(hdc, NULL, MWT_IDENTITY); - SetViewportOrgEx (hdc, 0,0, NULL); - SetWindowOrgEx (hdc, 0,0, NULL); - - cxDPI = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSX); - cyDPI = (FLOAT) GetDeviceCaps(hdc, LOGPIXELSY); - - pt.x = (int) (iDeciPtWidth * cxDPI / 72); - pt.y = (int) (iDeciPtHeight * cyDPI / 72); - - DPtoLP(hdc, &pt, 1); - - lf.lfHeight = - (int) (fabs ((double) pt.y) / 10.0 + 0.5); - lf.lfWidth = 0; - lf.lfEscapement = 0; - lf.lfOrientation = 0; - lf.lfWeight = (isBold > 0) ? FW_BOLD : 0; - lf.lfItalic = 0; - lf.lfUnderline = 0; - lf.lfStrikeOut = 0; - lf.lfCharSet = 0; - lf.lfOutPrecision = 0; - lf.lfClipPrecision = 0; - lf.lfQuality = 0; - lf.lfPitchAndFamily = 0; - - TCHAR szLocaleData[BUFFER_SIZE]; - GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SENGCOUNTRY, - szLocaleData, BUFFER_SIZE); - - if (strncmp(szLocaleData, "Japan", 5) == 0) { - // need special font for _ja locale - strcpy (lf.lfFaceName, TEXT("MS UI Gothic")); - } else { - strcpy (lf.lfFaceName, lpszFaceName); - } - - hFont = CreateFontIndirect(&lf); - - RestoreDC (hdc, iSavedDC); - return hFont; -} - -void CDownloadDialog::FreeGDIResources () -{ - ::DeleteObject(m_hMastheadFont); - m_hMastheadFont = NULL; - - ::DeleteObject(m_hDialogFont); - m_hDialogFont = NULL; - - ::DeleteObject(m_hSixPointFont); - m_hSixPointFont = NULL; - - ::DeleteObject(m_hBitmap); - m_hBitmap = NULL; - - ::DeleteDC(m_hMemDC); - m_hMemDC = NULL; -} - - -JNIEnv* CDownloadDialog::getJNIEnv() { - if (m_jvm == NULL) - return NULL; - JNIEnv *env; - m_jvm->AttachCurrentThread((void**) &env, NULL); - return env; -} - - -void CDownloadDialog::log(char *msg) { - JNIEnv *env = getJNIEnv(); - if (env != NULL) { - jclass dm = env->FindClass("sun/jkernel/DownloadManager"); - if (dm == NULL) { - printf("Cound not find class sun.jkernel.DownloadManager\n"); - return; - } - jmethodID log = env->GetStaticMethodID(dm, "log", "(Ljava/lang/String;)V"); - if (log == NULL) { - printf("Could not find method sun.jkernel.DownloadManager.log(String)\n"); - return; - } - jstring string = env->NewStringUTF(msg); - if (string == NULL) { - printf("Error creating log string\n"); - return; - } - env->CallStaticVoidMethod(dm, log, string); - } -} - - -void CDownloadDialog::logProgress() { - char msg[256]; - sprintf(msg, "Progress: %d / %d", m_ulProgress, m_ulProgressMax); - log(msg); -} diff --git a/jdk/src/windows/native/sun/jkernel/DownloadDialog.h b/jdk/src/windows/native/sun/jkernel/DownloadDialog.h deleted file mode 100644 index a8f68f6f1cc..00000000000 --- a/jdk/src/windows/native/sun/jkernel/DownloadDialog.h +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -// -// DownloadDialog.h : Declaration of the CDownloadDialog -// - -#ifndef __DOWNLOADDIALOG_H_ -#define __DOWNLOADDIALOG_H_ - -#include "resource.h" // main symbols -#include -#include "jni.h" - -#ifndef BUFFER_SIZE -#define BUFFER_SIZE 2048 -#endif - -#define iTimerID 1000 -#define destroyWindowTimerID 2000 - -#define E_JDHELPER_TIMEOUT 12002 -#define E_JDHELPER_NAME_NOT_RESOLVED 12007 -#define E_JDHELPER_CANNOT_CONNECT 12029 - -/* Following lines were copied from the new version of commctrl.h - These definitions are not available in default version of - this header file in VS 2003 but they are needed to use - new Vista task dialog API. -*/ -#ifndef TD_ERROR_ICON - -/* These modifiers have sense with new VS only, - reset them to get code to compile */ -#define __in -#define __in_opt -#define __out_opt - -#ifdef _WIN32 -#include -#endif - - -typedef HRESULT (CALLBACK *PFTASKDIALOGCALLBACK)(HWND hwnd, __in UINT msg, __in WPARAM wParam, __in LPARAM lParam, __in LONG_PTR lpRefData); - -enum _TASKDIALOG_FLAGS -{ - TDF_ENABLE_HYPERLINKS = 0x0001, - TDF_USE_HICON_MAIN = 0x0002, - TDF_USE_HICON_FOOTER = 0x0004, - TDF_ALLOW_DIALOG_CANCELLATION = 0x0008, - TDF_USE_COMMAND_LINKS = 0x0010, - TDF_USE_COMMAND_LINKS_NO_ICON = 0x0020, - TDF_EXPAND_FOOTER_AREA = 0x0040, - TDF_EXPANDED_BY_DEFAULT = 0x0080, - TDF_VERIFICATION_FLAG_CHECKED = 0x0100, - TDF_SHOW_PROGRESS_BAR = 0x0200, - TDF_SHOW_MARQUEE_PROGRESS_BAR = 0x0400, - TDF_CALLBACK_TIMER = 0x0800, - TDF_POSITION_RELATIVE_TO_WINDOW = 0x1000, - TDF_RTL_LAYOUT = 0x2000, - TDF_NO_DEFAULT_RADIO_BUTTON = 0x4000, - TDF_CAN_BE_MINIMIZED = 0x8000 -}; -typedef int TASKDIALOG_FLAGS; // Note: _TASKDIALOG_FLAGS is an int - -typedef enum _TASKDIALOG_MESSAGES -{ - TDM_NAVIGATE_PAGE = WM_USER+101, - TDM_CLICK_BUTTON = WM_USER+102, // wParam = Button ID - TDM_SET_MARQUEE_PROGRESS_BAR = WM_USER+103, // wParam = 0 (nonMarque) wParam != 0 (Marquee) - TDM_SET_PROGRESS_BAR_STATE = WM_USER+104, // wParam = new progress state - TDM_SET_PROGRESS_BAR_RANGE = WM_USER+105, // lParam = MAKELPARAM(nMinRange, nMaxRange) - TDM_SET_PROGRESS_BAR_POS = WM_USER+106, // wParam = new position - TDM_SET_PROGRESS_BAR_MARQUEE = WM_USER+107, // wParam = 0 (stop marquee), wParam != 0 (start marquee), lparam = speed (milliseconds between repaints) - TDM_SET_ELEMENT_TEXT = WM_USER+108, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR) - TDM_CLICK_RADIO_BUTTON = WM_USER+110, // wParam = Radio Button ID - TDM_ENABLE_BUTTON = WM_USER+111, // lParam = 0 (disable), lParam != 0 (enable), wParam = Button ID - TDM_ENABLE_RADIO_BUTTON = WM_USER+112, // lParam = 0 (disable), lParam != 0 (enable), wParam = Radio Button ID - TDM_CLICK_VERIFICATION = WM_USER+113, // wParam = 0 (unchecked), 1 (checked), lParam = 1 (set key focus) - TDM_UPDATE_ELEMENT_TEXT = WM_USER+114, // wParam = element (TASKDIALOG_ELEMENTS), lParam = new element text (LPCWSTR) - TDM_SET_BUTTON_ELEVATION_REQUIRED_STATE = WM_USER+115, // wParam = Button ID, lParam = 0 (elevation not required), lParam != 0 (elevation required) - TDM_UPDATE_ICON = WM_USER+116 // wParam = icon element (TASKDIALOG_ICON_ELEMENTS), lParam = new icon (hIcon if TDF_USE_HICON_* was set, PCWSTR otherwise) -} TASKDIALOG_MESSAGES; - -typedef enum _TASKDIALOG_NOTIFICATIONS -{ - TDN_CREATED = 0, - TDN_NAVIGATED = 1, - TDN_BUTTON_CLICKED = 2, // wParam = Button ID - TDN_HYPERLINK_CLICKED = 3, // lParam = (LPCWSTR)pszHREF - TDN_TIMER = 4, // wParam = Milliseconds since dialog created or timer reset - TDN_DESTROYED = 5, - TDN_RADIO_BUTTON_CLICKED = 6, // wParam = Radio Button ID - TDN_DIALOG_CONSTRUCTED = 7, - TDN_VERIFICATION_CLICKED = 8, // wParam = 1 if checkbox checked, 0 if not, lParam is unused and always 0 - TDN_HELP = 9, - TDN_EXPANDO_BUTTON_CLICKED = 10 // wParam = 0 (dialog is now collapsed), wParam != 0 (dialog is now expanded) -} TASKDIALOG_NOTIFICATIONS; - -typedef struct _TASKDIALOG_BUTTON -{ - int nButtonID; - PCWSTR pszButtonText; -} TASKDIALOG_BUTTON; - -typedef enum _TASKDIALOG_ELEMENTS -{ - TDE_CONTENT, - TDE_EXPANDED_INFORMATION, - TDE_FOOTER, - TDE_MAIN_INSTRUCTION -} TASKDIALOG_ELEMENTS; - -typedef enum _TASKDIALOG_ICON_ELEMENTS -{ - TDIE_ICON_MAIN, - TDIE_ICON_FOOTER -} TASKDIALOG_ICON_ELEMENTS; - -#define TD_WARNING_ICON MAKEINTRESOURCEW(-1) -#define TD_ERROR_ICON MAKEINTRESOURCEW(-2) -#define TD_INFORMATION_ICON MAKEINTRESOURCEW(-3) -#define TD_SHIELD_ICON MAKEINTRESOURCEW(-4) - - -enum _TASKDIALOG_COMMON_BUTTON_FLAGS -{ - TDCBF_OK_BUTTON = 0x0001, // selected control return value IDOK - TDCBF_YES_BUTTON = 0x0002, // selected control return value IDYES - TDCBF_NO_BUTTON = 0x0004, // selected control return value IDNO - TDCBF_CANCEL_BUTTON = 0x0008, // selected control return value IDCANCEL - TDCBF_RETRY_BUTTON = 0x0010, // selected control return value IDRETRY - TDCBF_CLOSE_BUTTON = 0x0020 // selected control return value IDCLOSE -}; -typedef int TASKDIALOG_COMMON_BUTTON_FLAGS; // Note: _TASKDIALOG_COMMON_BUTTON_FLAGS is an int - -typedef struct _TASKDIALOGCONFIG -{ - UINT cbSize; - HWND hwndParent; - HINSTANCE hInstance; // used for MAKEINTRESOURCE() strings - TASKDIALOG_FLAGS dwFlags; // TASKDIALOG_FLAGS (TDF_XXX) flags - TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons; // TASKDIALOG_COMMON_BUTTON (TDCBF_XXX) flags - PCWSTR pszWindowTitle; // string or MAKEINTRESOURCE() - union - { - HICON hMainIcon; - PCWSTR pszMainIcon; - }; - PCWSTR pszMainInstruction; - PCWSTR pszContent; - UINT cButtons; - const TASKDIALOG_BUTTON *pButtons; - int nDefaultButton; - UINT cRadioButtons; - const TASKDIALOG_BUTTON *pRadioButtons; - int nDefaultRadioButton; - PCWSTR pszVerificationText; - PCWSTR pszExpandedInformation; - PCWSTR pszExpandedControlText; - PCWSTR pszCollapsedControlText; - union - { - HICON hFooterIcon; - PCWSTR pszFooterIcon; - }; - PCWSTR pszFooter; - PFTASKDIALOGCALLBACK pfCallback; - LONG_PTR lpCallbackData; - UINT cxWidth; // width of the Task Dialog's client area in DLU's. If 0, Task Dialog will calculate the ideal width. -} TASKDIALOGCONFIG; - -WINCOMMCTRLAPI HRESULT WINAPI TaskDialogIndirect(const TASKDIALOGCONFIG *pTaskConfig, __out_opt int *pnButton, __out_opt int *pnRadioButton, __out_opt BOOL *pfVerificationFlagChecked); -WINCOMMCTRLAPI HRESULT WINAPI TaskDialog(__in_opt HWND hwndParent, __in_opt HINSTANCE hInstance, __in_opt PCWSTR pszWindowTitle, __in_opt PCWSTR pszMainInstruction, __in_opt PCWSTR pszContent, TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons, __in_opt PCWSTR pszIcon, __out_opt int *pnButton); - -#ifdef _WIN32 -#include -#endif - -#endif /* end of copy from commctrl.h */ - -typedef HRESULT (WINAPI *TaskDialogIndirectFn) (const TASKDIALOGCONFIG *pTaskConfig, __out_opt int *pnButton, __out_opt int *pnRadioButton, __out_opt BOOL *pfVerificationFlagChecked); - -typedef enum { - DIALOG_ERROR_RETRYCANCEL = 0, - DIALOG_WARNING_CANCELOK -} DialogType; - - -///////////////////////////////////////////////////////////////////////////// -// CDownloadDialog -class CDownloadDialog : - public CAxDialogImpl -{ -public: - CDownloadDialog(); - ~CDownloadDialog(); - - enum { IDD = IDD_DOWNLOAD_DIALOG }; - -BEGIN_MSG_MAP(CDownloadDialog) - MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) - MESSAGE_HANDLER(WM_TIMER, OnTimer) - MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic) - COMMAND_ID_HANDLER(IDOK, OnOK) - COMMAND_ID_HANDLER(IDCANCEL, OnCancel) -END_MSG_MAP() - - LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnCancel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); - LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - LRESULT OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); - - STDMETHODIMP OnStartBinding(); - - STDMETHODIMP OnProgress(ULONG ulProgress); - - void initDialogText(LPCTSTR pszDownloadURL, LPCTSTR pszBundleName); - - BOOL isDownloading(); - BOOL isDownloadCancelled(); - - void addToTotalContentLength(DWORD contentLength); - - void decrementProgressMax(ULONG contentLength, ULONG readSoFar); - - void bundleInstallStart(); - void bundleInstallComplete(); - - void waitUntilInitialized(); - - void log(char *msg); - void logProgress(); - - void setFile(LPCTSTR pszFileName) - { - m_pszFileName = pszFileName; - } - - void setURL(LPCTSTR pszURL) - { - m_pszURL = pszURL; - } - - void setNameText(LPTSTR pszNameText) - { - m_pszNameText = pszNameText; - } - - - JNIEnv* getJNIEnv(); - - - void setJavaVM(JavaVM *jvm) - { - m_jvm = jvm; - } - - - HRESULT DownloadConfiguration(LPTSTR pszConfigURL, LPTSTR pszConfigFile); - - void delayedDoModal(); - - int SafeMessageBox(UINT details, UINT mainInstruction, UINT caption, - DialogType type, LPCWSTR instructionArg = NULL, - LPCWSTR detailsArg = NULL); - - void destroyDialog(); - - private: - - HFONT CreateDialogFont (HDC hdc, LPCTSTR lpszFaceName, int ptSize, int isBold = 0); - void FreeGDIResources (); - - BOOL m_feedbackOnCancel; - TaskDialogIndirectFn taskDialogFn; - LPCTSTR m_pszFileName; - LPCTSTR m_pszURL; - time_t m_startTime; - ULONG m_ulProgress; - ULONG m_ulProgressMax; - int m_iProgressFactor; - int m_iMaxProgressFactor; - int m_numDownloadThreadsRunning; - BOOL m_destroyWindowTimerStarted; - volatile BOOL m_dialogUp; - CComAutoCriticalSection m_csDownload; - CComAutoCriticalSection m_csNumDownloadThreads; - HANDLE m_hCancelEvent; - HANDLE m_hDownloadThreadExitEvent; - HANDLE m_hDialogInitializedEvent; - HFONT m_hMastheadFont; - HFONT m_hDialogFont; - HFONT m_hSixPointFont; - LPTSTR m_pszNameText; - BITMAP m_bmMasthead; - HBITMAP m_hBitmap; - HDC m_hMemDC; - TCHAR m_szUrlPath[BUFFER_SIZE]; - TCHAR m_szHostName[BUFFER_SIZE]; - JavaVM* m_jvm; - CComAutoCriticalSection m_csMessageBox; -}; - -#endif //__DOWNLOADDIALOG_H_ diff --git a/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp b/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp deleted file mode 100644 index e61ed4851fe..00000000000 --- a/jdk/src/windows/native/sun/jkernel/DownloadHelper.cpp +++ /dev/null @@ -1,655 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - */ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define STRICT -#ifndef _WIN32_WINNT -/* REMIND : 0x500 means Windows 2000 .. seems like we can update - * for Windows XP when we move the SDK and build platform - */ -#define _WIN32_WINNT 0x0500 -#endif -#define _ATL_APARTMENT_THREADED - - -#include -//You may derive a class from CComModule and use it if you want to override -//something, but do not change the name of _Module -extern CComModule _Module; -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "resource.h" // main symbols -#include "DownloadHelper.h" - -DownloadHelper::DownloadHelper() { - - m_showProgressDialog = TRUE; - m_pszURL = NULL; - m_pszFileName = NULL; - m_pszNameText = NULL; -} - -DownloadHelper::~DownloadHelper() { - -} - -HRESULT DownloadHelper::doDownload() { - return DownloadFile(m_pszURL, m_pszFileName, FALSE, m_showProgressDialog); -} - -HRESULT DownloadHelper::DownloadFile(const TCHAR* szURL, - const TCHAR* szLocalFile, BOOL bResumable, BOOL bUIFeedback) { - HINTERNET hOpen = NULL; - HINTERNET hConnect = NULL; - HINTERNET hRequest = NULL; - HANDLE hFile = INVALID_HANDLE_VALUE; - DWORD dwDownloadError = 0; - DWORD nContentLength = 0; - - /* Some of error messages use drive letter. - Result is something like "(C:)". - NB: Parentheses are added here because in some other places - we same message but can not provide disk label info */ - TCHAR drivePath[5]; - /* assuming szLocalFile is not NULL */ - _sntprintf(drivePath, 5, "(%c:)", szLocalFile[0]); - WCHAR* wName = CT2CW(drivePath); - - __try { - m_csDownload.Lock(); - - time(&m_startTime); - - } - __finally { - m_csDownload.Unlock(); - } - - __try { - // block potential security hole - if (strstr(szURL, TEXT("file://")) != NULL) { - dwDownloadError = 1; - __leave; - } - - HWND hProgressInfo = NULL; - TCHAR szStatus[BUFFER_SIZE]; - - if (bUIFeedback) { - // init download dialg text - m_dlg->initDialogText(m_pszURL, m_pszNameText); - } - - // Open Internet Call - hOpen = ::InternetOpen("deployHelper", INTERNET_OPEN_TYPE_PRECONFIG, - NULL, NULL, NULL); - - if (hOpen == NULL) { - dwDownloadError = 1; - __leave; - } - - // URL components - URL_COMPONENTS url_components; - ::ZeroMemory(&url_components, sizeof(URL_COMPONENTS)); - - TCHAR szHostName[BUFFER_SIZE], szUrlPath[BUFFER_SIZE], - szExtraInfo[BUFFER_SIZE]; - url_components.dwStructSize = sizeof(URL_COMPONENTS); - url_components.lpszHostName = szHostName; - url_components.dwHostNameLength = BUFFER_SIZE; - url_components.nPort = NULL; - url_components.lpszUrlPath = szUrlPath; - url_components.dwUrlPathLength = BUFFER_SIZE; - url_components.lpszExtraInfo = szExtraInfo; - url_components.dwExtraInfoLength = BUFFER_SIZE; - - // Crack the URL into pieces - ::InternetCrackUrl(szURL, lstrlen(szURL), NULL, &url_components); - - // Open Internet Connection - hConnect = ::InternetConnect(hOpen, url_components.lpszHostName, - url_components.nPort, "", "", INTERNET_SERVICE_HTTP, NULL, - NULL); - - if (hConnect == NULL) { - dwDownloadError = 1; - __leave; - } - - // Determine the relative URL path by combining - // Path and ExtraInfo - char szURL[4096]; - - if (url_components.dwUrlPathLength != 0) - lstrcpy(szURL, url_components.lpszUrlPath); - else - lstrcpy(szURL, "/"); - - if (url_components.dwExtraInfoLength != 0) - lstrcat(szURL, url_components.lpszExtraInfo); - - BOOL bRetryHttpRequest = FALSE; - int numberOfRetry = 0; - long secondsToWait = 60; - - do { - bRetryHttpRequest = FALSE; - - // Make a HTTP GET request - hRequest = ::HttpOpenRequest(hConnect, "GET", szURL, "HTTP/1.1", - "", NULL, - INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_DONT_CACHE, - 0); - - if (hRequest == NULL) { - dwDownloadError = 1; - __leave; - } - - // Create or open existing destination file - hFile = ::CreateFile(szLocalFile, GENERIC_WRITE, 0, NULL, - OPEN_ALWAYS, FILE_ATTRIBUTE_ARCHIVE, NULL); - - if (hFile == INVALID_HANDLE_VALUE) { - if (bUIFeedback) { - if (IDRETRY == m_dlg->SafeMessageBox( - IDS_DISK_WRITE_ERROR, - IDS_DISK_WRITE_ERROR_CAPTION, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - wName)) { - bRetryHttpRequest = TRUE; - continue; - } - } - dwDownloadError = 1; - __leave; - } - DWORD fileSize = GetFileSize(hFile, NULL); - - // Check if resumable download is enabled - if (bResumable == FALSE) { - // Start from scratch - fileSize = 0; - } - - FILETIME tWrite; - BOOL rangereq = FALSE; - if ((fileSize != 0) && (fileSize != 0xFFFFFFFF) && - GetFileTime(hFile, NULL, NULL, &tWrite)) { - char szHead[100]; - SYSTEMTIME tLocal; - char buf[INTERNET_RFC1123_BUFSIZE]; - - FileTimeToSystemTime(&tWrite, &tLocal); - InternetTimeFromSystemTime(&tLocal, INTERNET_RFC1123_FORMAT, - buf, INTERNET_RFC1123_BUFSIZE); - sprintf(szHead, "Range: bytes=%d-\r\nIf-Range: %s\r\n", - fileSize, buf); - HttpAddRequestHeaders(hRequest, szHead, lstrlen(szHead), - HTTP_ADDREQ_FLAG_ADD|HTTP_ADDREQ_FLAG_REPLACE); - rangereq = TRUE; - } - - // This is a loop to handle various potential error when the - // connection is made - BOOL bCont = TRUE; - - while ((FALSE == ::HttpSendRequest(hRequest, NULL, NULL, NULL, NULL)) - && bCont ) { - // We might have an invalid CA. - DWORD dwErrorCode = GetLastError(); - - switch(dwErrorCode) { - case E_JDHELPER_TIMEOUT: - case E_JDHELPER_NAME_NOT_RESOLVED: - case E_JDHELPER_CANNOT_CONNECT: { - bCont = FALSE; - // Display the information dialog - if (bUIFeedback) { - // decrement download counter to prevent progress - // dialog from popping up while the message box is - // up - m_dlg->bundleInstallComplete(); - if (dwErrorCode == E_JDHELPER_TIMEOUT) { - bRetryHttpRequest = - (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_REQUEST_TIMEOUT, - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL)); - } else { - bRetryHttpRequest = - (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE, - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL)); - } - // re-increment counter because it will be decremented - // again upon return - m_dlg->bundleInstallStart(); - bCont = bRetryHttpRequest; - } - break; - } - case ERROR_INTERNET_INVALID_CA: - case ERROR_INTERNET_SEC_CERT_CN_INVALID: - case ERROR_INTERNET_SEC_CERT_DATE_INVALID: - case ERROR_INTERNET_HTTP_TO_HTTPS_ON_REDIR: - case ERROR_INTERNET_INCORRECT_PASSWORD: - case ERROR_INTERNET_CLIENT_AUTH_CERT_NEEDED: - default: { - // Unless the user agrees to continue, we just - // abandon now ! - bCont = FALSE; - - // Make sure to test the return code from - // InternetErrorDlg user may click OK or Cancel. In - // case of Cancel, request should not be resubmitted - if (bUIFeedback) { - if (ERROR_SUCCESS == ::InternetErrorDlg( - NULL, hRequest, - dwErrorCode, - FLAGS_ERROR_UI_FILTER_FOR_ERRORS | - FLAGS_ERROR_UI_FLAGS_GENERATE_DATA | - FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS, - NULL)) - bCont = TRUE; - } - } - } - } - - if (bCont == FALSE) { - // User has denied the request - dwDownloadError = 1; - __leave; - } - - // - // Read HTTP status code - // - DWORD dwErrorCode = GetLastError(); - DWORD dwStatus=0; - DWORD dwStatusSize = sizeof(DWORD); - - if (FALSE == ::HttpQueryInfo(hRequest, HTTP_QUERY_FLAG_NUMBER | - HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, NULL)) { - dwErrorCode = GetLastError(); - } - - bCont = TRUE; - while ((dwStatus == HTTP_STATUS_PROXY_AUTH_REQ || - dwStatus == HTTP_STATUS_DENIED) && - bCont) { - int result = ::InternetErrorDlg(GetDesktopWindow(), hRequest, ERROR_INTERNET_INCORRECT_PASSWORD, - FLAGS_ERROR_UI_FILTER_FOR_ERRORS | - FLAGS_ERROR_UI_FLAGS_CHANGE_OPTIONS | - FLAGS_ERROR_UI_FLAGS_GENERATE_DATA, - NULL); - if (ERROR_CANCELLED == result) { - bCont = FALSE; - } - else { - ::HttpSendRequest(hRequest, NULL, 0, NULL, 0); - - // Reset buffer length - dwStatusSize = sizeof(DWORD); - - ::HttpQueryInfo(hRequest, HTTP_QUERY_FLAG_NUMBER | - HTTP_QUERY_STATUS_CODE, &dwStatus, &dwStatusSize, - NULL); - } - } - - if (dwStatus == HTTP_STATUS_OK || - dwStatus == HTTP_STATUS_PARTIAL_CONTENT) { - // Determine content length, so we may show the progress bar - // meaningfully - // - nContentLength = 0; - DWORD nLengthSize = sizeof(DWORD); - ::HttpQueryInfo(hRequest, - HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, - &nContentLength, &nLengthSize, NULL); - - if (nContentLength <= 0) { - // If can't estimate content length, estimate it - // to be 6MB - nContentLength = 15000000; - } - else if (rangereq && (fileSize != 0) && - (nContentLength == fileSize)) { - // If the file is already downloaded completely and then - // we send a range request, the whole file is sent instead - // of nothing. So avoid downloading again. - // Some times return value is 206, even when whole file - // is sent. So check if "Content-range:" is present in the - // reply - char buffer[256]; - DWORD length = sizeof(buffer); - if(!HttpQueryInfo(hRequest, HTTP_QUERY_CONTENT_RANGE, - buffer, &length, NULL)) { - if(HttpQueryInfo(hRequest, HTTP_QUERY_LAST_MODIFIED, - buffer, &length, NULL)) { - SYSTEMTIME systime; - FILETIME filtime; - InternetTimeToSystemTime(buffer, &systime, NULL); - SystemTimeToFileTime(&systime, &filtime); - if ((CompareFileTime(&tWrite, &filtime)) == 1) { - // no need to download - dwDownloadError = 0; - __leave; - } - } - else { - ::SetFilePointer(hFile, 0, 0, FILE_BEGIN); - ::SetEndOfFile(hFile); // truncate the file - } - } - - } - - TCHAR szBuffer[8096]; - DWORD dwBufferSize = 8096; - - // Read from HTTP connection and write into - // destination file - // - DWORD nRead = 0; - DWORD dwTotalRead = 0; - BOOL bCancel = FALSE; - - if (dwStatus == HTTP_STATUS_PARTIAL_CONTENT) { - // If we are using resumable download, fake - // start time so it looks like we have begun - // the download several minutes again. - // - m_startTime = m_startTime - 100; - - ::SetFilePointer(hFile, 0, 0, FILE_END); // seek to end - } - else { - ::SetFilePointer(hFile, 0, 0, FILE_BEGIN); - ::SetEndOfFile(hFile); // truncate the file - } - - do { - nRead=0; - - if (::InternetReadFile(hRequest, szBuffer, dwBufferSize, - &nRead)) { - if (nRead) { - DWORD dwNumberOfBytesWritten = NULL; - - BOOL ret = WriteFile(hFile, szBuffer, nRead, - &dwNumberOfBytesWritten, NULL); - - if (!ret) { - // WriteFile failed - if (bUIFeedback) { - if (GetLastError() == ERROR_DISK_FULL) { - bRetryHttpRequest = - (IDRETRY == m_dlg->SafeMessageBox( - IDS_DISK_FULL_ERROR, - IDS_DISK_FULL_ERROR_CAPTION, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - wName)); - } else { - bRetryHttpRequest = - (IDRETRY == m_dlg->SafeMessageBox( - IDS_DISK_WRITE_ERROR, - IDS_DISK_WRITE_ERROR_CAPTION, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - wName)); - } - if (!bRetryHttpRequest) { - dwDownloadError = 1; - break; - } - } - continue; - } - } - - dwTotalRead += nRead; - - // update download progress dialog - m_dlg->OnProgress(nRead); - // Check if download has been cancelled - if (m_dlg->isDownloadCancelled()) { - m_dlg->decrementProgressMax(nContentLength, - dwTotalRead); - bCancel = TRUE; - break; - } - - } - else { - bCancel = TRUE; - break; - } - } - while (nRead); - - - if (bCancel) { - // User has cancelled the operation or InternetRead failed - // don't do return here, we need to cleanup - dwDownloadError = 1; - __leave; - } - } - else if (dwStatus == 416 && (fileSize != 0) && - (fileSize != 0xFFFFFFFF)) { - // This error could be returned, When the full file exists - // and a range request is sent with range beyond filessize. - // The best way to fix this is in future is, to send HEAD - // request and get filelength before sending range request. - dwDownloadError = 0; - __leave; - } - else if (dwStatus == 403) { // Forbidden from Akamai means we need to get a new download token - JNIEnv *env = m_dlg->getJNIEnv(); - jclass exceptionClass = env->FindClass("java/net/HttpRetryException"); - if (exceptionClass == NULL) { - /* Unable to find the exception class, give up. */ - __leave; - } - jmethodID constructor; - constructor = env->GetMethodID(exceptionClass, - "", "(Ljava/lang/String;I)V"); - if (constructor != NULL) { - jobject exception = env->NewObject(exceptionClass, - constructor, env->NewStringUTF("Forbidden"), - 403); - env->Throw((jthrowable) exception); - } - __leave; - } - else if(dwStatus >= 400 && dwStatus < 600) { - /* NB: Following case seems to be never used! - - HTTP_STATUS_FORBIDDEN is the same as 403 and - 403 was specially handled few lines above! */ - if (dwStatus == HTTP_STATUS_FORBIDDEN) { - if (bUIFeedback) { - bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_FORBIDDEN, - IDS_HTTP_INSTRUCTION_FORBIDDEN, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - L"403")); - } - } - else if (dwStatus == HTTP_STATUS_SERVER_ERROR) { - if (bUIFeedback) { - bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_SERVER_ERROR, - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - L"500")); - } - } - else if (dwStatus == HTTP_STATUS_SERVICE_UNAVAIL) { - if (numberOfRetry < 5) { - // If the server is busy, automatically retry - - // We wait couple seconds before retry to avoid - // congestion - for (long i = (long) secondsToWait; i >= 0; i--) { - // Update status - if (bUIFeedback) { - char szBuffer[BUFFER_SIZE]; - ::LoadString(_Module.GetResourceInstance(), - IDS_DOWNLOAD_STATUS_RETRY, szStatus, - BUFFER_SIZE); - wsprintf(szBuffer, szStatus, i); - - ::SetWindowText(hProgressInfo, szBuffer); - } - - // Sleep 1 second - ::Sleep(1000); - } - - // We use a semi-binary backoff algorithm to - // determine seconds to wait - numberOfRetry += 1; - secondsToWait = secondsToWait + 30; - bRetryHttpRequest = TRUE; - - continue; - } - else { - if (bUIFeedback) { - bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_SERVICE_UNAVAIL, - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - L"503")); - - if (bRetryHttpRequest) { - numberOfRetry = 0; - secondsToWait = 60; - continue; - } - } - } - } - else { - if (bUIFeedback) { - WCHAR szBuffer[10]; - _snwprintf(szBuffer, 10, L"%d", dwStatus); - bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_OTHER, - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - szBuffer)); - } - } - if (!bRetryHttpRequest) { - dwDownloadError = 1; - } - } - else { - if (bUIFeedback) { - WCHAR szBuffer[10]; - _snwprintf(szBuffer, 10, L"%d", dwStatus); - bRetryHttpRequest = (IDRETRY == m_dlg->SafeMessageBox( - IDS_HTTP_STATUS_OTHER, - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL, - szBuffer)); - } - if (!bRetryHttpRequest) { - dwDownloadError = 1; - } - } - - - - // Close HTTP request - // - // This is necessary if the HTTP request - // is retried - if (hRequest) - ::InternetCloseHandle(hRequest); - if (hFile != INVALID_HANDLE_VALUE) { - ::CloseHandle(hFile); - hFile = INVALID_HANDLE_VALUE; - } - } - while (bRetryHttpRequest); - } - __finally { - if (hRequest) - ::InternetCloseHandle(hRequest); - - if (hConnect) - ::InternetCloseHandle(hConnect); - - if (hOpen) - ::InternetCloseHandle(hOpen); - - if (hFile != INVALID_HANDLE_VALUE) - ::CloseHandle(hFile); - } - - - - // Exit dialog - if (dwDownloadError == 0) { - return S_OK; - } else { - DeleteFile(szLocalFile); - return E_FAIL; - } -} diff --git a/jdk/src/windows/native/sun/jkernel/DownloadHelper.h b/jdk/src/windows/native/sun/jkernel/DownloadHelper.h deleted file mode 100644 index ab7466b9813..00000000000 --- a/jdk/src/windows/native/sun/jkernel/DownloadHelper.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -#ifndef BUFFER_SIZE -#define BUFFER_SIZE 2048 -#endif - -#define E_JDHELPER_TIMEOUT 12002 -#define E_JDHELPER_NAME_NOT_RESOLVED 12007 -#define E_JDHELPER_CANNOT_CONNECT 12029 - -#include -#include "DownloadDialog.h" - -class DownloadHelper { -public: - DownloadHelper(); - ~DownloadHelper(); - - HRESULT doDownload(); - - void setFile(LPCTSTR pszFileName) { - m_pszFileName = pszFileName; - } - - void setURL(LPCTSTR pszURL) { - m_pszURL = pszURL; - } - - void setNameText(LPTSTR pszNameText) { - m_pszNameText = pszNameText; - } - - void setShowProgressDialog(BOOL showProgress) { - m_showProgressDialog = showProgress; - } - - void setDownloadDialog(CDownloadDialog* dialog) { - m_dlg = dialog; - } - - void setJavaVM(JavaVM *jvm) { - m_jvm = jvm; - } - -private: - HRESULT DownloadFile(const TCHAR* szURL, const TCHAR* szLocalFile, - BOOL bResumable, BOOL bUIFeedback); - - BOOL m_showProgressDialog; - LPCTSTR m_pszURL; - LPCTSTR m_pszFileName; - LPTSTR m_pszNameText; - time_t m_startTime; - CComAutoCriticalSection m_csDownload; - CDownloadDialog* m_dlg; - JavaVM* m_jvm; -}; diff --git a/jdk/src/windows/native/sun/jkernel/graphics/bullet.bmp b/jdk/src/windows/native/sun/jkernel/graphics/bullet.bmp deleted file mode 100644 index f54142bcf194eb638bd6a49bc3aaa7c9030693e7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 68 rcmZ?rbzy)2Cm^K(#LQ64$iTwD1Z0D-5H|$FJ7TtnM&Jy>Cz zF?VLz;)HCNTN0BBMalh=@a%Uwb&mJ*`F@`N^MAhY|M|b?JntJ3?X5!16=DMfF!HWN zf(jDjN;%NL-i+Yfgy|AOAc0IGa-|Y!9OsjzB%RpU+F~Wg45BA%iGge)u~hlEiZtf?={LZ) zOC;to?!PVzp|L}-qT(6cZwWLxSp=_Q0nbxK@aJ4xBGBrNKwA=0DiF$CJN6LHdBk1z zUGf46>|+EOSt&4z{fyzWjw2H|pF*ayw;AkB<>ZXs>8lW#lmcy(4ny}GLDR4fP&?O0 zqZ7q&C4M&q{EN76A%8RW5qOg@7tDDW<8Tsot_ zA$P2gfZbORNWwC+(Vq8(XJsSy_zesu>SF@-MuB?7;go=54r`qda3*pGXN0Uih;~G` zClB`X_M`F29JprWp!ND(1QGS5E$~>94WAiVXhwXeXF`><2db$%pqjEB>f}RE&pHV8 z%mZW})YDDuhB|3CR1>#AHEuKHQDY!$(*ufx^-v5-hhp$DDC5__cEUE;j?RRlUoz{_ zpRyA&-89GtE{D8NGGxIquo<`vh@J!JQh=x=ASecC-3w@}1seH6icW>pD;bh*7Nm$o z$oemaEHV+2XB$XOS^^Q{VK3PcKrJ~EKqc|Rp?dQ6;e!Vc-#)S79I%zpfS-uRk1i~7 zwI2|>{lcTioH7fg1P#Nge`hHb?YeKBKk>_j=c|}t9tsIAz_S-8G@345Bf4)j7z`6W zIQimP%?fNJcmPkI{~-?ik)s;R?I zuU~(Q^Uco|XIaNei*x@!j|Fv3&5-G1dV+EXE}FqMKCc6z2N; zWpT2AkrrpNe{P}KDc#xI>TKp|v^pJjmYSWClw_;39_VRx!c$Ak&aJWETAeLGH>=Yx z@s`=S6Sl+Z><7kJo$>AOn4R0+zgeAaJVaJ!T(jFI#}Rkk{#u|e`*F7TC#jc*6ZNvI)IyEgY zISS+_9XJg|KI;9m*s;-f23is+x&fSdOi&=Tq(GI+4NT6^7V6v9X@RAc;uWV mQE-I{*DmqxwZo08r($AGUFElp8Pf@Nkf6l1yu53sNctaGlp4?g diff --git a/jdk/src/windows/native/sun/jkernel/graphics/java-icon.ico b/jdk/src/windows/native/sun/jkernel/graphics/java-icon.ico deleted file mode 100644 index f98f780893942a36885d1989475472d095b39c16..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 29926 zcmeHw4_wdJ_y47lG5;bqH2)rcZ?~K^zx5w|X`*_@5_nv$2Ip^McUiX}H z&+Cm4HN-QbTen91d`dXh79vRq(WZ^Ao?lalE|x+(`>eiRLx^T|g=o}BSGVQ*AN2%} z7d*a>Sl>X1PW3TfU#}xXN=uB_)sHZK*A5u3t2@>bqHkwqd>gU8qY&YYOE;eD+;8CL z%J??I_h}(Y9hC8HgyT~}cuW++mU-r3Vhm@@qhew-hUAG7|MAopJoOb%1|%dT2tqsm zA$@`L6#~G*&P-y;J-D?}nj|a&DghZ#*3Hr!m}p{8^YB?ZxUY|!F8S)w&YB8r3KVU= z5`hokT$}2vOI(yA^zd?~$|Qv3Utc#yEBgb7M5Jpi^YQfsZi&1c4|gh)U^h^cN!K56 ziN`=kf$OkxdxidlnMr1KLzMo?%mVa)ayan&Obsa0(N^Hfx_|>9>Apw10tjKO$4xhp2>TjnSSp(>G~Ky)vl%t6NyDk^|v zawD}lI3qC&S2G&m*QIhi4h&Z*;Bx#-^Ikc6Q}}m=?k4au2QzR|JCZp(#Mrq>N#*>I zt0TFV&(}~Q=18|!7*kdb2Zb^zgcaaeHbs7n`(uETOyF|;buA`vQX8n5!hNcMm-i|! z0dIM&td7Eg>C?B40i{WUr%+~S0`~P3bs*pslc&hU*<`tVK?0r@nK-%lz)R3SWsL#K zlZ*ePM_K_-eQ)`!!TJDoerDonnIQE{8!p;&{@>{t)-SsATPG!DZo<+;p2{XxP(PFS z;Lorj|}%>W1^NG(gRR%j;^K z1?BZJN99%5ojYaUnb!G*ca`0h^X;DFJ>C57>CkWoP%nR@dAvzoIWi1yyuM&KsC3ijtbIFn!;pys@+i3r~pI|0sc0f;?4(CG06S*`!VNm&!TQP?C{p z)vbqNdCDNmN|JJ=uW(ssesEWxsjPS*ODs|hhq=O4og6|487yTI_JksDkY-;u9b6hW zD66ED2S9$L4Cw_-mP^%=vaURJ0xG&b6Qm-MWm1<(xMaUf_R)!m@n4C?NNa$m4u-$J zb->@mYQPfpRMzQ9JsGb&&tMz3;rv(bvwm;8>GzWN3rmiD!$h$+_uSm>sj#P9 zcjG5F2jJ%$kG&x#OMgo&Rruknk;eu{(UhzR4Zb`{e`x;R79ng zi14^9k(Qb){9Qj685tQ&!%4(OhKj`WQjwAzC&B{VMO2udNYj*ve|c#{pvPDd7Z)o^ zOG}08*ms25<#RDONGp=!B1L*ys%Yk-5osC4A|j<&IE8DOhZ3Gcx=2cl<-UV?{Al4H z3qGAia&)LrN0*4mP(Lv+P$P;3i0FtQ?xz;v$)zI5 z-%BLMMu?X@G$J-4P{i_>tgH+XqIMD)+7j`)S|dUdOL!h3!pfQFUR)wlQ<8X%2J`r0 z5$5kA{M|u?bl70!JUMP!)2NXse_DM_&+Fs@WY1i3Tq5aBYsFV7>5 z*IdnOQzG8+$C_$HRCu7!mfYvHEai1f5lK;@A|(rJm&j{YDoRTK5FSqbczvS8^R61< z5}_5D8R;S@u9*3C5ZPH-V!7H`OdQ@z)OXT|sgWhT$Hn4sI?p>!E5?Rscn`xFZ-^)< zDPf*@zccQOj4ZAAS@hiFAM&wo3weOz>;7#>vY`ub^wotIVwc{uQX6$`)E67f->miOYmI20SnYpfML z)LN02k}M*UOL*;Eg+o}e*bw9)-uKrEjkZ{%XR(|`1_?iw!IxOp?%)4IWbnQ}&$5uh z`|i*C9>V*c933Vy(MOZ=`7!YEZS;J8Pc-s zMDyIDS#HuBY6FQArj90?EL)fbba~< z+Yk74e@pjq?yszAJ0@z({vkiOHPsJa66~%o+4)V9{oRpTzUR<7WB+>%;x{9;dUt*6 zArkIhQ}^I8c9SM8)>ZU>hcw*0FaBcB@CKcD)WuaMZCqJA=^4}hW0p6V75w`TrLRm3 zUNW*}#qRElpZUzRzxxo=PBx}P7Jt@V_Sa8m+_?TNgIo80+QH%J-d|eK6bJ9-I2kZ{?ppB zce}6M#x-r(JF~Z&GQw_zY5!Mlf1)(;v%lN`cc)_xE%i{l5no9B*khU8+YXUwZcCjE z0NAwM=5RcDjNKQVq&!HOt7&z+!GN@jNXsw&ob*%7?UBFtM@w+#W;}R^U8hb`-cVIL zWo}Nt9XuwuUcGwB2Va<9qhIfK;j@}@!>WCB)N?(?$0?)@3(7Hs*+E`V}eDL6TpPK8xew??hN&2X$ps($~&VxTpH37?t_qg>> zSM2|Jmy`e*UnE&<-264SLS@yO3>9JzKHKc3A!ewXJo9G-1P(j!Uh7n>VG|gbFRT z>I(_#3NWrtSkUCdUe<3OTDkJ$H%(jB3C+#)w+;-7JlV_Ide5P!LQP4in_ zvJXFI)Pb>kObDnGwY5zEhRWL2tJ@eVhC*%aZk3^8T6n+Xy6;UPTvP4dR8@cLpw;6m z_usTvWj)7y@>%&+#RhBD-r1^(K&9^D5u_9iPt|Pard8pebAP;{pT1zNa;EdP6`@tv zt1sAW7*Gw-}w&v+R{f&EtY;B{7m>D{_L;7 zr+`1`I{F>yKQ?pDVxPB|eY_IsXTbM{-yY8X6nqKzbnqSFH;1yX1)sQ|KaY19$bJ|5 zVeG?&1*zGe`$PK5@R8xK!%v3)tMgAwrC%P)J|O(lQufE-H^Rq@3JYXkDpK@g9}j+I zCtg4Je7HA&{|>)6oc+8Axn4RyI+=Z8_|F;I`#j$)=`-T)AdTk*p9g+Tc%nu`vftyy zzFHjnm+*Oesre3qeO>r@;eoE~x3WJBAC`Sf_+KUL$Au;qOMenRZ#es@@DbrdC$jGe ze-A!&8n1^x`)Tm~W0|fC%UqVh|BIHsDegAl-{H;!ejR+SWXzLgr5(>PkYxnECw%*G zo?8^(Il$LS=KT)keT6>_=QfqC-Cv( zcn>^y58wyF_l9o=pAM}f~->A;D1FJ~2JCEwuQzEZfXQr#)LDny|IBy%Aw63Nk==NRD z=SPBgt!H+2`>IZ|E`60`=@J)>4sIi#S9iz#;a4twKDO^%bKllF9artPXTXGTfZe*Q zXUlfCNv-O1v|MZZOvrZI-ri`@MSQ!@{`bhv`qZ&`!}{;NSO4{vpDB>eok#xL!O%Ya zwfE}O?>p$TNo<=wt?x3@;mwi2#_6N+F7JH*{X0FHH{TrmS@`Q8N#MvgC+p~Q`_RE1 z|JA9}zXsKBW#zW7w~K7=KDl{!-AwH#)%Wf=ZBU(8mrnBS?BwLWU4pweZ*C@eq*a^@6p>zE`Mz& z`+ZHj2EO%5T^p~!+MPRoH3)lB+p4#Vm0@#g2R=J&mUWEJ8no!3RxWYV0|zQ;(~PGE zj<9(9bEQ5oaC%(B>4vQzIHJi5@Am5di2*Qo?(~LxI~%HBP8>0JK>z<33rpv{mToUA zX?Yu)_)q%JSE_irS@tP!Z_)ll+b?WpykOM9txuFwdG!V74KLa`JA0HvoTB`lUT$ni zTiUmhW$L{!^V1;Q=?C78#RZ8HU416w_#xc3as|0 zb83g_JWu`K##4U`FaW}8(fv7ssp0n0`k0F7(bsL^z;p{gtVG|m8++q6c?x{WWJ zQZTfJy}WT9zkok1^_^Qj=Ksh%b@cDS>Hl$1tD=-saJckPKBO> z9TUNPL1!1UeF3{AlzD+Jb!A@uN&l?C-(>|xRh7&$II5R*U#m)~uXV4NTG`dDlOa+?M~@Cq zSu|{~gMZu%{0wUMP931A_qIjDCWEZ(>@1pf?o+p}oz+JT8?qW`IHYEuhE1$^LVY^7 zY{#>*vTFNWpT@O14jNQ{Fu--&wfta^y*)-)z488wZ-5ko?d=DB(2e0}vHEo6(^ghk z5!45Dt8LW<$=>d*XWo0uuCBeTb+M}5UI*_|_mfwwUT*rD0&j0?XCqUWx-T@fd)dB= zu4ZT3Ko7U+Qnz^<1#Dy2;MKai9yT^zS~S=9wy~-EYK^)!{dLKv3xoB=x;1*YQ{esk z8%j3qdJla43k6a6^NZI9jv8t9RNMw}9Q3;wv3JNuce+q_tRLFYiP{fl)B^iymq$B9`-B4!Mq z9Xh5H`}~MSBJKu#3*83Y@=y9_1^!uq$}7;z6x6Fz!?xwAXTwe{t=o31^OP?2w6t#7 zs8w5QYXsUjwQbv~(W?#EcWGCvR;_l8n|Ep4;MM0_wQbzEd-v`wT39q_-l4(s^{jig zt=0UE7i+!oblX}T8q|Bv+Oj8K>b_Rnx^a&Vjjf-vX>7^qmBuwKEgQGBY;4o4F}t#s zwwAWGmX@76H*QwHZR^&pJ9li__N8Y!w{G3G{>wd^aI&;|#$?1GV)<+h3m$Js7BzakV3K-y)`*Dad*3JY{Y@Lw)ihK4VQ3FK z&Ow~%Z=S)Uo$(Z$zj(u8!mwVyE%Bd8xw*MiP*Cu<%&bocJc3v7j5+Z4Fl~Pv(fikf z39(dER75v#-lSW%Zv8DYcmt2%6+G*B?=yATd=;@iGvOV5|85!U3ZB3#c>ZxjpQ$dR z`cm@YgNC(Nc*Z>cZrPYO@C@E3kA92TuBpUpVPPSaXD#Jvaw+Fp2Bn`pLCFc*DIsbV zMJ`v|p$&3f((G)WC8(QN(i8hCLQS62wIvBH_E}l6~nw)E-Eyy#X zXH2`iY`mV}8N9oWd7G|Wxl(DY@(yP+&lj2J_-(6b(^4;5?LV1T_&Cv0uWxAaPa_RE zXvSy?V*V>;%n7i?KaDc$1c z(@s^&m(HK23#rHH#KGNkByJle?TMt_8<*0yRdZ=$uoo@!9w%{Pj$!jA({b*Xr^%7D z6&{qQvZi=~XYfAln|~AE6IJS;mzPJ#YZpwVMZ9+YlRl*-o?kN`u@bJdKi*Tr=XEw^ zT)sfZ5@TpXkV?+yY)TU0tgMJznFpTW8NC1G@B#4$DwXiN4_H{FxJU^>Vu8SHW%W zxsT;Ed4CLLXI+!Hjr$nS2RwuK8IJwv!i5W!`sU>1Fn^}`?5Sjm*$_;dmZ@pamX&lR z{Q{*Nj+3yJENAoGhLPWdL6x#U%U$ryZ)rWRZ|vsflzRLSWoKts!Vg&bg|n653LnOE z0ngxF<z)FK_Qp0sM}KFY@3$J4QL#S#&rq ziZ=5c!xznvbJVb&H%AXJ-_?(|A9Y%Cl6*Q?{H-c7VocBA{2Ff+r#Ikqp)X_?P zjOPOW!Mp#oQD*g*v97DC483*oNIac6k;Lz@KBKJ9smBh|dDe3pX%FO8((x7XVqR+k z-DwW%kTCw`SH*T^4e*5i0`K#uk1=aM7~2|3`O<|{+8?ulwuSlA%AY5(J|0I)XF19< zALqJpUd-nz>S41+QJ9Yd1$#Tw+J!TC&-^K2M>wS(J3z1v72L`*IdK=u(O~)BC@|$| zJRjH(;C-RT*JkZE_z1=sIJU1@AZ66|2i8|V4w3UnW;s7`Xb;PMw6q~%Mzh?eaw$)r|KkEz)+dsy14)OcqH{lcBgO5$%=%dU7 zPuOqZeX-}abouh-N_~xORi%9X%rV-^@9I)s_Ym*z*=`7;Gsh257TZWlpNh}q3xyOO zpUEbKKG5Z?0y=xOh%z-rmo#SdP7rb%O>6<&(<>et)j( z@GXhEPIbP^A-h?5lysq}3L3ic4?`bw1JB@n)x1f>zle}H75})p&-Cn@G;m=ay*n?D zu4;7m7e_7?)9c=ORM#vAjRZ%)3dW8CKsZN9JC>y#5z&JoeoZ<^Z0-dpP@tuob~G$3d!{e>qr8 z4ZhDM$2D4sI+Z<2e6}BjN-xTcm*!-_O za)X-xm`k00(ojV54aw&mU&5A74W-v?^Y`xxL881 zS$3Xt$)&GX71GUHcj@}gyEJoqF+uL}-d@VBKK_b)fmhg~;CWYWq#HbO6av&`P6wvJ}o^^VuCxH=eXzGT{)j$e|iw0p-U>4O>HsXvJ_{5s$U4bTEj@W9`?FzrDUy=ATRJ)nQ^K33_KCc z`#JbGpaq(sJ>^S#RoD_AdG7+-&)og$lZ1f=?sz~GwE0_&_`NY(ZVOFa2|4L4e$#`iJb(z00&y3F6X7|IO8_b2NYPp6%0=hM-BTPcI@@wM7~llyJZ zz+QkRXuE&=zKnAMW*moD#@|%T<8MQj^0z@-Lw#v)(TffG8UPVw3ol{I7(M8rcu_ltMdLsiN_(Hgt(GYH-0MLIe30Qz-*imefjsqbcny> zK@2G6a6E0~xHDo`^QVoVxh|j5+)1CwxGlbQSgsyVaobi`qIHeq(Z+O@GU$W$!^Zhf zB*oD}j%%$6oKE|rH_+ku?HnK3PKhxaIR?9g<3Ii!Gu$s_%Q&80RauGCtA89~Hcnr0 zTsC6Tyyi*!qByp`OU9%VIi`hgCGai81^y-?i(@XxsfbhZo>atPTnBy7My%IdoZUF4 zed)qEj>*lJ-(xJ9`5i4*eao5Sh@K9##LJNu%@`~5x}cfz8x8P-81Rnp#dMkF!WfrQ z22IeOH+7`hI4xvU$(JskrIm9hQ}|*P9Y3^}W0VK!0)K0Oe45M2{7upR==CfsTPgGE z6*&$v8sa@(e(R#(F@7S>3ffi0S#jp(<>hiL^eW5YX&GPLw=IlLu)H7Vxa2Wj_v8Hi z)2Tzzbe3bLkk!nLOT6Y;hWPGT{sts~W6|c$ZzWE;h}Y3voDugZ_;zZQzbnW7M$vMg z2^cr6HlTdeKbUykG*qt7=|BF3v@S7E!mo4u5AoEKhxgGQJ~Q#nnG&B!fBhj`z0X-6lX z%A|e)cW6^`5nax`K`**%=#ANVl$BQ==PNEoj8WIWV(bn2Oo_9F@frOnakjK;x2Ugg zK26(PKt;tj$uW%MP>$Ke|Aquzs0bE;+0&l(7Q!&g*17K8MDK7gEuU zhmSESaURe{tN}XVVd4zC&)lNclXL04dHHm! zc>cHOyhd05aK4tdpDuZ*IDzp!eRSB*(mr_LPgujP?ilr^-D$XydLI=h36y^A_Ctl{~ibyU%eMzuh87aINK|96Zp2k6aVD&|2TnW0@Jo-y5;}Ac^j_%ze)U?qZXV!IiKUq z_XAHP0~c_%m^7-dXP}Q89o)Z1>RV%5ygFs*Y~TV;;C3DJ&bj2niPF}EombK3dek~_ zz)l8E;CBD!eQ7hpe}=w58+d>}W9(O%E29tkVhqMA8Mt7F12_C|<@Xlo3!5;JeVX+P zr_u6RUsH(Zmu55C&*Av zzE;KGGhq%Gvwckd!T&;i>&iKje~eY|04H#-m@`50s=P<= zVIXIi@1Dp|+RwiOz*;TZolTyR+4Ms=e}Bn)i8;uN~zfVKm`Ma050`h3m#yknfS}1#o_Y1f&R>1?Dz`bsvyW|DBSIN*x=&Q`7 zmw!G@*~tFP^a8ndz^(9!C;C?OQ!qc^-W05oW1#CQW{d%EHmU;pA~c^C?ah;A%nh`` z5A?D*9|U^{+=`!IP9K9F&a0*I1=M~P|0a?5#V5Ley3Wy3P=d}cGdB(}^abu6tLDhP zfo)bX!(IXn@H#KHkh;v#onbyP*X23`PsK4x9s3R3ik%G`q+*6W3L2O{)_DHDB6@Q{ zk;DzUz*TXKQpXxfJ9>l8j;_jvMStJ{zJuwvn1=4VI|X-D$N@`*a& z(2J2Pbb1kb8DouqmxHqtIhlW>dX#_TfSkl}lf#^^@bAW;2bb{gr?-U8kvbh?7kQT7 zm*U)CMx24z*oG(g7pGEufsfC9ww&S%UpE}Lf%CSlxjKSEQRh;vnHD{NW zI(ZjLofmt$P@a{_S%9^|*w}UR<@}WMS9#)003UPr6j4wA>vF8ph9}ktW8*hfeU9Qx zgAO=&QFouBoU_U~iLnQ_Ejyl(eoo@AN~ZybaU0HjjKNs;I~_UW2_N)PvK%W!>z{Oo O!%J135f5m1>i+-?1X{rW diff --git a/jdk/src/windows/native/sun/jkernel/graphics/masthead.bmp b/jdk/src/windows/native/sun/jkernel/graphics/masthead.bmp deleted file mode 100644 index f4fa2a8f1a84d0f2d9912fa4b8e2146d59cf9d70..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33336 zcmeHP2|!a<);^E~kR4R~5rs$$f{JV^h*ntyM3x{zD^d-TQUyU#Ky*X~sR~MIt0~%A zux`a#eigbfrCMaHj{elKcGR)0?f=s{BZ}-u-Qhp?zV`y6RwN0jQ!nq`BZousH0A`(?ouCue06HO!aOtb};C5Rb z+{a@-T)7Xe*S-gsQU_*h+hM>f&7k!{J=Fbl90mk80^hp<3My{Hi68F4|NhShP<-+Z z42Wp~gQQki@!?HyU)>5ik&U1`vjrxty8#1Yo8asJUJkl*o8d)yJJg*15boV>1HZf* zkn@+@0G@Tw(a`}Tm$aZv9k8zCCfvdD@cFw?*U|w-scoP$rx7AH+yGr!3k*qUfped& z1-<#rP+wCG1Liftwqtj|WKBB^jc5epv>PxZqZM9#_gBzEIkd)K1ILxEV7#&oOjq9k z)65&7?bQIM_a{L|=RG*G#Sdm~{S^$CwSwJiH=ya?=RkK>6PT>J0rADRpyU26_}4!^ z2A$c>aP-~TaO}Mop}p}J`0VSu04}xg?Z<22!WVh)b3+Fl-#HHkrnLfiTtz+A!B<65 zaN~9dbar$?RY4$Fpe_vJ8{tgpD$v8v(~H7(atl-zgrFV}i@qs{_3`EpTeD z42H~WhLLg2pcB*x0^fQtOuhkn)2~D2mKkvW{(Uh1a~lW(>OnBG0sejA3lPkxgA=dSN?^MtupU*2A4&vGlkG-&e`Oa7im%Je-gEsDlBET7f_1I_OMq zfNy`g2VWM#?u*p}D;S_p?F8`;gcS_wU?<^wOKCuj?>% z^RJ-4s0Duc<^X6nN|qilEYcS6(UzoXu+ zf?+iB&A$n>CSHfCZDC-zuod(Z+MxEkFTre8E8Mwr8)7!z04>z79_oreqaOZIo(ls| zm%NE}Ai#TdrZ>W1e3s6lM!0zw$Hwe>xO?w5ymjy<7_9sic(aiE6B@u!)(j{2E&`+E zCeRCP1VDY8%x{7LiO4U+Lfh{;7_4Xmy~T*joa+GYwV>^O6|ViW0t}*BfQRFa|579T zbn<=RO>F{;%r@YA)&tM;8g$;h3;MGfK>uaL2tWJFEx};EycrBv--Lr_?gAgjpW#bQ zaQ5?T#AP9z`Y;JDex3{F>Fsdp{RMF4++VX!m;~O9hlC-&kn8wUNn}{ zRY|a&m5-S@^VHALvvn>5x3IK5P?&D+e z*56y|mkx3Ge?4Q$3?>a2&mLPol}i`?^aB2ojqXgwot%1sJ?d8|?yL5dReisxN?9R$ ze}6xAXUfDWQ>I+ReFj$>pfCXA6%hBPa^bq0#s*P8Dy;V?_Vvns?F@&yqMY$3ZupO1 zK7Kjb=+0zp&J~K1srb$niTm1VCGYE3ohd2n6K?O{u1p*~5!1yfZ4#9s00j7RmU!T$C5)g~Pq@D-Sb!44K;zep~0_bz|ept1IG!j?8XN?6u9lV1NeA!pLj+C@Wb@c zv1Fq=lg;>gqTek?Pe?kg3UONtoz6mdo_i> zCN%d%IG^qU4Rs;*Y%Hch2tBPZ)?jnQHb37|DBM;k9x-L2pF?Sc-xo7Rz{$dhLb0!6 zrkF@5K!B&EqF)5|LK8_t%2QoeHP(Sa+Xu0UtDqyWS!b@Fn_zdFpZ&YLr;pxP z>QEXO`$fduy=}e`qtGC{$oLA3=Q#QzB2U04yQz4q>U8o{pQJGbK9!V@y;x)752~9! zXzh2gWMio?arAixf8Vx?fda(eeCuup(}|-Cw{=_`Z7$e*7AK1b6Vd^>KdD*Rj9-+F7%{PUQ7zV7oagblbI!0~VC5V6}AjllHH5pyl;#ePcy1*U<% zrs7B7-^B(^1ppdVp>iD1u;_?7;=W}|7Y|tcmspxdM9f9}eM?Q3?2ZnMUAxhq96p$|<9-cWYRQeHEL&u|V1T8a3gq%BBzW@sDil*5z$qhuJ#Bu@1-o zl3)LNVDs+i-P1?Fh$TW%{StH#+cwwZ_>Uz>$KoH^=+0z#7+(QtBt4_}{|>~?TQ~o8 z{XECKygY*ad^7{2&%Z_Ne{9Fu*t2eez}P~uaOY-+h!35*Xr|>JM~w9!L_$f!Nmx{vGen&%?<8qXQBkY5O1HUq7%8-A|2Pr46f0@5-nTv~IjemY-ewK@*#y=>_ySUx3 z*u@M_x#(8-*Z4mYnndSXGyn<;kjY@}K>cwMg2@Vhkn;<>4t)NY>Ra12HUBH8y~jYJ zuES~&HqAPyJuRp>JD<-hv&KeNepa}DRuIBpWmuDMjr$INZ?X5oGeq#JVXIcTx~>{X zc`$USGbR9Yq)1)NQ{kw_$&x)nAOKA(>n*}So8 zmNt{L@tloh7k)cZED*yeQFjIy4qGs0*sx&>T!#&F#Wc*dcDv)yp|z`OIr!HNMX(9p z6mu?EU}(U#xN9Btce5l@lkR@|V^yQs-+qP)&ZTRe(tLl{yKV4Nq`bU+7m&E()!n^FsVP=^% zuclps$`|<;yAU3@Sd+85Wt0I;!auNsP7oYMgI>zM*S^SX;zJrs!qhR z$dd5pl2&OX_32RMlB#lPv6)qTg=kdfCV6?dzjvlpZe)ePMjB-;7Km)Dl1pm#+hjTI z@7X%7Y?st0 z{u{%s*>bOcixB_Z(0FTcnc-G(wD^JktO(JX6g(+r(xgdb1|aG6+D}%Uv&(UCD6}^j z9OyBeBoCYikPKl(fs^l9dc5w8L*E&*p(Jx=rwvz9ABo@pK<|QaFuJ=L4?MJA8Y&T}JV2vV79f55yC*ZOq7I(Iagcrqy5+psl4991|RK z>NaBU+W0+XfW>gjGqo0W_7V7-4u>4`!Pr_wfJaK;S^-@yAe3S}cLYUlLIRW_0St+=FUSw^N$2xhe6nYXZJd&QYW8mx?m!btMBpaz0uwXP6(o!rEKX`}_$#T{9x$n>sdAx0 zlOtyn0?4zity^W+!mE$~vSwYzuj9$&IR78^kMb!-`FTDvH29*~K0e_#(MSy|WWz(< z565|Lvfq6RH)- zCp|QBc4WC%d9z5gNgkiO(n;2weuy~#02SqOd89$UKXA=o(NfKtQL! zGw3tXa4=}gD=np3tW{&AO(>y_4sy(e9 z<@Z@e)rrHCMa_;3&8p!!g@*2ExrPMr%F0G}A4I#dbLDb`Se!2{j?cw#0NM}9{3TY_ zPO=*RO+nr~SrvI-&;y_Gu;SB7?YNJ$jkL8f3SgoE(j>m%tqAu7*Tz#<{_m4{Z;$mD zxoAvGf=P}AITMW20WH{^DXN$KUc5imDZI~^cipH`VTwy4vm+y2tYuNxnsFg09K!+p z#t*`(n|?^1y^B0G2;U7k;XyPA+0ibMB{&X?uxtCMu%Hka@MX3t>15VGg7{1!h1XH!0#}W6DX!r>W5**Aa@`Mj` zV+y3g75BN1cz|;1>&xA$S9xEgzSp$0d?Sp(7N2izA+ffT>0?+6AeVaSe%BXvNq$l$sVH_IB0PCPnz> zFU({tP6ZzsnMVA?c!ktn;q(2U*P1{c+d_M_M>?M^&IU)R!C22D` z`F3TK6&{huDN>g^)Qb}F|Fm*LWole%WoiuifwYBF0xk+RyuI4)$YK%>1O#}vUm=wQ zcaNMfWWh&twjis9`0|LnKO*~Bjs5eVep35ysk47YFbs)u3XRW>#DAmNl_b(~Gl}F! z8Ls~KehpSAT)5$Q5qj~qQe{twizM|GY0;HvRl{-bs=}SMwqxn29sq~wbX8fnXK`2ZzPQtV_ zDGA}P+>n&C;rPO%3kkdgW#SpSSKl$pIB8D+Ctwp=;6`?a0}KP=?wCFlTqq>#hf4qG z{jnYC@5g7R9}1BL^_*`dF8ThC2=X2)HGoh!$2f_i9uTA08ALl{S+daov@U(ZJIr zivOBvbBwj)5O%E4JdSY)NxnGZNaez@-h!}&7$^|@S!a=H5DqY;NO51rN<-XEk{@4BBRMJdW>*yUja~(vRAYApn|48hR`PdRM&NWd#t3-X@{&wKc}m zjEw^pt}&QHHnOu`z|o_rDeeM~xD7b`SATUpg?fj_msT2+Is%Ubz;{P0Qc@@h>@4H>y7sr80<4fTnV(tQ&LPy(fr?v);U4iG(ONKZbB+; zav3E7S^dEumptRz{iBI56kfi3aQ&x874Wa$W4rHo(uS|djsw1^w0c9*k?636j7``; z55M!Mgx~yESfD?e7N6bz3Wfi=d^t&*g`b!Lv;otMNgzn$!XwcR8A%gzU~%VhMWEPK zA*3J?BgyUGeRj3*$CX?tJa}-;e=+c*B{+Bqo5UY5o`%WTIH|Iz)c%g~+YY8DHn6Z8 zaPV{M225#Gh~^(BfamF%(ty73m_dWVrO%FC`s^U0Ps{H38=nXhgiV<9wvK7WQVa~H zy@t%dNP+xO9#HT}W~B4n{6AC3Gr|gmm#)6{1H~OF@bMnoW45*m{7E#p=3A4}oQ$O> z>~fA&Do%7&6t(C0KZEF#^}i(JV`Th$9`mH|dlLVjnE;a5aPfyQ)B!ag=hK|mO zH4mPc)}v`$q_O|}p#io1$2?Lfe3hhGBw_Bkr#q~OJxhd)ZPj{u>-B!tGuTHK2yFMg zLdikc!BORwhSvN4W1!GTM_BwR2?z~rX=27bMHWFP(cuw?3Eikcslf0-K>>Hh{y$#> z(g==yeW*~#j(j@&XU*z9yvg9kQBM|y_ASjB%UXu+xpehz_0&M3iMT!=l5wq z0}TGu{Lexo@Cr#dq`N@os@1EJ2uKCiK0I&8gO%e6O-qgZ!$9g z13y8ZGJt}8$rdMk+to)H=$V%7D=aTqq7c^H!r%Ts>MN#7O8ESCb!x!PmBpX3;4^}1 zH_*G)$4=N|yJyd5dtPFW*>XG}jG@Wk4GaLDuK}tPEH!-g@}&y=J>Mh?Kpgs{M2u-7 zSflNKfB-E1%vER~FxkIL;D7D_ssSdoePrBJfY>3MpFG$4xu_z6}0Ip;$ zG9ZXi1|WIYSB(U}4-!-%Ll8?IS1+O0;-!e! zN=P7|!CE5uO!@^bTZMV#3&~T674%G1H^Qk}f^&@ocSf&T36@clVeIURVD1>l9TOPG zSJz{7c@4%@en2#9G2A&>&3%kv~xAypDW8AtJkh<6gA7$-7Lddq#RPiBlGoI*!o7H?X@TO407e@Z;( z{p4MrN$@1^Rw1D$a~~q0QbG{-1d|WoE~UyE!%HeKf%_)#o(O*L2*ybEqR69Jk70~q zEtWi%yE_C1Ba!zwJ|P})-(!B4atSWvF08o{ZshK)xwGfN+>>{CF?M6@&RP%N)`R_? zjJ;U*=AGV*y_x$^<3sMtnjfQJZUKMRgO~@gH=b`6&hOB^r!U%d^F}1OrMEvUd-)-n zcdL2_z{@o z^9t;@T!8)NJh<&B!k|ON7`XpBVt=}awRv}ub?FgK-l@RtiZ^Jt@;Gcao`-FE9wHB4 z!Q#`maO!R)%3f6CQgJC>*1m^T$`9zW`UGTh0Ry(@q5syiNIi7}+w;nhdF~cYmOe#Q zT|LCa{lxbW6ZXMs(Gd(=cN8Ntjw5{MFIaHoGHyS6jh2=cG&eV+si_GK4Gqw0wWzDB zLseB3%F4=6R8)lg{Cr3h)-2T)4NlG(ACKuimrli>Rr>HI@QJ=eaDz5Ko~Q2tS&0X^z|^V z{*$7y%H;Ee)YfTGrY4T<*Kcg1jw@0VJ~ydq{Ny8Q-~T!=DK!md|Ak4~jD8)Bj5_w4 zk;Y6+OHCU1>wE40uMyRCcO4?vQF{XNwc|QMkVD>a+*(~Ormc%~xLc?GsLq!`p?!aD zP||v{laQ|uGJ^0o$c=*5gSldT(!g`?KfVZ+^sNnv+VCArson5NyFr(W-))Ersim*s z{Vr0i`EX%Kaz;8#exiDOCkW3W?=*gcE*H}?l80RQpg}AByB6?@^4gGzGdG%?hDrL& z;LZv~=ir&?%oH1EP7J9nZ~cc(=lW&%=1nm9AC#MBO$ZL2Fl!UJxM_3vmpVs-vQX#v z^o!`(TTIVDv1RM**;@^4cJvod%iHMPbQ(=%!SH#RX4@cSCMWBnB6HsGf=Z1+QA9<< zv%!Osx0|q&72dypc$SWBPaZV*S%bOWg&I-ws-WkB>>V)v8H#LAFE7t*GI2-tf}RDh zG%)BcQAe*yb9U{7@)s!Pcn%ogIfqQ#xogfO+M%u9Pp8woEa(-rI|t%Fpv;N*?Cjak zB67&ZoZV5q3SMeHDlhZ8`WK6a&D|^h6Ux02;+{QXgpMor&KEGAbhndEZ5 zqQ0Hpk1G0IQH7-(fDv^m4m}PX>fw+=E*?k;Q(d8-L3x#a+KN1v*ri4Xpo}pcaq!>> z(-?Ba(pZXUV@SvCJWO8w7jGyYp9W@NfYciN=ALO|X zUB2w_;blWx3IB#!tD!o+e5h;Q1FfarPp4Afxo+hjyCOGtMYlG>zhKs;n~ul&TV21S zHmI)4U`j95uqi8YS9W)Ta0I4K-B;$Wm@-U7E2#8dI+gnI{XPM4D|4qfc7gC8n09fT zlDjf4pwIos>W``$GMH!{=39;YcGb77eTAbi@oh~y(klO<#!Bx~EQ4|R{XT(HznN-2 z0>Te49$`)%*ynyZtUoE}VI4L#)M6ThV=$g(5jr)@nid}wC48sydtbYRjYy!~v7ZfOkNo1ASZp6=SatuKVt5PjSBcAZ|_ zfDZaub}clwi){RT+WW3v?c3hR-=^rc#?UL3!JLySAD?!XmhF6eR2;L_PqCxmR0sbs z;qOp{`FG%qp>s -#include -#include - -CComModule _Module; - -#include -#include -#include -#include "Windows.h" -#include "WinNT.h" -#include -#include "DownloadDialog.h" -#include "DownloadHelper.h" -#include "kernel.h" -#include "sun_jkernel_DownloadManager.h" -#include "sun_jkernel_Bundle.h" -#include "sun_jkernel_Mutex.h" -#include "sun_jkernel_BackgroundDownloader.h" -#include -#include -#include -#include -#include -#include -#include -#include - -BOOL IsPlatformWindowsVista(); - -#define BUFSIZE 4096 - -#define JBROKERPIPE "\\\\.\\pipe\\jbrokerpipe" -#define JREMAINKEY "SOFTWARE\\JavaSoft\\Java Runtime Environment" -#define JRE_VERSION_REGISTRY_KEY JREMAINKEY "\\" VERSION -#define ReleaseAndClose(mutex) \ - if (mutex != NULL) { \ - ReleaseMutex(mutex); \ - CloseHandle(mutex); \ - mutex = NULL; \ - } - -#define KERNEL_DEBUG false - -// used to inform kernel that we believe it is running in high integrity -#define JBROKER_KEY "-Dkernel.spawned.from.jbroker=true -Dkernel.background.download=false" - -// this is only available on Vista SDK, hard code it here for now -#define LABEL_SECURITY_INFORMATION (0x00000010L) - -// The LABEL_SECURITY_INFORMATION SDDL SACL to be set for low integrity -LPCSTR LOW_INTEGRITY_SDDL_SACL = "S:(ML;;NW;;;LW)"; - -CDownloadDialog dlg; -BOOL createDialog = TRUE; - -CComAutoCriticalSection m_csCreateDialog; - -typedef BOOL (WINAPI *LPFNInitializeSecurityDescriptor)( - PSECURITY_DESCRIPTOR pSecurityDescriptor, DWORD dwRevision); -typedef BOOL (WINAPI *LPFNSetSecurityDescriptorDacl)( - PSECURITY_DESCRIPTOR pSecurityDescriptor, BOOL bDaclPresent, PACL pDacl, - BOOL bDaclDefaulted); - -typedef BOOL (WINAPI *LPFNConvertStringSecurityDescriptorToSecurityDescriptorA)( - LPCSTR StringSecurityDescriptor, DWORD StringSDRevision, - PSECURITY_DESCRIPTOR* SecurityDescriptor, - PULONG SecurityDescriptorSize); - -typedef BOOL (WINAPI *LPFNGetSecurityDescriptorSacl)( - PSECURITY_DESCRIPTOR pSecurityDescriptor, LPBOOL lpbSaclPresent, - PACL* pSacl, LPBOOL lpbSaclDefaulted); - -typedef DWORD (WINAPI *LPFNSetSecurityInfo)(HANDLE handle, - SE_OBJECT_TYPE ObjectType, SECURITY_INFORMATION SecurityInfo, - PSID psidOwner, PSID psidGroup, PACL pDacl, PACL pSacl); - -BOOL APIENTRY DllMain( HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved - ) -{ - return TRUE; -} - -char* getStringPlatformChars(JNIEnv* env, jstring jstr) { - char *result = NULL; - size_t len; - const jchar* utf16 = env->GetStringChars(jstr, NULL); - len = wcstombs(NULL, (const wchar_t*)utf16, env->GetStringLength(jstr) * 4) + 1; - if (len == -1) - return NULL; - result = (char*) malloc(len); - if (wcstombs(result, (const wchar_t*)utf16, len) == -1) - return NULL; - env->ReleaseStringChars(jstr, utf16); - return result; -} - -bool SetObjectToLowIntegrity ( HANDLE hObject, - SE_OBJECT_TYPE type = SE_KERNEL_OBJECT ) { - - bool bRet = false; - DWORD dwErr = ERROR_SUCCESS; - PSECURITY_DESCRIPTOR pSD = NULL; - PACL pSacl = NULL; - BOOL fSaclPresent = FALSE; - BOOL fSaclDefaulted = FALSE; - - // initialize function pointers - HMODULE hModule = LoadLibrary("Advapi32.dll"); - - // ConvertStringSecurityDescriptorToSecurityDescriptorA - LPFNConvertStringSecurityDescriptorToSecurityDescriptorA - lpfnConvertStringSecurityDescriptorToSecurityDescriptorA = - (LPFNConvertStringSecurityDescriptorToSecurityDescriptorA)GetProcAddress( - hModule, - "ConvertStringSecurityDescriptorToSecurityDescriptorA"); - - // GetSecurityDescriptorSacl - LPFNGetSecurityDescriptorSacl lpfnGetSecurityDescriptorSacl = - (LPFNGetSecurityDescriptorSacl)GetProcAddress(hModule, - "GetSecurityDescriptorSacl"); - - // SetSecurityInfo - LPFNSetSecurityInfo lpfnSetSecurityInfo = - (LPFNSetSecurityInfo)GetProcAddress(hModule, - "SetSecurityInfo"); - - if (lpfnConvertStringSecurityDescriptorToSecurityDescriptorA == NULL || - lpfnGetSecurityDescriptorSacl == NULL || - lpfnSetSecurityInfo == NULL) { - if (KERNEL_DEBUG) { - printf("Fail to initialize function pointer\n"); - } - FreeLibrary(hModule); - return FALSE; - } - - // Set object to lower integrity - if ( lpfnConvertStringSecurityDescriptorToSecurityDescriptorA( - LOW_INTEGRITY_SDDL_SACL, SDDL_REVISION_1, &pSD, NULL ) ) { - if ( lpfnGetSecurityDescriptorSacl( - pSD, &fSaclPresent, &pSacl, &fSaclDefaulted ) ) { - dwErr = lpfnSetSecurityInfo( - hObject, type, LABEL_SECURITY_INFORMATION, - NULL, NULL, NULL, pSacl ); - - bRet = (ERROR_SUCCESS == dwErr); - } - - LocalFree( pSD ); - } - - FreeLibrary(hModule); - return bRet; -} - - -JNIEXPORT jlong JNICALL Java_sun_jkernel_Mutex_createNativeMutex - (JNIEnv *env , jclass cls, jstring id) { - SECURITY_ATTRIBUTES sa; - PSECURITY_DESCRIPTOR pSD = NULL; - BOOL saInitialized = FALSE; - - // initialize function pointers - HMODULE hModule = LoadLibrary("Advapi32.dll"); - - // InitializeSecurityDescriptor - LPFNInitializeSecurityDescriptor lpfnInitializeSecurityDescriptor = - (LPFNInitializeSecurityDescriptor)GetProcAddress(hModule, - "InitializeSecurityDescriptor"); - - // SetSecurityDescriptorDacl - LPFNSetSecurityDescriptorDacl lpfnSetSecurityDescriptorDacl = - (LPFNSetSecurityDescriptorDacl)GetProcAddress(hModule, - "SetSecurityDescriptorDacl"); - - if (lpfnInitializeSecurityDescriptor != NULL && - lpfnSetSecurityDescriptorDacl != NULL) { - - // Initialize a security descriptor. - pSD = (PSECURITY_DESCRIPTOR) LocalAlloc(LPTR, - SECURITY_DESCRIPTOR_MIN_LENGTH); - if (NULL == pSD) { - if (KERNEL_DEBUG) { - printf("LocalAlloc Error %u\n", GetLastError()); - } - FreeLibrary(hModule); - return NULL; - } - - if (!lpfnInitializeSecurityDescriptor(pSD, - SECURITY_DESCRIPTOR_REVISION)) { - if (KERNEL_DEBUG) { - printf("InitializeSecurityDescriptor Error %u\n", GetLastError()); - } - FreeLibrary(hModule); - return NULL; - - } - // Add the ACL to the security descriptor. - if (!lpfnSetSecurityDescriptorDacl(pSD, - TRUE, // bDaclPresent flag - NULL, // NULL DACL is assigned to the security descriptor, - // which allows all access to the object. - // This is to allow the mutex to be accessbile by - // all users; The background downloader launched - // by the installer will be running as SYSTEM user; - // while other java process started by the current - // user will be running as the current username. - FALSE)) // not a default DACL - { - if (KERNEL_DEBUG) { - printf("SetSecurityDescriptorDacl Error %u\n", - GetLastError()); - } - FreeLibrary(hModule); - return NULL; - } - - // Initialize a security attributes structure. - sa.nLength = sizeof (SECURITY_ATTRIBUTES); - sa.lpSecurityDescriptor = pSD; - sa.bInheritHandle = FALSE; - - saInitialized = TRUE; - FreeLibrary(hModule); - } - - HANDLE m = CreateMutex(saInitialized ? &sa : NULL, FALSE, - (LPCSTR) getStringPlatformChars(env, id)); - if (m == NULL) { - if (KERNEL_DEBUG) { - printf("CreateMutex Error %u\n", GetLastError()); - } - } - - // set the mutex object to low integrity on vista, so the mutex - // can be accessed by different integrity level - if (IsPlatformWindowsVista()) { - if (!SetObjectToLowIntegrity(m)) { - if (KERNEL_DEBUG) { - printf("Fail to set Mutex object to low integrity\n"); - } - } - } - return (jlong)m ; -} - - -HANDLE getMutexHandle(JNIEnv *env, jobject mutex) { - jfieldID handle = env->GetFieldID(env->GetObjectClass(mutex), "handle", "J"); - return (HANDLE) env->GetLongField(mutex, handle); -} - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_Mutex_acquire__I - (JNIEnv *env, jobject mutex, jint timeout) { - HANDLE hmutex = getMutexHandle(env, mutex); - if (hmutex != NULL) { - int result = WaitForSingleObject(hmutex, timeout); - if (result == WAIT_ABANDONED) - result = WaitForSingleObject(hmutex, timeout); - return (result == WAIT_OBJECT_0); - } - else - return false; -} - -void ThrowByName(JNIEnv *env, const char *name, const char *msg) { - jclass cls = env->FindClass(name); - /* if cls is NULL, an exception has already been thrown */ - if (cls != NULL) { - env->ThrowNew(cls, msg); - } - /* free the local ref */ - env->DeleteLocalRef(cls); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_Mutex_acquire__ - (JNIEnv *env, jobject mutex) { - if (!Java_sun_jkernel_Mutex_acquire__I(env, mutex, INFINITE)) { - // failed to acquire mutex, most likely because it was already disposed - ThrowByName(env, "java/lang/IllegalStateException", - "error acquiring mutex"); - } -} - -JNIEXPORT void JNICALL Java_sun_jkernel_Mutex_release - (JNIEnv *env, jobject mutex) { - HANDLE hmutex = getMutexHandle(env, mutex); - if (hmutex != NULL) - ReleaseMutex(hmutex); - else - ThrowByName(env, "java/lang/IllegalStateException", - "releasing disposed mutex"); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_Mutex_destroyNativeMutex - (JNIEnv *env, jobject mutex) { - HANDLE hmutex = getMutexHandle(env, mutex); - if (hmutex != NULL) { - Java_sun_jkernel_Mutex_release(env, mutex); - CloseHandle(hmutex); - } -} - -void createDownloadWindowProc(LPVOID lpParameter) { - CDownloadDialog* pDlg = (CDownloadDialog *) lpParameter; - - pDlg->delayedDoModal(); - - // dialog destroyed, need to create a new one next time - createDialog = TRUE; -} - - -void createDownloadWindow(LPVOID lpParameter) { - // Create a new thread for download window - DWORD dwThreadId = NULL; - ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) createDownloadWindowProc, lpParameter, 0, &dwThreadId); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_bundleInstallComplete - (JNIEnv *env, jclass dm) { - dlg.bundleInstallComplete(); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_bundleInstallStart - (JNIEnv *env, jclass dm) { - - dlg.bundleInstallStart(); -} - -typedef HRESULT (WINAPI *LPFNIEIsProtectedModeProcess)(BOOL *pbResult); - -BOOL isRunningIEProtectedMode() { - - HMODULE hModule = NULL; - LPFNIEIsProtectedModeProcess lpfnIEIsProtectedModeProcess; - - __try { - hModule = LoadLibrary("ieframe.dll"); - if (hModule != NULL) { - - lpfnIEIsProtectedModeProcess = (LPFNIEIsProtectedModeProcess) - GetProcAddress(hModule, "IEIsProtectedModeProcess"); - - if (lpfnIEIsProtectedModeProcess != NULL) { - BOOL bProtectedMode = FALSE; - HRESULT hr = lpfnIEIsProtectedModeProcess(&bProtectedMode); - if ( SUCCEEDED(hr) && bProtectedMode ) { - // IE is running in protected mode - return TRUE; - } else { - // IE isn't running in protected mode - return FALSE; - } - } - } - } __finally { - if (hModule != NULL) { - FreeLibrary(hModule); - } - } - return FALSE; -} - -/* Return TRUE if current running platform is Windows Vista, FALSE otherwise */ -BOOL IsPlatformWindowsVista() { - static BOOL initialized = FALSE; - static BOOL isVista = FALSE; - OSVERSIONINFO osvi; - - if (initialized) { - return isVista; - } - - // Initialize the OSVERSIONINFO structure. - ZeroMemory( &osvi, sizeof( osvi ) ); - osvi.dwOSVersionInfoSize = sizeof( osvi ); - - GetVersionEx( &osvi ); // Assume this function succeeds. - - if ( osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && - osvi.dwMajorVersion == 6 ) { - isVista = TRUE; - } else { - isVista = FALSE; - } - - initialized = TRUE; - - return isVista; -} - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_isIEProtectedMode - (JNIEnv *env, jclass dm) { - - if (isRunningIEProtectedMode()) { - return TRUE; - } - return FALSE; -} - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_isWindowsVista - (JNIEnv *env, jclass dm) { - - if (IsPlatformWindowsVista()) { - return TRUE; - } - return FALSE; -} - -int sendMessageToBroker(const char * message) { - char ackString[1024]; - HANDLE hp = INVALID_HANDLE_VALUE; - - while (hp == INVALID_HANDLE_VALUE) { - hp = CreateNamedPipe(_T(JBROKERPIPE), - PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE , - PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT, - 1, // number of pipes that can exist - 1024, // output buffer - 1024, // input buffer - 0, // timeout - NULL); // security attributes - - if (hp == INVALID_HANDLE_VALUE) { - DWORD err = GetLastError(); - // we only allow one instance of the pipe; if the instance - // already exists, we will get ERROR_ACCESS_DENIED, which means - // some other process is using the pipe, so let's try again - if (err != ERROR_ACCESS_DENIED && err != ERROR_PIPE_BUSY) { - // create pipe failed - return 0; - } - // pipe instance might be in use, keep trying - } - } - - // Wait for the client to connect; if it succeeds, - // the function returns a nonzero value. If the function - // returns zero, GetLastError returns ERROR_PIPE_CONNECTED. - BOOL fConnected = ConnectNamedPipe(hp, NULL) ? - TRUE : (GetLastError() == ERROR_PIPE_CONNECTED); - - if (fConnected) - { - // Send message to the pipe server. - DWORD cbWritten; - - BOOL fSuccess = WriteFile( - hp, // pipe handle - message, // message - (strlen(message)+1)*sizeof(char), // message length - &cbWritten, // bytes written - NULL); // not overlapped - - if (!fSuccess) - { - // WriteFile failed - CloseHandle(hp); - return 0; - } - - // wait for ack from server - DWORD cbRead; - TCHAR chBuf[BUFSIZE]; - - do - { - // Read from the pipe. - fSuccess = ReadFile( - hp, // pipe handle - chBuf, // buffer to receive reply - BUFSIZE*sizeof(TCHAR), // size of buffer - &cbRead, // number of bytes read - NULL); // not overlapped - - if (! fSuccess && GetLastError() != ERROR_MORE_DATA) - break; - - sprintf(ackString, "%s", chBuf); - - - } while (!fSuccess); // repeat loop if ERROR_MORE_DATA - } - - CloseHandle(hp); - - if (strcmp(ackString, "SUCCESS") == 0) { - // server completed move command successfully - return 1; - } - - return 0; -} - -int sendMoveMessageToBroker(const char * fromPath, const char * userHome) { - // Send move message - char * movecmd = "MOVEFILE"; - - char * msg = (char*)malloc((strlen(fromPath) + strlen(movecmd) + - strlen(userHome) + 3) * sizeof(char)); - - sprintf(msg, "%s*%s*%s", movecmd, fromPath, userHome); - - return sendMessageToBroker(msg); -} - -int sendMoveDirMessageToBroker(const char * fromPath, const char * userHome) { - // Send move dir message - char * movecmd = "MOVEDIR"; - - char * msg = (char*)malloc((strlen(fromPath) + strlen(movecmd) + - strlen(userHome) + 3) * sizeof(char)); - - sprintf(msg, "%s*%s*%s", movecmd, fromPath, userHome); - - return sendMessageToBroker(msg); -} - - -int sendKillMessageToBroker() { - // Send move message - char * killcmd = "KILLBROKER"; - return sendMessageToBroker(killcmd); -} - - -int sendPerformCompletionMessageToBroker(const char *javaHome) { - const char *cmd = "PERFORMCOMPLETION"; - - int result = sendMessageToBroker(cmd); - - if (result) - sendKillMessageToBroker(); - return result; -} - -int getConstantInt(JNIEnv *env, jclass cls, const char *name) { - jfieldID handle = env->GetStaticFieldID(cls, name, "I"); - return env->GetStaticIntField(cls, handle); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_displayError - (JNIEnv *env, jclass dm, jint code, jstring arg) { - int messageId = IDS_FATAL_ERROR; - int titleId = IDS_ERROR_CAPTION; - if (code == getConstantInt(env, dm, "ERROR_MALFORMED_BUNDLE_PROPERTIES")) - messageId = IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES; - else if (code == getConstantInt(env, dm, "ERROR_DOWNLOADING_BUNDLE_PROPERTIES")) - messageId = IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES; - else if (code == getConstantInt(env, dm, "ERROR_MALFORMED_URL")) - messageId = IDS_ERROR_MALFORMED_URL; - char message[BUFFER_SIZE]; - char rawMessage[BUFFER_SIZE]; - char title[BUFFER_SIZE]; - ::LoadString(_Module.GetModuleInstance(), titleId, title, BUFFER_SIZE); - ::LoadString(_Module.GetModuleInstance(), messageId, rawMessage, BUFFER_SIZE); - if (arg != NULL) { - char *chars = getStringPlatformChars(env, arg); - sprintf(message, rawMessage, chars); - } - else - strcpy(message, rawMessage); - - MessageBox(NULL, message, title, MB_OK|MB_TASKMODAL); -} - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_askUserToRetryDownloadOrQuit - (JNIEnv *env, jclass dm, jint code) { - - int ret; - if (code == getConstantInt(env, dm, "ERROR_DISK_FULL")) { - ret = dlg.SafeMessageBox(IDS_DISK_FULL_ERROR, - IDS_DISK_FULL_ERROR_CAPTION, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL); - } else { - ret = dlg.SafeMessageBox(IDS_DOWNLOAD_RETRY_TEXT, - IDS_DOWNLOAD_RETRY, - IDS_ERROR_CAPTION, - DIALOG_ERROR_RETRYCANCEL); - } - if (ret != IDRETRY) { - // user choose to exit, return 0 - return JNI_FALSE; - } - - // return 1 (retry the download) - return JNI_TRUE; -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_startBackgroundDownloadWithBrokerImpl -(JNIEnv *env, jclass dm, jstring command) { - - char* szCommand = getStringPlatformChars(env, command); - - // Send createprocess message - char * createproccmd = "STARTBACKGROUNDDOWNLOAD"; - - char * msg = (char*)malloc((strlen(createproccmd) + strlen(szCommand) + 2) * sizeof(char)); - - sprintf(msg, "%s*%s", createproccmd, szCommand); - - sendMessageToBroker(msg); - - free(szCommand); -} - - -void getParent(TCHAR *path, TCHAR *dest) { - char* lastSlash = max(strrchr(path, '\\'), strrchr(path, '/')); - if (lastSlash == NULL) { - *dest = NULL; - return; - } - if (path != dest) - strcpy(dest, path); - *lastSlash = NULL; -} - - -bool createProcess(const TCHAR *path, const TCHAR *args) { - SHELLEXECUTEINFOA shInfo; - - shInfo.cbSize = sizeof(SHELLEXECUTEINFOA); - shInfo.fMask = 0; - shInfo.hwnd = NULL; - shInfo.lpVerb = "runas"; - shInfo.lpFile = path; - shInfo.lpParameters = args; - shInfo.lpDirectory = NULL; - shInfo.nShow = SW_NORMAL; - shInfo.hInstApp = NULL; - - int result = (int) ::ShellExecuteExA(&shInfo); - // ShellExecute is documented to return >32 on success, but I'm consistently - // getting a return of 1 despite obviously successful results. 1 is not a - // documented return code from ShellExecute, and this may have something to - // do with the fact that we're using an undocumented verb in the first place - // ("runas"). - return result > 32 || result == 1; -} - - -bool launchJBroker(const char *szJavaHome) { - char szPath[2048]; - wsprintf(szPath, "%s\\bin\\jbroker.exe", szJavaHome); - return createProcess(szPath, NULL); -} - - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_launchJBroker -(JNIEnv *env, jclass dm, jstring javaHomePath) { - char* szJavaHome = getStringPlatformChars(env, javaHomePath); - bool result = launchJBroker(szJavaHome); - free(szJavaHome); - return result ? TRUE : FALSE; -} - - -bool isJBrokerRunning() { - HANDLE hMutex = NULL; - DWORD ret = 0; - - if (isRunningIEProtectedMode()) { - - // check if jbroker process is running - // Use OpenMutex since we have limited access rights. - // CreateMutex function will fail with ERROR_ACCESS_DENIED in protected mode - hMutex = OpenMutex(SYNCHRONIZE, FALSE, "SunJavaBrokerMutex"); - - ret = ::GetLastError(); - - if (hMutex != NULL) { - CloseHandle(hMutex); - } - - if (ret == ERROR_FILE_NOT_FOUND) - { - // jbroker not running yet, launch it - return FALSE; - } - - return TRUE; - - } else { - hMutex = ::CreateMutex(NULL, TRUE, "SunJavaBrokerMutex"); - - if ( (hMutex == NULL) || (::GetLastError() == ERROR_ALREADY_EXISTS)) { - // jbroker already running - if (hMutex != NULL) ::CloseHandle(hMutex); - return TRUE; - } - - if (hMutex != NULL) ::CloseHandle(hMutex); - - return FALSE; - } -} - - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_isJBrokerRunning -(JNIEnv *env, jclass dm) { - return isJBrokerRunning() ? TRUE : FALSE; -} - - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_moveDirWithBrokerImpl - (JNIEnv *env, jclass dm, jstring fromPath, jstring userHome) { - - char* fromPathChars = getStringPlatformChars(env, fromPath); - - char* userHomeChars = getStringPlatformChars(env, userHome); - - int ret = sendMoveDirMessageToBroker(fromPathChars, userHomeChars); - - free(fromPathChars); - - free(userHomeChars); - - if (ret == 0) { - return FALSE; - } - return TRUE; -} - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_moveFileWithBrokerImpl - (JNIEnv *env, jclass dm, jstring fromPath, jstring userHome) { - - char* fromPathChars = getStringPlatformChars(env, fromPath); - - char* userHomeChars = getStringPlatformChars(env, userHome); - - int ret = sendMoveMessageToBroker(fromPathChars, userHomeChars); - - free(fromPathChars); - - free(userHomeChars); - - if (ret == 0) { - return FALSE; - } - return TRUE; -} - -/** - * Throw an exception with the last Windows error code if available. - */ - -void ThrowByNameWithLastError(JNIEnv *env, char *exception, char* msg) { - char fullMsg[1024] = {0}; - if (StringCbPrintf(fullMsg, 1024, "%s. Windows error: %d\n", - msg, GetLastError()) != S_OK) { - - // Formatting failed: fall back to msg w/o error code - ThrowByName(env, exception, msg); - } else { - ThrowByName(env, exception, fullMsg); - } -} - -/** - * Common code for "extra" compression or uncompression. If extra code - * not available do nothing but return false. If available, return true - * after locating the extra compression library at ".." and the defined - * path relative to the native library containing this method's code. - * If enabled, compress or uncompress the srcPath file into destpath, - * throwing exceptions for errors (see JNI routine docs below for details). - */ - -jboolean extraCommon(BOOL docompress, - JNIEnv *env, jclass dm, jstring srcPath, jstring destPath) { -#ifdef EXTRA_COMP_INSTALL_PATH - const char *operation = (docompress == true) ? "e" : "d"; - - // This should be shared with the deploy tree and should be defined - // in an implementation like LzmaAlone.h. However the deploy build - // doesn't exit yet wrt to this function pointer type. - - typedef int (*EXTRACOMPTRTYPE) (int, const char**); - - // Function pointer for invoking the encoder/decoder (uncompressor) - static volatile EXTRACOMPTRTYPE mptr = NULL; - // Volatile boolean becomes true when mptr init is finished - -// Stringifier macros to get the relative library path - -#define K_STRING(x) #x -#define K_GETSTRING(x) K_STRING(x) - - char *srcPathChars = getStringPlatformChars(env, srcPath); - - if (srcPathChars == NULL) { - // TODO (for all throw calls). If the class&method are *reliably* - // reported to the user these message prefixes are silly. - ThrowByName(env, "java/io/IOException", - "Bundle.uncompress: GetStringPlatformChars failed"); - return true; - } - - char *destPathChars = getStringPlatformChars(env, destPath); - if (destPathChars == NULL) { - free(srcPathChars); - ThrowByName(env, "java/io/IOException", - "Bundle.uncompress: GetStringPlatformChars failed"); - return true; - } - if (KERNEL_DEBUG) { - printf("LZMA: %s %s to %s\n", operation, srcPathChars, destPathChars); - } - - - // This loop avoids a lot of repetitious code for exception handling. - // If any loops are put inside this one be careful to properly - // handle exceptions within the inner loops. - - do { - - if (mptr == NULL) { - - // Need to locate and link to the extra compression lib, which - // has a pathname relative to the directory containing the library - // containing this code, which is assumed to be one directory - // "below" the JRE base path. That is, the JRE base path is - // assumed to be ".." from the path of this library and then - // EXTRA_COMP_INSTALL_PATH from the JRE base path is expected to - // be the compression lib path. - // But this code is defensive and tries not to fail if the - // currently executing library is in ".". It will fail in a - // case like this if the extra compression lib path isn't - // "./EXTRA_CMP_INSTALL_PATH" (or just "EXTRA_CMP_INSTALL_PATH"). - // Use macro magic to get the path macro as a string value. - - const char *libRelativePath = K_GETSTRING(EXTRA_COMP_INSTALL_PATH); - - // The max length the base JRE path can be to safely concatenate - // libRelativePath, a (possible) separator, and a null terminator. - int jreMaxPathLength = MAX_PATH - sizeof(libRelativePath) - 2; - - TCHAR extraLibPath[MAX_PATH] = {0}; - HMODULE kernel = GetModuleHandle("jkernel"); - if (kernel != NULL) { - DWORD result = GetModuleFileName(kernel, extraLibPath, - MAX_PATH-1); - if (result > 0) { - // remove the name of this library (and maybe a - // separator) - getParent(extraLibPath, extraLibPath); - if (extraLibPath[0] != NULL) { - // There was a directory containing the library - // (probably "bin"), so - // remove that to go up to the assumed JRE base path - getParent(extraLibPath, extraLibPath); - } else { - ThrowByName(env, "java/io/IOException", - "bundle uncompression: expected lib path component not found"); - break; - } - // This is effectively an assertion that the concat - // below cannot overflow - if (extraLibPath[0] != NULL) { - // Current dir is not ".", so add a separator - strcat(extraLibPath, "\\"); - } - if ((strlen(extraLibPath) + 1) > jreMaxPathLength) { - ThrowByName(env, "java/io/IOException", - "bundle uncompression: JRE base pathname too long"); - break; - } - strcat(extraLibPath, libRelativePath); - } else { - ThrowByName(env, "java/io/IOException", - "bundle uncompression: GetModuleFileName failed"); - break; - } - } else { - ThrowByNameWithLastError(env, "java/io/IOException", - "bundle uncompression: GetModuleHandle failed"); - break; - } - - // Load the library and develop a pointer to the decoder routine - - if (KERNEL_DEBUG) { - printf("bundle uncompression: extra library path %s\n", - extraLibPath); - } - - HMODULE handle = LoadLibrary(extraLibPath); - if (handle == NULL) { - ThrowByNameWithLastError(env, "java/io/IOException", - "bundle uncompression: LoadLibrary failed"); - break; - } - - // find the extra uncompression routine - - mptr = (EXTRACOMPTRTYPE) GetProcAddress(handle, - "ExtraCompressionMain"); - - if (mptr == NULL) { - ThrowByNameWithLastError(env, "java/io/IOException", - "bundle uncompression: GetProcAddress failed"); - break; - } - } - - // Create the arguments for the decoder - // Decoder options must go *between* the "d" argument and the - // source path arguments and don't forget to keep the 1st arg to - // (*mptr) the same as the number of elements of args. - const char *args[] = { - "", // the shared lib makes no attempt access it's "command name" - operation, - - // Special decoder/encoder switch strings would go here - - // For example: "-d24", to set the dictionary size to 16MB - - "-q", // Suppress banner msg output - - // No special option switch strings after here - - srcPathChars, - destPathChars - }; - int argc = sizeof(args) / sizeof(const char *); - if ((*mptr)(argc, args) != 0) { - if (KERNEL_DEBUG) { - printf("uncompress lib call failed with args: "); - for (int i = 0; i < argc; i++) { - printf("%s", args[i]); - } - printf("\n"); - } - ThrowByName(env, "java/io/IOException", - "bundle uncompression: uncompression failed"); - break; - } - } while (false); - - free(srcPathChars); - free(destPathChars); - return TRUE; -#else - if (KERNEL_DEBUG) { - printf("LZMA not compiled in!\n"); - } - - return FALSE; -#endif // EXTRA_COMP_INSTALL_PATH -} - -/** - * Compress file sourcePath with "extra" algorithm (e.g. 7-Zip LZMA) - * if available, put the compressed data into file destPath and - * return true. If extra compression is not available do nothing - * with destPath and return false; - * @param srcPath the path of the uncompressed file - * @param destPath the path of the compressed file, if used - * @return true if the extra algorithm was used and destPath created - * - * @throws IOException if the extra compression code should be available - * but cannot be located or linked to, the destination file already - * exists or cannot be opened for writing, or the compression fails - */ -JNIEXPORT jboolean JNICALL Java_sun_jkernel_Bundle_extraCompress - (JNIEnv *env, jclass dm, jstring srcPath, jstring destPath) { - return extraCommon(true, env, dm, srcPath, destPath); -} - -/** - * Uncompress file sourcePath with "extra" algorithm (e.g. 7-Zip LZMA) - * if available, put the uncompressed data into file destPath and - * return true. If if the extra algorithm is not available, leave the - * destination path unchanged and return false; - * @param srcPath the path of the file having extra compression - * @param destPath the path of the uncompressed file - * @return true if the extra algorithm was used - * - * @throws IOException if the extra uncompression code should be available - * but cannot be located or linked to, the destination file already - * exists or cannot be opened for writing, or the uncompression fails - */ - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_Bundle_extraUncompress - (JNIEnv *env, jclass dm, jstring srcPath, jstring destPath) { - return extraCommon(false, env, dm, srcPath, destPath); -} - - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_addToTotalDownloadSize - (JNIEnv *env, jclass dm, jint size) { - dlg.addToTotalContentLength(size); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_downloadFromURLImpl - (JNIEnv *env, jclass dm, jstring url, jobject file, jstring name, - jboolean showProgress) { - jclass object = env->FindClass("java/lang/Object"); - jmethodID toString = env->GetMethodID(object, "toString", "()Ljava/lang/String;"); - jstring urlString = (jstring) env->CallObjectMethod(url, toString); - char* urlChars = getStringPlatformChars(env, urlString); - if (KERNEL_DEBUG) { - printf("Kernel downloadFromURL: %s\n", urlChars); - } - jstring fileString = (jstring) env->CallObjectMethod(file, toString); - char* fileChars = getStringPlatformChars(env, fileString); - char* nameChars = getStringPlatformChars(env, name); - - JavaVM *jvm; - env->GetJavaVM(&jvm); - - __try - { - - m_csCreateDialog.Lock(); - if (createDialog && showProgress) { - // create download progress dialog in a new thread - dlg.setJavaVM(jvm); - createDownloadWindow(&dlg); - createDialog = FALSE; - } - - } - __finally - { - m_csCreateDialog.Unlock(); - } - - DownloadHelper dh; - - dh.setJavaVM(jvm); - dh.setURL(urlChars); - dh.setFile(fileChars); - dh.setNameText((char*) nameChars); - dh.setShowProgressDialog(showProgress); - dh.setDownloadDialog(&dlg); - - if (dh.doDownload() != S_OK) { - // remove incomplete file - int ret = DeleteFile(fileChars); - } - - free(urlChars); - free(fileChars); - free(nameChars); -} - - -void error(char* msg) { - MessageBox(NULL, msg, "Java Error", MB_OK); -} - - -// Replace the dest file with the src file. Returns zero on success, Windows -// error code otherwise. -int replace(TCHAR* fullDest, TCHAR* fullSrc) { - struct _stat stat; - int result = _stat(fullSrc, &stat); - if (result == 0) { - DeleteFile(fullDest); - if (MoveFile(fullSrc, fullDest)) - return 0; - else - return GetLastError(); - } - else - return ENOENT; // src file not found -} - - -// Replace the dest file with the src file, where both paths are relative to -// the specified root. Returns zero on success, Windows error code otherwise. -int replaceRelative(TCHAR* root, TCHAR* dest, TCHAR* src) { - TCHAR fullDest[MAX_PATH]; - TCHAR fullSrc[MAX_PATH]; - strcpy(fullDest, root); - strcat(fullDest, dest); - strcpy(fullSrc, root); - strcat(fullSrc, src); - return replace(fullDest, fullSrc); -} - - -// Atomically deletes a file tree. Returns zero on success, Windows -// error code otherwise. -int deleteAll(TCHAR* root) { - TCHAR tmp[MAX_PATH]; - if (strlen(root) + 5 > MAX_PATH) - return ERROR_BUFFER_OVERFLOW; - strcpy(tmp, root); - strcat(tmp, ".tmp"); - struct _stat stat; - int result = _stat(tmp, &stat); - if (result == 0) { - result = !deleteAll(tmp); - if (result) - return result; - } - if (!MoveFile(root, tmp)) - return GetLastError(); - struct _SHFILEOPSTRUCTA fileOp; - memset(&fileOp, NULL, sizeof(fileOp)); - fileOp.wFunc = FO_DELETE; - TCHAR pFrom[MAX_PATH + 1]; - strcpy(pFrom, tmp); - pFrom[strlen(pFrom) + 1] = NULL; // extra null to signify that there is only one file in the list - fileOp.pFrom = pFrom; - fileOp.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; - return SHFileOperation(&fileOp); -} - - -// moves all file with "wait='true'" specified in bundles.xml into their final -// locations. These files are stored under lib/bundles/tmp, e.g. lib/meta-index -// is stored at lib/bundles/tmp/lib/meta-index. -// relativePath is the current relative path we are searching (e.g. "lib" for the -// example above), which begins as the empty string. -int moveDelayedFiles(TCHAR* javaHome, TCHAR* relativePath) { - TCHAR src[MAX_PATH]; - TCHAR* tmp = "lib\\bundles\\tmp"; - if (strlen(javaHome) + strlen(relativePath) + strlen(tmp) > MAX_PATH) { - error("Path too long."); - return ERROR_BUFFER_OVERFLOW; - } - strcpy(src, javaHome); - strcat(src, tmp); - if (relativePath[0] != NULL) { - strcat(src, "\\"); - strcat(src, relativePath); - } - - struct _stat stat; - int result = _stat(src, &stat); - if (result == 0) { - if (stat.st_mode & _S_IFDIR) { // is a directory, loop through contents - strcat(src, "\\*"); - struct _WIN32_FIND_DATAA file; - HANDLE findHandle = FindFirstFile(src, &file); - if (findHandle != INVALID_HANDLE_VALUE) { - do { - if (file.cFileName[0] != '.') { - char child[MAX_PATH]; - strcpy(child, relativePath); - strcat(child, "\\"); - strcat(child, file.cFileName); - moveDelayedFiles(javaHome, child); - } - } - while (FindNextFile(findHandle, &file) != 0); - FindClose(findHandle); - } - } - else { // normal file, move into place - if (strcmp(relativePath, "\\finished")) { - TCHAR dest[MAX_PATH]; - strcpy(dest, javaHome); - strcat(dest, relativePath); - - DeleteFile(dest); // just in case; ignore failures - if (MoveFile(src, dest)) - return 0; - else - return GetLastError(); - } - } - } - return result; -} - - -// activates Class Data Sharing -void activateCDS(const char *javaHome) { - char java[MAX_PATH]; - strcpy(java, javaHome); - strcat(java, "bin\\javaw.exe"); - - STARTUPINFO si; - PROCESS_INFORMATION pi; - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - const char *args = " -Xshare:dump"; - const int argLength = 13; - char commandLine[MAX_PATH + argLength + 2]; - strcpy(commandLine, "\""); - strcat(commandLine, java); - strcat(commandLine, "\""); - strcat(commandLine, args); - if (KERNEL_DEBUG) - printf("Exec: %s\n", commandLine); - if (CreateProcess(java, commandLine, NULL, NULL, FALSE, 0, - NULL, NULL, &si, &pi)) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - else - printf("Error initializing Class Data Sharing: %d", GetLastError()); -} - -typedef BOOL (*LPFNInstallJQS)(); - -// activates the Java Quickstart Service -void activateJQS(HMODULE hModule) { - LPFNInstallJQS lpfnInstallJQS; - - if (hModule != NULL) { - lpfnInstallJQS = (LPFNInstallJQS)GetProcAddress(hModule, "InstallJQS"); - if (lpfnInstallJQS != NULL) { - if ((lpfnInstallJQS)() == false && KERNEL_DEBUG) { - printf("InstallJQS returned FALSE\n"); - } - } - } -} - -// determines JAVA_HOME and stores it in the specified buffer. Returns true on success. -BOOL getJavaHome(char* buffer, int bufferSize) { - HMODULE kernel = GetModuleHandle("jkernel"); - if (kernel != NULL) { - DWORD result = GetModuleFileName(kernel, buffer, bufferSize); - if (result > 0) { - getParent(buffer, buffer); // remove "jkernel.dll" - if (buffer[0] != NULL) - getParent(buffer, buffer); // remove "bin" - if (buffer[0] != NULL) { - strcat(buffer, "\\"); - return TRUE; - } - } - } - return FALSE; -} - -typedef unsigned int (WINAPI *LPFNPostPing)(LPVOID err); -HANDLE PostPing(HMODULE hModule, char* fname, DWORD err) -{ - LPFNPostPing lpfnPostPing; - HANDLE hThread = NULL; - lpfnPostPing = (LPFNPostPing)GetProcAddress(hModule, fname); - if (lpfnPostPing != NULL) { - printf("############# ERROR CODE: %d\n", err); - hThread = (HANDLE)_beginthreadex(NULL, 0, lpfnPostPing, - (LPVOID)err, 0, NULL); - if (hThread == NULL) - lpfnPostPing((LPVOID)err); - } - return hThread; -} - -void postPingAndWait(char* fname, DWORD err) { - TCHAR path[MAX_PATH]; - if (getJavaHome(path, MAX_PATH)) { - strcat(path, "bin\\regutils.dll"); - HANDLE hThread = NULL; - HMODULE hModule = LoadLibrary(path); - if (hModule != NULL) { - hThread = PostPing(hModule, fname, err); - if (hThread != NULL) { - DWORD dwRet = 0; - WaitForSingleObject(hThread, 60*1000); - GetExitCodeThread(hThread, &dwRet); - CloseHandle(hThread); - } - } - } - else - printf("error determining JAVA_HOME for ping\n"); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_postDownloadError - (JNIEnv *env, jclass dm, jint error) { - postPingAndWait("PostKernelDLComp", error); -} - -JNIEXPORT void JNICALL Java_sun_jkernel_DownloadManager_postDownloadComplete - (JNIEnv *env, jclass dm) { - Java_sun_jkernel_DownloadManager_postDownloadError(env, dm, ERROR_SUCCESS); -} - -bool spawnedFromJBroker() { - return strstr(GetCommandLine(), JBROKER_KEY) != NULL; -} - - -// Determines if we have sufficient access to go ahead and perform completion. -// This is true either if we are not on Vista (in which case we can't elevate -// privileges anyway and have to hope for the best) or if we are on Vista and -// running at High integrity level. -bool highIntegrity() { - if (!IsPlatformWindowsVista()) - return TRUE; - else { - // directly determining this would require access to Vista-specific - // APIs, which aren't supported by our current build configurations. - // Instead we look for the presence of a flag on the command line to - // indicate that we were launched by the jbroker process. This is - // actually safer, as it prevents us from re-launching another JRE in - // the event that we somehow didn't end up with high integrity. - return spawnedFromJBroker(); - } -} - -JNIEXPORT jint JNICALL Java_sun_jkernel_DownloadManager_getCurrentProcessId - (JNIEnv *env, jclass dm) { - return (jint) GetCurrentProcessId(); -} - -JNIEXPORT jstring JNICALL Java_sun_jkernel_DownloadManager_getVisitorId0 - (JNIEnv *env, jclass dm) { - CRegKey swKey, jsKey, juKey, pKey; - if (swKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - if (jsKey.Open(swKey, "JavaSoft", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - if (juKey.Open(jsKey, "Java Update", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - if (pKey.Open(juKey, "Policy", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - DWORD dwCount = BUFSIZE; - char* keyValue = new char[BUFSIZE]; - if (pKey.QueryValue(keyValue, "VisitorId", &dwCount) != ERROR_SUCCESS){ - return NULL; - } - jstring visitorId = env->NewStringUTF(keyValue); - - return visitorId; -} - - -JNIEXPORT jstring JNICALL Java_sun_jkernel_DownloadManager_getUrlFromRegistry - (JNIEnv *env, jclass dm) { - - CRegKey swKey, jsKey; - if (swKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - if (jsKey.Open(swKey, "JavaSoft", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - DWORD dwCount = BUFSIZE; - char * keyValue = new char[BUFSIZE]; - if (jsKey.QueryValue(keyValue, "KernelDownloadUrl", &dwCount) != ERROR_SUCCESS){ - return NULL; - } - - jstring downloadKeyValue = env->NewStringUTF(keyValue); - - return downloadKeyValue; -} - - - -jboolean getBooleanRegistryKey(char *name, jboolean defaultValue) { - // Check DWORD registry key - // HKEY_LOCAL_MACHINE/Software/JavaSoft/ - - CRegKey swKey, jsKey; - if (swKey.Open(HKEY_LOCAL_MACHINE, "SOFTWARE", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - if (jsKey.Open(swKey, "JavaSoft", KEY_READ) != ERROR_SUCCESS){ - return NULL; - } - - DWORD dwValue = 0; - if (jsKey.QueryValue(dwValue, name) != ERROR_SUCCESS){ - - // Key does not exist, will return default value - return defaultValue; - } - - return dwValue != 0; -} - - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_BackgroundDownloader_getBackgroundDownloadKey - (JNIEnv *env, jclass dm) { - return getBooleanRegistryKey("KernelBackgroundDownload", TRUE); -} - - -JNIEXPORT jboolean JNICALL Java_sun_jkernel_DownloadManager_getDebugKey - (JNIEnv *env, jclass dm) { - return getBooleanRegistryKey("KernelDebug", FALSE); -} - - -// Called by the launcher before the JVM starts. If all kernel bundles have been -// downloaded, this function performs various post-download cleanups such as -// moving the merged rt.jar into place. At the end of cleanup, the JRE should -// be indistinguishable from the non-kernel JRE. -void preJVMStart() { - char rawMsg[BUFFER_SIZE]; - char msg[BUFFER_SIZE]; - HMODULE kernel = GetModuleHandle("jkernel"); - if (kernel != NULL) { - TCHAR javaHome[MAX_PATH]; - DWORD result = GetModuleFileName(kernel, javaHome, MAX_PATH); - if (result > 0) { - getParent(javaHome, javaHome); // remove "jkernel.dll" - if (javaHome[0] != NULL) - getParent(javaHome, javaHome); // remove "bin" - if (javaHome[0] != NULL) { - // should now be pointing to correct java.home - strcat(javaHome, "\\"); - bool jbroker = spawnedFromJBroker(); - HANDLE file; - TCHAR rt[MAX_PATH]; - strcpy(rt, javaHome); - strcat(rt, "lib\\rt.jar"); - HANDLE startMutex = CreateMutex(NULL, FALSE, "jvmStart"); - if (!jbroker) { // else mutex is already held by the pre-jbroker JVM - if (KERNEL_DEBUG) - printf("Locking startMutex\n"); - WaitForSingleObject(startMutex, INFINITE); - if (KERNEL_DEBUG) - printf("Locked startMutex\n"); - // open rt.jar for reading. This prevents other JREs from being - // able to acquire a write lock on rt.jar, which is used as a test - // to ensure that no other JREs are running. - // The failure to close the file handle is intentional -- if we - // close it, there will be a brief window between the close and - // when the JRE reopens it during which another jre could get - // a write lock on it, hosing us. - file = CreateFile(rt, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, NULL, NULL); - if (file == INVALID_HANDLE_VALUE) { - ReleaseAndClose(startMutex); - return; - } - if (KERNEL_DEBUG) - printf("Opened rt.jar for reading\n"); - } - TCHAR finished[MAX_PATH]; - TCHAR* finishedPath = "lib\\bundles\\tmp\\finished"; - if (strlen(javaHome) + strlen(finishedPath) < MAX_PATH) { - strcpy(finished, javaHome); - strcat(finished, finishedPath); - struct _stat finishedStat; - result = _stat(finished, &finishedStat); - if (result == 0) { // JRE has been fully downloaded but not yet cleaned up - if (KERNEL_DEBUG) - printf("Beginning completion.\n"); - if (!jbroker) - CloseHandle(file); - if (highIntegrity()) { - // attempt to open rt.jar for exclusive write access -- if this succeeds, - // we know no other JREs are running - file = CreateFile(rt, GENERIC_WRITE, NULL, NULL, OPEN_EXISTING, NULL, NULL); - if (file == INVALID_HANDLE_VALUE) { - // must be another JRE running... - ReleaseAndClose(startMutex); - return; - } - if (KERNEL_DEBUG) - printf("Opened rt.jar for writing.\n"); - CloseHandle(file); - if (KERNEL_DEBUG) - printf("Closed rt.jar.\n"); - int result = replaceRelative(javaHome, "lib\\rt.jar", - "lib\\bundles\\tmp\\merged-rt.jar"); - if (result != 0 && result != ENOENT) { - ::LoadString(_Module.GetModuleInstance(), IDS_FILE_UPDATE_ERROR, rawMsg, BUFFER_SIZE); - wsprintf(msg, rawMsg, javaHome, "lib\\rt.jar"); - error(msg); - ReleaseAndClose(startMutex); - return; - } - result = replaceRelative(javaHome, "lib\\resources.jar", - "lib\\bundles\\tmp\\merged-resources.jar"); - if (result != 0 && result != ENOENT) { - ::LoadString(_Module.GetModuleInstance(), IDS_FILE_UPDATE_ERROR, rawMsg, BUFFER_SIZE); - wsprintf(msg, rawMsg, javaHome, "lib\\resources.jar"); - error(msg); - ReleaseAndClose(startMutex); - return; - } - - TCHAR bundles[MAX_PATH]; - strcpy(bundles, javaHome); - strcat(bundles, "lib\\bundles"); - if (moveDelayedFiles(javaHome, "")) { - ::LoadString(_Module.GetModuleInstance(), IDS_FILE_UPDATE_ERROR, msg, BUFFER_SIZE); - error(msg); - ReleaseAndClose(startMutex); - return; - } - - TCHAR kernel[MAX_PATH]; - strcpy(kernel, javaHome); - strcat(kernel, "bin\\kernel"); - result = deleteAll(kernel); - if (result != 0 && result != ENOENT) { - ::LoadString(_Module.GetModuleInstance(), IDS_FILE_DELETE_ERROR, rawMsg, BUFFER_SIZE); - wsprintf(msg, rawMsg, kernel); - error(msg); - ReleaseAndClose(startMutex); - return; - } - - if (deleteAll(bundles)) { - // fail silently, CR #6643218 - printf("deleteAll failed!\n"); - ReleaseAndClose(startMutex); - return; - } - - TCHAR kernelMap[MAX_PATH]; - strcpy(kernelMap, javaHome); - strcat(kernelMap, "lib\\kernel.map"); - result = deleteAll(kernelMap); - if (result != 0 && result != ENOENT) { - ::LoadString(_Module.GetModuleInstance(), IDS_FILE_DELETE_ERROR, rawMsg, BUFFER_SIZE); - wsprintf(msg, rawMsg, kernelMap); - error(msg); - ReleaseAndClose(startMutex); - return; - } - - strcpy(rt, javaHome); - strcat(rt, "bin\\regutils.dll"); - HANDLE hThread = NULL; - HMODULE hModule = LoadLibrary(rt); - if (hModule != NULL) - hThread = PostPing(hModule, "PostKernelComp", ERROR_SUCCESS); - if (KERNEL_DEBUG) - printf("Activating JQS.\n"); - activateJQS(hModule); - - if (KERNEL_DEBUG) - printf("Activating CDS.\n"); - activateCDS(javaHome); - - if (hThread != NULL) { - DWORD dwRet = 0; - WaitForSingleObject(hThread, 60*1000); - GetExitCodeThread(hThread, &dwRet); - CloseHandle(hThread); - } - if (hModule != NULL) - FreeLibrary(hModule); - } else { - bool jbroker = isJBrokerRunning(); - if (!jbroker) { - // remove trailing slash - javaHome[strlen(javaHome) - 1] = 0; - jbroker = launchJBroker(javaHome); - if (!jbroker) { - ::LoadString(_Module.GetModuleInstance(), - IDS_JBROKER_ERROR, - msg, - BUFFER_SIZE); - error(msg); - } - } - if (jbroker) - sendPerformCompletionMessageToBroker(javaHome); - } - } - } - if (KERNEL_DEBUG) - printf("Releasing startMutex.\n"); - ReleaseAndClose(startMutex); - } else { - ::LoadString(_Module.GetModuleInstance(), IDS_JAVA_HOME_ERROR, msg, BUFFER_SIZE); - error(msg); - } - } else { - ::LoadString(_Module.GetModuleInstance(), IDS_KERNEL_HOME_ERROR, msg, BUFFER_SIZE); - error(msg); - } - } else { - ::LoadString(_Module.GetModuleInstance(), IDS_KERNEL_HOME_ERROR, msg, BUFFER_SIZE); - error(msg); - } -} diff --git a/jdk/src/windows/native/sun/jkernel/kernel.def b/jdk/src/windows/native/sun/jkernel/kernel.def deleted file mode 100644 index 5eb29e92faf..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel.def +++ /dev/null @@ -1,28 +0,0 @@ -; -; Copyright 2008 - 2009 Sun Microsystems, Inc. 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. -; - -LIBRARY jkernel -EXPORTS - preJVMStart @1 diff --git a/jdk/src/windows/native/sun/jkernel/kernel.h b/jdk/src/windows/native/sun/jkernel/kernel.h deleted file mode 100644 index f39f42374ac..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ -void preJVMStart(); diff --git a/jdk/src/windows/native/sun/jkernel/kernel.rc b/jdk/src/windows/native/sun/jkernel/kernel.rc deleted file mode 100644 index 943d7cbbec4..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel.rc +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - */ -#include "version.rc" - -#include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -#include "afxres.h" -#undef APSTUDIO_READONLY_SYMBOLS - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// -IDI_JAVA ICON DISCARDABLE "graphics\\java-icon.ico" -IDI_MASTHEAD BITMAP DISCARDABLE "graphics\\masthead.bmp" - -///////////////////////////////////////////////////////////////////////////// -// Include foreign resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Japanese resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN) -#ifdef _WIN32 -LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT -#pragma code_page(932) -#endif //_WIN32 -#include "kernel_ja.rc" -#endif // Japanese resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Chinese (P.R.C.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED -#pragma code_page(936) -#endif //_WIN32 -#include "kernel_zh.rc" -#endif // Chinese (P.R.C.) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Korean resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_KOR) -#ifdef _WIN32 -LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT -#pragma code_page(949) -#endif //_WIN32 -#include "kernel_ko.rc" -#endif // Korean resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Chinese (Taiwan) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHT) -#ifdef _WIN32 -LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_TRADITIONAL -#pragma code_page(950) -#endif //_WIN32 -#include "kernel_zh_TW.rc" -#endif // Chinese (Taiwan) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// German (Germany) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) -#ifdef _WIN32 -LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_de.rc" -#endif // German (Germany) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Spanish (Castilian) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ESP) -#ifdef _WIN32 -LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_es.rc" -#endif // Spanish (Castilian) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// French (France) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) -#ifdef _WIN32 -LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_fr.rc" -#endif // French (France) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Italian (Italy) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ITA) -#ifdef _WIN32 -LANGUAGE LANG_ITALIAN, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_it.rc" -#endif // Italian (Italy) resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Swedish resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE) -#ifdef _WIN32 -LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_sv.rc" -#endif // Swedish resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// Brazilian Portuguese resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_PTB) -#ifdef _WIN32 -LANGUAGE LANG_PORTUGUESE, SUBLANG_PORTUGUESE_BRAZILIAN -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_pt_BR.rc" -#endif // Brazilian Portuguese resources -///////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 -#include "kernel_en.rc" -#endif // English resources - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/jdk/src/windows/native/sun/jkernel/kernel_de.rc b/jdk/src/windows/native/sun/jkernel/kernel_de.rc deleted file mode 100644 index eef147534b6..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_de.rc +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Zustzliche Komponenten erforderlich" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 4, 220, 30 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "Abbrechen", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "Wenn Sie die Installation zustzlicher Komponenten, die fr die Anwendung erforderlich sind, abbrechen, wird die Anwendung mglicherweise geschlossen.\n\nMchten Sie die Installation zustzlicher Komponenten wirklich abbrechen?" - IDS_DOWNLOAD_CANCEL_CAPTION "Abbrechen - Zustzliche Komponenten" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Verbindungszeitberschreitung" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Internetverbindung kann nicht hergestellt werden" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Serverfehler (Fehler %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Der Dienst nicht verfgbar (Fehler %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "Zugriff verweigert oder verboten (Fehler %s)" - IDS_HTTP_STATUS_OTHER "Bei der Anfrage ist ein Fehler aufgetreten. Mchten Sie die Anfrage wiederholen?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "Whrend der Server auf die Anforderung wartete, kam es zu einer Zeitberschreitung." - IDS_HTTP_STATUS_FORBIDDEN "Der Server hat die Anforderung verstanden, verweigert jedoch deren Ausfhrung." - IDS_HTTP_STATUS_SERVER_ERROR "Der Server stie auf eine unerwartete Bedingung, die das Ausfhren der Anforderung verhinderte." - IDS_HTTP_STATUS_SERVICE_UNAVAIL "Der Dienst ist vorbergehend berlastet." - - - IDS_DOWNLOAD_STATUS_RETRY "Server beschftigt. Erneuter Versuch in %ld Sekunden ..." - - IDS_ERROR_CAPTION "Fehler - Java Kernel" - IDS_HOURSMINUTESECOND "Verbleibende Zeit (geschtzt): %d Stunden, %d Minuten und %.0f Sekunden" - IDS_HOURMINUTESECOND "Verbleibende Zeit (geschtzt): %d Stunde, %d Minuten und %.0f Sekunden" - IDS_MINUTESECOND "Verbleibende Zeit (geschtzt): %d Minuten %.0f Sekunden" - IDS_SECOND "Verbleibende Zeit (geschtzt): %.0f Sekunden" - IDS_DISK_FULL_ERROR_CAPTION "Festplatte voll" - IDS_DISK_FULL_ERROR "Java Kernel konnte erforderliche Komponenten nicht herunterladen, da der Datentrger voll ist. Noch einmal versuchen?" - IDS_DISK_WRITE_ERROR_CAPTION "Fehler beim Schreiben auf Datentrger" - IDS_DISK_WRITE_ERROR "Java Kernel hat beim Schreiben uf den Datentrger einen Fehler verursacht Noch einmal versuchen?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel kann aufgrund der aktuellen Internetverbindungseinstellungen Ihres Systems nicht fortfahren. berprfen Sie in der Windows-Systemsteuerung unter 'Internetoptionen -> Verbindungen' die Einstellungen und Proxy-Angaben." - - IDS_DOWNLOAD_RETRY "Downloadfehler" - IDS_DOWNLOAD_RETRY_TEXT "Beim Herunterladen einiger bentigter Komponenten ist ein Fehler aufgetreten. Mchten Sie noch einmal versuchen, diese Komponenten herunterzuladen?" - - IDS_DOWNLOAD "Zustzliche Komponenten werden installiert." - IDS_DOWNLOAD_UNPACKING "Entpacken des Pakets" - IDS_DOWNLOAD_TEXT "Die Java-Anwendung wird starten, sobald zustzliche Komponenten heruntergeladen und installiert sind." - - IDS_FILE_UPDATE_ERROR "Beim Aktualisieren von %s%s ist ein Fehler aufgetreten." - IDS_FILE_DELETE_ERROR "Beim Entfernen von %s ist ein Fehler aufgetreten." - IDS_JAVA_HOME_ERROR "Java-Verzeichnis kann nicht ermittelt werden." - IDS_KERNEL_HOME_ERROR "Pfad der jkernel.dll kann nicht ermittelt werden." - IDS_JBROKER_ERROR "jbroker.exe kann nicht gestartet werden." - IDS_FATAL_ERROR "Java konnte einige erforderliche Komponenten nicht herunterladen. Das Programm wird geschlossen." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java konnte keine Verbindung zum Downloadserver herstellen. Das Programm wird geschlossen." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Bei der Verbindung mit dem Downloadserver ist ein Fehler aufgetreten. Das Programm wird geschlossen." - IDS_ERROR_MALFORMED_URL "Java konnte von URL '%s' keinen Dowload ausfhren. Das Programm wird geschlossen." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_en.rc b/jdk/src/windows/native/sun/jkernel/kernel_en.rc deleted file mode 100644 index b57e4e78fbc..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_en.rc +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Additional Components Needed" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "Cancel", 2, 285, 100, 46, 14 -END - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "Canceling the installation of additional components which the application needs may cause the application to exit.\n\nAre you sure you want to cancel the installation of additional components?" - IDS_DOWNLOAD_CANCEL_CAPTION "Cancel - Additional Components" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Connection Timed Out" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Unable to connect to the Internet" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Server error (Error %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Service Unavailable (Error %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "Access Denied or Forbidden (Error %s)" - IDS_HTTP_STATUS_OTHER "An error has occured during this request. Do you want to try the request again?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "The server used to download the requested components is not responding and the connection has timed out. Do you want to try to connect again?" - IDS_HTTP_STATUS_FORBIDDEN "You do not have permission to access the server to download the components requested by the application. Retry your access to the server?" - IDS_HTTP_STATUS_SERVER_ERROR "An error occured on the server and it could not complete the request. Do you want to try the request again?" - IDS_HTTP_STATUS_SERVICE_UNAVAIL "The requested service is temporarily unavailable. Do you want to try the request again?" - - - IDS_DOWNLOAD_STATUS_RETRY "Server is currently busy, retry in %ld seconds ..." - - IDS_ERROR_CAPTION "Java Installer" - IDS_HOURSMINUTESECOND "Estimated time remaining: %d hours %d minutes %.0f seconds" - IDS_HOURMINUTESECOND "Estimated time remaining: %d hour %d minutes %.0f seconds" - IDS_MINUTESECOND "Estimated time remaining: %d minutes %.0f seconds" - IDS_SECOND "Estimated time remaining: %.0f seconds" - IDS_DISK_FULL_ERROR_CAPTION "Disk Full %s" - IDS_DISK_FULL_ERROR "There is not enough space on the disk to download the requested components. Clear space on the disk and then Retry." - IDS_DISK_WRITE_ERROR_CAPTION "Can't write to the disk %s" - IDS_DISK_WRITE_ERROR "An error occurred during writing to the disk. Please check that the disk is not write protected." - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java cannot connect to the Internet. Please check that the Internet Connection settings are correct (these can be found in the Windows Control Panel under Internet Options > Connection) and that your firewall allows java.exe to access the Internet." - - IDS_DOWNLOAD_RETRY "Download error" - IDS_DOWNLOAD_RETRY_TEXT "An error occurred during the download of some requested components. Do you want to try the download of these components again?" - - IDS_DOWNLOAD "Installing Additional Components" - IDS_DOWNLOAD_UNPACKING "Unpacking bundle" - IDS_DOWNLOAD_TEXT "The Java application will start when additional components that it requires are downloaded and installed." - - IDS_FILE_UPDATE_ERROR "An error occurred while updating %s%s." - IDS_FILE_DELETE_ERROR "An error occurred while removing %s." - IDS_JAVA_HOME_ERROR "Unable to determine Java home directory." - IDS_KERNEL_HOME_ERROR "Unable to determine path to jkernel.dll." - IDS_JBROKER_ERROR "Unable to launch jbroker.exe." - IDS_FATAL_ERROR "Java was unable to download required components. The program will now exit." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java was unable to communicate with the download server. The program will now exit." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java encountered an error communicating with the download server. The program will now exit." - IDS_ERROR_MALFORMED_URL "Java was unable to download from the URL '%s'. The program will now exit." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_es.rc b/jdk/src/windows/native/sun/jkernel/kernel_es.rc deleted file mode 100644 index 6f3183bd291..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_es.rc +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Componentes adicionales necesarios" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 8, 225, 20 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "Cancelar", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "Cancelar la instalacin de los componentes adicionales que necesita la aplicacin puede hacer que se cierre la aplicacin.\n\nSeguro que desea cancelar la instalacin de componentes adicionales?" - IDS_DOWNLOAD_CANCEL_CAPTION "Cancelar - Componentes adicionales" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Se ha agotado el tiempo de espera de la conexin" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "No es posible conectarse a Internet" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Ha habido un error en el servidor (error %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "El servicio no est disponible (error %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "El acceso se ha denegado o est prohibido (error %s)" - IDS_HTTP_STATUS_OTHER "Ha habido un error en el transcurso de esta solicitud. Desea ejecutar de nuevo la solicitud?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "El servidor ha agotado el tiempo de espera de la solicitud." - IDS_HTTP_STATUS_FORBIDDEN "El servidor ha podido interpretar la solicitud, pero la rechaza." - IDS_HTTP_STATUS_SERVER_ERROR "El servidor ha encontrado una condicin inesperada que le ha impedido satisfacer la solicitud." - IDS_HTTP_STATUS_SERVICE_UNAVAIL "El servicio est temporalmente sobrecargado." - - - IDS_DOWNLOAD_STATUS_RETRY "El servidor est ocupado en este momento, se volver a intentar la conexin en %ld segundos..." - - IDS_ERROR_CAPTION "Error - Java Kernel" - IDS_HOURSMINUTESECOND "Tiempo restante estimado: %d horas %d minutos %.0f segundos" - IDS_HOURMINUTESECOND "Tiempo restante estimado: %d hora %d minutos %.0f segundos" - IDS_MINUTESECOND "Tiempo restante estimado: %d minutos %.0f segundos" - IDS_SECOND "Tiempo restante estimado: %.0f segundos" - IDS_DISK_FULL_ERROR_CAPTION "Disco lleno" - IDS_DISK_FULL_ERROR "Java Kernel no puede descargar los componentes necesarios porque el disco est lleno. Desea volver a intentarlo?" - IDS_DISK_WRITE_ERROR_CAPTION "Error de escritura en disco" - IDS_DISK_WRITE_ERROR "Se ha producido un error cuando Java Kernel intentaba escribir en el disco. Desea volver a intentarlo?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel no puede continuar con la configuracin actual de conexin a Internet del sistema. En el Panel de control de Windows, compruebe Opciones de Internet -> Conexiones para verificar que la informacin de la configuracin y de proxy sea la correcta." - - IDS_DOWNLOAD_RETRY "Error de descarga" - IDS_DOWNLOAD_RETRY_TEXT "Se ha producido un error durante la descarga de algunos componentes solicitados. Quiere volver a intentar descargar estos componentes?" - - IDS_DOWNLOAD "Instalacin de componentes adicionales" - IDS_DOWNLOAD_UNPACKING "Desempaquetando paquete" - IDS_DOWNLOAD_TEXT "La aplicacin Java se iniciar cuando los componentes adicionales necesarios se hayan descargado e instalado." - - IDS_FILE_UPDATE_ERROR "Se ha producido un error al actualizar %s%s." - IDS_FILE_DELETE_ERROR "Se ha producido un error al eliminar %s." - IDS_JAVA_HOME_ERROR "Imposible determinar el directorio de inicio Java." - IDS_KERNEL_HOME_ERROR "Imposible determinar la ruta a jkernel.dll." - IDS_JBROKER_ERROR "Imposible iniciar jbroker.exe." - IDS_FATAL_ERROR "Java no ha podido descargar los componentes necesarios. El programa se cerrar." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java no ha podido comunicarse con el servidor de descarga. El programa se cerrar." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Se ha producido un error en la comunicacin entre Java y el servidor de descarga. El programa se cerrar." - IDS_ERROR_MALFORMED_URL "Java no ha podido realizar la descarga desde el URL '%s'. El programa se cerrar." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_fr.rc b/jdk/src/windows/native/sun/jkernel/kernel_fr.rc deleted file mode 100644 index 3e494a3683d..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_fr.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Composants supplmentaires requis" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 4, 220, 30 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "Annuler", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "L'annulation de l'installation de composants supplmentaires ncessaires l'application risque d'entraner la fermeture de celle-ci.\n\nVoulez-vous vraiment annuler l'installation des composants supplmentaires ?" - IDS_DOWNLOAD_CANCEL_CAPTION "Annuler : composants supplmentaires" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Dlai de connexion dpass" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Connexion Internet impossible" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Erreur de serveur (erreur %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Service non disponible (erreur %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "Accs refus ou interdit (erreur %s)" - IDS_HTTP_STATUS_OTHER "Une erreur s'est produite lors de cette demande. Voulez-vous effectuer nouveau la demande ?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "Temporisation du serveur lors de l'attente de la requte." - IDS_HTTP_STATUS_FORBIDDEN "Le serveur a compris la requte mais refuse de la satisfaire." - IDS_HTTP_STATUS_SERVER_ERROR "Le serveur a rencontr une condition inattendue l'empchant de satisfaire la requte." - IDS_HTTP_STATUS_SERVICE_UNAVAIL "Le service est temporairement surcharg." - - - IDS_DOWNLOAD_STATUS_RETRY "Le serveur est occup ; veuillez ressayer dans %ld secondes..." - - IDS_ERROR_CAPTION "Erreur - Java Kernel" - IDS_HOURSMINUTESECOND "Temps restant prvu : %d heures %d minutes %.0f secondes" - IDS_HOURMINUTESECOND "Temps restant prvu : %d heure %d minutes %.0f secondes" - IDS_MINUTESECOND "Temps restant prvu : %d minutes %.0f secondes" - IDS_SECOND "Temps restant prvu : %.0f secondes" - IDS_DISK_FULL_ERROR_CAPTION "Disque satur" - IDS_DISK_FULL_ERROR "En raison de la saturation du disque, Java Kernel n'a pas t en mesure de tlcharger les composants requis. Voulez-vous ressayer ?" - IDS_DISK_WRITE_ERROR_CAPTION "Erreur d'criture sur le disque" - IDS_DISK_WRITE_ERROR "Java Kernel a rencontr une erreur lors de l'criture sur le disque. Voulez-vous ressayer ?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel ne peut pas s'excuter avec les paramtres de connexion Internet actuels de votre systme. Dans le Panneau de configuration de Windows, cliquez sur Options Internet -> Connexions pour vrifier les paramtres et informations de proxy." - - IDS_DOWNLOAD_RETRY "Erreur de tlchargement" - IDS_DOWNLOAD_RETRY_TEXT "Une erreur s'est produite lors du tlchargement de certains composants requis. Souhaitez-vous ressayer de tlcharger ces composants ?" - - IDS_DOWNLOAD "Installation de composants supplmentaires" - IDS_DOWNLOAD_UNPACKING "Dcompression du bundle" - IDS_DOWNLOAD_TEXT "L'application Java dmarre lorsque des composants supplmentaires requis sont tlchargs et installs." - - IDS_FILE_UPDATE_ERROR "Une erreur s'est produite lors de la mise jour de %s%s." - IDS_FILE_DELETE_ERROR "Une erreur s'est produite lors de la suppression de %s." - IDS_JAVA_HOME_ERROR "Le rpertoire d'accueil Java est introuvable." - IDS_KERNEL_HOME_ERROR "Le chemin de jkernel.dll est introuvable." - IDS_JBROKER_ERROR "Impossible de lancer jbroker.exe." - IDS_FATAL_ERROR "Java n'a pas t en mesure de tlcharger les composants requis. Fermeture imminente du programme." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java n'a pas t en mesure de communiquer avec le serveur de tlchargement. Fermeture imminente du programme." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java a rencontr une erreur lors de la communication avec le serveur de tlchargement. Fermeture imminente du programme." - IDS_ERROR_MALFORMED_URL "Java n'a pas t en mesure de raliser le tlchargement partir de l'URL '%s'. Fermeture imminente du programme." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_it.rc b/jdk/src/windows/native/sun/jkernel/kernel_it.rc deleted file mode 100644 index d8fdf0b4e6a..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_it.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Componenti aggiuntivi richiesti" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 4, 220, 30 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "Annulla", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "Se si annulla l'installazione di componenti aggiuntivi necessari per l'applicazione, quest'ultima potrebbe chiudersi.\n\nAnnullare l'installazione di componenti aggiuntivi?" - IDS_DOWNLOAD_CANCEL_CAPTION "Annulla - Componenti aggiuntivi" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Timeout della connessione" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Impossibile stabilire una connessione a Internet" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Errore del server (errore %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Servizio non disponibile (errore %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "Accesso negato o vietato (errore %s)" - IDS_HTTP_STATUS_OTHER "Errore durante la richiesta. Provare a reinviare la richiesta?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "Tempo scaduto del server in attesa della richiesta." - IDS_HTTP_STATUS_FORBIDDEN "Il server ha ricevuto la richiesta ma non ne consente l'elaborazione." - IDS_HTTP_STATUS_SERVER_ERROR "Il server ha rilevato una condizione imprevista che ha impedito di soddisfare la richiesta." - IDS_HTTP_STATUS_SERVICE_UNAVAIL "Il servizio temporaneamente sovraccarico." - - - IDS_DOWNLOAD_STATUS_RETRY "Server occupato, riprovare tra %ld secondi..." - - IDS_ERROR_CAPTION "Errore - Java Kernel" - IDS_HOURSMINUTESECOND "Tempo rimanente previsto: %d ore %d minuti %.0f secondi" - IDS_HOURMINUTESECOND "Tempo rimanente previsto: %d ora %d minuti %.0f secondi" - IDS_MINUTESECOND "Tempo rimanente previsto: %d minuti %.0f secondi" - IDS_SECOND "Tempo rimanente previsto: %.0f secondi" - IDS_DISK_FULL_ERROR_CAPTION "Disco pieno" - IDS_DISK_FULL_ERROR "Java Kernel non ha effettuato il download dei componenti necessari perché il disco è pieno. Riprovare?" - IDS_DISK_WRITE_ERROR_CAPTION "Errore di scrittura sul disco" - IDS_DISK_WRITE_ERROR "Java Kernel ha rilevato un errore durante la scrittura sul disco. Riprovare?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Non possibile utilizzare Java Kernel con le impostazioni di connessione Internet attive nel sistema. Nel Pannello di controllo di Windows, selezionare Opzioni Internet -> Connessioni per controllare che le impostazioni e le informazioni sul proxy siano corrette." - - IDS_DOWNLOAD_RETRY "Errore di download" - IDS_DOWNLOAD_RETRY_TEXT "Si verificato un errore durante il download di alcuni componenti richiesti. Ritentare il download di tali componenti?" - - IDS_DOWNLOAD "Installazione di componenti aggiuntivi in corso" - IDS_DOWNLOAD_UNPACKING "Decompressione del bundle in corso" - IDS_DOWNLOAD_TEXT "L'applicazione Java verr avviata dopo il download e l'installazione dei componenti richiesti." - - IDS_FILE_UPDATE_ERROR "Errore durante l'aggiornamento di %s%s." - IDS_FILE_DELETE_ERROR "Errore durante la rimozione di %s." - IDS_JAVA_HOME_ERROR "Impossibile determinare la directory home di Java." - IDS_KERNEL_HOME_ERROR "Impossibile determinare il percorso di jkernel.dll." - IDS_JBROKER_ERROR "Impossibile avviare jbroker.exe." - IDS_FATAL_ERROR "Java non in grado di scaricare i componenti necessari. Il programma verr terminato." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java non in grado di comunicare con il server di download. Il programma verr terminato." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java ha rilevato un errore durante la comunicazione con il server di download. Il programma verr terminato." - IDS_ERROR_MALFORMED_URL "Java non in grado di eseguire il download dall'URL '%s'. Il programma verr terminato." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_ja.rc b/jdk/src/windows/native/sun/jkernel/kernel_ja.rc deleted file mode 100644 index 3179110db2f..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_ja.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "ljR|[lgKv" -EXSTYLE WS_EX_APPWINDOW -FONT 10, "MS UI Gothic" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "AvP[VKvƂljR|[lg̃CXg[LZƁAAvP[VI”\܂B\n\nljR|[lg̃CXg[LZĂ낵łH" - IDS_DOWNLOAD_CANCEL_CAPTION "LZ - ljR|[lg" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "ڑ^CAEg܂" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "C^[lbgɐڑł܂" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "T[o[G[ (G[ %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "T[rXps (G[ %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "ANZXۂ܂͋֎~Ă܂ (G[ %s)" - IDS_HTTP_STATUS_OTHER "̗v̏ɃG[܂BvĎs܂?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "vҋ@ɃT[o[^CAEg܂B" - IDS_HTTP_STATUS_FORBIDDEN "T[o[́AvFĂ܂AsۂĂ܂B" - IDS_HTTP_STATUS_SERVER_ERROR "T[o[́Av̎sW\Ȃ󋵂ɑ܂B" - IDS_HTTP_STATUS_SERVICE_UNAVAIL "T[rXꎞIɃI[o[[hĂ܂B" - - - IDS_DOWNLOAD_STATUS_RETRY "T[o[͌݃rW[łB%ld bɍĎs܂ ..." - - IDS_ERROR_CAPTION "G[ - Java J[l" - IDS_HOURSMINUTESECOND "\zc莞: %d %d %.0f b" - IDS_HOURMINUTESECOND "\zc莞: %d %d %.0f b" - IDS_MINUTESECOND "\zc莞: %d %.0f b" - IDS_SECOND "\zc莞: %.0f b" - IDS_DISK_FULL_ERROR_CAPTION "fBXNςł" - IDS_DISK_FULL_ERROR "fBXNς̂߁AJava J[lKvȃR|[lg_E[hł܂łBx܂?" - IDS_DISK_WRITE_ERROR_CAPTION "fBXN݃G[" - IDS_DISK_WRITE_ERROR "Java J[lfBXNւ̏ݎɃG[o܂Bx܂?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java J[ĺAg̃VXě݂̃C^[lbgڑݒł͓삵܂BWindows ̃Rg[plŁAuC^[lbgIvVv -> uڑvIāAݒ肨уvLV񂪐ƂmFĂB" - - IDS_DOWNLOAD_RETRY "_E[hG[" - IDS_DOWNLOAD_RETRY_TEXT "vꂽR|[lg̈ꕔ_E[hɃG[܂B̃R|[lg̃_E[hēx݂܂ ?" - - IDS_DOWNLOAD "ljR|[lgCXg[Ă܂" - IDS_DOWNLOAD_UNPACKING "ohWJĂ܂" - IDS_DOWNLOAD_TEXT "Java AvP[V́AK{̒ljR|[lg̃_E[hуCXg[ɋN܂B" - - IDS_FILE_UPDATE_ERROR "%s%s ̍XVɃG[܂B" - IDS_FILE_DELETE_ERROR "%s ̍폜ɃG[܂B" - IDS_JAVA_HOME_ERROR "Java z[fBNg𔻒ł܂B" - IDS_KERNEL_HOME_ERROR "jkernel.dll ̃pX𔻒ł܂B" - IDS_JBROKER_ERROR "jbroker.exe Nł܂B" - IDS_FATAL_ERROR "Java KvȃR|[lg_E[hł܂łBvO͏I܂B" - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java _E[hT[o[ƒʐMł܂łBvO͏I܂B" - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java _E[hT[o[Ƃ̒ʐMɃG[o܂BvO͏I܂B" - IDS_ERROR_MALFORMED_URL "Java URL '%s' _E[hł܂łBvO͏I܂B" -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_ko.rc b/jdk/src/windows/native/sun/jkernel/kernel_ko.rc deleted file mode 100644 index 6a6911d3a4c..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_ko.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "߰ ʿ" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE " α׷ ʿ ߰ ġ ϸ α׷ ֽϴ.\n\n߰ ġ Ͻðڽϱ?" - IDS_DOWNLOAD_CANCEL_CAPTION " - ߰ " - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT " ð ʰ" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "ͳݿ ϴ." - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR " ( %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "񽺸 ( %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "׼ źεǾų ( %s)" - IDS_HTTP_STATUS_OTHER " û ߻߽ϴ. û ٽ õϽðڽϱ?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT " û ٸ ð ʰǾϴ." - IDS_HTTP_STATUS_FORBIDDEN " û ϱ⸦ źմϴ." - IDS_HTTP_STATUS_SERVER_ERROR " û ϴ ġ ߰ߵǾϴ." - IDS_HTTP_STATUS_SERVICE_UNAVAIL " Ͻ ϵǾϴ." - - - IDS_DOWNLOAD_STATUS_RETRY " ̹Ƿ %ld Ŀ ٽ õϽʽÿ." - - IDS_ERROR_CAPTION " - Java Ŀ" - IDS_HOURSMINUTESECOND " ð: %dð %d %.0f" - IDS_HOURMINUTESECOND " ð: %dð %d %.0f" - IDS_MINUTESECOND " ð: %d %.0f" - IDS_SECOND " ð: %.0f" - IDS_DISK_FULL_ERROR_CAPTION "ũ " - IDS_DISK_FULL_ERROR "ũ Java Kernel ʿ Ҹ ٿε ߽ϴ. ٽ õϽðڽϱ?" - IDS_DISK_WRITE_ERROR_CAPTION "ũ " - IDS_DISK_WRITE_ERROR "ũ Java Kernel ߻߽ϴ. ٽ õϽðڽϱ?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "ý ͳ δ Java Kernel ϴ. Windows ǿ ͳ ɼ -> Ͽ Ͻ ùٸ ȮϽʽÿ." - - IDS_DOWNLOAD_RETRY "ٿε " - IDS_DOWNLOAD_RETRY_TEXT "û Ҹ ٿεϴ ߻߽ϴ. Ҹ ٽ ٿεϽðڽϱ?" - - IDS_DOWNLOAD "߰ ġ" - IDS_DOWNLOAD_UNPACKING " Ǯ" - IDS_DOWNLOAD_TEXT "ʿ ߰ Ұ ٿεǾ ġǸ Java α׷ ۵˴ϴ." - - IDS_FILE_UPDATE_ERROR "%s%s() Ʈϴ ߻߽ϴ." - IDS_FILE_DELETE_ERROR "%s() ϴ ߻߽ϴ." - IDS_JAVA_HOME_ERROR "Java Ȩ 丮 Ȯ ϴ." - IDS_KERNEL_HOME_ERROR "jkernel.dll θ Ȯ ϴ." - IDS_JBROKER_ERROR "jbroker.exe ϴ." - IDS_FATAL_ERROR "ʿ Ҹ ٿε ߽ϴ. α׷ ˴ϴ." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "ٿε ߽ϴ. α׷ ˴ϴ." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "ٿε ߻߽ϴ. α׷ ˴ϴ." - IDS_ERROR_MALFORMED_URL "URL '%s' ٿε ߽ϴ. α׷ ˴ϴ." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc b/jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc deleted file mode 100644 index 550847691de..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_pt_BR.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - */ - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0,0,340,120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Componentes adicionais necessrios" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD,0,0,340,39 - LTEXT "", IDC_MASTHEAD_TEXT,60,8,225,12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN,0,39,340,1 - LTEXT "", IDC_DOWNLOAD_TEXT,12,60,316,20 - LTEXT "", IDC_TIME_REMAINING,12,90,316,10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH,12,100,265,14 - PUSHBUTTON "Cancelar", 2,285,100,46,14 -END - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "O cancelamento da instalao dos componentes adicionais necessrios ao aplicativo pode fazer com que o aplicativo se feche.\n\nTem certeza que deseja cancelar a instalao dos componentes adicionais?" - IDS_DOWNLOAD_CANCEL_CAPTION "Cancelar - Componentes adicionais" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Tempo limite de conexo excedido" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "No possvel se conectar Internet" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Erro de servidor (Erro %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Servio no disponvel (Erro %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "Acesso negado ou proibido (Erro %s)" - IDS_HTTP_STATUS_OTHER "Ocorreu um erro durante esta solicitao. Deseja tentar a solicitao novamente?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "O servidor usado para baixar os componentes necessrios no est respondendo e o tempo limite da conexo foi excedido. Deseja tentar se conectar novamente?" - IDS_HTTP_STATUS_FORBIDDEN "Voc no tem permisso para acessar o servidor para baixar os componentes necessrios ao aplicativo. Tentar acessar o servidor novamente?" - IDS_HTTP_STATUS_SERVER_ERROR "Ocorreu um erro no servidor e no foi possvel concluir a solicitao. Deseja tentar a solicitao novamente?" - IDS_HTTP_STATUS_SERVICE_UNAVAIL "O servio solicitado no est disponvel temporariamente. Deseja tentar a solicitao novamente?" - - - IDS_DOWNLOAD_STATUS_RETRY "O servidor est ocupado atualmente, tente novamente em %ld segundos ..." - - IDS_ERROR_CAPTION "Instalador Java" - IDS_HOURSMINUTESECOND "Tempo restante estimado: %d horas %d minutos %.0f segundos" - IDS_HOURMINUTESECOND "Tempo restante estimado: %d hora %d minutos %.0f segundos" - IDS_MINUTESECOND "Tempo restante estimado: %d minutos %.0f segundos" - IDS_SECOND "Tempo restante estimado: %.0f segundos" - IDS_DISK_FULL_ERROR_CAPTION "Disco cheio %s" - IDS_DISK_FULL_ERROR "No h espao em disco suficiente para baixar os componentes solicitados. Libere espao em disco e, a seguir, tente novamente." - IDS_DISK_WRITE_ERROR_CAPTION "No possvel gravar no disco %s" - IDS_DISK_WRITE_ERROR "Ocorreu um erro durante a gravao no disco. Verifique se o disco no est protegido contra gravao." - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "O Java no pode se conectar Internet. Verifique se as configuraes de conexo Internet esto corretas (isso pode ser encontrado no painel de controle do Windows em Opes de Internet > Conexo) e se o firewall permite que java.exe acesse a Internet." - - IDS_DOWNLOAD_RETRY "Erro de download" - IDS_DOWNLOAD_RETRY_TEXT "Ocorreu um erro durante o download de alguns componentes solicitados. Deseja tentar o download destes componentes novamente?" - - IDS_DOWNLOAD "Instalando componentes adicionais" - IDS_DOWNLOAD_UNPACKING "Descompactando pacotes" - IDS_DOWNLOAD_TEXT "O aplicativo Java se iniciar quando os componentes adicionais que ele precisa tiverem sido baixados e instalados." - - IDS_FILE_UPDATE_ERROR "Ocorreu um erro durante a atualizao de %s%s." - IDS_FILE_DELETE_ERROR "Ocorreu um erro durante a remoo de %s%s." - IDS_JAVA_HOME_ERROR "No possvel determinar o diretrio base Java." - IDS_KERNEL_HOME_ERROR "No possvel determinar o caminho para o jkernel.dll." - IDS_JBROKER_ERROR "No possvel iniciar jbroker.exe" - IDS_FATAL_ERROR "O Java no pde baixar os componentes necessrios. O programa se fechar agora." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "O Java no pde estabelecer comunicao com o servidor de downloads. O programa se fechar agora." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "O Java encontrou um erro ao estabelecer comunicao com o servidor de downloads. O programa se fechar agora." - IDS_ERROR_MALFORMED_URL "O Java no pde baixar da URL '%s'. O programa se fechar agora." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_sv.rc b/jdk/src/windows/native/sun/jkernel/kernel_sv.rc deleted file mode 100644 index 4fc5832caea..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_sv.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "Ytterligare komponenter behvs" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "Avbryt", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "Programmet kan avslutas om du avbryter installationen av ytterligare komponenter som r ndvndiga fr programmet.\n\nVill du avbryta installationen av ytterligare komponenter?" - IDS_DOWNLOAD_CANCEL_CAPTION "Avbryt - Ytterligare komponenter" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "Anslutningen avbrts p grund av timeout" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Det gr inte att ansluta till Internet." - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "Serverfel (Fel %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "Tjnsten r inte tillgnglig (Fel %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "tkomst nekad eller frbjuden (Fel %s)" - IDS_HTTP_STATUS_OTHER "Ett fel intrffade i samband med begran. Vill du frska skicka begran igen?" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "Ett tidsfel intrffade medan servern vntade p begran." - IDS_HTTP_STATUS_FORBIDDEN "Servern frstod begran men vgrar uppfylla den." - IDS_HTTP_STATUS_SERVER_ERROR "Ett ovntat tillstnd som innebr att begran inte kan uppfyllas ptrffades." - IDS_HTTP_STATUS_SERVICE_UNAVAIL "Tjnsten r tillflligt verbelastad." - - - IDS_DOWNLOAD_STATUS_RETRY "Servern r upptagen fr nrvarande. Frsk igen om %ld sekund(er) ..." - - IDS_ERROR_CAPTION "Fel - Java Kernel" - IDS_HOURSMINUTESECOND "terstende tid: %d timmar %d minuter %.0f sekunder" - IDS_HOURMINUTESECOND "terstende tid: %d timme %d minuter %.0f sekunder" - IDS_MINUTESECOND "terstende tid: %d minuter %.0f sekunder" - IDS_SECOND "terstende tid: %.0f sekunder" - IDS_DISK_FULL_ERROR_CAPTION "Disken r full" - IDS_DISK_FULL_ERROR "Java Kernel kunde inte ladda ned ndvndiga komponenter drfr att disken r full. Frska igen?" - IDS_DISK_WRITE_ERROR_CAPTION "Fel vid skrivning till disk" - IDS_DISK_WRITE_ERROR "Java Kernel sttte p ett fel vid skrivning till disken. Frska igen?" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "Java Kernel kan inte fortstta med systemets aktuella instllningar fr Internetanslutning. ppna Kontrollpanelen, Internet-alternativ > Anslutningar och kontrollera att instllningarna och proxyinformationen stmmer." - - IDS_DOWNLOAD_RETRY "Nedladdningsfel" - IDS_DOWNLOAD_RETRY_TEXT "Ett fel uppstod under nedladdning av vissa begrda komponenter. Vill du frska ladda ned dessa komponenter igen?" - - IDS_DOWNLOAD "Ytterligare komponenter installeras" - IDS_DOWNLOAD_UNPACKING "Uppackning av paket" - IDS_DOWNLOAD_TEXT "Java-applikationen startar nr ytterligare komponenter som krvs r nedladdade och installerade." - - IDS_FILE_UPDATE_ERROR "Ett fel uppstod nr %s%s uppdaterades." - IDS_FILE_DELETE_ERROR "Ett fel uppstod nr %s skulle tas bort." - IDS_JAVA_HOME_ERROR "Det gr inte att avgra Javas hemkatalog" - IDS_KERNEL_HOME_ERROR "Det gr inte att avgra skvgen till jkernell.dll." - IDS_JBROKER_ERROR "Det gr inte att starta jbroker.exe." - IDS_FATAL_ERROR "Det gick inte att ladda ned de ndvndiga komponenterna med Java. Programmet avslutas." - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Det gick inte att upprtta ngon kommunikation mellan Java och nedladdningsservern. Programmet avslutas." - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Det uppstod ett fel i kommunikationen mellan Java och nedladdningsservern. Programmet avslutas." - IDS_ERROR_MALFORMED_URL "Det gick inte att ladda ned frn webbadressen '%s'. Programmet avslutas." -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_zh.rc b/jdk/src/windows/native/sun/jkernel/kernel_zh.rc deleted file mode 100644 index e1f0620fb8f..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_zh.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "ȡ", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "ȡװӦóĶܻᵼ¸Ӧó˳\n\nǷȷҪȡװ" - IDS_DOWNLOAD_CANCEL_CAPTION "ȡ - " - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "ѳʱ" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "޷ӵ Internet" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "󣨴 %s" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "񲻿ã %s" - IDS_HTTP_INSTRUCTION_FORBIDDEN "ܾʻֹʣ %s" - IDS_HTTP_STATUS_OTHER "ڴڼִǷҪ" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "ȴʱʱ" - IDS_HTTP_STATUS_FORBIDDEN "ѽ󣬵ִܾС" - IDS_HTTP_STATUS_SERVER_ERROR "޷" - IDS_HTTP_STATUS_SERVICE_UNAVAIL "ʱء" - - - IDS_DOWNLOAD_STATUS_RETRY "æ %ld ..." - - IDS_ERROR_CAPTION " - Java Kernel" - IDS_HOURSMINUTESECOND "ʣʱ:%d Сʱ %d %.0f " - IDS_HOURMINUTESECOND "ʣʱ:%d Сʱ %d %.0f " - IDS_MINUTESECOND "ʣʱ:%d %.0f " - IDS_SECOND "ʣʱ:%.0f " - IDS_DISK_FULL_ERROR_CAPTION "" - IDS_DISK_FULL_ERROR "ڴJava Kernel ޷Ƿԣ" - IDS_DISK_WRITE_ERROR_CAPTION "д" - IDS_DISK_WRITE_ERROR "ִдʱ Java Kernel Ƿԣ" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "ʹϵͳǰ Internet õ£Java Kernel ޷ִС Windows""""У""Internet ѡ""->""""ȷúʹϢȷ" - - IDS_DOWNLOAD_RETRY "ش" - IDS_DOWNLOAD_RETRY_TEXT "ijЩڼ䷢ǷҪһЩ" - - IDS_DOWNLOAD "װ" - IDS_DOWNLOAD_UNPACKING "ڽѹ" - IDS_DOWNLOAD_TEXT "زװ Java Ӧó󣬸Ӧó" - - IDS_FILE_UPDATE_ERROR " %s%s ʱ" - IDS_FILE_DELETE_ERROR "ɾ %s ʱ" - IDS_JAVA_HOME_ERROR "޷ȷ Java Ŀ¼" - IDS_KERNEL_HOME_ERROR "޷ȷ jkernel.dll ·" - IDS_JBROKER_ERROR "޷ jbroker.exe" - IDS_FATAL_ERROR "Java ޷ڳ˳" - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java ޷طͨšڳ˳" - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java طͨʱڳ˳" - IDS_ERROR_MALFORMED_URL "Java ޷ URL '%s' ִءڳ˳" -END diff --git a/jdk/src/windows/native/sun/jkernel/kernel_zh_TW.rc b/jdk/src/windows/native/sun/jkernel/kernel_zh_TW.rc deleted file mode 100644 index 6bae5a15113..00000000000 --- a/jdk/src/windows/native/sun/jkernel/kernel_zh_TW.rc +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DOWNLOAD_DIALOG DIALOGEX 0, 0, 340, 120 -STYLE DS_MODALFRAME | DS_3DLOOK | DS_CENTER | WS_POPUP | - WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "һݪL" -EXSTYLE WS_EX_APPWINDOW -FONT 8, "MS Sans Serif" -BEGIN - LTEXT "", IDC_DOWNLOAD_MASTHEAD, 0, 0, 340, 39 - LTEXT "", IDC_MASTHEAD_TEXT, 60, 14, 200, 12 - CONTROL "", IDC_STATIC,"Static", SS_BLACKFRAME | SS_SUNKEN, - 0, 39, 340, 1 - LTEXT "", IDC_DOWNLOAD_TEXT, 12, 60, 316, 20 - LTEXT "", IDC_TIME_REMAINING, 12, 90, 316, 10 - CONTROL "Progress1",1006,"msctls_progress32",PBS_SMOOTH, - 12, 100, 265, 14 - PUSHBUTTON "", 2, 285, 100, 46, 14 -END -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO DISCARDABLE -BEGIN - 105, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 236 - TOPMARGIN, 7 - BOTTOMMARGIN, 63 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// String Table -// - -STRINGTABLE DISCARDABLE -BEGIN - IDS_DOWNLOAD_CANCEL_MESSAGE "wε{һݪLAi|ɭPε{C\n\nzTwnw˨LH" - IDS_DOWNLOAD_CANCEL_CAPTION " - L" - IDS_DOWNLOAD_CANCEL_INSTRUCTION "" - IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT "suO" - IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE "Lksuܺں" - IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR "A~ (~ %s)" - IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL "LkϥΪA (~ %s)" - IDS_HTTP_INSTRUCTION_FORBIDDEN "ڵθTs (~ %s)" - IDS_HTTP_STATUS_OTHER "bШDoͿ~CO_nսШDH" - -// HTTP status code - IDS_HTTP_STATUS_REQUEST_TIMEOUT "AݽШDɥX{OɡC" - IDS_HTTP_STATUS_FORBIDDEN "AAѸӽШDAbڵ{C" - IDS_HTTP_STATUS_SERVER_ERROR "AJ{ШDwC" - IDS_HTTP_STATUS_SERVICE_UNAVAIL "AȼȮɶWC" - - - IDS_DOWNLOAD_STATUS_RETRY "AثeB󦣸LAAЦb %ld ᭫..." - - IDS_ERROR_CAPTION "~ - Java Kernel" - IDS_HOURSMINUTESECOND "wѾlɶG%d p %d %.0f " - IDS_HOURMINUTESECOND "wѾlɶG%d p %d %.0f " - IDS_MINUTESECOND "wѾlɶG%d %.0f " - IDS_SECOND "wѾlɶG%.0f " - IDS_DISK_FULL_ERROR_CAPTION "ϺФw" - IDS_DISK_FULL_ERROR "ѩϺФwAJava Kernel LkUһݪCO_nաH" - IDS_DISK_WRITE_ERROR_CAPTION "ϺмgJ~" - IDS_DISK_WRITE_ERROR "Java Kernel bgJܺϺЮɹJ~CO_nաH" - IDS_HTTP_STATUS_SERVER_NOT_REACHABLE "btΥثeںsu]wUAJava Kernel Lk~Cb WindowsuxvAЮֹuںﶵv->usuvAHTw]wMNzATTC" - - IDS_DOWNLOAD_RETRY "U~" - IDS_DOWNLOAD_RETRY_TEXT "UYǩһݤɵoͿ~CO_nդUoǤH" - - IDS_DOWNLOAD "bw˨L" - IDS_DOWNLOAD_UNPACKING "bY" - IDS_DOWNLOAD_TEXT "Uæw˨LһݤAJava ε{NҰʡC" - - IDS_FILE_UPDATE_ERROR "s %s%s ɵoͿ~C" - IDS_FILE_DELETE_ERROR " %s ɵoͿ~C" - IDS_JAVA_HOME_ERROR "LkTw Java DؿC" - IDS_KERNEL_HOME_ERROR "LkTw jkernel.dll |C" - IDS_JBROKER_ERROR "LkҰ jbroker.exeC" - IDS_FATAL_ERROR "Java LkUһݪC{NߧYC" - IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES "Java LkPUAiqTC{NߧYC" - IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES "Java bPUAiqTɹJF@ӿ~C{NߧYC" - IDS_ERROR_MALFORMED_URL "Java Lkq URLu%svUC{NߧYC" -END diff --git a/jdk/src/windows/native/sun/jkernel/resource.h b/jdk/src/windows/native/sun/jkernel/resource.h deleted file mode 100644 index b5563206132..00000000000 --- a/jdk/src/windows/native/sun/jkernel/resource.h +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// -// - - -// HTTP status code -#define IDS_HTTP_STATUS_FORBIDDEN 403 -#define IDS_HTTP_STATUS_REQUEST_TIMEOUT 408 -#define IDS_HTTP_STATUS_SERVER_ERROR 500 -#define IDS_HTTP_STATUS_SERVICE_UNAVAIL 503 - - - -#define IDS_HTTP_INSTRUCTION_REQUEST_TIMEOUT 2408 -#define IDS_HTTP_INSTRUCTION_SERVICE_UNAVAIL 2503 -#define IDS_HTTP_INSTRUCTION_FORBIDDEN 2403 -#define IDS_HTTP_INSTRUCTION_SERVER_NOT_REACHABLE 2035 -#define IDS_HTTP_INSTRUCTION_UNKNOWN_ERROR 2036 -#define IDS_HTTP_STATUS_OTHER 2037 - -#define IDS_DOWNLOAD_STATUS_RETRY 3004 - -#define IDD_DOWNLOAD_DIALOG 105 -#define IDI_JAVA 114 -#define IDI_MASTHEAD 115 -#define IDC_DOWNLOAD_PROGRESS 1006 -#define IDC_DOWNLOAD_INFO 1007 -#define IDC_DOWNLOAD_STATUS 1008 -#define IDC_DOWNLOAD_ANIMATE 1009 -#define IDS_ERROR_CAPTION 2004 -#define IDS_HOURSMINUTESECOND 2007 -#define IDS_HOURMINUTESECOND 2008 -#define IDS_MINUTESECOND 2009 -#define IDS_SECOND 2010 -#define IDS_DISK_FULL_ERROR 2023 -#define IDS_DISK_FULL_ERROR_CAPTION 2024 -#define IDS_DISK_WRITE_ERROR 2025 -#define IDS_DISK_WRITE_ERROR_CAPTION 2026 -#define IDS_HTTP_STATUS_SERVER_NOT_REACHABLE 2028 -#define IDS_FATAL_ERROR 2029 -#define IDS_ERROR_DOWNLOADING_BUNDLE_PROPERTIES 2030 -#define IDS_ERROR_MALFORMED_BUNDLE_PROPERTIES 2031 -#define IDS_ERROR_MALFORMED_URL 2032 - -#define IDS_DOWNLOAD_CANCEL_CAPTION 2038 -#define IDS_DOWNLOAD_CANCEL_INSTRUCTION 2039 -#define IDS_DOWNLOAD_CANCEL_MESSAGE 2040 - -// codes for download and install dialog -#define IDC_MASTHEAD_TEXT 116 -#define IDC_DOWNLOAD_MASTHEAD 121 -#define IDC_TIME_REMAINING 122 -#define IDC_DOWNLOAD_TEXT 123 - -// codes for download retry dialog -#define IDS_DOWNLOAD_RETRY 130 -#define IDS_DOWNLOAD_RETRY_TEXT 131 - -#define IDS_DOWNLOAD_UNPACKING 3900 -#define IDS_DOWNLOAD 4000 -#define IDS_DOWNLOAD_TEXT 4001 - -// codes for completion cleanup -#define IDS_FILE_UPDATE_ERROR 4101 -#define IDS_FILE_DELETE_ERROR 4103 -#define IDS_JAVA_HOME_ERROR 4104 -#define IDS_KERNEL_HOME_ERROR 4105 -#define IDS_JBROKER_ERROR 4106 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 128 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1016 -#define _APS_NEXT_SYMED_VALUE 103 -#endif -#endif diff --git a/jdk/src/windows/native/sun/jkernel/stdafx.cpp b/jdk/src/windows/native/sun/jkernel/stdafx.cpp deleted file mode 100644 index 65bb96520da..00000000000 --- a/jdk/src/windows/native/sun/jkernel/stdafx.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -// stdafx.cpp : source file that includes just the standard includes -// stdafx.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -#ifdef _ATL_STATIC_REGISTRY -#include -#include -#endif - -#include diff --git a/jdk/src/windows/native/sun/jkernel/stdafx.h b/jdk/src/windows/native/sun/jkernel/stdafx.h deleted file mode 100644 index f25b5115ca3..00000000000 --- a/jdk/src/windows/native/sun/jkernel/stdafx.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - */ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, -// but are changed infrequently - -#if !defined(AFX_STDAFX_H__FBC6C744_18F8_11D6_9DF1_0001023B10AA__INCLUDED_) -#define AFX_STDAFX_H__FBC6C744_18F8_11D6_9DF1_0001023B10AA__INCLUDED_ - -#if _MSC_VER > 1000 -#pragma once -#endif // _MSC_VER > 1000 - -#define STRICT -#ifndef _WIN32_WINNT -/* REMIND : 0x500 means Windows 2000 .. seems like we can update - * for Windows XP when we move the SDK and build platform - */ -#define _WIN32_WINNT 0x0500 -#endif -#define _ATL_APARTMENT_THREADED - -#include -//You may derive a class from CComModule and use it if you want to override -//something, but do not change the name of _Module -extern CComModule _Module; -#include -#include - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__FBC6C744_18F8_11D6_9DF1_0001023B10AA__INCLUDED) diff --git a/jdk/src/windows/native/sun/jkernel/version.rc b/jdk/src/windows/native/sun/jkernel/version.rc deleted file mode 100644 index f2df9e56e30..00000000000 --- a/jdk/src/windows/native/sun/jkernel/version.rc +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2008, 2009, 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. - */ - -#include "afxres.h" - -// Need 2 defines so macro argument to XSTR will get expanded before quoting. -#define XSTR(x) STR(x) -#define STR(x) #x - -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION JDK_FVER - PRODUCTVERSION JDK_FVER - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - // FILEOS 0x4 is Win32, 0x40004 is Win32 NT only - FILEOS 0x4L - // FILETYPE should be 0x1 for .exe and 0x2 for .dll - FILETYPE JDK_FTYPE - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "CompanyName", XSTR(JDK_COMPANY) "\0" - VALUE "FileDescription", XSTR(JDK_COMPONENT) "\0" - VALUE "FileVersion", XSTR(JDK_VER) "\0" - VALUE "Full Version", XSTR(JDK_BUILD_ID) "\0" - VALUE "InternalName", XSTR(JDK_INTERNAL_NAME) "\0" - VALUE "LegalCopyright", XSTR(JDK_COPYRIGHT) "\0" - VALUE "OriginalFilename", XSTR(JDK_FNAME) "\0" - VALUE "ProductName", XSTR(JDK_NAME) "\0" - VALUE "ProductVersion", XSTR(JDK_VER) "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END From 35f815a7b424718b67ece434a7806463d9bead89 Mon Sep 17 00:00:00 2001 From: Vladimir Yaroslavskiy Date: Wed, 9 Feb 2011 15:59:27 +0000 Subject: [PATCH 71/84] 7018258: Dual-pivot updates in 7013585 can fail with ArrayIndexOutOfBoundsException Reviewed-by: alanb --- .../classes/java/util/DualPivotQuicksort.java | 14 +- jdk/test/java/util/Arrays/Sorting.java | 282 ++++++++++-------- 2 files changed, 170 insertions(+), 126 deletions(-) diff --git a/jdk/src/share/classes/java/util/DualPivotQuicksort.java b/jdk/src/share/classes/java/util/DualPivotQuicksort.java index 2a39dfdd985..ffbd4bcc94c 100644 --- a/jdk/src/share/classes/java/util/DualPivotQuicksort.java +++ b/jdk/src/share/classes/java/util/DualPivotQuicksort.java @@ -36,7 +36,7 @@ package java.util; * @author Jon Bentley * @author Josh Bloch * - * @version 2011.01.21 m765.827.12i:5\7pm + * @version 2011.02.11 m765.827.12i:5\7pm * @since 1.7 */ final class DualPivotQuicksort { @@ -115,7 +115,7 @@ final class DualPivotQuicksort { * Index run[i] is the start of i-th run * (ascending or descending sequence). */ - int[] run = new int[MAX_RUN_COUNT]; + int[] run = new int[MAX_RUN_COUNT + 1]; int count = 0; run[0] = left; // Check if the array is nearly sorted @@ -555,7 +555,7 @@ final class DualPivotQuicksort { * Index run[i] is the start of i-th run * (ascending or descending sequence). */ - int[] run = new int[MAX_RUN_COUNT]; + int[] run = new int[MAX_RUN_COUNT + 1]; int count = 0; run[0] = left; // Check if the array is nearly sorted @@ -1027,7 +1027,7 @@ final class DualPivotQuicksort { * Index run[i] is the start of i-th run * (ascending or descending sequence). */ - int[] run = new int[MAX_RUN_COUNT]; + int[] run = new int[MAX_RUN_COUNT + 1]; int count = 0; run[0] = left; // Check if the array is nearly sorted @@ -1499,7 +1499,7 @@ final class DualPivotQuicksort { * Index run[i] is the start of i-th run * (ascending or descending sequence). */ - int[] run = new int[MAX_RUN_COUNT]; + int[] run = new int[MAX_RUN_COUNT + 1]; int count = 0; run[0] = left; // Check if the array is nearly sorted @@ -2076,7 +2076,7 @@ final class DualPivotQuicksort { * Index run[i] is the start of i-th run * (ascending or descending sequence). */ - int[] run = new int[MAX_RUN_COUNT]; + int[] run = new int[MAX_RUN_COUNT + 1]; int count = 0; run[0] = left; // Check if the array is nearly sorted @@ -2603,7 +2603,7 @@ final class DualPivotQuicksort { * Index run[i] is the start of i-th run * (ascending or descending sequence). */ - int[] run = new int[MAX_RUN_COUNT]; + int[] run = new int[MAX_RUN_COUNT + 1]; int count = 0; run[0] = left; // Check if the array is nearly sorted diff --git a/jdk/test/java/util/Arrays/Sorting.java b/jdk/test/java/util/Arrays/Sorting.java index e5c132b64a2..9eac7989e12 100644 --- a/jdk/test/java/util/Arrays/Sorting.java +++ b/jdk/test/java/util/Arrays/Sorting.java @@ -23,7 +23,7 @@ /* * @test - * @bug 6880672 6896573 6899694 6976036 7013585 + * @bug 6880672 6896573 6899694 6976036 7013585 7018258 * @summary Exercise Arrays.sort * @build Sorting * @run main Sorting -shortrun @@ -66,7 +66,7 @@ public class Sorting { } long end = System.currentTimeMillis(); - out.format("\nPASSED in %d sec.\n", Math.round((end - start) / 1E3)); + out.format("PASSED in %d sec.\n", Math.round((end - start) / 1E3)); } private static void testAndCheck(int[] lengths, long[] randoms) { @@ -78,46 +78,19 @@ public class Sorting { testEmptyAndNullFloatArray(); testEmptyAndNullDoubleArray(); - for (long random : randoms) { - reset(random); - + for (int length : lengths) { + testMergeSort(length); + testAndCheckRange(length); + testAndCheckSubArray(length); + } + for (long seed : randoms) { for (int length : lengths) { - testAndCheckWithInsertionSort(length, random); - } - reset(random); - - for (int length : lengths) { - testAndCheckWithCheckSum(length, random); - } - reset(random); - - for (int length : lengths) { - testAndCheckWithScrambling(length, random); - } - reset(random); - - for (int length : lengths) { - testAndCheckFloat(length, random); - } - reset(random); - - for (int length : lengths) { - testAndCheckDouble(length, random); - } - reset(random); - - for (int length : lengths) { - testAndCheckRange(length, random); - } - reset(random); - - for (int length : lengths) { - testAndCheckSubArray(length, random); - } - reset(random); - - for (int length : lengths) { - testStable(length, random); + testAndCheckWithInsertionSort(length, new MyRandom(seed)); + testAndCheckWithCheckSum(length, new MyRandom(seed)); + testAndCheckWithScrambling(length, new MyRandom(seed)); + testAndCheckFloat(length, new MyRandom(seed)); + testAndCheckDouble(length, new MyRandom(seed)); + testStable(length, new MyRandom(seed)); } } } @@ -255,7 +228,7 @@ public class Sorting { failed("Arrays.sort(double[]) shouldn't catch null array"); } - private static void testAndCheckSubArray(int length, long random) { + private static void testAndCheckSubArray(int length) { ourDescription = "Check sorting of subarray"; int[] golden = new int[length]; boolean newLine = false; @@ -282,7 +255,7 @@ public class Sorting { } } - private static void testAndCheckRange(int length, long random) { + private static void testAndCheckRange(int length) { ourDescription = "Check range check"; int[] golden = new int[length]; @@ -300,15 +273,16 @@ public class Sorting { out.println(); } - private static void testStable(int length, long random) { + private static void testStable(int length, MyRandom random) { ourDescription = "Check if sorting is stable"; - Pair[] a = build(length); + Pair[] a = build(length, random); - out.println("Test 'stable': " + "random = " + random + + out.println("Test 'stable': " + "random = " + random.getSeed() + ", length = " + length); Arrays.sort(a); checkSorted(a); checkStable(a); + out.println(); } private static void checkSorted(Pair[] a) { @@ -342,11 +316,11 @@ public class Sorting { } } - private static Pair[] build(int length) { + private static Pair[] build(int length, Random random) { Pair[] a = new Pair[length * 4]; for (int i = 0; i < a.length; ) { - int key = ourRandom.nextInt(); + int key = random.nextInt(); a[i++] = new Pair(key, 1); a[i++] = new Pair(key, 2); a[i++] = new Pair(key, 3); @@ -389,7 +363,7 @@ public class Sorting { } - private static void testAndCheckWithInsertionSort(int length, long random) { + private static void testAndCheckWithInsertionSort(int length, MyRandom random) { if (length > 1000) { return; } @@ -398,13 +372,13 @@ public class Sorting { for (int m = 1; m < 2 * length; m *= 2) { for (UnsortedBuilder builder : UnsortedBuilder.values()) { - builder.build(golden, m); + builder.build(golden, m, random); int[] test = golden.clone(); for (TypeConverter converter : TypeConverter.values()) { - out.println("Test 'insertion sort': " + converter + " " + - builder + "random = " + random + ", length = " + - length + ", m = " + m); + out.println("Test 'insertion sort': " + converter + + " " + builder + "random = " + random.getSeed() + + ", length = " + length + ", m = " + m); Object convertedGolden = converter.convert(golden); Object convertedTest1 = converter.convert(test); Object convertedTest2 = converter.convert(test); @@ -417,19 +391,44 @@ public class Sorting { out.println(); } - private static void testAndCheckWithCheckSum(int length, long random) { + private static void testMergeSort(int length) { + if (length < 1000) { + return; + } + ourDescription = "Check merge sorting"; + int[] golden = new int[length]; + int period = 67; // java.util.DualPivotQuicksort.MAX_RUN_COUNT + + for (int m = period - 2; m <= period + 2; m++) { + for (MergeBuilder builder : MergeBuilder.values()) { + builder.build(golden, m); + int[] test = golden.clone(); + + for (TypeConverter converter : TypeConverter.values()) { + out.println("Test 'merge sort': " + converter + " " + + builder + "length = " + length + ", m = " + m); + Object convertedGolden = converter.convert(golden); + sort(convertedGolden); + checkSorted(convertedGolden); + } + } + } + out.println(); + } + + private static void testAndCheckWithCheckSum(int length, MyRandom random) { ourDescription = "Check sorting with check sum"; int[] golden = new int[length]; for (int m = 1; m < 2 * length; m *= 2) { for (UnsortedBuilder builder : UnsortedBuilder.values()) { - builder.build(golden, m); + builder.build(golden, m, random); int[] test = golden.clone(); for (TypeConverter converter : TypeConverter.values()) { - out.println("Test 'check sum': " + converter + " " + - builder + "random = " + random + ", length = " + - length + ", m = " + m); + out.println("Test 'check sum': " + converter + + " " + builder + "random = " + random.getSeed() + + ", length = " + length + ", m = " + m); Object convertedGolden = converter.convert(golden); Object convertedTest = converter.convert(test); sort(convertedTest); @@ -440,7 +439,7 @@ public class Sorting { out.println(); } - private static void testAndCheckWithScrambling(int length, long random) { + private static void testAndCheckWithScrambling(int length, MyRandom random) { ourDescription = "Check sorting with scrambling"; int[] golden = new int[length]; @@ -451,12 +450,12 @@ public class Sorting { for (SortedBuilder builder : SortedBuilder.values()) { builder.build(golden, m); int[] test = golden.clone(); - scramble(test); + scramble(test, random); for (TypeConverter converter : TypeConverter.values()) { - out.println("Test 'scrambling': " + converter + " " + - builder + "random = " + random + ", length = " + - length + ", m = " + m); + out.println("Test 'scrambling': " + converter + + " " + builder + "random = " + random.getSeed() + + ", length = " + length + ", m = " + m); Object convertedGolden = converter.convert(golden); Object convertedTest = converter.convert(test); sort(convertedTest); @@ -467,7 +466,7 @@ public class Sorting { out.println(); } - private static void testAndCheckFloat(int length, long random) { + private static void testAndCheckFloat(int length, MyRandom random) { ourDescription = "Check float sorting"; float[] golden = new float[length]; final int MAX = 10; @@ -485,13 +484,12 @@ public class Sorting { continue; } for (FloatBuilder builder : FloatBuilder.values()) { - out.println("Test 'float': random = " + random + - ", length = " + length + ", a = " + a + - ", g = " + g + ", z = " + z + ", n = " + n + - ", p = " + p); - builder.build(golden, a, g, z, n, p); + out.println("Test 'float': random = " + random.getSeed() + + ", length = " + length + ", a = " + a + ", g = " + + g + ", z = " + z + ", n = " + n + ", p = " + p); + builder.build(golden, a, g, z, n, p, random); float[] test = golden.clone(); - scramble(test); + scramble(test, random); sort(test); compare(test, golden, a, n, g); } @@ -506,7 +504,7 @@ public class Sorting { } } - private static void testAndCheckDouble(int length, long random) { + private static void testAndCheckDouble(int length, MyRandom random) { ourDescription = "Check double sorting"; double[] golden = new double[length]; final int MAX = 10; @@ -524,12 +522,12 @@ public class Sorting { continue; } for (DoubleBuilder builder : DoubleBuilder.values()) { - out.println("Test 'double': random = " + random + + out.println("Test 'double': random = " + random.getSeed() + ", length = " + length + ", a = " + a + ", g = " + g + ", z = " + z + ", n = " + n + ", p = " + p); - builder.build(golden, a, g, z, n, p); + builder.build(golden, a, g, z, n, p, random); double[] test = golden.clone(); - scramble(test); + scramble(test, random); sort(test); compare(test, golden, a, n, g); } @@ -562,21 +560,21 @@ public class Sorting { } } - private static void scramble(int[] a) { + private static void scramble(int[] a, Random random) { for (int i = 0; i < a.length * 7; i++) { - swap(a, ourRandom.nextInt(a.length), ourRandom.nextInt(a.length)); + swap(a, random.nextInt(a.length), random.nextInt(a.length)); } } - private static void scramble(float[] a) { + private static void scramble(float[] a, Random random) { for (int i = 0; i < a.length * 7; i++) { - swap(a, ourRandom.nextInt(a.length), ourRandom.nextInt(a.length)); + swap(a, random.nextInt(a.length), random.nextInt(a.length)); } } - private static void scramble(double[] a) { + private static void scramble(double[] a, Random random) { for (int i = 0; i < a.length * 7; i++) { - swap(a, ourRandom.nextInt(a.length), ourRandom.nextInt(a.length)); + swap(a, random.nextInt(a.length), random.nextInt(a.length)); } } @@ -689,10 +687,10 @@ public class Sorting { private static enum FloatBuilder { SIMPLE { - void build(float[] x, int a, int g, int z, int n, int p) { + void build(float[] x, int a, int g, int z, int n, int p, Random random) { int fromIndex = 0; - float negativeValue = -ourRandom.nextFloat(); - float positiveValue = ourRandom.nextFloat(); + float negativeValue = -random.nextFloat(); + float positiveValue = random.nextFloat(); writeValue(x, negativeValue, fromIndex, n); fromIndex += n; @@ -710,15 +708,15 @@ public class Sorting { } }; - abstract void build(float[] x, int a, int g, int z, int n, int p); + abstract void build(float[] x, int a, int g, int z, int n, int p, Random random); } private static enum DoubleBuilder { SIMPLE { - void build(double[] x, int a, int g, int z, int n, int p) { + void build(double[] x, int a, int g, int z, int n, int p, Random random) { int fromIndex = 0; - double negativeValue = -ourRandom.nextFloat(); - double positiveValue = ourRandom.nextFloat(); + double negativeValue = -random.nextFloat(); + double positiveValue = random.nextFloat(); writeValue(x, negativeValue, fromIndex, n); fromIndex += n; @@ -736,7 +734,7 @@ public class Sorting { } }; - abstract void build(double[] x, int a, int g, int z, int n, int p); + abstract void build(double[] x, int a, int g, int z, int n, int p, Random random); } private static void writeValue(float[] a, float value, int fromIndex, int count) { @@ -812,7 +810,6 @@ public class Sorting { } } }, - ORGAN_PIPES { void build(int[] a, int m) { int i = 0; @@ -841,37 +838,85 @@ public class Sorting { } } + private static enum MergeBuilder { + ASCENDING { + void build(int[] a, int m) { + int period = a.length / m; + int v = 1, i = 0; + + for (int k = 0; k < m; k++) { + v = 1; + for (int p = 0; p < period; p++) { + a[i++] = v++; + } + } + for (int j = i; j < a.length - 1; j++) { + a[j] = v++; + } + a[a.length - 1] = 0; + } + }, + DESCENDING { + void build(int[] a, int m) { + int period = a.length / m; + int v = -1, i = 0; + + for (int k = 0; k < m; k++) { + v = -1; + for (int p = 0; p < period; p++) { + a[i++] = v--; + } + } + for (int j = i; j < a.length - 1; j++) { + a[j] = v--; + } + a[a.length - 1] = 0; + } + }; + + abstract void build(int[] a, int m); + + @Override public String toString() { + String name = name(); + + for (int i = name.length(); i < 12; i++) { + name += " "; + } + return name; + } + } + private static enum UnsortedBuilder { RANDOM { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { - a[i] = ourRandom.nextInt(); + a[i] = random.nextInt(); } } }, ASCENDING { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { a[i] = m + i; } } }, DESCENDING { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { a[i] = a.length - m - i; } } }, ALL_EQUAL { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { a[i] = m; } } }, SAW { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { int incCount = 1; int decCount = a.length; int i = 0; @@ -897,21 +942,21 @@ public class Sorting { } }, REPEATED { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { a[i] = i % m; } } }, DUPLICATED { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { - a[i] = ourRandom.nextInt(m); + a[i] = random.nextInt(m); } } }, ORGAN_PIPES { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { int middle = a.length / (m + 1); for (int i = 0; i < middle; i++) { @@ -923,28 +968,29 @@ public class Sorting { } }, STAGGER { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { a[i] = (i * m + i) % a.length; } } }, PLATEAU { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { for (int i = 0; i < a.length; i++) { a[i] = Math.min(i, m); } } }, SHUFFLE { - void build(int[] a, int m) { + void build(int[] a, int m, Random random) { + int x = 0, y = 0; for (int i = 0; i < a.length; i++) { - a[i] = ourRandom.nextBoolean() ? (ourFirst += 2) : (ourSecond += 2); + a[i] = random.nextBoolean() ? (x += 2) : (y += 2); } } }; - abstract void build(int[] a, int m); + abstract void build(int[] a, int m, Random random); @Override public String toString() { String name = name(); @@ -1953,18 +1999,6 @@ public class Sorting { } } - private static void prepareRandom(int[] a) { - for (int i = 0; i < a.length; i++) { - a[i] = ourRandom.nextInt(); - } - } - - private static void reset(long seed) { - ourRandom = new Random(seed); - ourFirst = 0; - ourSecond = 0; - } - private static void outArray(Object[] a) { for (int i = 0; i < a.length; i++) { out.print(a[i] + " "); @@ -1993,8 +2027,18 @@ public class Sorting { out.println(); } - private static int ourFirst; - private static int ourSecond; - private static Random ourRandom; + private static class MyRandom extends Random { + MyRandom(long seed) { + super(seed); + mySeed = seed; + } + + long getSeed() { + return mySeed; + } + + private long mySeed; + } + private static String ourDescription; } From d30b5f01d3ae7c8ecd99a3e26327820b8a81de7e Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Thu, 10 Feb 2011 12:55:56 +0100 Subject: [PATCH 72/84] 7018366: hotspot/runtime_erro Fix for 7014918 does not build using MVC 2003 Looking at API_VERSION_NUMBER define to see what version of dbghelp.h/imagehlp.h is included to determine what MINIDUMP_TYPEs are defined in the header file Reviewed-by: acorn, brutisso, sla --- hotspot/src/os/windows/vm/os_windows.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 50018200d9f..1b1f04bd052 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -956,9 +956,14 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char* return; } - dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithFullMemoryInfo | - MiniDumpWithHandleData | MiniDumpWithThreadInfo | MiniDumpWithUnloadedModules); + dumpType = (MINIDUMP_TYPE)(MiniDumpWithFullMemory | MiniDumpWithHandleData); +// Older versions of dbghelp.h doesn't contain all the dumptypes we want, dbghelp.h with +// API_VERSION_NUMBER 11 or higher contains the ones we want though +#if API_VERSION_NUMBER >= 11 + dumpType = (MINIDUMP_TYPE)(dumpType | MiniDumpWithFullMemoryInfo | MiniDumpWithThreadInfo | + MiniDumpWithUnloadedModules); +#endif cwd = get_current_directory(NULL, 0); jio_snprintf(buffer, bufferSize, "%s\\hs_err_pid%u.mdmp",cwd, current_process_id()); From c5468080e4898d6f4991b93be77f65a8984310e6 Mon Sep 17 00:00:00 2001 From: Michael Fang Date: Thu, 10 Feb 2011 11:07:10 -0800 Subject: [PATCH 73/84] 7014477: pt_BR corba resource bundle is missing in jdk7 build Reviewed-by: ohair --- corba/make/common/Defs.gmk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/corba/make/common/Defs.gmk b/corba/make/common/Defs.gmk index 6d78ecb580e..ade12fb285a 100644 --- a/corba/make/common/Defs.gmk +++ b/corba/make/common/Defs.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1995, 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 @@ -63,8 +63,8 @@ include $(TOPDIR)/make/common/Defs-$(PLATFORM).gmk # Localizations for the different parts of the product beyond English # -JRE_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK -PLUGIN_LOCALES = de es fr it ja ko sv zh_CN zh_TW zh_HK +JRE_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK +PLUGIN_LOCALES = de es fr it ja ko pt_BR sv zh_CN zh_TW zh_HK JDK_LOCALES = ja zh_CN # From 02c1789d11492aee7cefce6459028fd22d1e92c2 Mon Sep 17 00:00:00 2001 From: Michael Fang Date: Thu, 10 Feb 2011 14:25:42 -0800 Subject: [PATCH 74/84] 7017734: jdk7 message drop 1 translation integration Reviewed-by: ogino, yhuang --- .../orbutil/resources/sunorb_de.properties | 108 +++++++-------- .../orbutil/resources/sunorb_es.properties | 80 +++++------ .../orbutil/resources/sunorb_fr.properties | 78 +++++------ .../orbutil/resources/sunorb_it.properties | 52 +++---- .../orbutil/resources/sunorb_ja.properties | 130 +++++++++--------- .../orbutil/resources/sunorb_ko.properties | 128 ++++++++--------- .../orbutil/resources/sunorb_pt_BR.properties | 80 +++++------ .../orbutil/resources/sunorb_sv.properties | 94 ++++++------- .../orbutil/resources/sunorb_zh_CN.properties | 110 +++++++-------- .../orbutil/resources/sunorb_zh_TW.properties | 114 +++++++-------- 10 files changed, 487 insertions(+), 487 deletions(-) diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties index 3ed58f3637a..b33670ea62f 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=Syntax: {0} \n\nwobei folgende m\u00f6glich sind:\n -port Aktivierungsport, an dem der ORBD gestartet werden sollte, Standardvorgabe 1049 (optional)\n -defaultdb Verzeichnis f\u00fcr ORBD-Dateien, Standardvorgabe "./orb.db" (optional)\n -serverid Server-ID f\u00fcr ORBD, Standardvorgabe 1 (optional)\n -ORBInitialPort Anfangsport (erforderlich)\n -ORBInitialHost Anf\u00e4nglicher Rechnername (erforderlich)\n +orbd.usage=Verwendung: {0} \n\nwobei folgende m\u00F6glich sind:\n -port Aktivierungsport, an dem der ORBD gestartet werden sollte, Standardwert 1049 (optional)\n -defaultdb Verzeichnis f\u00FCr ORBD-Dateien, Standardwert "./orb.db" (optional)\n -serverid Server-ID f\u00FCr ORBD, Standardwert 1 (optional)\n -ORBInitialPort Anfangsport (erforderlich)\n -ORBInitialHost Anf\u00E4nglicher HostName (erforderlich)\n -servertool.usage=Syntax: {0} \n\nwobei folgende m\u00f6glich sind:\n -ORBInitialPort Anfangsport (erforderlich)\n -ORBInitialHost Anf\u00e4nglicher Rechnername (erforderlich)\n -servertool.banner=\n\nWillkommen beim Java IDL-Server-Tool \nBitte geben Sie an der Eingabeaufforderung Befehle ein. \n -servertool.shorthelp=\n\n\tVerf\u00fcgbare Befehle: \n\t------------------- \n -servertool.baddef=Fehlerhafte Serverdefinition: {0} -servertool.nosuchserver=\tDer Server wurde nicht gefunden. -servertool.helddown=\tServer ist au\u00dfer Betrieb. -servertool.nosuchorb=\tUng\u00fcltige ORB -servertool.serverup=\tServer ist bereits in Betrieb. -servertool.appname=\tAnwendungsname - {0} +servertool.usage=Verwendung: {0} \n\nwobei folgende m\u00F6glich sind:\n -ORBInitialPort Anfangsport (erforderlich)\n -ORBInitialHost Anf\u00E4nglicher HostName (erforderlich)\n +servertool.banner=\n\nWillkommen beim Java IDL-Servertool \nGeben Sie die entsprechenden Befehle im Prompt ein \n +servertool.shorthelp=\n\n\tVerf\u00FCgbare Befehle: \n\t------------------- \n +servertool.baddef=Ung\u00FCltige Serverdefinition: {0} +servertool.nosuchserver=\tServer wurde nicht gefunden. +servertool.helddown=\tServer ist au\u00DFer Betrieb. +servertool.nosuchorb=\tUng\u00FCltiger ORB. +servertool.serverup=\tServer ist bereits hochgefahren. +servertool.appname=\tapplicationName - {0} servertool.name=\tName - {0} -servertool.classpath=\tKlassenpfad - {0} -servertool.args=\tArgs - {0} -servertool.vmargs=\tVmargs - {0} +servertool.classpath=\tclasspath - {0} +servertool.args=\targs - {0} +servertool.vmargs=\tvmargs - {0} servertool.serverid=\tServer-ID - {0} -servertool.servernotrunning=\tServer l\u00e4uft nicht. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.servernotrunning=\tServer wird nicht ausgef\u00FChrt. +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n servertool.register1=aktivierbaren Server registrieren -servertool.register2=\tServer registriert (serverid = {0}) -servertool.register3=\tServer registriert, aber au\u00dfer Betrieb (serverid = {0}) -servertool.register4=\tServer bereits registriert (serverid = {0}) +servertool.register2=\tServer registriert (serverid = {0}). +servertool.register3=\tServer registriert, aber au\u00DFer Betrieb (serverid = {0}). +servertool.register4=\tServer bereits registriert (serverid = {0}). servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=Registrierung eines registrierten Servers l\u00f6schen -servertool.unregister2=\tServer-Registrierung gel\u00f6scht +servertool.unregister1=Registrierung eines registrierten Servers aufheben +servertool.unregister2=\tServerregistrierung aufgehoben. -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=Finden von Ports eines speziellen Typs bei einem registrierten Server +servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n +servertool.locate1=Ports eines speziellen Typs f\u00FCr einen registrierten Server finden servertool.locate2=\n\n\tHostname {0} \n\n\t\tPort\t\tPorttyp\t\tORB-ID\n\t\t----\t\t-------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=Finden von Ports eines speziellen ORBs bei einem registrierten Server -servertool.locateorb2=\n\n\tHostname {0} \n\n\t\tPort\t\tPorttyp\t\tORB-ID\n\t\t----\t\t-------\t\t------\n +servertool.locateorb1=Ports f\u00FCr einen speziellen ORB bei einem registrierten Server finden +servertool.locateorb2=\n\n\tHostname {0} \n\n\t\tPort\t\tPortType\t\tORB-ID\n\t\t----\t\t-------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=\u00dcbergeben der Server-ID f\u00fcr einen Anwendungsnamen -servertool.getserverid2=\tServer-ID f\u00fcr Anwendungsname {0} ist {1}. +servertool.getserverid1=Server-ID f\u00FCr applicationName zur\u00FCckgeben +servertool.getserverid2=\tServer-ID f\u00FCr applicationName {0} ist {1} servertool.list=\n\tlist\n -servertool.list1=Auflisten aller registrierten Server -servertool.list2=\n\tServer-ID\tServer-Klassenname\t\tServer-Anwendung\n\t---------\t------------------\t\t----------------\n +servertool.list1=alle registrierten Server auflisten +servertool.list2=\n\tServer-ID\tServerklassenname\t\tServeranwendung\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive -servertool.listactive1=Auflisten der gegenw\u00e4rtig aktiven Server +servertool.listactive1=derzeit aktive Server auflisten servertool.listappnames=\tlistappnames\n -servertool.listappnames1=Auflisten der gegenw\u00e4rtig definierten Anwendungsnamen -servertool.listappnames2=Gegenw\u00e4rtig definierte Serveranwendungsnamen: +servertool.listappnames1=derzeit definierte applicationNames auflisten +servertool.listappnames2=Derzeit definierte Server-applicationNames: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=Herunterfahren eines registrierten Servers -servertool.shutdown2=\tServer erfolgreich heruntergefahren +servertool.shutdown1=registrierten Server herunterfahren +servertool.shutdown2=\tServer erfolgreich heruntergefahren. servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=Hochfahren eines registrierten Servers -servertool.startserver2=\tServer erfolgreich hochgefahren +servertool.startserver1=registrierten Server starten +servertool.startserver2=\tServer erfolgreich hochgefahren. servertool.quit=\n\tquit\n -servertool.quit1=Dieses Tool beenden +servertool.quit1=dieses Tool beenden servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=Hilfe anfordern +servertool.help1=Hilfe abrufen -servertool.orbidmap=\tSyntax: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap=\\Verwendung: orblist [ -serverid | -applicationName ]\n servertool.orbidmap1=Liste von ORB-Namen und ihren Zuordnungen servertool.orbidmap2=\n\tORB-ID\t\tORB-Name\n\t------\t\t--------\n -pnameserv.success=St\u00e4ndiger Namensserver erfolgreich hochgefahren +pnameserv.success=Persistenter NameServer erfolgreich gestartet -bootstrap.usage=Syntax: {0} \n\nwobei folgende m\u00f6glich sind:\n -ORBInitialPort Erster Port (erforderlich)\n -InitialServicesFile Datei mit Liste von Anfangsdiensten (erforderlich)\n -bootstrap.success=Ein Port wird auf {0} eingestellt, und Dienste werden von {1} gelesen -bootstrap.filenotreadable=Die Datei {0} kann nicht gelesen werden. -bootstrap.filenotfound=Die Datei {0} wurde nicht gefunden. -bootstrap.exception=Beim Speichern von Eigenschaften in Datei {0} wurde eine Ausnahme aufgefangen: Ausnahme {1}. +bootstrap.usage=Verwendung: {0} \n\nwobei folgende m\u00F6glich sind:\n -ORBInitialPort Anf\u00E4nglicher Port (erforderlich)\n -InitialServicesFile Datei mit Liste von anf\u00E4nglichen Services (erforderlich)\n +bootstrap.success=Port wird auf {0} gesetzt, Services werden aus {1} gelesen +bootstrap.filenotreadable=Datei {0} kann nicht gelesen werden +bootstrap.filenotfound=Datei {0} wurde nicht gefunden +bootstrap.exception=Beim Speichern von Eigenschaften in Datei {0} wurde eine Ausnahme abgefangen: Ausnahme {1} -tnameserv.exception=Beim Hochfahren des Bootstrap-Dienstes auf Port {0} wurde eine Ausnahme aufgefangen. -tnameserv.usage=Versuchen Sie, einen anderen Port mit den Befehlszeilenargumenten -ORBInitialPort zu verwenden. -tnameserv.invalidhostoption=ORBInitialHost ist keine g\u00fcltige Option f\u00fcr NameService -tnameserv.orbinitialport0=ORBInitialPort 0 ist keine g\u00fcltige Option f\u00fcr NameService -tnameserv.hs1=Anf\u00e4nglicher Namenskontext:\n{0} -tnameserv.hs2=\u00dcbergangsnamensserver: Port f\u00fcr anf\u00e4ngliche Objektreferenzen wird eingestellt auf: {0} -tnameserv.hs3=Bereit +tnameserv.exception=Beim Hochfahren des Bootstrap-Services auf Port {0} wurde eine Ausnahme abgefangen +tnameserv.usage=Verwenden Sie einen anderen Port mit den Befehlszeilenargumenten -ORBInitialPort +tnameserv.invalidhostoption=ORBInitialHost ist keine g\u00FCltige Option f\u00FCr NameService +tnameserv.orbinitialport0=ORBInitialPort 0 ist keine g\u00FCltige Option f\u00FCr NameService +tnameserv.hs1=Anf\u00E4nglicher Namenskontext:\n{0} +tnameserv.hs2=TransientNameServer: Port f\u00FCr anf\u00E4ngliche Objektreferenzen wird auf {0} gesetzt +tnameserv.hs3=Bereit. -orbd.commfailure=\nORBD konnte nicht gestartet werden, weil ORBinitialPort bereits verwendet wird -orbd.internalexception=\ORBD konnte wegen einer internen Ausnahme nicht gestartet werden. \nM\u00f6gliche Ursachen: \n1. Der angegebene ORBInitialPort oder ORBActivationPort wird bereits verwendet \n2. Keine Berechtigung zum Schreiben von orb.db +orbd.commfailure=\nStart von ORBD nicht erfolgreich, da ORBinitialPort bereits verwendet wird +orbd.internalexception=\nStart von ORBD aufgrund einer internen Ausnahme nicht erfolgreich. \nM\u00F6gliche Ursachen: \n1. Der angegebene ORBInitialPort oder ORBActivationPort wird bereits verwendet \n2. Keine Berechtigung zum Schreiben von orb.db diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties index 80cbfcf50c0..12562891caa 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_es.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,24 +23,24 @@ # questions. # -orbd.usage=Sintaxis: {0} \n\ndonde incluye:\n -port Puerto de activaci\u00f3n en el que se debe iniciar el ORBD, el predeterminado es el 1049 (opcional)\n -defaultdb Directorio para los archivos de ORBD, el predeterminado es "./orb.db" (opcional)\n -serverid Identificador de servidor para ORBD, el predeterminado es 1 (opcional)\n -ORBInitialPort Puerto inicial (necesario)\n -ORBInitialHost Nombre de sistema inicial (necesario)\n +orbd.usage=Sintaxis: {0} \n\ndonde incluye:\n -port Puerto de activaci\u00F3n en el que se debe iniciar el ORBD, por defecto es el 1049 (opcional)\n -defaultdb Directorio para los archivos de ORBD, por defecto es "./orb.db" (opcional)\n -serverid Identificador de servidor para ORBD, por defecto es 1 (opcional)\n -ORBInitialPort Puerto inicial (necesario)\n -ORBInitialHost Nombre de host inicial (necesario)\n -servertool.usage=Sintaxis: {0} \n\ndonde incluye:\n -ORBInitialPort Puerto inicial (necesario)\n -ORBInitialHost Nombre de sistema inicial (necesario)\n -servertool.banner=\n\nBienvenido Java IDL Server Tool \nescriba los comandos en el indicador \n +servertool.usage=Sintaxis: {0} \n\ndonde incluye:\n -ORBInitialPort Puerto inicial (necesario)\n -ORBInitialHost Nombre de host inicial (necesario)\n +servertool.banner=\n\nBienvenido a Java IDL Server Tool \nescriba los comandos en la petici\u00F3n de datos \n servertool.shorthelp=\n\n\tComandos disponibles: \n\t------------------- \n -servertool.baddef=Definici\u00f3n de servidor incorrecta: {0} +servertool.baddef=Definici\u00F3n de servidor incorrecta: {0} servertool.nosuchserver=\tno se ha encontrado el servidor. servertool.helddown=\tel servidor se mantiene desconectado. -servertool.nosuchorb=\tORB no v\u00e1lido. -servertool.serverup=\tel servidor ya est\u00e1 conectado. -servertool.appname=\tnombre de aplicaci\u00f3n - {0} -servertool.name=\tnombre - {0} -servertool.classpath=\truta de clase - {0} -servertool.args=\targumentos - {0} -servertool.vmargs=\targumentos de MV - {0} -servertool.serverid=\tidentificador de servidor - {0} -servertool.servernotrunning=\tel servidor no se est\u00e1 ejecutando. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.nosuchorb=\tORB no v\u00E1lido. +servertool.serverup=\tel servidor ya est\u00E1 conectado. +servertool.appname=\tapplicationName - {0} +servertool.name=\tname - {0} +servertool.classpath=\tclasspath - {0} +servertool.args=\targs - {0} +servertool.vmargs=\tvmargs - {0} +servertool.serverid=\tserver id - {0} +servertool.servernotrunning=\tel servidor no se est\u00E1 ejecutando. +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n servertool.register1=registrar un servidor que se pueda activar servertool.register2=\tservidor registrado (identificador de servidor = {0}). servertool.register3=\tservidor registrado pero desconectado (identificador de servidor = {0}). @@ -51,57 +51,57 @@ servertool.unregister1=anular el registro de un servidor registrado servertool.unregister2=\tanulado el registro del servidor. servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=localizar puertos de un tipo espec\u00edfico para un servidor registrado -servertool.locate2=\n\n\tNombre de sistema {0} \n\n\t\tPuerto\t\tTipo de puerto\t\tIdentificador ORB\n\t\t----\t\t---------\t\t------\n +servertool.locate1=localizar puertos de un tipo espec\u00EDfico para un servidor registrado +servertool.locate2=\n\n\tNombre de host {0} \n\n\t\tPuerto\t\tTipo de puerto\t\tIdentificador ORB\n\t\t----\t\t---------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=localizar puertos para un ORB espec\u00edfico del servidor registrado -servertool.locateorb2=\n\n\tNombre de sistema {0} \n\n\t\tPuerto\t\tTipo de puerto\t\tIdentificador de ORB\n\t\t----\t\t--------\t\t------\n +servertool.locateorb1=localizar puertos para un ORB espec\u00EDfico del servidor registrado +servertool.locateorb2=\n\n\tNombre de host {0} \n\n\t\tPuerto\t\tTipo de puerto\t\tIdentificador de ORB\n\t\t----\t\t--------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=devolver el identificador de servidor para un nombre de aplicaci\u00f3n -servertool.getserverid2=\tIdentificador de servidor para el nombre de aplicaci\u00f3n {0} es {1} +servertool.getserverid1=devolver el identificador de servidor para un valor de applicationName +servertool.getserverid2=\tEl identificador de servidor para applicationName {0} es {1} -servertool.list=\n\tlista\n +servertool.list=\n\tlist\n servertool.list1=enumerar todos los servidores registrados -servertool.list2=\n\tIdentificador de servidor\tNombre de clase del servidor\t\tAplicaci\u00f3n de servidor\n\t-------------------------\t----------------------------\t\t----------------------\n +servertool.list2=\n\tIdentificador de servidor\tNombre de clase del servidor\t\tAplicaci\u00F3n de servidor\n\t-------------------------\t----------------------------\t\t----------------------\n servertool.listactive=\n\tlistactive servertool.listactive1=enumerar los servidores actualmente activos servertool.listappnames=\tlistappnames\n -servertool.listappnames1=enumerar los nombres de aplicaci\u00f3n actualmente definidos -servertool.listappnames2=Nombres de aplicaci\u00f3n de servidor actualmente definidos: +servertool.listappnames1=enumerar los nombres de aplicaci\u00F3n actualmente definidos +servertool.listappnames2=Nombres de aplicaci\u00F3n de servidor actualmente definidos: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n servertool.shutdown1=apagar un servidor registrado -servertool.shutdown2=\tservidor apagado satisfactoriamente. +servertool.shutdown2=\tservidor apagado correctamente. servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n servertool.startserver1=iniciar un servidor registrado -servertool.startserver2=\tservidor iniciado satisfactoriamente. +servertool.startserver2=\tservidor iniciado correctamente. -servertool.quit=\n\tsalir\n +servertool.quit=\n\tquit\n servertool.quit1=salir de esta herramienta servertool.help=\thelp\n\tO\n\thelp \n servertool.help1=obtener ayuda servertool.orbidmap=\tSintaxis: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=lista de nombres de ORB y su reasignaci\u00f3n +servertool.orbidmap1=lista de nombres de ORB y su asignaci\u00F3n servertool.orbidmap2=\n\tIdentificador de ORB\t\tNombre de ORB\n\t------\t\t--------\n -pnameserv.success=Servidor de nombres constante iniciado satisfactoriamente +pnameserv.success=NameServer constante iniciado correctamente bootstrap.usage=Sintaxis: {0} \n\ndonde incluye:\n -ORBInitialPort Puerto inicial (necesario)\n -InitialServicesFile Archivo que contiene una lista de los servicios iniciales (necesario)\n -bootstrap.success=estableciendo puerto en {0} y leyendo servicios de {1} +bootstrap.success=definiendo puerto en {0} y leyendo servicios de {1} bootstrap.filenotreadable=el archivo {0} no se puede leer bootstrap.filenotfound=no se ha encontrado el archivo {0} -bootstrap.exception=se ha interceptado una excepci\u00f3n al guardar las propiedades en el archivo {0}: Excepci\u00f3n {1} +bootstrap.exception=se ha obtenido una excepci\u00F3n al guardar las propiedades en el archivo {0}: Excepci\u00F3n {1} -tnameserv.exception=se ha interceptado una excepci\u00f3n al iniciar el servicio de rutina de carga en el puerto {0} -tnameserv.usage=intente utilizar un puerto distinto con argumentos de l\u00ednea de comandos -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost no es una opci\u00f3n v\u00e1lida para NameService -tnameserv.orbinitialport0=ORBInitialPort 0 no es una opci\u00f3n v\u00e1lida para NameService -tnameserv.hs1=Contexto de asignaci\u00f3n de nombres inicial:\n{0} -tnameserv.hs2=TransientNameServer: estableciendo puerto para referencias a objeto iniciales en: {0} +tnameserv.exception=se ha obtenido una excepci\u00F3n al iniciar el servicio de inicializaci\u00F3n de datos en el puerto {0} +tnameserv.usage=intente utilizar un puerto distinto con argumentos de l\u00EDnea de comandos -ORBInitialPort +tnameserv.invalidhostoption=ORBInitialHost no es una opci\u00F3n v\u00E1lida para NameService +tnameserv.orbinitialport0=ORBInitialPort 0 no es una opci\u00F3n v\u00E1lida para NameService +tnameserv.hs1=Contexto de Nomenclatura Inicial:\n{0} +tnameserv.hs2=TransientNameServer: definiendo puerto para referencias a objeto iniciales en: {0} tnameserv.hs3=Listo. -orbd.commfailure=\nORBD no puede iniciarse porque ORBinitialPort ya est\u00e1 en uso -orbd.internalexception=\nORBD no puede iniciarse debido a una excepci\u00f3n interna. \nCausas posibles: \n1. El ORBInitialPort o el ORBActivationPort especificado ya est\u00e1 en uso \n2. No tiene permiso de escritura para orb.db +orbd.commfailure=\nORBD no puede iniciarse porque ORBinitialPort ya est\u00E1 en uso +orbd.internalexception=\nORBD no puede iniciarse debido a una excepci\u00F3n interna. \nCausas posibles: \n1. El ORBInitialPort o el ORBActivationPort especificado ya est\u00E1 en uso \n2. No tiene permiso de escritura para orb.db diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties index 331309ae916..b1b64f1f9f3 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_fr.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,58 +23,58 @@ # questions. # -orbd.usage=Syntaxe : {0} \n\no\u00f9 comprend :\n -port Port d''activation o\u00f9 le ORBD doit \u00eatre d\u00e9marr\u00e9, 1049 par d\u00e9faut (facultatif)\n -defaultdb R\u00e9pertoire des fichiers ORBD, par d\u00e9faut "./orb.db" (facultatif)\n -serverid ID de serveur pour ORBD, 1 (facultatif)\n -ORBInitialPort Port initial (requis)\n -ORBInitialHost Nom d''h\u00f4te initial (requis)\n +orbd.usage=Syntaxe : {0} \n\no\u00F9 comprend :\n -port Port d''activation o\u00F9 l''ORBD doit \u00EAtre d\u00E9marr\u00E9, 1049 par d\u00E9faut (facultatif)\n -defaultdb R\u00E9pertoire des fichiers ORBD, par d\u00E9faut "./orb.db" (facultatif)\n -serverid ID de serveur pour ORBD, 1 par d\u00E9faut (facultatif)\n -ORBInitialPort Port initial (obligatoire)\n -ORBInitialHost Nom d''h\u00F4te initial (obligatoire)\n -servertool.usage=Syntaxe : {0} \n\no\u00f9 comprend :\n -ORBInitialPort Port initial (requis)\n -ORBInitialHost Nom d''h\u00f4te initial (requis)\n -servertool.banner=\n\nBienvenue dans l'outil Java IDL Server Tool \nSp\u00e9cifiez des commandes \u00e0 l'invite \n +servertool.usage=Syntaxe : {0} \n\no\u00F9 comprend :\n -ORBInitialPort Port initial (obligatoire)\n -ORBInitialHost Nom d''h\u00F4te initial (obligatoire)\n +servertool.banner=\n\nBienvenue dans l'outil Java IDL Server Tool \nSp\u00E9cifiez des commandes \u00E0 l'invite \n servertool.shorthelp=\n\n\tCommandes disponibles : \n\t------------------- \n -servertool.baddef=D\u00e9finition de serveur non valide : {0} +servertool.baddef=D\u00E9finition de serveur incorrecte : {0} servertool.nosuchserver=\tce serveur est introuvable. servertool.helddown=\tserveur interrompu. servertool.nosuchorb=\tORB non valide. -servertool.serverup=\tle serveur fonctionne d\u00e9j\u00e0. -servertool.appname=\tNom d''application - {0} -servertool.name=\tnom - {0} +servertool.serverup=\tle serveur fonctionne d\u00E9j\u00E0. +servertool.appname=\tapplicationName - {0} +servertool.name=\tname - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targs - {0} servertool.vmargs=\tvmargs - {0} -servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\tLe serveur ne fonctionne pas. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.serverid=\tID de serveur - {0} +servertool.servernotrunning=\tle serveur ne fonctionne pas. +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n servertool.register1=inscrire un serveur activable servertool.register2=\tserveur inscrit (ID serveur = {0}). servertool.register3=\tserveur inscrit mais interrompu (ID serveur = {0}). -servertool.register4=\tserveur d\u00e9j\u00e0 inscrit (ID serveur = {0}). +servertool.register4=\tserveur d\u00E9j\u00E0 inscrit (ID serveur = {0}). servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=d\u00e9sinscrire un serveur inscrit -servertool.unregister2=\tserveur d\u00e9sinscrit. +servertool.unregister1=d\u00E9sinscrire un serveur inscrit +servertool.unregister2=\tserveur d\u00E9sinscrit. -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=rep\u00e9rer des ports de type sp\u00e9cifique d'un serveur inscrit -servertool.locate2=\n\n\tNom d''h\u00f4te {0} \n\n\t\tPort\t\tType de port\t\tID ORB\n\t\t----\t\t---------\t\t------\n +servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n +servertool.locate1=rep\u00E9rer des ports de type sp\u00E9cifique d'un serveur inscrit +servertool.locate2=\n\n\tNom d''h\u00F4te {0} \n\n\t\tPort\t\tType de port\t\tID ORB\n\t\t----\t\t---------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=rep\u00e9rer les ports d'un ORB sp\u00e9cifique de serveurs inscrits -servertool.locateorb2=\n\n\tNom d''h\u00f4te {0} \n\n\t\tPort\t\tType de port\t\tID ORB\n\t\t----\t\t--------\t\t------\n +servertool.locateorb1=rep\u00E9rer les ports d'un ORB sp\u00E9cifique de serveur inscrit +servertool.locateorb2=\n\n\tNom d''h\u00F4te {0} \n\n\t\tPort\t\tType de port\t\tID ORB\n\t\t----\t\t--------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=renvoyer l'ID serveur pour un applicationName -servertool.getserverid2=\tL''ID serveur de applicationName {0} est {1} +servertool.getserverid1=renvoyer l'ID serveur pour un nom d'application +servertool.getserverid2=\tL''ID serveur du nom d''application {0} est {1} -servertool.list=\n\tlist +servertool.list=\n\tlist\n servertool.list1=lister tous les serveurs inscrits servertool.list2=\n\tID serveur\tNom de classe serveur\t\tApplication serveur\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive servertool.listactive1=lister les serveurs actifs servertool.listappnames=\tlistappnames\n -servertool.listappnames1=lister les noms d'application d\u00e9finis -servertool.listappnames2=noms d'application du serveur d\u00e9finis : +servertool.listappnames1=lister les noms d'application d\u00E9finis +servertool.listappnames2=Noms d'application du serveur d\u00E9finis : servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=arr\u00eater un serveur inscrit -servertool.shutdown2=\tserveur arr\u00eat\u00e9. +servertool.shutdown1=arr\u00EAter un serveur inscrit +servertool.shutdown2=\tserveur arr\u00EAt\u00E9. servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=d\u00e9marrer un serveur inscrit -servertool.startserver2=\tserveur d\u00e9marr\u00e9. +servertool.startserver1=d\u00E9marrer un serveur inscrit +servertool.startserver2=\tserveur d\u00E9marr\u00E9. servertool.quit=\n\tquit\n servertool.quit1=fermer cet outil @@ -83,25 +83,25 @@ servertool.help=\thelp\n\tOR\n\thelp \n servertool.help1=afficher l'aide servertool.orbidmap=\tSyntaxe : orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=liste des noms orb et de leur mappage +servertool.orbidmap1=liste des noms ORB et de leur mappage servertool.orbidmap2=\n\tID ORB\t\tNom ORB\n\t------\t\t--------\n -pnameserv.success=NameServer persistant d\u00e9marr\u00e9 +pnameserv.success=NameServer persistant d\u00E9marr\u00E9 -bootstrap.usage=Syntaxe : {0} \n\no\u00f9 comprend :\n -ORBInitialPort Port initial (requis)\n -InitialServicesFile Fichier contenant la liste des services initiaux (requis)\n +bootstrap.usage=Syntaxe : {0} \n\no\u00F9 comprend :\n -ORBInitialPort Port initial (obligatoire)\n -InitialServicesFile Fichier contenant la liste des services initiaux (obligatoire)\n bootstrap.success=configuration du port sur {0} et lecture des services de {1} bootstrap.filenotreadable=le fichier {0} n''est pas lisible bootstrap.filenotfound=fichier {0} introuvable -bootstrap.exception=erreur d\u00e9tect\u00e9e pendant l''enregistrement des propri\u00e9t\u00e9s dans le fichier {0} : Erreur {1} +bootstrap.exception=exception d\u00E9tect\u00E9e lors de l''enregistrement des propri\u00E9t\u00E9s dans le fichier {0}. Exception : {1} -tnameserv.exception=Erreur d\u00e9tect\u00e9e pendant le d\u00e9marrage du service d''amor\u00e7age sur le port {0} -tnameserv.usage=essayez un autre port avec les arguments de ligne de commande -ORBInitialPort +tnameserv.exception=exception d\u00E9tect\u00E9e lors du d\u00E9marrage du service bootstrap sur le port {0} +tnameserv.usage=essayez un autre port avec les arguments de ligne de commande -ORBInitialPort tnameserv.invalidhostoption=ORBInitialHost n'est pas une option valide pour NameService tnameserv.orbinitialport0=ORBInitialPort 0 n'est pas une option valide pour NameService -tnameserv.hs1=Contexte d''appellation initial :\n{0} -tnameserv.hs2=TransientNameServer : configuration du port pour des r\u00e9f\u00e9rences d''objet initial \u00e0 : {0} -tnameserv.hs3=Pr\u00eat. +tnameserv.hs1=Contexte de d\u00E9nomination initial :\n{0} +tnameserv.hs2=TransientNameServer : configuration du port pour des r\u00E9f\u00E9rences d''objet initial sur {0} +tnameserv.hs3=Pr\u00EAt. -orbd.commfailure=\nLe d\u00e9marrage de ORBD a \u00e9chou\u00e9 car ORBinitialPort est d\u00e9j\u00e0 utilis\u00e9 -orbd.internalexception=\nLe d\u00e9marrage de ORBD a \u00e9chou\u00e9 \u00e0 cause d'une exception interne. \nCauses possibles\u00a0: \n1. Le ORBInitialPort ou le ORBActivationPort sp\u00e9cifi\u00e9 est d\u00e9j\u00e0 utilis\u00e9 \n2. Pas d'autorisation en \u00e9criture permettant d'\u00e9crire orb.db +orbd.commfailure=\nLe d\u00E9marrage d'ORBD a \u00E9chou\u00E9 car ORBinitialPort est d\u00E9j\u00E0 utilis\u00E9 +orbd.internalexception=\nLe d\u00E9marrage d'ORBD a \u00E9chou\u00E9 en raison d'une exception interne. \nCauses possibles\u00A0: \n1. L'\u00E9l\u00E9ment ORBInitialPort ou ORBActivationPort sp\u00E9cifi\u00E9 est d\u00E9j\u00E0 utilis\u00E9 \n2. Aucune autorisation en \u00E9criture permettant d'\u00E9crire orb.db diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties index 699ca04ae01..1ef1814688f 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_it.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,28 +23,28 @@ # questions. # -orbd.usage=Utilizzo: {0} \n\ndove comprende:\n -port Porta di attivazione da cui avviare ORBD, default 1049 (opzionale)\n -defaultdb Directory per i file ORBD, default "./orb.db" (opzionale)\n -serverid Id server per ORBD, default 1 (opzionale)\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost Nome host iniziale (richiesto)\n +orbd.usage=Utilizzo: {0} \n\ndove include:\n -port Porta di attivazione da cui avviare ORBD, valore predefinito 1049 (opzionale)\n -defaultdb Directory per i file ORBD, valore predefinito "./orb.db" (opzionale)\n -serverid ID server per ORBD, valore predefinito 1 (opzionale)\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n -servertool.usage=Utilizzo: {0} \n\ndove comprende:\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost Nome host iniziale (richiesto)\n -servertool.banner=\n\nBenvenuti a Java IDL Server Tool \nimmettere i comandi quando richiesto \n +servertool.usage=Utilizzo: {0} \n\ndove include:\n -ORBInitialPort Porta iniziale (richiesta)\n -ORBInitialHost HostName iniziale (richiesto)\n +servertool.banner=\n\nBenvenuti in Java IDL Server Tool \nimmettere i comandi quando richiesto \n servertool.shorthelp=\n\n\tComandi disponibili:\n\t-------------------- \n servertool.baddef=Definizione server errata: {0} servertool.nosuchserver=\timpossibile trovare il server indicato. -servertool.helddown=\til server \u00e8 mantenuto inattivo. +servertool.helddown=\til server \u00E8 mantenuto inattivo. servertool.nosuchorb=\tORB non valido. -servertool.serverup=\til server \u00e8 gi\u00e0 attivo. -servertool.appname=\tNomeApplicazione - {0} +servertool.serverup=\til server \u00E8 gi\u00E0 attivo. +servertool.appname=\tapplicationName - {0} servertool.name=\tnome - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targom - {0} servertool.vmargs=\targomvm - {0} -servertool.serverid=\tid server - {0} -servertool.servernotrunning=\til server non \u00e8 in funzione. +servertool.serverid=\tID server - {0} +servertool.servernotrunning=\til server non \u00E8 in funzione. servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n servertool.register1=registra un server attivabile servertool.register2=\tserver registrato (idserver = {0}). servertool.register3=\tserver registrato ma mantenuto inattivo (idserver = {0}). -servertool.register4=\tserver gi\u00e0 registrato (idserver = {0}). +servertool.register4=\tserver gi\u00E0 registrato (idserver = {0}). servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n servertool.unregister1=rimuovi un server registrato. @@ -55,19 +55,19 @@ servertool.locate1=individua le porte di un tipo specifico per un server registr servertool.locate2=\n\n\tNome host {0} \n\n\t\tPorta\t\tTipo porta\t\tId ORB\n\t\t-----\t\t----------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n servertool.locateorb1=individua le porte per un orb specifico di un server registrato -servertool.locateorb2=\n\n\tNome host {0} \n\n\t\tPorta\t\tTipoPorta\t\tId ORB\n\t\t-----\t\t---------\t\t------\n +servertool.locateorb2=\n\n\tNome host {0} \n\n\t\tPorta\t\tPortType\t\tId ORB\n\t\t-----\t\t---------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n servertool.getserverid1=restituisce l'id server per un applicationName -servertool.getserverid2=\tL''ID server per applicationName {0} \u00e8 {1} +servertool.getserverid2=\tL''ID server per applicationName {0} \u00E8 {1} -servertool.list=\n\tlist\n +servertool.list=\n\tlista\n servertool.list1=elenca tutti i server registrati servertool.list2=\n\tID server\tNome classe server\t\tApplicazione server\n\t---------\t------------------\t\t-------------------\n servertool.listactive=\n\tlistactive -servertool.listactive1=elenca i server attualmente attivi +servertool.listactive1=elenca i server attivi al momento servertool.listappnames=\tlistappnames\n -servertool.listappnames1=elenca gli applicationName attualmente definiti -servertool.listappnames2=applicationName del server attualmente definiti: +servertool.listappnames1=elenca applicationNames definiti al momento +servertool.listappnames2=applicationNames del server definiti al momento: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n servertool.shutdown1=arresta un server registrato @@ -76,32 +76,32 @@ servertool.startserver=\n\tstartup [ -serverid | -applicationName \n -servertool.help1=get help +servertool.help1=Guida servertool.orbidmap=\tUtilizzo: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=elenco dei nomi orb e relativa mappatura +servertool.orbidmap1=lista nomi orb e relativa mappatura servertool.orbidmap2=\n\tId ORB\t\tNome ORB\n\t------\t\t--------\n pnameserv.success=NameServer persistente avviato correttamente -bootstrap.usage=Utilizzo: {0} \n\ndove comprende:\n -ORBInitialPort Porta iniziale (richiesta)\n -InitialServicesFile File contenente l''elenco dei servizi iniziali (richiesto)\n +bootstrap.usage=Utilizzo: {0} \n\ndove include:\n -ORBInitialPort Porta iniziale (richiesta)\n -InitialServicesFile File contenente la lista dei servizi iniziali (richiesto)\n bootstrap.success=impostazione porta su {0} e lettura servizi da {1} in corso -bootstrap.filenotreadable=il file {0} non \u00e8 leggibile +bootstrap.filenotreadable=il file {0} non \u00E8 leggibile bootstrap.filenotfound=impossibile trovare il file {0} -bootstrap.exception=rilevata un''eccezione durante il salvataggio delle propriet\u00e0 nel file {0}: eccezione {1} +bootstrap.exception=rilevata un''eccezione durante il salvataggio delle propriet\u00E0 nel file {0}: eccezione {1} tnameserv.exception=rilevata un''eccezione durante l''avvio del servizio di bootstrap sulla porta {0} tnameserv.usage=utilizzare un'altra porta con gli argomenti di riga di comando -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost non \u00e8 un'opzione valida per NameService -tnameserv.orbinitialport0=ORBInitialPort 0 non \u00e8 un'opzione valida per NameService +tnameserv.invalidhostoption=ORBInitialHost non \u00E8 un'opzione valida per NameService +tnameserv.orbinitialport0=ORBInitialPort 0 non \u00E8 un'opzione valida per NameService tnameserv.hs1=Contesto di denominazione iniziale:\n{0} tnameserv.hs2=TransientNameServer: impostazione della porta per i riferimenti degli oggetti iniziali a: {0} tnameserv.hs3=Pronto. -orbd.commfailure=\nImpossibile avviare ORBD perch\u00e9 ORBinitialPort \u00e8 gi\u00e0 in uso -orbd.internalexception=\nImpossibile avviare ORBD a causa di un'eccezione interna. \neCause possibili: \n1. ORBInitialPort o ORBActivationPort specificato gi\u00e0 in uso \n2. Mancanza dei permessi di scrittura per orb.db +orbd.commfailure=\nImpossibile avviare ORBD perch\u00E9 ORBinitialPort \u00E8 gi\u00E0 in uso +orbd.internalexception=\nImpossibile avviare ORBD a causa di un'eccezione interna. \neCause possibili: \n1. ORBInitialPort o ORBActivationPort specificato gi\u00E0 in uso \n2. Non esistono autorizzazioni per scrivere orb.db diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties index 77d0309b526..c236f07507b 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=\u4f7f\u3044\u65b9: {0} \n\n \u306b\u306f\u6b21\u306e\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\n -port ORBD \u306e\u8d77\u52d5\u30dd\u30fc\u30c8\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f 1049 (\u30aa\u30d7\u30b7\u30e7\u30f3)\n -defaultdb ORBD \u30d5\u30a1\u30a4\u30eb\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f "./orb.db" (\u30aa\u30d7\u30b7\u30e7\u30f3)\n -serverid ORBD \u306e\u30b5\u30fc\u30d0 Id\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306f 1 (\u30aa\u30d7\u30b7\u30e7\u30f3)\n -ORBInitialPort \u521d\u671f\u30dd\u30fc\u30c8 (\u5fc5\u9808)\n -ORBInitialHost \u521d\u671f\u30db\u30b9\u30c8\u540d (\u5fc5\u9808)\n +orbd.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\n\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -port ORBD\u306E\u8D77\u52D5\u30DD\u30FC\u30C8\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F1049(\u30AA\u30D7\u30B7\u30E7\u30F3)\n -defaultdb ORBD\u30D5\u30A1\u30A4\u30EB\u306E\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F"./orb.db"(\u30AA\u30D7\u30B7\u30E7\u30F3)\n -serverid ORBD\u306E\u30B5\u30FC\u30D0\u30FCId\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F1(\u30AA\u30D7\u30B7\u30E7\u30F3)\n -ORBInitialPort \u521D\u671F\u30DD\u30FC\u30C8(\u5FC5\u9808)\n -ORBInitialHost \u521D\u671F\u30DB\u30B9\u30C8\u540D(\u5FC5\u9808)\n -servertool.usage=\u4f7f\u3044\u65b9: {0} \n\n \u306b\u306f\u6b21\u306e\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\n -ORBInitialPort \u521d\u671f\u30dd\u30fc\u30c8 (\u5fc5\u9808)\n -ORBInitialHost \u521d\u671f\u30db\u30b9\u30c8\u540d (\u5fc5\u9808)\n -servertool.banner=\n\nJava IDL Server Tool \u3078\u3088\u3046\u3053\u305d\n\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u30b3\u30de\u30f3\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044 \n -servertool.shorthelp=\n\n\t\u4f7f\u7528\u53ef\u80fd\u306a\u30b3\u30de\u30f3\u30c9: \n\t------------------- \n -servertool.baddef=\u4e0d\u6b63\u306a\u30b5\u30fc\u30d0\u5b9a\u7fa9: {0} -servertool.nosuchserver=\t\u6307\u5b9a\u3055\u308c\u305f\u30b5\u30fc\u30d0\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 -servertool.helddown=\t\u30b5\u30fc\u30d0\u306f\u505c\u6b62\u3057\u3066\u3044\u307e\u3059\u3002 -servertool.nosuchorb=\tORB \u304c\u7121\u52b9\u3067\u3059\u3002 -servertool.serverup=\t\u30b5\u30fc\u30d0\u306f\u8d77\u52d5\u3057\u3066\u3044\u307e\u3059\u3002 -servertool.appname=\tapplicationName - {0} -servertool.name=\tname - {0} +servertool.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\n\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -ORBInitialPort \u521D\u671F\u30DD\u30FC\u30C8(\u5FC5\u9808)\n -ORBInitialHost \u521D\u671F\u30DB\u30B9\u30C8\u540D(\u5FC5\u9808)\n +servertool.banner=\n\nJava IDL Server Tool\u3078\u3088\u3046\u3053\u305D\n\u30D7\u30ED\u30F3\u30D7\u30C8\u306B\u30B3\u30DE\u30F3\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044\n +servertool.shorthelp=\n\n\t\u4F7F\u7528\u53EF\u80FD\u306A\u30B3\u30DE\u30F3\u30C9: \n\t------------------- \n +servertool.baddef=\u4E0D\u6B63\u306A\u30B5\u30FC\u30D0\u30FC\u5B9A\u7FA9: {0} +servertool.nosuchserver=\t\u6307\u5B9A\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 +servertool.helddown=\t\u30B5\u30FC\u30D0\u30FC\u306F\u505C\u6B62\u3057\u3066\u3044\u307E\u3059\u3002 +servertool.nosuchorb=\tORB\u304C\u7121\u52B9\u3067\u3059\u3002 +servertool.serverup=\t\u30B5\u30FC\u30D0\u30FC\u306F\u8D77\u52D5\u3057\u3066\u3044\u307E\u3059\u3002 +servertool.appname=\tapplicationName - {0} +servertool.name=\tname - {0} servertool.classpath=\tclasspath - {0} -servertool.args=\targs - {0} -servertool.vmargs=\tvmargs - {0} +servertool.args=\targs - {0} +servertool.vmargs=\tvmargs - {0} servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\t\u30b5\u30fc\u30d0\u306f\u7a3c\u52d5\u3057\u3066\u3044\u307e\u305b\u3093\u3002 -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=\u8d77\u52d5\u53ef\u80fd\u306a\u30b5\u30fc\u30d0\u3092\u767b\u9332\u3057\u307e\u3059\u3002 -servertool.register2=\t\u767b\u9332\u3055\u308c\u305f\u30b5\u30fc\u30d0 (serverid = {0})\u3002 -servertool.register3=\t\u767b\u9332\u3055\u308c\u3066\u3044\u308b\u304c\u8d77\u52d5\u3057\u3066\u3044\u306a\u3044\u30b5\u30fc\u30d0 (serverid = {0})\u3002 -servertool.register4=\t\u767b\u9332\u6e08\u307f\u306e\u30b5\u30fc\u30d0 (serverid = {0})\u3002 +servertool.servernotrunning=\t\u30B5\u30FC\u30D0\u30FC\u306F\u7A3C\u50CD\u3057\u3066\u3044\u307E\u305B\u3093\u3002 +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.register1=\u8D77\u52D5\u53EF\u80FD\u306A\u30B5\u30FC\u30D0\u30FC\u3092\u767B\u9332\u3057\u307E\u3059 +servertool.register2=\t\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC(serverid={0})\u3002 +servertool.register3=\t\u767B\u9332\u3055\u308C\u3066\u3044\u308B\u304C\u8D77\u52D5\u3057\u3066\u3044\u306A\u3044\u30B5\u30FC\u30D0\u30FC(serverid={0})\u3002 +servertool.register4=\t\u767B\u9332\u6E08\u306E\u30B5\u30FC\u30D0\u30FC(serverid={0})\u3002 -servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=\u767b\u9332\u3055\u308c\u305f\u30b5\u30fc\u30d0\u306e\u767b\u9332\u3092\u89e3\u9664\u3057\u307e\u3059\u3002 -servertool.unregister2=\t\u30b5\u30fc\u30d0\u306e\u767b\u9332\u304c\u89e3\u9664\u3055\u308c\u307e\u3057\u305f\u3002 +servertool.unregister=\n\tunregister [ -serverid | -applicationName ]\n +servertool.unregister1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u306E\u767B\u9332\u3092\u89E3\u9664\u3057\u307E\u3059 +servertool.unregister2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u767B\u9332\u304C\u89E3\u9664\u3055\u308C\u307E\u3057\u305F\u3002 -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=\u767b\u9332\u3055\u308c\u305f\u30b5\u30fc\u30d0\u306e\u7279\u5b9a\u30bf\u30a4\u30d7\u306e\u30dd\u30fc\u30c8\u3092\u691c\u51fa\u3057\u307e\u3059\u3002 -servertool.locate2=\n\n\t\u30db\u30b9\u30c8\u540d {0} \n\n\t\t\u30dd\u30fc\u30c8\t\t\u30dd\u30fc\u30c8\u30bf\u30a4\u30d7\t\tORB ID\n\t\t------\t\t------------\t\t------\n +servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ]\n +servertool.locate1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u306E\u7279\u5B9A\u30BF\u30A4\u30D7\u306E\u30DD\u30FC\u30C8\u3092\u691C\u51FA\u3057\u307E\u3059 +servertool.locate2=\n\n\t\u30DB\u30B9\u30C8\u540D{0}\n\n\t\t\u30DD\u30FC\u30C8\t\t\u30DD\u30FC\u30C8\u30FB\u30BF\u30A4\u30D7\t\tORB ID\n\t\t------\t\t------------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\u767b\u9332\u3055\u308c\u305f\u30b5\u30fc\u30d0\u306e\u7279\u5b9a ORB \u306e\u30dd\u30fc\u30c8\u3092\u691c\u51fa\u3057\u307e\u3059\u3002 -servertool.locateorb2=\n\n\t\u30db\u30b9\u30c8\u540d {0} \n\n\t\t\u30dd\u30fc\u30c8\t\t\u30dd\u30fc\u30c8\u30bf\u30a4\u30d7\t\tORB ID\n\t\t------\t\t------------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=applicationName \u306e\u30b5\u30fc\u30d0 ID \u3092\u8fd4\u3057\u307e\u3059\u3002 -servertool.getserverid2=\tapplicationName {0} \u306e\u30b5\u30fc\u30d0 ID \u306f {1} \u3067\u3059\u3002 +servertool.locateorb1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u306E\u7279\u5B9AORB\u306E\u30DD\u30FC\u30C8\u3092\u691C\u51FA\u3057\u307E\u3059 +servertool.locateorb2=\n\n\t\u30DB\u30B9\u30C8\u540D{0}\n\n\t\t\u30DD\u30FC\u30C8\t\t\u30DD\u30FC\u30C8\u30FB\u30BF\u30A4\u30D7\t\tORB ID\n\t\t------\t\t------------\t\t------\n +servertool.getserverid=\n\tgetserverid [ -applicationName ]\n +servertool.getserverid1=applicationName\u306E\u30B5\u30FC\u30D0\u30FCID\u3092\u8FD4\u3057\u307E\u3059 +servertool.getserverid2=\tapplicationName {0}\u306E\u30B5\u30FC\u30D0\u30FCID\u306F{1}\u3067\u3059 -servertool.list=\n\t\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002\n -servertool.list1=\u767b\u9332\u3055\u308c\u305f\u3059\u3079\u3066\u306e\u30b5\u30fc\u30d0\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002 -servertool.list2=\n\t\u30b5\u30fc\u30d0 Id\t\u30b5\u30fc\u30d0\u306e\u30af\u30e9\u30b9\u540d\t\t\u30b5\u30fc\u30d0\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\n\t---------\t----------------\t\t----------------------\n -servertool.listactive=\n\t\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b5\u30fc\u30d0\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002 -servertool.listactive1=\u73fe\u5728\u30a2\u30af\u30c6\u30a3\u30d6\u306a\u30b5\u30fc\u30d0\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002 -servertool.listappnames=\tapplicationNames \u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002\n -servertool.listappnames1=\u73fe\u5728\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b applicationNames \u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002 -servertool.listappnames2=\u73fe\u5728\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u308b\u30b5\u30fc\u30d0 applicationNames: +servertool.list=\n\t\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n +servertool.list1=\u767B\u9332\u3055\u308C\u305F\u3059\u3079\u3066\u306E\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 +servertool.list2=\n\t\u30B5\u30FC\u30D0\u30FCID\t\u30B5\u30FC\u30D0\u30FC\u306E\u30AF\u30E9\u30B9\u540D\t\t\u30B5\u30FC\u30D0\u30FC\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\n\t---------\t----------------\t\t----------------------\n +servertool.listactive=\n\t\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 +servertool.listactive1=\u73FE\u5728\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u30B5\u30FC\u30D0\u30FC\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 +servertool.listappnames=\tapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059\n +servertool.listappnames1=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308BapplicationNames\u306E\u30EA\u30B9\u30C8\u3092\u8868\u793A\u3057\u307E\u3059 +servertool.listappnames2=\u73FE\u5728\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u308B\u30B5\u30FC\u30D0\u30FCapplicationNames: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\u767b\u9332\u3055\u308c\u305f\u30b5\u30fc\u30d0\u3092\u505c\u6b62\u3057\u307e\u3059\u3002 -servertool.shutdown2=\t\u30b5\u30fc\u30d0\u306e\u505c\u6b62\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +servertool.shutdown1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u3092\u505C\u6B62\u3057\u307E\u3059 +servertool.shutdown2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u505C\u6B62\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002 servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\u767b\u9332\u3055\u308c\u305f\u30b5\u30fc\u30d0\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002 -servertool.startserver2=\t\u30b5\u30fc\u30d0\u306e\u8d77\u52d5\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +servertool.startserver1=\u767B\u9332\u3055\u308C\u305F\u30B5\u30FC\u30D0\u30FC\u3092\u8D77\u52D5\u3057\u307E\u3059 +servertool.startserver2=\t\u30B5\u30FC\u30D0\u30FC\u306E\u8D77\u52D5\u306B\u6210\u529F\u3057\u307E\u3057\u305F\u3002 -servertool.quit=\n\tquit\n -servertool.quit1=\u3053\u306e\u30c4\u30fc\u30eb\u3092\u7d42\u4e86\u3057\u307e\u3059\u3002 +servertool.quit=\n\t\u7D42\u4E86\u3057\u307E\u3059\n +servertool.quit1=\u3053\u306E\u30C4\u30FC\u30EB\u3092\u7D42\u4E86\u3057\u307E\u3059 -servertool.help=\thelp\n\t\u307e\u305f\u306f\n\thelp \n -servertool.help1=\u30d8\u30eb\u30d7\u3092\u8868\u793a\u3057\u307e\u3059\u3002 +servertool.help=\thelp\n\t\u307E\u305F\u306F\n\thelp \n +servertool.help1=\u30D8\u30EB\u30D7\u3092\u8868\u793A\u3057\u307E\u3059 -servertool.orbidmap=\t\u4f7f\u3044\u65b9: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=ORB \u540d\u304a\u3088\u3073\u305d\u306e\u30de\u30c3\u30d4\u30f3\u30b0\u306e\u30ea\u30b9\u30c8 -servertool.orbidmap2=\n\tORB Id\t\tORB \u540d\n\t------\t\t--------\n -pnameserv.success=\u6301\u7d9a NameServer \u306e\u8d77\u52d5\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002 +servertool.orbidmap=\t\u4F7F\u7528\u65B9\u6CD5: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap1=ORB\u540D\u304A\u3088\u3073\u305D\u306E\u30DE\u30C3\u30D4\u30F3\u30B0\u306E\u30EA\u30B9\u30C8 +servertool.orbidmap2=\n\tORB ID\t\tORB\u540D\n\t------\t\t--------\n +pnameserv.success=\u6301\u7D9ANameServer\u306E\u8D77\u52D5\u306B\u6210\u529F\u3057\u307E\u3057\u305F -bootstrap.usage=\u4f7f\u3044\u65b9: {0} \n\n \u306b\u306f\u6b21\u306e\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002\n -ORBInitialPort \u521d\u671f\u30dd\u30fc\u30c8 (\u5fc5\u9808)\n -InitialServicesFile \u521d\u671f\u30b5\u30fc\u30d3\u30b9\u30ea\u30b9\u30c8\u3092\u542b\u3080\u30d5\u30a1\u30a4\u30eb (\u5fc5\u9808)\n -bootstrap.success=\u30dd\u30fc\u30c8\u3092 {0} \u306b\u8a2d\u5b9a\u3057\u3001{1} \u304b\u3089\u30b5\u30fc\u30d3\u30b9\u3092\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002 -bootstrap.filenotreadable=\u30d5\u30a1\u30a4\u30eb {0} \u3092\u8aad\u307f\u8fbc\u3081\u307e\u305b\u3093\u3002 -bootstrap.filenotfound=\u30d5\u30a1\u30a4\u30eb {0} \u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 -bootstrap.exception=\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u30d5\u30a1\u30a4\u30eb {0} \u306b\u4fdd\u5b58\u4e2d\u306b\u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\u3057\u307e\u3057\u305f: \u4f8b\u5916 {1} +bootstrap.usage=\u4F7F\u7528\u65B9\u6CD5: {0} \n\n\u306B\u306F\u6B21\u306E\u3082\u306E\u304C\u3042\u308A\u307E\u3059\u3002\n -ORBInitialPort \u521D\u671F\u30DD\u30FC\u30C8(\u5FC5\u9808)\n -InitialServicesFile \u521D\u671F\u30B5\u30FC\u30D3\u30B9\u30FB\u30EA\u30B9\u30C8\u3092\u542B\u3080\u30D5\u30A1\u30A4\u30EB(\u5FC5\u9808)\n +bootstrap.success=\u30DD\u30FC\u30C8\u3092{0}\u306B\u8A2D\u5B9A\u3057\u3001{1}\u304B\u3089\u30B5\u30FC\u30D3\u30B9\u3092\u8AAD\u307F\u8FBC\u307F\u307E\u3059 +bootstrap.filenotreadable=\u30D5\u30A1\u30A4\u30EB{0}\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093 +bootstrap.filenotfound=\u30D5\u30A1\u30A4\u30EB{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093 +bootstrap.exception=\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u30D5\u30A1\u30A4\u30EB{0}\u306B\u4FDD\u5B58\u4E2D\u306B\u4F8B\u5916\u3092\u6355\u6349\u3057\u307E\u3057\u305F: \u4F8B\u5916{1} -tnameserv.exception=\u30dd\u30fc\u30c8 {0} \u3067\u30d6\u30fc\u30c8\u30b9\u30c8\u30e9\u30c3\u30d7\u30b5\u30fc\u30d3\u30b9\u3092\u8d77\u52d5\u4e2d\u306b\u4f8b\u5916\u3092\u30ad\u30e3\u30c3\u30c1\u3057\u307e\u3057\u305f\u3002 -tnameserv.usage=\u30b3\u30de\u30f3\u30c9\u884c\u5f15\u6570 -ORBInitialPort \u3092\u4f7f\u3063\u3066\u5225\u306e\u30dd\u30fc\u30c8\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -tnameserv.invalidhostoption=ORBInitialHost \u306f NameService \u306b\u6709\u52b9\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -tnameserv.orbinitialport0=ORBInitialPort 0 \u306f NameService \u306b\u6709\u52b9\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -tnameserv.hs1=\u521d\u671f\u30cd\u30fc\u30df\u30f3\u30b0\u30b3\u30f3\u30c6\u30ad\u30b9\u30c8:\n{0} -tnameserv.hs2=TransientNameServer: \u521d\u671f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u53c2\u7167\u306e\u30dd\u30fc\u30c8\u3092 {0} \u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002 -tnameserv.hs3=\u6e96\u5099\u304c\u5b8c\u4e86\u3057\u307e\u3057\u305f\u3002 +tnameserv.exception=\u30DD\u30FC\u30C8{0}\u3067\u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30B5\u30FC\u30D3\u30B9\u3092\u8D77\u52D5\u4E2D\u306B\u4F8B\u5916\u3092\u6355\u6349\u3057\u307E\u3057\u305F +tnameserv.usage=\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u5F15\u6570-ORBInitialPort\u3092\u4F7F\u7528\u3057\u3066\u5225\u306E\u30DD\u30FC\u30C8\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +tnameserv.invalidhostoption=ORBInitialHost\u306FNameService\u306B\u6709\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +tnameserv.orbinitialport0=ORBInitialPort 0\u306FNameService\u306B\u6709\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +tnameserv.hs1=\u521D\u671F\u30CD\u30FC\u30DF\u30F3\u30B0\u30FB\u30B3\u30F3\u30C6\u30AD\u30B9\u30C8:\n{0} +tnameserv.hs2=TransientNameServer: \u521D\u671F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u53C2\u7167\u306E\u30DD\u30FC\u30C8\u3092{0}\u306B\u8A2D\u5B9A\u3057\u307E\u3059 +tnameserv.hs3=\u6E96\u5099\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F\u3002 -orbd.commfailure=\nORBinitialPort \u304c\u4f7f\u7528\u4e2d\u3067\u3042\u308b\u305f\u3081\u3001ORBD \u306e\u8d77\u52d5\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -orbd.internalexception=\n\u5185\u90e8\u4f8b\u5916\u306e\u305f\u3081\u306b ORBD \u306e\u8d77\u52d5\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002\n\u8003\u3048\u3089\u308c\u308b\u539f\u56e0: \n1. \u6307\u5b9a\u3055\u308c\u305f ORBInitialPort \u307e\u305f\u306f ORBActivationPort \u304c\u4f7f\u7528\u4e2d\n2. orb.db \u3078\u306e\u66f8\u304d\u8fbc\u307f\u6a29\u9650\u304c\u306a\u3044 +orbd.commfailure=\nORBinitialPort\u304C\u4F7F\u7528\u4E2D\u3067\u3042\u308B\u305F\u3081\u3001ORBD\u306E\u8D77\u52D5\u306B\u5931\u6557\u3057\u307E\u3057\u305F +orbd.internalexception=\n\u5185\u90E8\u4F8B\u5916\u306E\u305F\u3081\u306BORBD\u306E\u8D77\u52D5\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002\n\u8003\u3048\u3089\u308C\u308B\u539F\u56E0: \n1. \u6307\u5B9A\u3055\u308C\u305FORBInitialPort\u307E\u305F\u306FORBActivationPort\u304C\u4F7F\u7528\u4E2D\n2. orb.db\u3078\u306E\u66F8\u8FBC\u307F\u6A29\u9650\u304C\u306A\u3044 diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties index 616b17ce256..7be6158a9f5 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_ko.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=\uc0ac\uc6a9\ubc95: {0} <\uc635\uc158> \n\n<\uc635\uc158>\uc5d0 \ub4e4\uc5b4\uac00\ub294 \ud56d\ubaa9\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.\n -port ORBD\uac00 \uc2dc\uc791\ub418\uc5b4\uc57c \ud558\ub294 \ud65c\uc131 \ud3ec\ud2b8\ub85c \uae30\ubcf8\uac12\uc740 1049\uc785\ub2c8\ub2e4(\uc120\ud0dd \uc0ac\ud56d).\n -defaultdb ORBD \ud30c\uc77c\uc758 \ub514\ub809\ud1a0\ub9ac. \uae30\ubcf8\uac12\uc740 "./orb.db"\uc785\ub2c8\ub2e4(\uc120\ud0dd \uc0ac\ud56d).\n -serverid ORBD\uc758 \uc11c\ubc84 ID. \uae30\ubcf8\uac12\uc740 1 \uc785\ub2c8\ub2e4(\uc120\ud0dd \uc0ac\ud56d).\n -ORBInitialPort \ucd08\uae30 \ud3ec\ud2b8(\ud544\uc218)\n -ORBInitialHost \ucd08\uae30 \ud638\uc2a4\ud2b8\uba85(\ud544\uc218)\n +orbd.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -port ORBD\uAC00 \uC2DC\uC791\uB418\uC5B4\uC57C \uD558\uB294 \uD65C\uC131 \uD3EC\uD2B8\uB85C, \uAE30\uBCF8\uAC12\uC740 1049\uC785\uB2C8\uB2E4(\uC120\uD0DD \uC0AC\uD56D).\n -defaultdb ORBD \uD30C\uC77C\uC758 \uB514\uB809\uD1A0\uB9AC\uB85C, \uAE30\uBCF8\uAC12\uC740 "./orb.db"\uC785\uB2C8\uB2E4(\uC120\uD0DD \uC0AC\uD56D).\n -serverid ORBD\uC758 \uC11C\uBC84 ID\uB85C, \uAE30\uBCF8\uAC12\uC740 1 \uC785\uB2C8\uB2E4(\uC120\uD0DD \uC0AC\uD56D).\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -ORBInitialHost \uCD08\uAE30 HostName\uC785\uB2C8\uB2E4(\uD544\uC218).\n -servertool.usage=\uc0ac\uc6a9\ubc95: {0} <\uc635\uc158> \n\n<\uc635\uc158>\uc5d0 \ub4e4\uc5b4\uac00\ub294 \ud56d\ubaa9\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.\n -ORBInitialPort \ucd08\uae30 \ud3ec\ud2b8(\ud544\uc218)\n -ORBInitialHost \ucd08\uae30 \ud638\uc2a4\ud2b8\uba85(\ud544\uc218)\n -servertool.banner=\n\nJava IDL \uc11c\ubc84 \ub3c4\uad6c\uc785\ub2c8\ub2e4\n\ud504\ub86c\ud504\ud2b8\uc5d0 \uba85\ub839\uc5b4\ub97c \uc785\ub825\ud558\uc2ed\uc2dc\uc624\n -servertool.shorthelp=\n\n\t\uc0ac\uc6a9 \uac00\ub2a5\ud55c \uba85\ub839\uc5b4: \n\t------------------- \n -servertool.baddef=\uc798\ubabb\ub41c \uc11c\ubc84 \uc815\uc758: {0} -servertool.nosuchserver=\t\ud574\ub2f9 \uc11c\ubc84\uac00 \uc5c6\uc2b5\ub2c8\ub2e4. -servertool.helddown=\t\uc11c\ubc84\uac00 \ub2e4\uc6b4\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -servertool.nosuchorb=\t\uc798\ubabb\ub41c ORB. -servertool.serverup=\t\uc11c\ubc84\uac00 \uc774\ubbf8 \uac00\ub3d9\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -servertool.appname=\t\uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uc774\ub984 - {0} -servertool.name=\t\uc774\ub984 - {0} +servertool.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -ORBInitialHost \uCD08\uAE30 HostName\uC785\uB2C8\uB2E4(\uD544\uC218).\n +servertool.banner=\n\nJava IDL \uC11C\uBC84 \uD234 \uC2DC\uC791 \n\uD504\uB86C\uD504\uD2B8\uC5D0 \uBA85\uB839\uC744 \uC785\uB825\uD558\uC2ED\uC2DC\uC624.\n +servertool.shorthelp=\n\n\t\uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uBA85\uB839: \n\t------------------- \n +servertool.baddef=\uC798\uBABB\uB41C \uC11C\uBC84 \uC815\uC758: {0} +servertool.nosuchserver=\t\uD574\uB2F9 \uC11C\uBC84\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +servertool.helddown=\t\uC11C\uBC84\uC758 \uC791\uB3D9\uC774 \uC911\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +servertool.nosuchorb=\tORB\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +servertool.serverup=\t\uC11C\uBC84\uAC00 \uC774\uBBF8 \uC791\uB3D9 \uC911\uC785\uB2C8\uB2E4. +servertool.appname=\tapplicationName - {0} +servertool.name=\tname - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targs - {0} servertool.vmargs=\tvmargs - {0} -servertool.serverid=\t\uc11c\ubc84 ID - {0} -servertool.servernotrunning=\t\uc11c\ubc84\uac00 \uc2e4\ud589 \uc911\uc774 \uc544\ub2d9\ub2c8\ub2e4. -servertool.register=\n\n\tregister -server <\uc11c\ubc84 \ud074\ub798\uc2a4 \uc774\ub984> \n\t -applicationName <\ub300\uccb4 \uc11c\ubc84 \uc774\ub984> \n\t -classpath <\uc11c\ubc84\uc758 classpath> \n\t -args <\uc11c\ubc84 \uc778\uc790> \n\t -vmargs <\uc11c\ubc84 Java VM \uc778\uc790>\n -servertool.register1=\ud65c\uc131 \uac00\ub2a5 \uc11c\ubc84 \ub4f1\ub85d -servertool.register2=\t\uc11c\ubc84\uac00 \ub4f1\ub85d\ub418\uc5c8\uc2b5\ub2c8\ub2e4(serverid = {0}). -servertool.register3=\t\uc11c\ubc84\uac00 \ub4f1\ub85d\ub418\uc5c8\uc9c0\ub9cc \ub2e4\uc6b4\ub418\uc5c8\uc2b5\ub2c8\ub2e4(serverid = {0}). -servertool.register4=\t\uc11c\ubc84\uac00 \uc774\ubbf8 \ub4f1\ub85d\ub418\uc5c8\uc2b5\ub2c8\ub2e4(serverid = {0}). +servertool.serverid=\tserver id - {0} +servertool.servernotrunning=\t\uC11C\uBC84\uAC00 \uC2E4\uD589 \uC911\uC774 \uC544\uB2D9\uB2C8\uB2E4. +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.register1=\uD65C\uC131 \uAC00\uB2A5 \uC11C\uBC84 \uB4F1\uB85D +servertool.register2=\t\uC11C\uBC84\uAC00 \uB4F1\uB85D\uB418\uC5C8\uC2B5\uB2C8\uB2E4(serverid = {0}). +servertool.register3=\t\uC11C\uBC84\uAC00 \uB4F1\uB85D\uB418\uC5C8\uC9C0\uB9CC \uC791\uB3D9\uC774 \uC911\uC9C0\uB418\uC5C8\uC2B5\uB2C8\uB2E4(serverid = {0}). +servertool.register4=\t\uC11C\uBC84\uAC00 \uC774\uBBF8 \uB4F1\uB85D\uB418\uC5C8\uC2B5\uB2C8\uB2E4(serverid = {0}). -servertool.unregister=\n\tunregister [ -serverid <\uc11c\ubc84 ID> | -applicationName <\uc774\ub984> ] \n -servertool.unregister1=\ub4f1\ub85d\ub41c \uc11c\ubc84\uc758 \ub4f1\ub85d\uc744 \ucde8\uc18c\ud569\ub2c8\ub2e4 -servertool.unregister2=\t\uc11c\ubc84\uac00 \ub4f1\ub85d \ucde8\uc18c\ub418\uc5c8\uc2b5\ub2c8\ub2e4. +servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n +servertool.unregister1=\uB4F1\uB85D\uB41C \uC11C\uBC84\uC758 \uB4F1\uB85D \uD574\uC81C +servertool.unregister2=\t\uC11C\uBC84\uC758 \uB4F1\uB85D\uC774 \uD574\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4. -servertool.locate=\n\tlocate [ -serverid <\uc11c\ubc84 ID> | -applicationName <\uc774\ub984> ] [ <-endpointType ] \n -servertool.locate1=\ub4f1\ub85d\ub41c \uc11c\ubc84\uc5d0 \ub300\ud55c \ud2b9\uc815 \uc885\ub958\uc758 \ud3ec\ud2b8\ub97c \ucc3e\uc2b5\ub2c8\ub2e4 -servertool.locate2=\n\n\t\ud638\uc2a4\ud2b8 \uc774\ub984 {0} \n\n\t\t\ud3ec\ud2b8\t\t\ud3ec\ud2b8 \uc885\ub958\t\tORB ID\n\t\t----\t\t---------\t\t------\n -servertool.locateorb=\n\tlocateperorb [ -serverid <\uc11c\ubc84 ID> | -applicationName <\uc774\ub984> ] [ -orbid ]\n -servertool.locateorb1=\ub4f1\ub85d\ub41c \uc11c\ubc84\uc758 \ud2b9\uc815 ORB\uc5d0 \ub300\ud55c \ud3ec\ud2b8\ub97c \ucc3e\uc2b5\ub2c8\ub2e4 -servertool.locateorb2=\n\n\t\ud638\uc2a4\ud2b8 \uc774\ub984 {0} \n\n\t\t\ud3ec\ud2b8\t\t\ud3ec\ud2b8 \uc885\ub958\t\tORB ID\n\t\t----\t\t--------\t\t------\n -servertool.getserverid=\n\tgetserverid [ -applicationName <\uc774\ub984> ] \n -servertool.getserverid1=\uc9c0\uc815\ud55c \uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uc774\ub984\uc5d0 \ub300\ud55c \uc11c\ubc84 ID\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4. -servertool.getserverid2=\t\uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uc774\ub984 {0}\uc5d0 \ub300\ud55c \uc11c\ubc84 ID\ub294 {1}\uc785\ub2c8\ub2e4. +servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n +servertool.locate1=\uB4F1\uB85D\uB41C \uC11C\uBC84\uC5D0 \uB300\uD55C \uD2B9\uC815 \uC720\uD615\uC758 \uD3EC\uD2B8 \uCC3E\uAE30 +servertool.locate2=\n\n\t\uD638\uC2A4\uD2B8 \uC774\uB984 {0} \n\n\t\t\uD3EC\uD2B8\t\t\uD3EC\uD2B8 \uC720\uD615\t\tORB ID\n\t\t----\t\t---------\t\t------\n +servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n +servertool.locateorb1=\uB4F1\uB85D\uB41C \uC11C\uBC84\uC5D0 \uB300\uD55C \uD2B9\uC815 ORB\uC758 \uD3EC\uD2B8 \uCC3E\uAE30 +servertool.locateorb2=\n\n\t\uD638\uC2A4\uD2B8 \uC774\uB984 {0} \n\n\t\t\uD3EC\uD2B8\t\tPortType\t\tORB ID\n\t\t----\t\t--------\t\t------\n +servertool.getserverid=\n\tgetserverid [ -applicationName ] \n +servertool.getserverid1=applicationName\uC5D0 \uB300\uD55C \uC11C\uBC84 ID \uBC18\uD658 +servertool.getserverid2=\tapplicationName {0}\uC5D0 \uB300\uD55C \uC11C\uBC84 ID\uB294 {1}\uC785\uB2C8\uB2E4. -servertool.list=\n\t\ubaa9\ub85d\n -servertool.list1=\ub4f1\ub85d\ub41c \uc11c\ubc84\ub97c \ubaa8\ub450 \ub098\uc5f4\ud569\ub2c8\ub2e4. -servertool.list2=\n\t\uc11c\ubc84 ID\t\uc11c\ubc84 \ud074\ub798\uc2a4 \uc774\ub984\t\t\uc11c\ubc84 \uc751\uc6a9 \ud504\ub85c\uadf8\ub7a8\n\t---------\t-----------------\t\t------------------\n +servertool.list=\n\t\uBAA9\uB85D\n +servertool.list1=\uB4F1\uB85D\uB41C \uC11C\uBC84 \uBAA8\uB450 \uB098\uC5F4 +servertool.list2=\n\t\uC11C\uBC84 ID\t\uC11C\uBC84 \uD074\uB798\uC2A4 \uC774\uB984\t\t\uC11C\uBC84 \uC751\uC6A9 \uD504\uB85C\uADF8\uB7A8\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive -servertool.listactive1=\ud604\uc7ac\uc758 \ud65c\uc131 \uc11c\ubc84\ub97c \ub098\uc5f4\ud569\ub2c8\ub2e4. +servertool.listactive1=\uD604\uC7AC \uD65C\uC131 \uC11C\uBC84 \uB098\uC5F4 servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\ud604\uc7ac \uc815\uc758\ub41c \uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uc774\ub984\uc744 \ub098\uc5f4\ud569\ub2c8\ub2e4. -servertool.listappnames2=\ud604\uc7ac \uc815\uc758\ub41c \uc11c\ubc84 \uc751\uc6a9\ud504\ub85c\uadf8\ub7a8 \uc774\ub984: +servertool.listappnames1=\uD604\uC7AC \uC815\uC758\uB41C applicationNames \uB098\uC5F4 +servertool.listappnames2=\uD604\uC7AC \uC815\uC758\uB41C \uC11C\uBC84 applicationNames: -servertool.shutdown=\n\tshutdown [ -serverid <\uc11c\ubc84 ID> | -applicationName <\uc774\ub984> ]\n -servertool.shutdown1=\ub4f1\ub85d\ub41c \uc11c\ubc84\ub97c \uc885\ub8cc\ud569\ub2c8\ub2e4. -servertool.shutdown2=\t\uc11c\ubc84\uac00 \uc131\uacf5\uc801\uc73c\ub85c \uc885\ub8cc\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -servertool.startserver=\n\tstartup [ -serverid <\uc11c\ubc84 ID> | -applicationName <\uc774\ub984> ]\n -servertool.startserver1=\ub4f1\ub85d\ub41c \uc11c\ubc84\ub97c \uc2dc\uc791\ud569\ub2c8\ub2e4. -servertool.startserver2=\t\uc11c\ubc84\uac00 \uc131\uacf5\uc801\uc73c\ub85c \uc2dc\uc791\ub418\uc5c8\uc2b5\ub2c8\ub2e4. +servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n +servertool.shutdown1=\uB4F1\uB85D\uB41C \uC11C\uBC84 \uC885\uB8CC +servertool.shutdown2=\t\uC11C\uBC84\uAC00 \uC131\uACF5\uC801\uC73C\uB85C \uC885\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n +servertool.startserver1=\uB4F1\uB85D\uB41C \uC11C\uBC84 \uC2DC\uC791 +servertool.startserver2=\t\uC11C\uBC84\uAC00 \uC131\uACF5\uC801\uC73C\uB85C \uC2DC\uC791\uB418\uC5C8\uC2B5\uB2C8\uB2E4. servertool.quit=\n\tquit\n -servertool.quit1=\uc774 \ub3c4\uad6c\ub97c \uc885\ub8cc\ud569\ub2c8\ub2e4. +servertool.quit1=\uC774 \uD234 \uC885\uB8CC -servertool.help=\thelp\n\t\ub610\ub294\n\thelp <\uba85\ub839\uc5b4 \uc774\ub984>\n -servertool.help1=\ub3c4\uc6c0\ub9d0\uc744 \ud45c\uc2dc\ud569\ub2c8\ub2e4. +servertool.help=\thelp\n\tOR\n\thelp \n +servertool.help1=\uB3C4\uC6C0\uB9D0 \uD45C\uC2DC -servertool.orbidmap=\tUsage:orblist [ -serverid <\uc11c\ubc84 ID> | -applicationName <\uc774\ub984> ]\n -servertool.orbidmap1=ORB \uc774\ub984\uacfc \ud574\ub2f9 \ub9e4\ud551\uc744 \ub098\uc5f4\ud569\ub2c8\ub2e4 -servertool.orbidmap2=\n\tORB ID\t\tORB \uc774\ub984\n\t------\t\t--------\n -pnameserv.success=\uc9c0\uc18d \uc774\ub984 \uc11c\ubc84\uac00 \uc131\uacf5\uc801\uc73c\ub85c \uc2dc\uc791\ub418\uc5c8\uc2b5\ub2c8\ub2e4 +servertool.orbidmap=\t\uC0AC\uC6A9\uBC95: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap1=ORB \uC774\uB984\uACFC \uD574\uB2F9 \uB9E4\uD551 \uB098\uC5F4 +servertool.orbidmap2=\n\tORB ID\t\tORB \uC774\uB984\n\t------\t\t--------\n +pnameserv.success=\uC9C0\uC18D NameServer\uAC00 \uC131\uACF5\uC801\uC73C\uB85C \uC2DC\uC791\uB428 -bootstrap.usage=\uc0ac\uc6a9\ubc95: {0} <\uc635\uc158> \n\n<\uc635\uc158>\uc5d0 \ub4e4\uc5b4\uac00\ub294 \ud56d\ubaa9\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.\n -ORBInitialPort \ucd08\uae30 \ud3ec\ud2b8(\ud544\uc218)\n -InitialServicesFile \ucd08\uae30 \uc11c\ube44\uc2a4 \ubaa9\ub85d\uc774 \ub4e4\uc5b4 \uc788\ub294 \ud30c\uc77c(\ud544\uc218)\n -bootstrap.success=\ud3ec\ud2b8\ub97c {0}(\uc73c)\ub85c \uc124\uc815\ud558\uace0 {1}\uc5d0\uc11c \uc11c\ube44\uc2a4\ub97c \uc77d\uc2b5\ub2c8\ub2e4 -bootstrap.filenotreadable={0} \ud30c\uc77c\uc744 \uc77d\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4 -bootstrap.filenotfound={0} \ud30c\uc77c\uc744 \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4 -bootstrap.exception={0} \ud30c\uc77c\uc5d0 \ub4f1\ub85d \uc815\ubcf4\ub97c \uc800\uc7a5\ud558\ub294 \ub3d9\uc548 \uc608\uc678\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4.\uc608\uc678 {1} +bootstrap.usage=\uC0AC\uC6A9\uBC95: {0} \n\n\uC5EC\uAE30\uC11C \uB294 \uB2E4\uC74C\uACFC \uAC19\uC2B5\uB2C8\uB2E4.\n -ORBInitialPort \uCD08\uAE30 \uD3EC\uD2B8\uC785\uB2C8\uB2E4(\uD544\uC218).\n -InitialServicesFile \uCD08\uAE30 \uC11C\uBE44\uC2A4 \uBAA9\uB85D\uC774 \uB4E4\uC5B4 \uC788\uB294 \uD30C\uC77C\uC785\uB2C8\uB2E4(\uD544\uC218).\n +bootstrap.success=\uD3EC\uD2B8\uB97C {0}(\uC73C)\uB85C \uC124\uC815\uD558\uACE0 {1}\uC5D0\uC11C \uC11C\uBE44\uC2A4\uB97C \uC77D\uB294 \uC911 +bootstrap.filenotreadable={0} \uD30C\uC77C\uC744 \uC77D\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +bootstrap.filenotfound={0} \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +bootstrap.exception={0} \uD30C\uC77C\uC5D0 \uC18D\uC131\uC744 \uC800\uC7A5\uD558\uB294 \uC911 \uC608\uC678 \uC0AC\uD56D \uBC1C\uC0DD: {1} \uC608\uC678 \uC0AC\uD56D -tnameserv.exception={0} \ud3ec\ud2b8\uc5d0\uc11c \ubd80\ud2b8\uc2a4\ud2b8\ub7a9 \uc11c\ube44\uc2a4\ub97c \uc2dc\uc791\ud558\ub294 \ub3d9\uc548 \uc624\ub958\uac00 \ubc1c\uc0dd\ud588\uc2b5\ub2c8\ub2e4 -tnameserv.usage=ORBInitialPort <\ud3ec\ud2b8 \ubc88\ud638> \uba85\ub839\uc904 \uc778\uc790\ub85c \ub2e4\ub978 \ud3ec\ud2b8 \uc0ac\uc6a9\uc744 \uc2dc\ub3c4\ud569\ub2c8\ub2e4 -tnameserv.invalidhostoption=ORBInitialHost\ub294 NameService\uc758 \uc720\ud6a8\ud55c \uc635\uc158\uc774 \uc544\ub2d9\ub2c8\ub2e4. -tnameserv.orbinitialport0=ORBInitialPort 0\uc740 NameService\uc758 \uc720\ud6a8\ud55c \uc635\uc158\uc774 \uc544\ub2d9\ub2c8\ub2e4 -tnameserv.hs1=\ucd08\uae30 \uba85\ub839 \ucee8\ud14d\uc2a4\ud2b8:\n{0} -tnameserv.hs2=TransientNameServer:\ucd08\uae30 \uac1d\uccb4 \ucc38\uc870\ub97c \uc704\ud55c \ud3ec\ud2b8 \uc124\uc815: {0} {0} -tnameserv.hs3=\uc900\ube44\ub418\uc5c8\uc2b5\ub2c8\ub2e4. +tnameserv.exception={0} \uD3EC\uD2B8\uC5D0\uC11C \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uC11C\uBE44\uC2A4\uB97C \uC2DC\uC791\uD558\uB294 \uC911 \uC608\uC678 \uC0AC\uD56D\uC774 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. +tnameserv.usage=-ORBInitialPort \uBA85\uB839\uD589 \uC778\uC218\uB85C \uB2E4\uB978 \uD3EC\uD2B8 \uC0AC\uC6A9 \uC2DC\uB3C4 +tnameserv.invalidhostoption=ORBInitialHost\uB294 NameService\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC635\uC158\uC774 \uC544\uB2D9\uB2C8\uB2E4. +tnameserv.orbinitialport0=ORBInitialPort 0\uC740 NameService\uC5D0 \uB300\uD574 \uC801\uD569\uD55C \uC635\uC158\uC774 \uC544\uB2D9\uB2C8\uB2E4. +tnameserv.hs1=\uCD08\uAE30 \uC774\uB984 \uC9C0\uC815 \uCEE8\uD14D\uC2A4\uD2B8:\n{0} +tnameserv.hs2=TransientNameServer: \uCD08\uAE30 \uAC1D\uCCB4 \uCC38\uC870\uB97C \uC704\uD55C \uD3EC\uD2B8\uB97C {0}(\uC73C)\uB85C \uC124\uC815\uD558\uB294 \uC911 +tnameserv.hs3=\uC900\uBE44\uB418\uC5C8\uC2B5\uB2C8\uB2E4. -orbd.commfailure=\nORBinitialPort\uac00 \uc774\ubbf8 \uc0ac\uc6a9 \uc911\uc774\ubbc0\ub85c ORBD\ub97c \uc2dc\uc791\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -orbd.internalexception=\n\ub0b4\ubd80 \uc624\ub958\ub85c \uc778\ud574 ORBD\ub97c \uc2dc\uc791\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\n\uac00\ub2a5\ud55c \uc774\uc720: \n1. \uc9c0\uc815\ud55c ORBInitialPort \ub610\ub294 ORBActivationPort\uac00 \uc774\ubbf8 \uc0ac\uc6a9 \uc911\uc785\ub2c8\ub2e4.\n2. orb.db\uc744 \uc791\uc131\ud560 \uc4f0\uae30 \uad8c\ud55c\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. +orbd.commfailure=\nORBinitialPort\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC774\uC5B4\uC11C ORBD \uC2DC\uC791\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +orbd.internalexception=\n\uB0B4\uBD80 \uC608\uC678 \uC0AC\uD56D\uC73C\uB85C \uC778\uD574 ORBD \uC2DC\uC791\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \n\uAC00\uB2A5\uD55C \uC6D0\uC778: \n1. \uC9C0\uC815\uB41C ORBInitialPort \uB610\uB294 ORBActivationPort\uAC00 \uC774\uBBF8 \uC0AC\uC6A9 \uC911\uC785\uB2C8\uB2E4.\n2. orb.db\uB97C \uC4F8 \uC218 \uC788\uB294 \uC4F0\uAE30 \uAD8C\uD55C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties index 7fc4dddab18..eeeb083abae 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_pt_BR.properties @@ -1,5 +1,5 @@ - -# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. +# +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=Uso: {0} \n\nem que inclui:\n -port porta de ativa\u00e7\u00e3o na qual o ORBD deve ser iniciado, padr\u00e3o 1049 (opcional)\n -defaultdb diret\u00f3rio dos arquivos ORBD, padr\u00e3o "./orb.db" (opcional)\n -serverid id do servidor para ORBD, padr\u00e3o 1 (opcional)\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -ORBInitialHost nome de host inicial (necess\u00e1rio)\n +orbd.usage=Uso: {0} \n\nem que inclui:\n -port porta de ativa\u00E7\u00E3o na qual o ORBD deve ser iniciado, default 1049 (opcional)\n -defaultdb diret\u00F3rio dos arquivos ORBD, default "./orb.db" (opcional)\n -serverid id do servidor para ORBD, default 1 (opcional)\n -ORBInitialPort porta inicial (necess\u00E1rio)\n -ORBInitialHost nome de host inicial (necess\u00E1rio)\n -servertool.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -ORBInitialHost nome de host inicial (necess\u00e1rio)\n -servertool.banner=\n\nBem-vindo a ferramenta de servidor IDL Java \ninsira os comandos no prompt \n -servertool.shorthelp=\n\n\tComandos dispon\u00edveis: \n\t------------------- \n -servertool.baddef=Servidor mal definido: {0} -servertool.nosuchserver=\tservidor n\u00e3o encontrado. -servertool.helddown=\to servidor est\u00e1 em espera. -servertool.nosuchorb=\tORB inv\u00e1lido. -servertool.serverup=\to servidor j\u00e1 est\u00e1 ativo. +servertool.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00E1rio)\n -ORBInitialHost nome de host inicial (necess\u00E1rio)\n +servertool.banner=\n\nBem-vindo \u00E0 Ferramenta de Servidor IDL Java \ninsira os comandos no prompt \n +servertool.shorthelp=\n\n\tComandos Dispon\u00EDveis: \n\t------------------- \n +servertool.baddef=Defini\u00E7\u00E3o do servidor inv\u00E1lida: {0} +servertool.nosuchserver=\tservidor n\u00E3o encontrado. +servertool.helddown=\to servidor est\u00E1 em espera. +servertool.nosuchorb=\tORB inv\u00E1lido. +servertool.serverup=\to servidor j\u00E1 est\u00E1 ativo. servertool.appname=\tapplicationName - {0} servertool.name=\tname - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targs - {0} servertool.vmargs=\tvmargs - {0} servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\to servidor n\u00e3o est\u00e1 em execu\u00e7\u00e3o. +servertool.servernotrunning=\to servidor n\u00E3o est\u00E1 em execu\u00E7\u00E3o. servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=registra um servidor ativ\u00e1vel +servertool.register1=registra um servidor ativ\u00E1vel servertool.register2=\tservidor registrado (serverid = {0}). servertool.register3=\tservidor registrado, mas em espera (serverid = {0}). -servertool.register4=\tservidor j\u00e1 registrado (serverid = {0}). +servertool.register4=\tservidor j\u00E1 registrado (serverid = {0}). servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n servertool.unregister1=cancela o registro de um servidor registrado -servertool.unregister2=\tservidor n\u00e3o registrado. +servertool.unregister2=\tservidor n\u00E3o registrado. servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=localiza portas de tipo espec\u00edfico para um servidor registrado -servertool.locate2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t---------\t\t------\n +servertool.locate1=localiza portas de tipo espec\u00EDfico para um servidor registrado +servertool.locate2=\n\n\tNome do Host {0} \n\n\t\tPorta\t\tTipo de Porta\t\tId do ORB\n\t\t----\t\t---------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=localiza portas para um orb espec\u00edfico de servidor registrado -servertool.locateorb2=\n\n\tNome do host {0} \n\n\t\tPorta\t\tTipo de porta\t\tId do ORB\n\t\t----\t\t--------\t\t------\n +servertool.locateorb1=localiza portas para um orb espec\u00EDfico de servidor registrado +servertool.locateorb2=\n\n\tNome do Host {0} \n\n\t\tPorta\t\tTipo de Porta\t\tId do ORB\n\t\t----\t\t--------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n servertool.getserverid1=retorna o id do servidor de um applicationName -servertool.getserverid2=\tID do servidor de applicationName {0} \u00e9 {1} +servertool.getserverid2=\tID do Servidor de applicationName {0} \u00E9 {1} servertool.list=\n\tlist\n servertool.list1=lista todos os servidores registrados -servertool.list2=\n\tId do servidor\tNome de classe do servidor\t\tAplicativo do servidor\n\t---------\t-----------------\t\t------------------\n +servertool.list2=\n\tId do Servidor\tNome de Classe do Servidor\t\tAplica\u00E7\u00E3o do Servidor\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive servertool.listactive1=lista os servidores atualmente ativos servertool.listappnames=\tlistappnames\n servertool.listappnames1=lista os applicationNames atualmente definidos -servertool.listappnames2=applicationNames do servidor atualmente definidos: +servertool.listappnames2=applicationNames do servidor definidos atualmente: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=desliga um servidor registrado -servertool.shutdown2=\tservidor desligado com \u00eaxito. +servertool.shutdown1=faz shutdown de um servidor registrado +servertool.shutdown2=\tshutdown do servidor bem-sucedido. servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n servertool.startserver1=inicia um servidor registrado -servertool.startserver2=\tservidor iniciado com \u00eaxito. +servertool.startserver2=\tservidor iniciado com \u00EAxito. servertool.quit=\n\tquit\n servertool.quit1=sai desta ferramenta servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=obt\u00e9m ajuda +servertool.help1=obt\u00E9m ajuda servertool.orbidmap=\tUso: orblist [ -serverid | -applicationName ]\n servertool.orbidmap1=lista de nomes de orb e seus mapeamentos servertool.orbidmap2=\n\tId de ORB\t\tNome de ORB\n\t------\t\t--------\n -pnameserv.success=NameServer persistente iniciado com \u00eaxito +pnameserv.success=NameServer Persistente Iniciado com \u00CAxito -bootstrap.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00e1rio)\n -InitialServicesFile arquivo que cont\u00e9m a lista de servi\u00e7os iniciais (necess\u00e1rio)\n -bootstrap.success=configurando porta para {0} e lendo servi\u00e7os de {1} -bootstrap.filenotreadable=o arquivo {0} n\u00e3o \u00e9 leg\u00edvel -bootstrap.filenotfound=arquivo {0} n\u00e3o encontrado -bootstrap.exception=exce\u00e7\u00e3o capturada ao salvar as propriedades no arquivo {0}: Exce\u00e7\u00e3o {1} +bootstrap.usage=Uso: {0} \n\nem que inclui:\n -ORBInitialPort porta inicial (necess\u00E1rio)\n -InitialServicesFile arquivo que cont\u00E9m a lista de servi\u00E7os iniciais (necess\u00E1rio)\n +bootstrap.success=definindo porta para {0} e lendo servi\u00E7os de {1} +bootstrap.filenotreadable=o arquivo {0} n\u00E3o \u00E9 leg\u00EDvel +bootstrap.filenotfound=arquivo {0} n\u00E3o encontrado +bootstrap.exception=exce\u00E7\u00E3o capturada ao salvar as propriedades no Arquivo {0}: exce\u00E7\u00E3o {1} -tnameserv.exception=uma exce\u00e7\u00e3o capturada ao iniciar o servi\u00e7o de inicializa\u00e7\u00e3o na porta {0} -tnameserv.usage=tente usar outra porta com os argumentos de linha de comando -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService -tnameserv.orbinitialport0=ORBInitialPort 0 n\u00e3o \u00e9 uma op\u00e7\u00e3o v\u00e1lida para NameService -tnameserv.hs1=Contexto de nomea\u00e7\u00e3o inicial:\n{0} -tnameserv.hs2=TransientNameServer: definindo porta para as refer\u00eancias de objeto iniciais: {0} +tnameserv.exception=uma exce\u00E7\u00E3o capturada ao iniciar o servi\u00E7o de inicializa\u00E7\u00E3o na porta {0} +tnameserv.usage=tente usar outra porta com os argumentos de linha de comandos -ORBInitialPort +tnameserv.invalidhostoption=ORBInitialHost n\u00E3o \u00E9 uma op\u00E7\u00E3o v\u00E1lida para NameService +tnameserv.orbinitialport0=ORBInitialPort 0 n\u00E3o \u00E9 uma op\u00E7\u00E3o v\u00E1lida para NameService +tnameserv.hs1=Contexto de Nomea\u00E7\u00E3o Inicial:\n{0} +tnameserv.hs2=TransientNameServer: definindo porta para as refer\u00EAncias de objeto iniciais: {0} tnameserv.hs3=Pronto. -orbd.commfailure=\nFalha ao iniciar ORBD porque ORBinitialPort j\u00e1 est\u00e1 em uso -orbd.internalexception=\nFalha ao iniciar ORBD devido a uma exce\u00e7\u00e3o interna. \nPoss\u00edveis causas: \n1. ORBInitialPort especificado ou ORBActivationPort j\u00e1 em uso \n2. Sem permiss\u00e3o de grava\u00e7\u00e3o para gravar orb.db +orbd.commfailure=\nFalha ao iniciar ORBD porque ORBinitialPort j\u00E1 est\u00E1 em uso +orbd.internalexception=\nFalha ao iniciar ORBD devido a uma exce\u00E7\u00E3o interna. \nPoss\u00EDveis causas: \n1. ORBInitialPort especificado ou ORBActivationPort j\u00E1 em uso \n2. Sem permiss\u00E3o de grava\u00E7\u00E3o para gravar orb.db diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties index 5dd8b44d13d..c11488e9f48 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_sv.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=G\u00f6r s\u00e5 h\u00e4r: {0} \n\nd\u00e4r omfattar:\n -port Aktiveringsport d\u00e4r ORBD ska startas, standard 1049 (valfritt)\n -defaultdb Katalog f\u00f6r ORBD-filer, standard "./orb.db" (valfritt)\n -serverid Server-ID f\u00f6r ORBD, standard 1 (valfritt)\n -ORBInitialPort Initialport (obligatoriskt)\n -ORBInitialHost Initialt v\u00e4rdnamn (obligatoriskt)\n +orbd.usage=Syntax: {0} \n\nd\u00E4r inkluderar:\n -port Aktiveringsport d\u00E4r ORBD ska startas, standard 1049 (valfritt)\n -defaultdb Katalog f\u00F6r ORBD-filer, standard "./orb.db" (valfritt)\n -serverid Server-id f\u00F6r ORBD, standard 1 (valfritt)\n -ORBInitialPort Ursprunglig port (obligatoriskt)\n -ORBInitialHost Ursprungligt v\u00E4rdnamn (obligatoriskt)\n -servertool.usage=G\u00f6r s\u00e5 h\u00e4r: {0} \n\nd\u00e4r omfattar:\n -ORBInitialPort Initialport (obligatoriskt)\n -ORBInitialHost Initialt v\u00e4rdnamn (obligatoriskt)\n -servertool.banner=\n\nV\u00e4lkommen till Java IDL Server Tool \nskriv kommandona vid prompten \n -servertool.shorthelp=\n\n\tTillg\u00e4ngliga kommandon: \n\t------------------- \n -servertool.baddef=D\u00e5lig serverdefinition: {0} -servertool.nosuchserver=\tn\u00e5gon s\u00e5dan server kan inte hittas. -servertool.helddown=\tserver h\u00e5lls nere. +servertool.usage=Syntax: {0} \n\nd\u00E4r inkluderar:\n -ORBInitialPort Ursprunglig port (obligatoriskt)\n -ORBInitialHost Ursprungligt v\u00E4rdnamn (obligatoriskt)\n +servertool.banner=\n\nV\u00E4lkommen till Java IDL Server Tool \nange kommandona vid kommandoraden \n +servertool.shorthelp=\n\n\tTillg\u00E4ngliga kommandon: \n\t------------------- \n +servertool.baddef=Felaktig serverdefinition: {0} +servertool.nosuchserver=\tn\u00E5gon s\u00E5dan server kan inte hittas. +servertool.helddown=\tservern h\u00E5lls avst\u00E4ngd. servertool.nosuchorb=\togiltig ORB. -servertool.serverup=\tserver \u00e4r redan uppe. +servertool.serverup=\tserver \u00E4r redan startad servertool.appname=\tapplicationName - {0} servertool.name=\tnamn - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targs - {0} servertool.vmargs=\tvmargs - {0} servertool.serverid=\tserver id - {0} -servertool.servernotrunning=\tserver k\u00f6rs inte. -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.servernotrunning=\tserver k\u00F6rs inte. +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n servertool.register1=registrera en aktiverbar server servertool.register2=\tserver registrerad (serverid = {0}). -servertool.register3=\tserver registrerad men h\u00e5lls nere (serverid = {0}). +servertool.register3=\tserver registrerad men h\u00E5lls avst\u00E4ngd(serverid = {0}). servertool.register4=\tserver har redan registrerats (serverid = {0}). servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n servertool.unregister1=avregistrera en registrerad server -servertool.unregister2=\tserver oregistrerad. +servertool.unregister2=\tserver avregistrerad. -servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=lokaliserar portar av en viss typ f\u00f6r en registrerad server -servertool.locate2=\n\n\tV\u00e4rdnamn {0} \n\n\t\tPort\t\tPorttyp\t\tORB-ID\n\t\t----\t\t---------\t\t------\n +servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n +servertool.locate1=hitta portar av en viss typ f\u00F6r en registrerad server +servertool.locate2=\n\n\tV\u00E4rdnamn {0} \n\n\t\tPort\t\tPorttyp\t\tORB-id\n\t\t----\t\t---------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=lokaliserar portar f\u00f6r en viss ORB f\u00f6r en registrerad server -servertool.locateorb2=\n\n\tV\u00e4rdnamn {0} \n\n\t\tPort\t\tPorttyp\t\tORB-ID\n\t\t----\t\t--------\t\t------\n +servertool.locateorb1=hitta portar f\u00F6r en viss ORB f\u00F6r en registrerad server +servertool.locateorb2=\n\n\tV\u00E4rdnamn {0} \n\n\t\tPort\t\tPorttyp\t\tORB-id\n\t\t----\t\t--------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=returnerar server-id f\u00f6r ett applicationName -servertool.getserverid2=\tServer-ID f\u00f6r applicationName {0} \u00e4r {1} +servertool.getserverid1=returnerar server-id f\u00F6r ett applicationName +servertool.getserverid2=\tServer-id f\u00F6r applicationName {0} \u00E4r {1} servertool.list=\n\tlist_\n servertool.list1=listar alla registrerade servrar -servertool.list2=\n\tServer Id\tServer Class Name\t\tServer Application\n\t---------\t-----------------\t\t------------------\n +servertool.list2=\n\tServer-id\tServerklassnamn\t\tServerapplikation\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive -servertool.listactive1=listar alla f\u00f6r tillf\u00e4llet aktiva servrar +servertool.listactive1=listar alla f\u00F6r tillf\u00E4llet aktiva servrar servertool.listappnames=\tlistappnames\n -servertool.listappnames1=listar de applicationNames som f\u00f6r tillf\u00e4llet \u00e4r definierade -servertool.listappnames2=Aktuella definierade server-applicationNames: +servertool.listappnames1=listar de applicationNames som f\u00F6r tillf\u00E4llet \u00E4r definierade +servertool.listappnames2=Definierade applikationsnamn f\u00F6r servern: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=st\u00e4nger en registrerad server -servertool.shutdown2=\tserver har st\u00e4ngts av. +servertool.shutdown1=st\u00E4nger av en registrerad server +servertool.shutdown2=\tserver har st\u00E4ngts av. servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n servertool.startserver1=startar en registrerad server servertool.startserver2=\tserver har startats. servertool.quit=\n\tquit\n -servertool.quit1=avsluta det h\u00e4r verktyget +servertool.quit1=avsluta det h\u00E4r verktyget -servertool.help=\thelp\n\tOR\n\thelp \n -servertool.help1=get help +servertool.help=\thelp\n\tELLER\n\thelp \n +servertool.help1=f\u00E5 hj\u00E4lp -servertool.orbidmap=\tG\u00f6r s\u00e5 h\u00e4r: orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=lista \u00f6ver ORB-namn och deras mappning -servertool.orbidmap2=\n\tORB-ID\t\tORB-namn\n\t------\t\t--------\n -pnameserv.success=Namnservern har startats utan problem +servertool.orbidmap=\tSyntax: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap1=lista \u00F6ver ORB-namn och deras mappning +servertool.orbidmap2=\n\tORB-id\t\tORB-namn\n\t------\t\t--------\n +pnameserv.success=Den best\u00E4ndiga namnservern har startats -bootstrap.usage=G\u00f6r s\u00e5 h\u00e4r: {0} \n\nd\u00e4r omfattar:\n -ORBInitialPort Initialport (obligatoriskt)\n -InitialServicesFile En fil som inneh\u00e5ller en lista \u00f6ver initiala tj\u00e4nster (obligatoriskt)\n -bootstrap.success=s\u00e4tter porten till {0} och l\u00e4ser tj\u00e4nster fr\u00e5n {1} -bootstrap.filenotreadable=filen {0} g\u00e5r inte att l\u00e4sa -bootstrap.filenotfound=filen {0} g\u00e5r inte att hitta -bootstrap.exception=p\u00e5tr\u00e4ffade undantag medan egenskaper sparades i filen {0}: Undantag {1} +bootstrap.usage=Syntax: {0} \n\nd\u00E4r inkluderar:\n -ORBInitialPort Ursprunglig port (obligatoriskt)\n -InitialServicesFile En fil som inneh\u00E5ller en lista \u00F6ver ursprungliga tj\u00E4nster (obligatoriskt)\n +bootstrap.success=st\u00E4ller in porten till {0} och l\u00E4ser tj\u00E4nster fr\u00E5n {1} +bootstrap.filenotreadable=filen {0} kan inte l\u00E4sas +bootstrap.filenotfound=filen {0} hittas inte +bootstrap.exception=p\u00E5tr\u00E4ffade undantag medan egenskaper sparades i filen {0}: Undantag {1} -tnameserv.exception=p\u00e5tr\u00e4ffade ett undantagsfel n\u00e4r starttj\u00e4nsten startades vid porten {0} -tnameserv.usage=f\u00f6rs\u00f6k att anv\u00e4nda en annan port med kommandoradsargument -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost \u00e4r inte ett giltigt alternativ f\u00f6r NameService -tnameserv.orbinitialport0=ORBInitialPort 0 \u00e4r inte ett giltigt alternativ f\u00f6r NameService -tnameserv.hs1=Initial namngivningskontext:\n{0} -tnameserv.hs2=TransientNameServer: anger port f\u00f6r initiala objektreferenser till: {0} -tnameserv.hs3=Klar. +tnameserv.exception=p\u00E5tr\u00E4ffade ett undantag n\u00E4r starttj\u00E4nsten startades vid porten {0} +tnameserv.usage=f\u00F6rs\u00F6k att anv\u00E4nda en annan port med kommandoradsargument -ORBInitialPort +tnameserv.invalidhostoption=ORBInitialHost \u00E4r inte ett giltigt alternativ f\u00F6r NameService +tnameserv.orbinitialport0=ORBInitialPort 0 \u00E4r inte ett giltigt alternativ f\u00F6r NameService +tnameserv.hs1=Ursprunglig namngivningskontext:\n{0} +tnameserv.hs2=TransientNameServer: st\u00E4ller in port f\u00F6r ursprungliga objektreferenser till: {0} +tnameserv.hs3=Redo. -orbd.commfailure=\nMisslyckades starta ORBD f\u00f6r att ORBinitialport anv\u00e4ndas redan -orbd.internalexception=\nMisslyckades starta ORBD p\u00e5 grund av internt undantag. \nM\u00f6jliga Orsakar: \n1. Anget ORBInitialPort or ORBAktiveringsPort anv\u00e4ndas redan \n2. No Write Tillst\u00e5nd att skriva orb.db +orbd.commfailure=\nKunde inte starta ORBD eftersom ORBinitialport redan anv\u00E4nds +orbd.internalexception=\nKunde inte starta ORBD p\u00E5 grund av internt undantag. \nM\u00F6jliga orsaker: \n1. Angivet ORBInitialPort eller ORBActivationPort anv\u00E4ndas redan \n2. Ingen beh\u00F6righet att skriva till orb.db diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties index 60c2407004e..6dce9e6e827 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=\u7528\u6cd5\uff1a{0} <\u9009\u9879> \n\n\u5176\u4e2d\uff0c<\u9009\u9879> \u5305\u62ec\uff1a\n -port \u6fc0\u6d3b\u542f\u52a8 ORBD \u7684\u7aef\u53e3\uff0c\u7f3a\u7701\u503c\u4e3a 1049 (\u53ef\u9009)\n -defaultdb ORBD \u6587\u4ef6\u7684\u76ee\u5f55\uff0c\u7f3a\u7701\u503c\u4e3a "./orb.db" (\u53ef\u9009)\n -serverid ORBD \u7684\u670d\u52a1\u5668\u6807\u8bc6\u7b26\uff0c\u7f3a\u7701\u503c\u4e3a 1 (\u53ef\u9009)\n -ORBInitialPort \u521d\u59cb\u7aef\u53e3\uff08\u5fc5\u9700\uff09\n -ORBInitialHost \u521d\u59cb\u4e3b\u673a\u540d\u79f0\uff08\u5fc5\u9700\uff09\n +orbd.usage=\u7528\u6CD5: {0} <\u9009\u9879> \n\n\u5176\u4E2D, <\u9009\u9879> \u5305\u62EC: \n -port \u6FC0\u6D3B\u542F\u52A8 ORBD \u7684\u7AEF\u53E3, \u9ED8\u8BA4\u503C\u4E3A 1049 (\u53EF\u9009)\n -defaultdb ORBD \u6587\u4EF6\u7684\u76EE\u5F55, \u9ED8\u8BA4\u503C\u4E3A "./orb.db" (\u53EF\u9009)\n -serverid ORBD \u7684\u670D\u52A1\u5668 ID, \u9ED8\u8BA4\u503C\u4E3A 1 (\u53EF\u9009)\n -ORBInitialPort \u521D\u59CB\u7AEF\u53E3 (\u5FC5\u9700)\n -ORBInitialHost \u521D\u59CB HostName (\u5FC5\u9700)\n -servertool.usage=\u7528\u6cd5\uff1a {0} <\u9009\u9879> \n\n\u5176\u4e2d\uff0c<\u9009\u9879> \u5305\u62ec\uff1a\n -ORBInitialPort \u521d\u59cb\u7aef\u53e3\uff08\u5fc5\u9700\uff09\n -ORBInitialHost \u521d\u59cb\u4e3b\u673a\u540d\u79f0\uff08\u5fc5\u9700\uff09\n -servertool.banner=\n\n\u6b22\u8fce\u4f7f\u7528 Java IDL \u670d\u52a1\u5668\u5de5\u5177 \n\u8bf7\u5728\u63d0\u793a\u5904\u8f93\u5165\u547d\u4ee4 \n -servertool.shorthelp=\n\n\t\u53ef\u7528\u547d\u4ee4\uff1a\n\t------------------- \n -servertool.baddef=\u9519\u8bef\u7684\u670d\u52a1\u5668\u5b9a\u4e49\uff1a {0} -servertool.nosuchserver=\t\u627e\u4e0d\u5230\u8fd9\u79cd\u670d\u52a1\u5668\u3002 -servertool.helddown=\t\u670d\u52a1\u5668\u5df2\u88ab\u5173\u95ed\u3002 -servertool.nosuchorb=\t\u65e0\u6548\u7684\u5bf9\u8c61\u8bf7\u6c42\u4ee3\u7406\u7a0b\u5e8f (ORB)\u3002 -servertool.serverup=\t\u670d\u52a1\u5668\u5df2\u5f00\u542f\u3002 +servertool.usage=\u7528\u6CD5: {0} <\u9009\u9879> \n\n\u5176\u4E2D, <\u9009\u9879> \u5305\u62EC: \n -ORBInitialPort \u521D\u59CB\u7AEF\u53E3 (\u5FC5\u9700)\n -ORBInitialHost \u521D\u59CB HostName (\u5FC5\u9700)\n +servertool.banner=\n\n\u6B22\u8FCE\u4F7F\u7528 Java IDL \u670D\u52A1\u5668\u5DE5\u5177 \n\u8BF7\u5728\u63D0\u793A\u5904\u8F93\u5165\u547D\u4EE4 \n +servertool.shorthelp=\n\n\t\u53EF\u7528\u547D\u4EE4: \n\t------------------- \n +servertool.baddef=\u9519\u8BEF\u7684\u670D\u52A1\u5668\u5B9A\u4E49: {0} +servertool.nosuchserver=\t\u627E\u4E0D\u5230\u8FD9\u79CD\u670D\u52A1\u5668\u3002 +servertool.helddown=\t\u670D\u52A1\u5668\u5DF2\u88AB\u5173\u95ED\u3002 +servertool.nosuchorb=\t\u65E0\u6548\u7684\u5BF9\u8C61\u8BF7\u6C42\u4EE3\u7406\u7A0B\u5E8F (ORB)\u3002 +servertool.serverup=\t\u670D\u52A1\u5668\u5DF2\u5728\u8FD0\u884C\u3002 servertool.appname=\tapplicationName - {0} servertool.name=\tname - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targs - {0} servertool.vmargs=\tvmargs - {0} -servertool.serverid=\t\u670d\u52a1\u5668\u6807\u8bc6\u7b26 - {0} -servertool.servernotrunning=\t\u670d\u52a1\u5668\u6ca1\u6709\u8fd0\u884c\u3002 -servertool.register=\n\n\tregister -server<\u670d\u52a1\u5668\u7c7b\u540d\u79f0> \n\t -applicationName <\u5907\u7528\u670d\u52a1\u5668\u540d\u79f0> \n\t -classpath <\u5230\u670d\u52a1\u5668\u7684\u7c7b\u8def\u5f84> \n\t -args <\u670d\u52a1\u5668\u7684\u53c2\u6570> \n\t -vmargs <\u670d\u52a1\u5668 Java VM \u7684\u53c2\u6570>\n -servertool.register1=\u6ce8\u518c\u4e00\u4e2a\u53ef\u6fc0\u6d3b\u7684\u670d\u52a1\u5668 -servertool.register2=\t\u5df2\u6ce8\u518c\u670d\u52a1\u5668 (serverid = {0})\u3002 -servertool.register3=\t\u5df2\u6ce8\u518c\u670d\u52a1\u5668\uff0c\u4f46\u5df2\u88ab\u5173\u95ed (serverid = {0})\u3002 -servertool.register4=\t\u670d\u52a1\u5668\u5df2\u6ce8\u518c (serverid = {0})\u3002 +servertool.serverid=\t\u670D\u52A1\u5668 ID - {0} +servertool.servernotrunning=\t\u670D\u52A1\u5668\u6CA1\u6709\u8FD0\u884C\u3002 +servertool.register=\n\n\tregister -server<\u670D\u52A1\u5668\u7C7B\u540D\u79F0> \n\t -applicationName <\u5907\u7528\u670D\u52A1\u5668\u540D\u79F0> \n\t -classpath <\u670D\u52A1\u5668\u7684\u7C7B\u8DEF\u5F84> \n\t -args <\u670D\u52A1\u5668\u7684\u53C2\u6570> \n\t -vmargs <\u670D\u52A1\u5668 Java VM \u7684\u53C2\u6570>\n +servertool.register1=\u6CE8\u518C\u4E00\u4E2A\u53EF\u6FC0\u6D3B\u7684\u670D\u52A1\u5668 +servertool.register2=\t\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 (serverid = {0})\u3002 +servertool.register3=\t\u5DF2\u6CE8\u518C\u670D\u52A1\u5668, \u4F46\u5DF2\u88AB\u5173\u95ED (serverid = {0})\u3002 +servertool.register4=\t\u670D\u52A1\u5668\u5DF2\u6CE8\u518C (serverid = {0})\u3002 servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=\u53d6\u6d88\u670d\u52a1\u5668\u6ce8\u518c -servertool.unregister2=\t\u670d\u52a1\u5668\u672a\u6ce8\u518c\u3002 +servertool.unregister1=\u6CE8\u9500\u5DF2\u6CE8\u518C\u7684\u670D\u52A1\u5668 +servertool.unregister2=\t\u670D\u52A1\u5668\u5DF2\u6CE8\u9500\u3002 servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=\u4e3a\u5df2\u6ce8\u518c\u670d\u52a1\u5668\u5b9a\u4f4d\u7279\u5b9a\u7c7b\u578b\u7684\u7aef\u53e3 -servertool.locate2=\n\n\t\u4e3b\u673a\u540d\u79f0 {0} \n\n\t\t\u7aef\u53e3\t\t\u7aef\u53e3\u7c7b\u578b\t\tORB \u6807\u8bc6\n\t\t----\t\t---------\t\t------\n +servertool.locate1=\u4E3A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668\u5B9A\u4F4D\u7279\u5B9A\u7C7B\u578B\u7684\u7AEF\u53E3 +servertool.locate2=\n\n\t\u4E3B\u673A\u540D\u79F0 {0} \n\n\t\t\u7AEF\u53E3\t\t\u7AEF\u53E3\u7C7B\u578B\t\tORB \u6807\u8BC6\n\t\t----\t\t---------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\u4e3a\u5df2\u6ce8\u518c\u670d\u52a1\u5668\u7684\u7279\u5b9a\u5bf9\u8c61\u8bf7\u6c42\u4ee3\u7406\u7a0b\u5e8f\u5b9a\u4f4d\u7aef\u53e3\u3002 -servertool.locateorb2=\n\n\t\u4e3b\u673a\u540d\u79f0 {0} \n\n\t\t\u7aef\u53e3\t\t\u7aef\u53e3\u7c7b\u578b\t\tORB \u6807\u8bc6\n\t\t----\t\t--------\t\t------\n +servertool.locateorb1=\u4E3A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668\u7684\u7279\u5B9A\u5BF9\u8C61\u8BF7\u6C42\u4EE3\u7406\u7A0B\u5E8F\u5B9A\u4F4D\u7AEF\u53E3\u3002 +servertool.locateorb2=\n\n\t\u4E3B\u673A\u540D\u79F0 {0} \n\n\t\t\u7AEF\u53E3\t\t\u7AEF\u53E3\u7C7B\u578B\t\tORB \u6807\u8BC6\n\t\t----\t\t--------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=\u8fd4\u56de\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\u7684\u670d\u52a1\u5668\u6807\u8bc6\u7b26 -servertool.getserverid2=\t\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0 {0} \u7684\u670d\u52a1\u5668\u6807\u8bc6\u7b26\u662f {1} +servertool.getserverid1=\u8FD4\u56DE applicationName \u7684\u670D\u52A1\u5668 ID +servertool.getserverid2=\tapplicationName {0} \u7684\u670D\u52A1\u5668 ID \u662F {1} servertool.list=\n\t\u5217\u8868\n -servertool.list1=\u5217\u51fa\u6240\u6709\u5df2\u6ce8\u518c\u670d\u52a1\u5668 -servertool.list2=\n\t\u670d\u52a1\u5668\u6807\u8bc6\u7b26\t\t\u670d\u52a1\u5668\u7c7b\u540d\u79f0\t\t\t\u670d\u52a1\u5668\u5e94\u7528\u7a0b\u5e8f\n\t---------\t-----------------\t------------------\n +servertool.list1=\u5217\u51FA\u6240\u6709\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 +servertool.list2=\n\t\u670D\u52A1\u5668 ID\t\u670D\u52A1\u5668\u7C7B\u540D\u79F0\t\t\u670D\u52A1\u5668\u5E94\u7528\u7A0B\u5E8F\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive -servertool.listactive1=\u5217\u51fa\u5f53\u524d\u6d3b\u52a8\u7684\u670d\u52a1\u5668 +servertool.listactive1=\u5217\u51FA\u5F53\u524D\u6D3B\u52A8\u7684\u670D\u52A1\u5668 servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\u5217\u51fa\u5f53\u524d\u5b9a\u4e49\u7684\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0 -servertool.listappnames2=\u5f53\u524d\u5b9a\u4e49\u7684\u670d\u52a1\u5668\u5e94\u7528\u7a0b\u5e8f\u540d\u79f0\uff1a +servertool.listappnames1=\u5217\u51FA\u5F53\u524D\u5B9A\u4E49\u7684 applicationName +servertool.listappnames2=\u5F53\u524D\u5B9A\u4E49\u7684\u670D\u52A1\u5668 applicationName: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\u5173\u95ed\u4e00\u4e2a\u5df2\u6ce8\u518c\u670d\u52a1\u5668 -servertool.shutdown2=\t\u670d\u52a1\u5668\u6210\u529f\u5173\u95ed\u3002 +servertool.shutdown1=\u5173\u95ED\u4E00\u4E2A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 +servertool.shutdown2=\t\u670D\u52A1\u5668\u6210\u529F\u5173\u95ED\u3002 servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\u542f\u52a8\u4e00\u4e2a\u5df2\u6ce8\u518c\u670d\u52a1\u5668 -servertool.startserver2=\t\u670d\u52a1\u5668\u6210\u529f\u542f\u52a8\u3002 +servertool.startserver1=\u542F\u52A8\u4E00\u4E2A\u5DF2\u6CE8\u518C\u670D\u52A1\u5668 +servertool.startserver2=\t\u670D\u52A1\u5668\u6210\u529F\u542F\u52A8\u3002 -servertool.quit=\n\t\u9000\u51fa\n -servertool.quit1=\u9000\u51fa\u6b64\u5de5\u5177 +servertool.quit=\n\t\u9000\u51FA\n +servertool.quit1=\u9000\u51FA\u6B64\u5DE5\u5177 servertool.help=\thelp\n\t\u6216\n\thelp \n -servertool.help1=\u53d6\u5f97\u5e2e\u52a9 +servertool.help1=\u83B7\u53D6\u5E2E\u52A9 -servertool.orbidmap=\t\u7528\u6cd5\uff1aorblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=\u5bf9\u8c61\u8bf7\u6c42\u4ee3\u7406\u7a0b\u5e8f (orb) \u540d\u79f0\u53ca\u5176\u6620\u5c04\u5217\u8868 -servertool.orbidmap2=\n\tORB \u6807\u8bc6\t\tORB \u540d\u79f0\n\t------\t\t--------\n -pnameserv.success=\u6301\u4e45\u6027\u540d\u79f0\u670d\u52a1\u5668\u6210\u529f\u542f\u52a8 +servertool.orbidmap=\t\u7528\u6CD5: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap1=\u5BF9\u8C61\u8BF7\u6C42\u4EE3\u7406\u7A0B\u5E8F (orb) \u540D\u79F0\u53CA\u5176\u6620\u5C04\u5217\u8868 +servertool.orbidmap2=\n\tORB \u6807\u8BC6\t\tORB \u540D\u79F0\n\t------\t\t--------\n +pnameserv.success=\u6301\u4E45\u6027\u540D\u79F0\u670D\u52A1\u5668\u6210\u529F\u542F\u52A8 -bootstrap.usage=\u7528\u6cd5\uff1a{0} <\u9009\u9879> \n\n\u5176\u4e2d\uff0c<\u9009\u9879> \u5305\u62ec\uff1a\n -ORBInitialPort \u521d\u59cb\u7aef\u53e3\uff08\u5fc5\u9700\uff09\n -InitialServicesFile \u5305\u542b\u521d\u59cb\u670d\u52a1\u5217\u8868\u7684\u6587\u4ef6\uff08\u5fc5\u9700\uff09\n -bootstrap.success=\u5c06\u7aef\u53e3\u8bbe\u7f6e\u4e3a{0}\u5e76\u4ece{1}\u8bfb\u53d6\u670d\u52a1 -bootstrap.filenotreadable=\u4e0d\u53ef\u8bfb\u53d6\u6587\u4ef6 {0} -bootstrap.filenotfound=\u6ca1\u6709\u627e\u5230\u6587\u4ef6{0} -bootstrap.exception=\u5c06\u5c5e\u6027\u4fdd\u5b58\u5230\u6587\u4ef6{0}\u65f6\u53d1\u751f\u5f02\u5e38\uff1a\u5f02\u5e38 {1} +bootstrap.usage=\u7528\u6CD5: {0} <\u9009\u9879> \n\n\u5176\u4E2D, <\u9009\u9879> \u5305\u62EC: \n -ORBInitialPort \u521D\u59CB\u7AEF\u53E3 (\u5FC5\u9700)\n -InitialServicesFile \u5305\u542B\u521D\u59CB\u670D\u52A1\u5217\u8868\u7684\u6587\u4EF6 (\u5FC5\u9700)\n +bootstrap.success=\u5C06\u7AEF\u53E3\u8BBE\u7F6E\u4E3A{0}\u5E76\u4ECE{1}\u8BFB\u53D6\u670D\u52A1 +bootstrap.filenotreadable=\u6587\u4EF6{0}\u4E0D\u53EF\u8BFB\u53D6 +bootstrap.filenotfound=\u6CA1\u6709\u627E\u5230\u6587\u4EF6{0} +bootstrap.exception=\u5C06\u5C5E\u6027\u4FDD\u5B58\u5230\u6587\u4EF6{0}\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF: \u5F02\u5E38\u9519\u8BEF{1} -tnameserv.exception=\u542f\u52a8{0}\u7aef\u53e3\u4e0a\u7684\u81ea\u5f15\u5bfc\u7a0b\u5e8f\u670d\u52a1\u65f6\u53d1\u751f\u5f02\u5e38 -tnameserv.usage=\u5c1d\u8bd5\u5229\u7528\u547d\u4ee4\u884c\u53c2\u6570\u4f7f\u7528\u4e0d\u540c\u7684\u7aef\u53e3 -ORBInnitialPort -tnameserv.invalidhostoption=ORBInitialHost \u4e0d\u662f\u540d\u79f0\u670d\u52a1\u5668\u7684\u6709\u6548\u9009\u9879 -tnameserv.orbinitialport0=ORBInitialPort 0 \u4e0d\u662f\u540d\u79f0\u670d\u52a1\u5668\u7684\u6709\u6548\u9009\u9879 -tnameserv.hs1=\u521d\u59cb\u7684\u547d\u540d\u8303\u56f4\uff1a\n{0} -tnameserv.hs2=TransientNameServer: \u5c06\u521d\u59cb\u5bf9\u8c61\u5f15\u7528\u7aef\u53e3\u8bbe\u7f6e\u4e3a\uff1a{0} -tnameserv.hs3=\u51c6\u5907\u5c31\u7eea\u3002 +tnameserv.exception=\u542F\u52A8{0}\u7AEF\u53E3\u4E0A\u7684\u5F15\u5BFC\u7A0B\u5E8F\u670D\u52A1\u65F6\u51FA\u73B0\u5F02\u5E38\u9519\u8BEF +tnameserv.usage=\u5C1D\u8BD5\u5229\u7528\u547D\u4EE4\u884C\u53C2\u6570 -ORBInitialPort \u4F7F\u7528\u4E0D\u540C\u7684\u7AEF\u53E3 +tnameserv.invalidhostoption=ORBInitialHost \u4E0D\u662F NameService \u7684\u6709\u6548\u9009\u9879 +tnameserv.orbinitialport0=ORBInitialPort 0 \u4E0D\u662F NameService \u7684\u6709\u6548\u9009\u9879 +tnameserv.hs1=\u521D\u59CB\u7684\u547D\u540D\u4E0A\u4E0B\u6587: \n{0} +tnameserv.hs2=TransientNameServer: \u5C06\u521D\u59CB\u5BF9\u8C61\u5F15\u7528\u7AEF\u53E3\u8BBE\u7F6E\u4E3A: {0} +tnameserv.hs3=\u51C6\u5907\u5C31\u7EEA\u3002 -orbd.commfailure=\n\u7531\u4e8e ORBinitialPort \u5df2\u5728\u4f7f\u7528\u4e2d\uff0c\u542f\u52a8 ORBD \u5931\u8d25 -orbd.internalexception=\n\u5185\u90e8\u5f02\u5e38\uff0c\u542f\u52a8 ORBD \u5931\u8d25\u3002 \n\u53ef\u80fd\u539f\u56e0\uff1a\n1. \u6307\u5b9a\u7684 ORBInitialPort \u6216 ORBActivationPort \u5df2\u5728\u4f7f\u7528\u4e2d \n2. \u6ca1\u6709\u5199 orb.db \u7684\u5199\u5165\u6743\u9650 +orbd.commfailure=\n\u7531\u4E8E ORBinitialPort \u5DF2\u5728\u4F7F\u7528\u4E2D, \u65E0\u6CD5\u542F\u52A8 ORBD +orbd.internalexception=\n\u7531\u4E8E\u5185\u90E8\u5F02\u5E38\u9519\u8BEF, \u65E0\u6CD5\u542F\u52A8 ORBD\u3002\n\u53EF\u80FD\u539F\u56E0: \n1. \u6307\u5B9A\u7684 ORBInitialPort \u6216 ORBActivationPort \u5DF2\u5728\u4F7F\u7528\u4E2D \n2. \u6CA1\u6709\u5199\u5165 orb.db \u7684\u6743\u9650 diff --git a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties index 7db8591348b..db797522663 100644 --- a/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties +++ b/corba/src/share/classes/com/sun/corba/se/impl/orbutil/resources/sunorb_zh_TW.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2000, 2005, 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,85 +23,85 @@ # questions. # -orbd.usage=\u7528\u6cd5\uff1a{0} \n\n\u5176\u4e2d \u5305\u62ec\uff1a\n -port ORBD \u61c9\u88ab\u555f\u52d5\u7684\u555f\u52d5\u57e0\u6240\u5728\uff0c\u9810\u8a2d\u70ba 1049 (\u53ef\u9078)\n -defaultdb ORBD \u6a94\u6848\u7684\u76ee\u9304\uff0c\u9810\u8a2d "./orb.db" (\u53ef\u9078)\n -serverid ORBD \u4f3a\u670d\u5668 Id\uff0c\u9810\u8a2d\u70ba 1 (\u53ef\u9078)\n -ORBInitialPort \u8d77\u59cb\u57e0\uff08\u5fc5\u8981\uff09\n -ORBInitialHost \u8d77\u59cb\u4e3b\u6a5f\u540d\u7a31\uff08\u5fc5\u8981\uff09\n +orbd.usage=\u7528\u6CD5: {0} \n\n\u5176\u4E2D \u5305\u62EC: \n -port ORBD \u61C9\u88AB\u555F\u52D5\u7684\u555F\u52D5\u9023\u63A5\u57E0\u6240\u5728\uFF0C\u9810\u8A2D\u70BA 1049 (\u53EF\u9078)\n -defaultdb ORBD \u6A94\u6848\u7684\u76EE\u9304\uFF0C\u9810\u8A2D "./orb.db" (\u53EF\u9078)\n -serverid ORBD \u4F3A\u670D\u5668 Id\uFF0C\u9810\u8A2D\u70BA 1 (\u53EF\u9078)\n -ORBInitialPort \u8D77\u59CB\u9023\u63A5\u57E0 (\u5FC5\u8981)\n -ORBInitialHost \u8D77\u59CB\u4E3B\u6A5F\u540D\u7A31 (\u5FC5\u8981)\n -servertool.usage=\u7528\u6cd5\uff1a {0} \n\nwhere \u5305\u62ec\uff1a\n -ORBInitialPort \u8d77\u59cb\u57e0\uff08\u5fc5\u8981\uff09\n -ORBInitialHost \u8d77\u59cb\u4e3b\u6a5f\u540d\u7a31\uff08\u5fc5\u8981\uff09\n -servertool.banner=\n\n\u6b61\u8fce\u4f86\u5230 Java IDL \u4f3a\u670d\u5668\u5de5\u5177 \n\u8acb\u5728\u63d0\u793a\u8655\u8f38\u5165\u6307\u4ee4 \n -servertool.shorthelp=\n\n\t\u73fe\u6709\u7684\u6307\u4ee4\uff1a\n\t------------------- \n -servertool.baddef=\u932f\u8aa4\u7684\u4f3a\u670d\u5668\u5b9a\u7fa9\uff1a {0} -servertool.nosuchserver=\t\u627e\u4e0d\u5230\u9019\u500b\u4f3a\u670d\u5668\u3002 -servertool.helddown=\t\u4f3a\u670d\u5668\u4e0d\u5728\u5de5\u4f5c\u72c0\u614b\u3002 +servertool.usage=\u7528\u6CD5: {0} \n\nwhere \u5305\u62EC:\n -ORBInitialPort \u8D77\u59CB\u9023\u63A5\u57E0 (\u5FC5\u8981)\n -ORBInitialHost \u8D77\u59CB\u4E3B\u6A5F\u540D\u7A31 (\u5FC5\u8981)\n +servertool.banner=\n\n\u6B61\u8FCE\u4F7F\u7528 Java IDL \u4F3A\u670D\u5668\u5DE5\u5177 \n\u8ACB\u5728\u63D0\u793A\u8655\u8F38\u5165\u547D\u4EE4 \n +servertool.shorthelp=\n\n\t\u53EF\u7528\u7684\u547D\u4EE4: \n\t------------------- \n +servertool.baddef=\u932F\u8AA4\u7684\u4F3A\u670D\u5668\u5B9A\u7FA9: {0} +servertool.nosuchserver=\t\u627E\u4E0D\u5230\u9019\u500B\u4F3A\u670D\u5668\u3002 +servertool.helddown=\t\u4F3A\u670D\u5668\u4E0D\u5728\u5DE5\u4F5C\u72C0\u614B\u3002 servertool.nosuchorb=\t\u7121\u6548\u7684 ORB. -servertool.serverup=\t\u4f3a\u670d\u5668\u5df2\u5728\u5de5\u4f5c\u72c0\u614b\u3002 +servertool.serverup=\t\u4F3A\u670D\u5668\u5DF2\u5728\u5DE5\u4F5C\u72C0\u614B\u3002 servertool.appname=\tapplicationName - {0} -servertool.name=\t\u540d\u7a31 - {0} +servertool.name=\tname - {0} servertool.classpath=\tclasspath - {0} servertool.args=\targs - {0} servertool.vmargs=\tvmargs - {0} -servertool.serverid=\t\u4f3a\u670d\u5668 id - {0} -servertool.servernotrunning=\t\u4f3a\u670d\u5668\u672a\u904b\u4f5c\u3002 -servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n -servertool.register1=\u8a3b\u518a\u4e00\u500b\u53ef\u555f\u52d5\u7684\u4f3a\u670d\u5668 -servertool.register2=\t\u5df2\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668 (serverid = {0})\u3002 -servertool.register3=\t\u5df2\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668\uff0c\u4f46\u4e0d\u5728\u5de5\u4f5c\u72c0\u614b (serverid = {0})\u3002 -servertool.register4=\t\u4f3a\u670d\u5668\u5df2\u8a3b\u518a (serverid = {0})\u3002 +servertool.serverid=\tserver id - {0} +servertool.servernotrunning=\t\u4F3A\u670D\u5668\u672A\u57F7\u884C\u3002 +servertool.register=\n\n\tregister -server \n\t -applicationName \n\t -classpath \n\t -args \n\t -vmargs \n +servertool.register1=\u8A3B\u518A\u4E00\u500B\u53EF\u555F\u52D5\u7684\u4F3A\u670D\u5668 +servertool.register2=\t\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 (serverid = {0})\u3002 +servertool.register3=\t\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668\uFF0C\u4F46\u4E0D\u5728\u5DE5\u4F5C\u72C0\u614B (serverid = {0})\u3002 +servertool.register4=\t\u4F3A\u670D\u5668\u5DF2\u8A3B\u518A (serverid = {0})\u3002 servertool.unregister=\n\tunregister [ -serverid | -applicationName ] \n -servertool.unregister1=\u672a\u8a3b\u518a\u4e00\u500b\u5df2\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668 -servertool.unregister2=\t\u4f3a\u670d\u5668\u672a\u8a3b\u518a\u3002 +servertool.unregister1=\u5C07\u5DF2\u8A3B\u518A\u7684\u4F3A\u670D\u5668\u53D6\u6D88\u8A3B\u518A +servertool.unregister2=\t\u4F3A\u670D\u5668\u5DF2\u53D6\u6D88\u8A3B\u518A\u3002 servertool.locate=\n\tlocate [ -serverid | -applicationName ] [ <-endpointType ] \n -servertool.locate1=\u91dd\u5c0d\u4e00\u500b\u5df2\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668\u5c0b\u627e\u7279\u5b9a\u985e\u578b\u7684\u9023\u63a5\u57e0 -servertool.locate2=\n\n\t\u4e3b\u6a5f\u540d\u7a31 {0} \n\n\t\tPort\t\tPort Type\t\tORB Id\n\t\t----\t\t---------\t\t------\n +servertool.locate1=\u91DD\u5C0D\u4E00\u500B\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668\u5C0B\u627E\u7279\u5B9A\u985E\u578B\u7684\u9023\u63A5\u57E0 +servertool.locate2=\n\n\t\u4E3B\u6A5F\u540D\u7A31 {0} \n\n\t\t\u9023\u63A5\u57E0\t\t\u9023\u63A5\u57E0\u985E\u578B\t\tORB Id\n\t\t----\t\t---------\t\t------\n servertool.locateorb=\n\tlocateperorb [ -serverid | -applicationName ] [ -orbid ]\n -servertool.locateorb1=\u91dd\u5c0d\u5df2\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668\u7684\u7279\u5b9a orb \u5c0b\u627e\u9023\u63a5\u57e0\u3002 -servertool.locateorb2=\n\n\t\u4e3b\u6a5f\u540d\u7a31 {0} \n\n\t\tPort\t\tPortType\t\tORB Id\n\t\t----\t\t--------\t\t------\n +servertool.locateorb1=\u91DD\u5C0D\u5DF2\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668\u7684\u7279\u5B9A orb \u5C0B\u627E\u9023\u63A5\u57E0\u3002 +servertool.locateorb2=\n\n\t\u4E3B\u6A5F\u540D\u7A31 {0} \n\n\t\t\u9023\u63A5\u57E0\t\t\u9023\u63A5\u57E0\u985E\u578B\t\tORB Id\n\t\t----\t\t--------\t\t------\n servertool.getserverid=\n\tgetserverid [ -applicationName ] \n -servertool.getserverid1=\u91dd\u5c0d\u4e00\u500b applicationName \u50b3\u56de\u4f3a\u670d\u5668\u8b58\u5225\u78bc -servertool.getserverid2=\tapplicationName \u7684\u4f3a\u670d\u5668\u8b58\u5225\u78bc {0} \u70ba {1} +servertool.getserverid1=\u50B3\u56DE applicationName \u7684\u4F3A\u670D\u5668\u8B58\u5225\u78BC +servertool.getserverid2=\tapplicationName \u7684\u4F3A\u670D\u5668\u8B58\u5225\u78BC {0} \u70BA {1} -servertool.list=\n\t\u6e05\u55ae\n -servertool.list1=\u5217\u51fa\u6240\u6709\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668 -servertool.list2=\n\t\u4f3a\u670d\u5668\u8b58\u5225\u78bc\t\u4f3a\u670d\u5668\u985e\u5225\u540d\u7a31\t\t\u4f3a\u670d\u5668\u61c9\u7528\u7a0b\u5f0f\n\t---------\t-----------------\t\t------------------\n +servertool.list=\n\tlist\n +servertool.list1=\u5217\u51FA\u6240\u6709\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 +servertool.list2=\n\t\u4F3A\u670D\u5668\u8B58\u5225\u78BC\t\u4F3A\u670D\u5668\u985E\u5225\u540D\u7A31\t\t\u4F3A\u670D\u5668\u61C9\u7528\u7A0B\u5F0F\n\t---------\t-----------------\t\t------------------\n servertool.listactive=\n\tlistactive -servertool.listactive1=\u5217\u51fa\u73fe\u5728\u555f\u52d5\u7684\u4f3a\u670d\u5668 +servertool.listactive1=\u5217\u51FA\u76EE\u524D\u4F7F\u7528\u4E2D\u7684\u4F3A\u670D\u5668 servertool.listappnames=\tlistappnames\n -servertool.listappnames1=\u5217\u51fa\u73fe\u5728\u88ab\u5b9a\u7fa9\u7684 applicationNames -servertool.listappnames2=\u73fe\u5728\u5b9a\u7fa9\u7684\u4f3a\u670d\u5668 applicationNames\uff1a +servertool.listappnames1=\u5217\u51FA\u76EE\u524D\u5B9A\u7FA9\u7684 applicationNames +servertool.listappnames2=\u76EE\u524D\u5B9A\u7FA9\u7684\u4F3A\u670D\u5668 applicationNames: servertool.shutdown=\n\tshutdown [ -serverid | -applicationName ]\n -servertool.shutdown1=\u95dc\u9589\u4e00\u500b\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668 -servertool.shutdown2=\t\u4f3a\u670d\u5668\u95dc\u9589\u6210\u529f\u3002 +servertool.shutdown1=\u95DC\u9589\u4E00\u500B\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 +servertool.shutdown2=\t\u4F3A\u670D\u5668\u95DC\u9589\u6210\u529F\u3002 servertool.startserver=\n\tstartup [ -serverid | -applicationName ]\n -servertool.startserver1=\u958b\u555f\u4e00\u500b\u8a3b\u518a\u904e\u7684\u4f3a\u670d\u5668 -servertool.startserver2=\t\u4f3a\u670d\u5668\u958b\u555f\u6210\u529f\u3002 +servertool.startserver1=\u555F\u52D5\u4E00\u500B\u8A3B\u518A\u904E\u7684\u4F3A\u670D\u5668 +servertool.startserver2=\t\u4F3A\u670D\u5668\u555F\u52D5\u6210\u529F\u3002 -servertool.quit=\n\t\u96e2\u958b\n -servertool.quit1=\u96e2\u958b\u9019\u500b\u5de5\u5177 +servertool.quit=\n\tquit\n +servertool.quit1=\u96E2\u958B\u9019\u500B\u5DE5\u5177 -servertool.help=\t\u5e6b\u52a9\n\tOR\n\thelp \n -servertool.help1=\u53d6\u5f97\u5e6b\u52a9 +servertool.help=\thelp\n\t\u6216\n\thelp \n +servertool.help1=\u53D6\u5F97\u8AAA\u660E -servertool.orbidmap=\t\u7528\u6cd5\uff1a orblist [ -serverid | -applicationName ]\n -servertool.orbidmap1=orb \u540d\u7a31\u53ca\u5176\u5c0d\u6620\u6e05\u55ae -servertool.orbidmap2=\n\tORB Id\t\tORB \u540d\u7a31\n\t------\t\t--------\n -pnameserv.success=\u6c38\u4e45\u6027 NameServer \u958b\u555f\u6210\u529f +servertool.orbidmap=\t\u7528\u6CD5: orblist [ -serverid | -applicationName ]\n +servertool.orbidmap1=orb \u540D\u7A31\u53CA\u5176\u5C0D\u6620\u6E05\u55AE +servertool.orbidmap2=\n\tORB Id\t\tORB \u540D\u7A31\n\t------\t\t--------\n +pnameserv.success=\u6C38\u4E45\u6027 NameServer \u555F\u52D5\u6210\u529F -bootstrap.usage=\u7528\u6cd5\uff1a {0} \n\n\u5176\u4e2d \u5305\u62ec\uff1a\n -ORBInitialPort \u8d77\u59cb\u57e0\uff08\u5fc5\u8981\uff09\n -InitialServicesFile \u542b\u6709\u8d77\u555f\u670d\u52d9\u6e05\u55ae\u7684\u6a94\u6848\uff08\u5fc5\u8981\uff09\n -bootstrap.success=\u8a2d\u5b9a\u9023\u63a5\u57e0\u81f3 {0} \u4e26\u5f9e {1} \u8b80\u53d6\u670d\u52d9 -bootstrap.filenotreadable=\u6a94\u6848 {0} \u7121\u6cd5\u8b80\u53d6 -bootstrap.filenotfound=\u6a94\u6848 {0} \u672a\u627e\u5230 -bootstrap.exception=\u5c07\u5c6c\u6027\u5132\u5b58\u81f3\u6a94\u6848 {0} \u6642\u767c\u751f\u7570\u5e38\uff1a\u7570\u5e38 {1} +bootstrap.usage=\u7528\u6CD5: {0} \n\n\u5176\u4E2D \u5305\u62EC: \n -ORBInitialPort \u8D77\u59CB\u9023\u63A5\u57E0 (\u5FC5\u8981)\n -InitialServicesFile \u542B\u6709\u8D77\u59CB\u670D\u52D9\u6E05\u55AE\u7684\u6A94\u6848 (\u5FC5\u8981)\n +bootstrap.success=\u8A2D\u5B9A\u9023\u63A5\u57E0\u81F3 {0} \u4E26\u5F9E {1} \u8B80\u53D6\u670D\u52D9 +bootstrap.filenotreadable=\u6A94\u6848 {0} \u7121\u6CD5\u8B80\u53D6 +bootstrap.filenotfound=\u627E\u4E0D\u5230\u6A94\u6848 {0} +bootstrap.exception=\u5C07\u5C6C\u6027\u5132\u5B58\u81F3\u6A94\u6848 {0} \u6642\u767C\u751F\u7570\u5E38\u72C0\u6CC1: \u7570\u5E38\u72C0\u6CC1 {1} -tnameserv.exception=\u958b\u555f {0} \u9023\u63a5\u57e0\u4e0a\u7684\u555f\u52d5\u7a0b\u5f0f\u670d\u52d9\u6642\uff0c\u767c\u751f\u7570\u5e38 -tnameserv.usage=\u8a66\u8457\u5229\u7528\u542b\u6709\u6307\u4ee4\u884c\u5f15\u6578\u7684\u4e0d\u540c\u9023\u63a5\u57e0 -ORBInitialPort -tnameserv.invalidhostoption=ORBInitialHost \u4e0d\u662f NameService \u7684\u6709\u6548\u9078\u9805 -tnameserv.orbinitialport0=ORBInitialPort 0 \u4e0d\u662f NameService \u7684\u6709\u6548\u9078\u9805 -tnameserv.hs1=\u8d77\u59cb\u547d\u540d\u5167\u6587\uff1a\n{0} -tnameserv.hs2=TransientNameServer: \u91dd\u5c0d\u8d77\u59cb\u7269\u4ef6\u53c3\u7167\uff0c\u8a2d\u5b9a\u9023\u63a5\u57e0\u81f3\uff1a{0} -tnameserv.hs3=\u5c31\u7dd2\u3002 +tnameserv.exception=\u958B\u555F {0} \u9023\u63A5\u57E0\u4E0A\u7684\u555F\u52D5\u5B89\u88DD\u670D\u52D9\u6642\uFF0C\u767C\u751F\u7570\u5E38\u72C0\u6CC1 +tnameserv.usage=\u5617\u8A66\u4EE5\u547D\u4EE4\u884C\u5F15\u6578\u4F86\u4F7F\u7528\u4E0D\u540C\u9023\u63A5\u57E0 -ORBInitialPort +tnameserv.invalidhostoption=ORBInitialHost \u4E0D\u662F NameService \u7684\u6709\u6548\u9078\u9805 +tnameserv.orbinitialport0=ORBInitialPort 0 \u4E0D\u662F NameService \u7684\u6709\u6548\u9078\u9805 +tnameserv.hs1=\u8D77\u59CB\u547D\u540D\u76F8\u95DC\u8CC7\u8A0A\u74B0\u5883: \n{0} +tnameserv.hs2=TransientNameServer: \u91DD\u5C0D\u8D77\u59CB\u7269\u4EF6\u53C3\u7167\uFF0C\u8A2D\u5B9A\u9023\u63A5\u57E0\u81F3: {0} +tnameserv.hs3=\u5C31\u7DD2\u3002 -orbd.commfailure=\n\u56e0\u70ba ORBinitialPort \u5728\u4f7f\u7528\u4e2d\uff0c\u6240\u4ee5\u7121\u6cd5\u555f\u52d5 ORBD\u3002 -orbd.internalexception=\n\u56e0\u70ba\u5167\u90e8\u767c\u751f\u7570\u5e38\uff0c\u6240\u4ee5\u7121\u6cd5\u555f\u52d5 ORBD\u3002 \n\u53ef\u80fd\u7684\u539f\u56e0\uff1a \n1. \u6307\u5b9a\u7684 ORBInitialPort \u6216 ORBActivationPort \u5728\u4f7f\u7528\u4e2d\u3002 \n2. \u6c92\u6709\u5beb\u5165 orb.db \u7684\u8a31\u53ef\u6b0a\u3002 +orbd.commfailure=\n\u56E0\u70BA ORBinitialPort \u5728\u4F7F\u7528\u4E2D\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002 +orbd.internalexception=\n\u56E0\u70BA\u5167\u90E8\u767C\u751F\u7570\u5E38\uFF0C\u6240\u4EE5\u7121\u6CD5\u555F\u52D5 ORBD\u3002 \n\u53EF\u80FD\u7684\u539F\u56E0: \n1. \u6307\u5B9A\u7684 ORBInitialPort \u6216 ORBActivationPort \u5728\u4F7F\u7528\u4E2D\u3002 \n2. \u6C92\u6709\u5BEB\u5165 orb.db \u7684\u6B0A\u9650\u3002 From 6db98ef403520f725296fb09b8d768c31f189855 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 10 Feb 2011 16:24:23 -0800 Subject: [PATCH 75/84] Added tag jdk7-b129 for changeset b66ada7c8e10 --- .hgtags-top-repo | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags-top-repo b/.hgtags-top-repo index edc59dcf5c7..4fe77eb16d4 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -103,3 +103,4 @@ ed6950da30cf1e8904b4bdb034d471647942271f jdk7-b123 b566d490905691787f8931f69947a92c67c6d5e4 jdk7-b126 bd70f76b0309068f157ae759c36eac8f2c6d098e jdk7-b127 57d702105b23fb90e40beaf00f8f8aeae5e249e7 jdk7-b128 +a6b015b59fbc2518762c17ccc35702f03ef7713a jdk7-b129 From 631189b716d172e5383a361ce2f8d8334d068831 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 10 Feb 2011 16:24:24 -0800 Subject: [PATCH 76/84] Added tag jdk7-b129 for changeset c9679be023bb --- corba/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/corba/.hgtags b/corba/.hgtags index ab1a96c5efc..17e1c755061 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -103,3 +103,4 @@ f90b3e014e831eb4f32ef035a1dad2b8ba87949f jdk7-b124 d7532bcd3742f1576dd07ff9fbb535c9c9a276e9 jdk7-b126 64775e83f4df894355f45555f50c410de6727b4e jdk7-b127 9baa8f94a11d6c5cab3f9f0e5a20106326d0932e jdk7-b128 +66fa0fcc779296c99746b09efce6109944f82f30 jdk7-b129 From 97dbe91443568b18c8ee58304d45f188a90a6008 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 10 Feb 2011 16:24:29 -0800 Subject: [PATCH 77/84] Added tag jdk7-b129 for changeset 251814950cb2 --- hotspot/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 577a6ec935c..944116357d8 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -146,3 +146,4 @@ e24ab3fa6aafad3efabbe7dba9918c5f461a20b1 hs20-b06 d535bf4c12355a2897e918da9f8910c0aceec4fb hs20-b07 102466e70debc4b907afbd7624e34ddb1aafee9f jdk7-b127 9a5762f448595794d449a8e17342abd81a3fadaf jdk7-b128 +ae4b185f2ed14af7bab610738c333840598cdcc4 jdk7-b129 From 20b88d2aaea44cd26f78e001684cd5df6dc0f226 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 10 Feb 2011 16:24:34 -0800 Subject: [PATCH 78/84] Added tag jdk7-b129 for changeset ff78798ebd0e --- jaxp/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jaxp/.hgtags b/jaxp/.hgtags index 5bd81082d47..add6fe9aec2 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -103,3 +103,4 @@ e2aedea6495d61557326928de20dbb2d78fdd9aa jdk7-b123 2fde639439c1fb3fbc44f533d48bb2916e813312 jdk7-b126 c532d6dbc8d18d55b5d693599ee5cd8250e16eb4 jdk7-b127 a42c6132c746c86e9fc27ec80cbd699f6ee5edca jdk7-b128 +f5b60c5a310f992c6ca627d17ca3e042f0e0b2c3 jdk7-b129 From e861a90caa31f4eee4c70d013faa676d8ed338f7 Mon Sep 17 00:00:00 2001 From: Christine Lu Date: Thu, 10 Feb 2011 16:24:40 -0800 Subject: [PATCH 79/84] Added tag jdk7-b129 for changeset 6552a84fac3c --- jdk/.hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/jdk/.hgtags b/jdk/.hgtags index 684719db0b2..3cd8441e11e 100644 --- a/jdk/.hgtags +++ b/jdk/.hgtags @@ -103,3 +103,4 @@ ac311eb325bfc763698219252bf3cee9e091f3af jdk7-b122 8361ef97a0f90086c9048beaf7cea1a37216c4cd jdk7-b126 29e09de1d0b4f84faea114cf10b3ec08b59acc4e jdk7-b127 f08682e23279d6cccbdcafda1eb0647ba4900874 jdk7-b128 +14cd5d54a8d0b9c368d60ea83a066735b9931015 jdk7-b129 From 43148e5328836a3aaddc81e4b9c898b3acd4cb1e Mon Sep 17 00:00:00 2001 From: Kelly O'Hair Date: Thu, 10 Feb 2011 20:45:13 -0800 Subject: [PATCH 80/84] 7012644: Regression: jdk/make/common/shared/Defs-windows.gmk has problems on cygwin 7018835: Debug build issues in jdk makefiles Reviewed-by: ksrini --- jdk/make/common/shared/Defs-windows.gmk | 37 +++++++++++++++++++------ jdk/make/common/shared/Defs.gmk | 5 ++-- jdk/make/common/shared/Platform.gmk | 19 +++++++++++-- 3 files changed, 48 insertions(+), 13 deletions(-) diff --git a/jdk/make/common/shared/Defs-windows.gmk b/jdk/make/common/shared/Defs-windows.gmk index e1af407680d..461913ac9dc 100644 --- a/jdk/make/common/shared/Defs-windows.gmk +++ b/jdk/make/common/shared/Defs-windows.gmk @@ -86,17 +86,25 @@ override INCREMENTAL_BUILD = false # ifdef USING_CYGWIN +# Macro to effectively do a toupper without an exec +define ToUpper +$(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,\ +$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,\ +$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,\ +$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,\ +$(subst y,Y,$(subst z,Z,$1)))))))))))))))))))))))))) +endef # All possible drive letters drives=a b c d e f g h i j k l m n o p q r s t v u w x y z # Convert /cygdrive/ paths to the mixed style without an exec of cygpath -# Must be a path with no spaces. +# Must be a path with no spaces. /cygdrive/letter is always lowercase +# and letter:/ is always uppercase coming from cygpath. define MixedPath -$(patsubst /%,c:/cygwin/%,$(sort $(filter-out /cygdrive/%,$(foreach drive,$(drives),$(patsubst /cygdrive/$(drive)/%,$(drive):/%,$1))))) +$(patsubst /%,$(CYGWIN_HOME)/%,$(sort $(filter-out /cygdrive/%,$(foreach drive,$(drives),$(patsubst /cygdrive/$(drive)/%,$(call ToUpper,$(drive)):/%,$1))))) endef # Use FullPath to get C:/ style non-spaces path. Never ends with a /! # We assume cygpath is available in the search path # NOTE: Use of 'pwd' with CYGWIN will not get you a mixed style path! -CYGPATH_CMD=cygpath -a -s -m define FullPath $(if $(word 2,$1),$(shell $(CYGPATH_CMD) $1 2> $(DEV_NULL)),$(call MixedPath,$(realpath $(subst ",,$1)))) endef @@ -125,10 +133,15 @@ _system_drive:=$(call CheckValue,_system_drive,C:) # UNIXCOMMAND_PATH: path to where the most common Unix commands are. # NOTE: Must end with / so that it could be empty, allowing PATH usage. +# With cygwin, just use this as is don't use FullPath on it. ifdef ALT_UNIXCOMMAND_PATH - xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))" - fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH)) - UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH)) + ifdef USING_CYGWIN + UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH)) + else + xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))" + fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH)) + UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH)) + endif else ifdef USING_CYGWIN UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin) @@ -459,9 +472,11 @@ else endif # SLASH_JAVA: location of all network accessable files +# NOTE: Do not use FullPath on this because it's often a drive letter and +# plain drive letters are ambiguous, so just use this 'as is'. ifdef ALT_SLASH_JAVA xALT_SLASH_JAVA :="$(subst \,/,$(ALT_SLASH_JAVA))" - SLASH_JAVA :=$(call FullPath,$(xALT_SLASH_JAVA)) + SLASH_JAVA :=$(xALT_SLASH_JAVA) else ifdef ALT_JDK_JAVA_DRIVE SLASH_JAVA =$(JDK_JAVA_DRIVE) @@ -751,7 +766,11 @@ ifeq ($(VS2010_EXISTS),true) # we do not or cannot redistribute. # List of filenames we should NOT be dependent on -BANNED_DLLS=msvcp100[.]dll|msvcr100d[.]dll|msvcrtd[.]dll +ifeq ($(MFC_DEBUG),true) + BANNED_DLLS=msvcp100[.]dll +else + BANNED_DLLS=msvcp100[.]dll|msvcr100d[.]dll|msvcrtd[.]dll +endif # Macro to check it's input file for banned dependencies and verify the # binary was built properly. Relies on process exit code. @@ -771,7 +790,7 @@ define binary_file_verification # binary_file fi ; \ $(ECHO) "Checking for banned dependencies in: $1" && \ if [ "`$(DUMPBIN) /dependents $1 | $(EGREP) -i '$(BANNED_DLLS)'`" != "" ] ; then \ - $(ECHO) "ERROR: Found us of $(BANNED_DLLS)"; \ + $(ECHO) "ERROR: Found use of $(BANNED_DLLS)"; \ $(DUMPBIN) /dependents $1 ; \ exit 9 ; \ fi ; \ diff --git a/jdk/make/common/shared/Defs.gmk b/jdk/make/common/shared/Defs.gmk index aae5e6d85f0..587f1ad1911 100644 --- a/jdk/make/common/shared/Defs.gmk +++ b/jdk/make/common/shared/Defs.gmk @@ -54,11 +54,12 @@ include $(JDK_MAKE_SHARED_DIR)/Defs-utils.gmk # Assumes ARCH, PLATFORM, ARCH_VM_SUBDIR, JDK_TOPDIR, etc. have been defined. # Simple pwd path +# NOTE: Just use the shell's cd and pwd here, more reliable at sanity time. define PwdPath -$(shell $(CD) $1 2> $(DEV_NULL) && $(PWD)) +$(shell cd $1 2> $(DEV_NULL) && pwd) endef define AbsPwdPathCheck -$(shell $(CD) .. 2> $(DEV_NULL) && $(CD) $1 2> $(DEV_NULL) && $(PWD)) +$(shell cd .. 2> $(DEV_NULL) && cd $1 2> $(DEV_NULL) && pwd) endef # Checks an ALT value for spaces (should be one word), diff --git a/jdk/make/common/shared/Platform.gmk b/jdk/make/common/shared/Platform.gmk index dc1463cc6e2..91326a9f794 100644 --- a/jdk/make/common/shared/Platform.gmk +++ b/jdk/make/common/shared/Platform.gmk @@ -72,7 +72,11 @@ PLATFORM_SHARED=done # USING_CYGWIN windows only: true or false # ISHIELD_TEMP_MIN windows only: minimum disk space in temp area -SYSTEM_UNAME := $(shell uname) +# Only run uname once in this make session. +ifndef SYSTEM_UNAME + SYSTEM_UNAME := $(shell uname) + export SYSTEM_UNAME +endif # # Prune out all known SCM (Source Code Management) directories @@ -222,6 +226,12 @@ ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME))) PLATFORM = windows USING_CYGWIN = true export USING_CYGWIN + CYGPATH_CMD=cygpath -a -s -m + # Only run "cygpath /" once in this make session. + ifndef CYGWIN_HOME + CYGWIN_HOME := $(shell $(CYGPATH_CMD) /) + export CYGWIN_HOME + endif endif # Platform settings specific to Windows @@ -235,7 +245,12 @@ ifeq ($(PLATFORM), windows) # And sometimes PROCESSOR_IDENTIFIER is not defined at all # (in some restricted shells), so we use uname if we have to. ifeq ($(PROCESSOR_IDENTIFIER),) - PROC_ARCH:=$(shell uname -m) + # Only run uname -m once in this make session. + ifndef SYSTEM_UNAME_M + SYSTEM_UNAME_M := $(shell uname -m) + export SYSTEM_UNAME_M + endif + PROC_ARCH:=$(SYSTEM_UNAME_M) else PROC_ARCH:=$(word 1, $(PROCESSOR_IDENTIFIER)) endif From 841872dc4bac42939d5a02f7f14f96ef394a2ed1 Mon Sep 17 00:00:00 2001 From: Michael Fang Date: Thu, 10 Feb 2011 20:52:39 -0800 Subject: [PATCH 81/84] 7017734: jdk7 message drop 1 translation integration Reviewed-by: ogino, yhuang --- .../resources/accessibility_de.properties | 80 +- .../resources/accessibility_es.properties | 82 +- .../resources/accessibility_fr.properties | 128 +- .../resources/accessibility_it.properties | 46 +- .../resources/accessibility_ja.properties | 196 +-- .../resources/accessibility_ko.properties | 196 +-- .../resources/accessibility_pt_BR.properties | 80 +- .../resources/accessibility_sv.properties | 86 +- .../resources/accessibility_zh_CN.properties | 182 +-- .../resources/accessibility_zh_TW.properties | 192 +-- .../plaf/gtk/resources/gtk_de.properties | 36 +- .../plaf/gtk/resources/gtk_es.properties | 42 +- .../plaf/gtk/resources/gtk_fr.properties | 44 +- .../plaf/gtk/resources/gtk_it.properties | 24 +- .../plaf/gtk/resources/gtk_ja.properties | 60 +- .../plaf/gtk/resources/gtk_ko.properties | 60 +- .../plaf/gtk/resources/gtk_pt_BR.properties | 20 +- .../plaf/gtk/resources/gtk_sv.properties | 58 +- .../plaf/gtk/resources/gtk_zh_CN.properties | 60 +- .../plaf/gtk/resources/gtk_zh_TW.properties | 60 +- .../plaf/motif/resources/motif_de.properties | 16 +- .../plaf/motif/resources/motif_es.properties | 8 +- .../plaf/motif/resources/motif_fr.properties | 14 +- .../plaf/motif/resources/motif_it.properties | 12 +- .../plaf/motif/resources/motif_ja.properties | 36 +- .../plaf/motif/resources/motif_ko.properties | 36 +- .../motif/resources/motif_pt_BR.properties | 9 +- .../plaf/motif/resources/motif_sv.properties | 16 +- .../motif/resources/motif_zh_CN.properties | 36 +- .../motif/resources/motif_zh_TW.properties | 36 +- .../windows/resources/windows_de.properties | 18 +- .../windows/resources/windows_es.properties | 26 +- .../windows/resources/windows_fr.properties | 26 +- .../windows/resources/windows_it.properties | 16 +- .../windows/resources/windows_ja.properties | 57 +- .../windows/resources/windows_ko.properties | 57 +- .../resources/windows_pt_BR.properties | 19 +- .../windows/resources/windows_sv.properties | 18 +- .../resources/windows_zh_CN.properties | 51 +- .../resources/windows_zh_TW.properties | 57 +- .../rowset/RowSetResourceBundle_de.properties | 202 +-- .../rowset/RowSetResourceBundle_es.properties | 180 +-- .../rowset/RowSetResourceBundle_fr.properties | 170 +-- .../rowset/RowSetResourceBundle_it.properties | 66 +- .../rowset/RowSetResourceBundle_ja.properties | 234 ++-- .../rowset/RowSetResourceBundle_ko.properties | 230 ++-- .../RowSetResourceBundle_pt_BR.properties | 198 +-- .../rowset/RowSetResourceBundle_sv.properties | 190 +-- .../RowSetResourceBundle_zh_CN.properties | 224 ++-- .../RowSetResourceBundle_zh_TW.properties | 232 ++-- .../plaf/basic/resources/basic_de.properties | 96 +- .../plaf/basic/resources/basic_es.properties | 100 +- .../plaf/basic/resources/basic_fr.properties | 100 +- .../plaf/basic/resources/basic_it.properties | 66 +- .../plaf/basic/resources/basic_ja.properties | 190 +-- .../plaf/basic/resources/basic_ko.properties | 196 +-- .../basic/resources/basic_pt_BR.properties | 92 +- .../plaf/basic/resources/basic_sv.properties | 114 +- .../basic/resources/basic_zh_CN.properties | 176 +-- .../basic/resources/basic_zh_TW.properties | 178 +-- .../plaf/metal/resources/metal_de.properties | 22 +- .../plaf/metal/resources/metal_es.properties | 24 +- .../plaf/metal/resources/metal_fr.properties | 30 +- .../plaf/metal/resources/metal_it.properties | 16 +- .../plaf/metal/resources/metal_ja.properties | 58 +- .../plaf/metal/resources/metal_ko.properties | 58 +- .../metal/resources/metal_pt_BR.properties | 21 +- .../plaf/metal/resources/metal_sv.properties | 26 +- .../metal/resources/metal_zh_CN.properties | 52 +- .../metal/resources/metal_zh_TW.properties | 58 +- .../plaf/synth/resources/synth_de.properties | 22 +- .../plaf/synth/resources/synth_es.properties | 26 +- .../plaf/synth/resources/synth_fr.properties | 28 +- .../plaf/synth/resources/synth_it.properties | 19 +- .../plaf/synth/resources/synth_ja.properties | 50 +- .../plaf/synth/resources/synth_ko.properties | 54 +- .../synth/resources/synth_pt_BR.properties | 24 +- .../plaf/synth/resources/synth_sv.properties | 20 +- .../synth/resources/synth_zh_CN.properties | 44 +- .../synth/resources/synth_zh_TW.properties | 48 +- .../example/debug/tty/TTYResources_ja.java | 621 ++++----- .../example/debug/tty/TTYResources_zh_CN.java | 633 ++++----- .../sun/tools/jdi/resources/jdi_ja.properties | 98 +- .../tools/jdi/resources/jdi_zh_CN.properties | 90 +- .../applet/resources/MsgAppletViewer_de.java | 256 ++-- .../applet/resources/MsgAppletViewer_es.java | 272 ++-- .../applet/resources/MsgAppletViewer_fr.java | 290 ++-- .../applet/resources/MsgAppletViewer_it.java | 252 ++-- .../applet/resources/MsgAppletViewer_ja.java | 326 ++--- .../applet/resources/MsgAppletViewer_ko.java | 334 ++--- .../resources/MsgAppletViewer_pt_BR.java | 270 ++-- .../applet/resources/MsgAppletViewer_sv.java | 292 ++-- .../resources/MsgAppletViewer_zh_CN.java | 330 ++--- .../resources/MsgAppletViewer_zh_TW.java | 322 ++--- .../sun/awt/resources/awt_de.properties | 76 +- .../sun/awt/resources/awt_es.properties | 191 ++- .../sun/awt/resources/awt_fr.properties | 158 +-- .../sun/awt/resources/awt_it.properties | 62 +- .../sun/awt/resources/awt_ja.properties | 208 +-- .../sun/awt/resources/awt_ko.properties | 110 +- .../sun/awt/resources/awt_pt_BR.properties | 179 +-- .../sun/awt/resources/awt_sv.properties | 124 +- .../sun/awt/resources/awt_zh_CN.properties | 228 ++-- .../sun/awt/resources/awt_zh_TW.properties | 20 +- .../management/resources/agent_de.properties | 88 +- .../management/resources/agent_es.properties | 68 +- .../management/resources/agent_fr.properties | 64 +- .../management/resources/agent_it.properties | 30 +- .../management/resources/agent_ja.properties | 104 +- .../management/resources/agent_ko.properties | 104 +- .../resources/agent_pt_BR.properties | 68 +- .../management/resources/agent_sv.properties | 72 +- .../resources/agent_zh_CN.properties | 104 +- .../resources/agent_zh_TW.properties | 104 +- .../sun/misc/resources/Messages_de.java | 8 +- .../sun/misc/resources/Messages_es.java | 8 +- .../sun/misc/resources/Messages_fr.java | 8 +- .../sun/misc/resources/Messages_it.java | 6 +- .../sun/misc/resources/Messages_ja.java | 8 +- .../sun/misc/resources/Messages_ko.java | 8 +- .../sun/misc/resources/Messages_pt_BR.java | 11 +- .../sun/misc/resources/Messages_sv.java | 8 +- .../sun/misc/resources/Messages_zh_CN.java | 8 +- .../sun/misc/resources/Messages_zh_TW.java | 8 +- .../print/resources/serviceui_de.properties | 76 +- .../print/resources/serviceui_es.properties | 154 +-- .../print/resources/serviceui_fr.properties | 112 +- .../print/resources/serviceui_it.properties | 28 +- .../print/resources/serviceui_ja.properties | 214 +-- .../print/resources/serviceui_ko.properties | 244 ++-- .../resources/serviceui_pt_BR.properties | 116 +- .../print/resources/serviceui_sv.properties | 126 +- .../resources/serviceui_zh_CN.properties | 222 ++-- .../resources/serviceui_zh_TW.properties | 154 +-- .../resources/rmiregistry_de.properties | 9 +- .../resources/rmiregistry_es.properties | 9 +- .../resources/rmiregistry_fr.properties | 9 +- .../resources/rmiregistry_it.properties | 9 +- .../resources/rmiregistry_ja.properties | 10 +- .../resources/rmiregistry_ko.properties | 9 +- .../resources/rmiregistry_pt_BR.properties | 6 +- .../resources/rmiregistry_sv.properties | 9 +- .../resources/rmiregistry_zh_CN.properties | 9 +- .../resources/rmiregistry_zh_TW.properties | 9 +- .../sun/rmi/rmic/resources/rmic_ja.properties | 195 +-- .../rmi/rmic/resources/rmic_zh_CN.properties | 196 +-- .../rmi/server/resources/rmid_de.properties | 83 +- .../rmi/server/resources/rmid_es.properties | 83 +- .../rmi/server/resources/rmid_fr.properties | 83 +- .../rmi/server/resources/rmid_it.properties | 83 +- .../rmi/server/resources/rmid_ja.properties | 84 +- .../rmi/server/resources/rmid_ko.properties | 83 +- .../server/resources/rmid_pt_BR.properties | 44 +- .../rmi/server/resources/rmid_sv.properties | 83 +- .../server/resources/rmid_zh_CN.properties | 83 +- .../server/resources/rmid_zh_TW.properties | 82 +- .../security/tools/JarSignerResources_ja.java | 377 +++--- .../tools/JarSignerResources_zh_CN.java | 379 +++--- .../sun/security/util/AuthResources_de.java | 152 +-- .../sun/security/util/AuthResources_es.java | 150 +-- .../sun/security/util/AuthResources_fr.java | 150 +-- .../sun/security/util/AuthResources_it.java | 133 +- .../sun/security/util/AuthResources_ja.java | 156 +-- .../sun/security/util/AuthResources_ko.java | 156 +-- .../security/util/AuthResources_pt_BR.java | 181 ++- .../sun/security/util/AuthResources_sv.java | 154 +-- .../security/util/AuthResources_zh_CN.java | 156 +-- .../security/util/AuthResources_zh_TW.java | 156 +-- .../sun/security/util/Resources_de.java | 1073 +++++++-------- .../sun/security/util/Resources_es.java | 1051 ++++++++------- .../sun/security/util/Resources_fr.java | 1077 +++++++-------- .../sun/security/util/Resources_it.java | 1017 +++++++------- .../sun/security/util/Resources_ja.java | 1143 ++++++++-------- .../sun/security/util/Resources_ko.java | 1143 ++++++++-------- .../sun/security/util/Resources_pt_BR.java | 1175 +++++++++-------- .../sun/security/util/Resources_sv.java | 1065 +++++++-------- .../sun/security/util/Resources_zh_CN.java | 1137 ++++++++-------- .../sun/security/util/Resources_zh_TW.java | 1137 ++++++++-------- .../sun/tools/jar/resources/jar_de.properties | 88 +- .../sun/tools/jar/resources/jar_es.properties | 88 +- .../sun/tools/jar/resources/jar_fr.properties | 88 +- .../sun/tools/jar/resources/jar_it.properties | 88 +- .../sun/tools/jar/resources/jar_ja.properties | 84 +- .../sun/tools/jar/resources/jar_ko.properties | 88 +- .../tools/jar/resources/jar_pt_BR.properties | 30 +- .../sun/tools/jar/resources/jar_sv.properties | 88 +- .../tools/jar/resources/jar_zh_CN.properties | 86 +- .../tools/jar/resources/jar_zh_TW.properties | 88 +- .../tools/javac/resources/javac_ja.properties | 882 ++++--------- .../javac/resources/javac_zh_CN.properties | 885 ++++--------- .../resources/JConsoleResources_ja.java | 629 +++++---- .../resources/JConsoleResources_zh_CN.java | 645 +++++---- .../resources/MsgNative2ascii_ja.java | 15 +- .../resources/MsgNative2ascii_zh_CN.java | 15 +- .../tools/serialver/serialver_ja.properties | 32 +- .../serialver/serialver_zh_CN.properties | 33 +- .../logging/resources/logging_de.properties | 16 +- .../logging/resources/logging_es.properties | 16 +- .../logging/resources/logging_fr.properties | 16 +- .../logging/resources/logging_it.properties | 12 +- .../logging/resources/logging_ja.properties | 18 +- .../logging/resources/logging_ko.properties | 20 +- .../resources/logging_pt_BR.properties | 14 +- .../logging/resources/logging_sv.properties | 12 +- .../resources/logging_zh_CN.properties | 20 +- .../resources/logging_zh_TW.properties | 18 +- .../resources/codepoint_ja.properties | 5 +- .../resources/codepoint_zh_CN.properties | 5 +- .../resources/TextResources_ja.properties | 2 +- .../resources/TextResources_zh_CN.properties | 2 +- .../Notepad/resources/Notepad_ja.properties | 58 +- .../resources/Notepad_zh_CN.properties | 48 +- .../awt/windows/awtLocalization_es.properties | 2 +- .../awt/windows/awtLocalization_ja.properties | 4 +- .../awt/windows/awtLocalization_ko.properties | 4 +- .../windows/awtLocalization_pt_BR.properties | 2 +- .../windows/awtLocalization_zh_CN.properties | 4 +- .../windows/awtLocalization_zh_TW.properties | 2 +- .../windows/native/sun/jkernel/kernel_de.rc | 243 ++-- .../windows/native/sun/jkernel/kernel_es.rc | 243 ++-- .../windows/native/sun/jkernel/kernel_fr.rc | 242 ++-- .../windows/native/sun/jkernel/kernel_it.rc | 242 ++-- .../windows/native/sun/jkernel/kernel_ja.rc | 242 ++-- .../windows/native/sun/jkernel/kernel_ko.rc | 242 ++-- .../native/sun/jkernel/kernel_pt_BR.rc | 242 ++-- .../windows/native/sun/jkernel/kernel_sv.rc | 242 ++-- .../windows/native/sun/jkernel/kernel_zh.rc | 242 ++-- .../native/sun/jkernel/kernel_zh_TW.rc | 242 ++-- 228 files changed, 17053 insertions(+), 18514 deletions(-) diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties index d15468e28c0..1cedaeb67c2 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_de.properties @@ -13,72 +13,72 @@ # # accessible roles # -alert=Warnmeldung +alert=Alert awtcomponent=AWT-Komponente -checkbox=Kontrollk\u00e4stchen +checkbox=Kontrollk\u00E4stchen colorchooser=Farbauswahl -columnheader=Spaltenkopf +columnheader=Spalten-Header combobox=Kombinationsfeld canvas=Leinwand -desktopicon=Desktop-Symbol -desktoppane=Desktop-Bereich +desktopicon=Desktopsymbol +desktoppane=Desktopbereich dialog=Dialogfeld directorypane=Verzeichnisbereich -glasspane=Glasbereich +glasspane=Glass Pane filechooser=Dateiauswahl -filler=F\u00fcllbereich +filler=F\u00FCllbereich frame=Rahmen internalframe=Innerer Rahmen -label=Beschriftung -layeredpane=\u00dcberlagertes Teilfenster +label=Label +layeredpane=Layered Pane list=Liste listitem=Listenelement -menubar=Men\u00fcleiste -menu=Men\u00fc -menuitem=Men\u00fceintrag +menubar=Men\u00FCleiste +menu=Men\u00FC +menuitem=Men\u00FCpunkt optionpane=Optionsbereich pagetab=Registerkarte -pagetablist=Register -panel=Steuerbereich -passwordtext=Passworttext -popupmenu=Popup-Men\u00fc -progressbar=Fortschrittsanzeige -pushbutton=Schaltfl\u00e4che +pagetablist=Registerkartenliste +panel=Bereich +passwordtext=Kennworttext +popupmenu=Popup-Men\u00FC +progressbar=Fortschrittsbalken +pushbutton=Schaltfl\u00E4che radiobutton=Optionsfeld rootpane=Root-Bereich -rowheader=Zeilenkopf +rowheader=Zeilen-Header scrollbar=Bildlaufleiste scrollpane=Bildlaufbereich separator=Trennzeichen slider=Schieberegler -splitpane=Geteilter Anzeigebereich +splitpane=Split Pane swingcomponent=Swing-Komponente table=Tabelle text=Text tree=Baumstruktur -togglebutton=Umschaltfl\u00e4che +togglebutton=Umschaltfl\u00E4che toolbar=Symbolleiste tooltip=QuickInfo unknown=Unbekannt -viewport=Anzeigeschnittstelle +viewport=Viewport window=Fenster # # accessible relations # -labelFor=Beschriftung f\u00fcr +labelFor=Label f\u00FCr labeledBy=beschriftet von memberOf=Mitglied von -controlledBy=Gesteuert von -controllerFor=Steuerung f\u00fcr +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # active=aktiv armed=aktiviert -busy=belegt +busy=ausgelastet checked=markiert collapsed=ausgeblendet -editable=editierbar +editable=bearbeitbar expandable=erweiterbar expanded=eingeblendet enabled=aktiviert @@ -87,15 +87,15 @@ focused=fokussiert iconified=minimiert modal=modal multiline=mehrzeilig -multiselectable=mehrfach ausw\u00e4hlbar -opaque=verdeckt -pressed=gedr\u00fcckt +multiselectable=mehrfach ausw\u00E4hlbar +opaque=nicht transparent +pressed=gedr\u00FCckt resizable=skalierbar -selectable=w\u00e4hlbar -selected=ausgew\u00e4hlt +selectable=w\u00E4hlbar +selected=ausgew\u00E4hlt showing=angezeigt singleline=einzeilig -transient=tempor\u00e4r +transient=transient visible=sichtbar vertical=vertikal horizontal=horizontal @@ -109,10 +109,10 @@ toggle expand=ein-/ausblenden # # accessible relations # -flowsTo=flie\u00dft zu -flowsFrom=flie\u00dft von +flowsTo=flie\u00DFt zu +flowsFrom=flie\u00DFt von subwindowOf=Unterfenster von -parentWindowOf=\u00fcbergeordnetes Fenster von +parentWindowOf=\u00FCbergeordnetes Fenster von embeds=bettet ein embeddedBy=eingebettet in childNodeOf=untergeordneter Knoten von @@ -120,8 +120,8 @@ childNodeOf=untergeordneter Knoten von # # accessible roles # -header=Kopfzeile -footer=Fu\u00dfzeile +header=Header +footer=Footer paragraph=Absatz ruler=Lineal editbar=Bearbeitungsleiste @@ -130,9 +130,9 @@ progressMonitor=Fortschrittsmonitor # # accessible states # -managesDescendants=verwaltet abgeleitete Objekte +managesDescendants=verwaltet untergeordnete Objekte indeterminate=unbestimmt -truncated=gek\u00fcrzt +truncated=abgeschnitten # new for J2SE 1.6.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties index 2f744ef3c7d..fe065eda0a1 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_es.properties @@ -14,53 +14,53 @@ # accessible roles # alert=alerta -awtcomponent=Componente AWT -checkbox=casilla de verificaci\u00f3n +awtcomponent=componente AWT +checkbox=casilla de control colorchooser=selector de color columnheader=cabecera de columna combobox=cuadro combinado -canvas=superficie +canvas=lienzo desktopicon=icono de escritorio -desktoppane=tablero de escritorio -dialog=cuadro de di\u00e1logo -directorypane=tablero de directorio -glasspane=tablero de cristal +desktoppane=panel de escritorio +dialog=cuadro de di\u00E1logo +directorypane=panel de directorio +glasspane=panel de cristal filechooser=selector de archivos filler=rellenador frame=marco internalframe=marco interno label=etiqueta -layeredpane=tablero en capas +layeredpane=panel en capas list=lista listitem=elemento de lista -menubar=barra de men\u00fas -menu=men\u00fa -menuitem=elemento de men\u00fa -optionpane=tablero de opciones -pagetab=pesta\u00f1a de p\u00e1gina -pagetablist=lista de pesta\u00f1as de p\u00e1gina +menubar=barra de men\u00FAs +menu=men\u00FA +menuitem=elemento de men\u00FA +optionpane=panel de opciones +pagetab=separador de p\u00E1gina +pagetablist=lista de separadores de p\u00E1gina panel=panel -passwordtext=texto de contrase\u00f1a -popupmenu=men\u00fa emergente +passwordtext=texto de contrase\u00F1a +popupmenu=men\u00FA emergente progressbar=barra de progreso -pushbutton=bot\u00f3n de acci\u00f3n -radiobutton=bot\u00f3n de radio -rootpane=tablero ra\u00edz +pushbutton=bot\u00F3n +radiobutton=bot\u00F3n de radio +rootpane=panel ra\u00EDz rowheader=cabecera de filas scrollbar=barra de desplazamiento -scrollpane=tablero de desplazamiento +scrollpane=panel de desplazamiento separator=separador slider=deslizador -splitpane=tablero de divisi\u00f3n +splitpane=panel de divisi\u00F3n swingcomponent=componente swing table=tabla text=texto -tree=\u00e1rbol -togglebutton=bot\u00f3n conmutador +tree=\u00E1rbol +togglebutton=bot\u00F3n conmutador toolbar=barra de herramientas -tooltip=consejo de herramienta +tooltip=ayuda de burbuja unknown=desconocido -viewport=puerto de vista +viewport=viewport window=ventana # # accessible relations @@ -68,25 +68,25 @@ window=ventana labelFor=etiqueta para labeledBy=etiquetado por memberOf=miembro de -controlledBy=controlado por -controllerFor=controlador de +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # active=activo armed=armado busy=ocupado -checked=marcado -collapsed=contra\u00eddo +checked=activado +collapsed=reducido editable=editable expandable=ampliable expanded=ampliado -enabled=habilitado +enabled=activado focusable=enfocable focused=enfocado iconified=convertido en icono modal=modal -multiline=l\u00ednea m\u00faltiple +multiline=l\u00EDnea m\u00FAltiple multiselectable=multiseleccionable opaque=opaco pressed=pulsado @@ -94,15 +94,15 @@ resizable=redimensionable selectable=seleccionable selected=seleccionado showing=mostrando -singleline=l\u00ednea \u00fanica -transient=temporal +singleline=l\u00EDnea \u00FAnica +transient=transitorio visible=visible vertical=vertical horizontal=horizontal # # accessible actions # -toggle expand=activar/desactivar ampliaci\u00f3n +toggle expand=activar/desactivar ampliaci\u00F3n # new relations, roles and states for J2SE 1.5.0 @@ -112,9 +112,9 @@ toggle expand=activar/desactivar ampliaci\u00f3n flowsTo=llega a flowsFrom=procede de subwindowOf=ventana subordinada de -parentWindowOf=ventana superior de -embeds=incluye -embeddedBy=se incluye en +parentWindowOf=ventana principal de +embeds=embebe +embeddedBy=embebido por childNodeOf=nodo secundario de # @@ -122,15 +122,15 @@ childNodeOf=nodo secundario de # header=cabecera footer=pie -paragraph=p\u00e1rrafo +paragraph=p\u00E1rrafo ruler=regla -editbar=barra de edici\u00f3n -progressMonitor=monitor de progresi\u00f3n +editbar=barra de edici\u00F3n +progressMonitor=monitor de progreso # # accessible states # -managesDescendants=gestiona objetos subordinados +managesDescendants=gestiona descendientes indeterminate=indeterminado truncated=truncado diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties index b557bc64a30..f41a5427605 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_fr.properties @@ -14,95 +14,95 @@ # accessible roles # alert=alerte -awtcomponent=Composant AWT -checkbox=case \u00e0 cocher -colorchooser=s\u00e9lecteur de couleurs -columnheader=en-t\u00eate de colonne -combobox=bo\u00eete de dialogue mixte +awtcomponent=composant AWT +checkbox=case \u00E0 cocher +colorchooser=s\u00E9lecteur de couleurs +columnheader=en-t\u00EAte de colonne +combobox=liste d\u00E9roulante canvas=canevas -desktopicon=ic\u00f4ne de bureau -desktoppane=sous-fen\u00eatre de bureau -dialog=bo\u00eete de dialogue -directorypane=sous-fen\u00eatre de r\u00e9pertoires -glasspane=sous-fen\u00eatre de grossissement -filechooser=s\u00e9lecteur de fichiers -filler=\u00e9l\u00e9ment de remplissage +desktopicon=ic\u00F4ne de bureau +desktoppane=panneau de bureau +dialog=bo\u00EEte de dialogue +directorypane=panneau de r\u00E9pertoires +glasspane=panneau de grossissement +filechooser=s\u00E9lecteur de fichiers +filler=\u00E9l\u00E9ment de remplissage frame=cadre internalframe=cadre interne -label=\u00e9tiquette -layeredpane=sous-fen\u00eatre superpos\u00e9e +label=libell\u00E9 +layeredpane=panneau superpos\u00E9 list=liste -listitem=\u00e9l\u00e9ment de liste +listitem=\u00E9l\u00E9ment de liste menubar=barre de menus menu=menu menuitem=option de menu -optionpane=sous-fen\u00eatre d''options +optionpane=panneau d'options pagetab=onglet de page -pagetablist=liste d''onglets de page +pagetablist=liste d'onglets de page panel=panneau passwordtext=texte de mot de passe popupmenu=menu contextuel progressbar=barre de progression -pushbutton=bouton poussoir +pushbutton=bouton radiobutton=bouton radio -rootpane=sous-fen\u00eatre racine -rowheader=en-t\u00eate de ligne -scrollbar=barre de d\u00e9filement -scrollpane=sous-fen\u00eatre de d\u00e9filement -separator=s\u00e9parateur +rootpane=panneau racine +rowheader=en-t\u00EAte de ligne +scrollbar=barre de d\u00E9filement +scrollpane=panneau de d\u00E9filement +separator=s\u00E9parateur slider=curseur -splitpane=sous-fen\u00eatre divis\u00e9e -swingcomponent=composant de bascule +splitpane=panneau divis\u00E9 +swingcomponent=composant Swing table=tableau text=texte -tree=arbre +tree=arborescence togglebutton=bouton de basculement -toolbar=barre d''outils +toolbar=barre d'outils tooltip=info-bulle unknown=inconnu -viewport=cl\u00f4ture -window=fen\u00eatre +viewport=lucarne +window=fen\u00EAtre # # accessible relations # -labelFor=\u00e9tiquette de -labeledBy=libell\u00e9(e) par +labelFor=libell\u00E9 de +labeledBy=libell\u00E9 par memberOf=membre de -controlledBy=contr\u00f4l\u00e9 par -controllerFor=contr\u00f4leur pour +controlledBy=contr\u00F4l\u00E9 par +controllerFor=contr\u00F4leur pour # # accessible states # -active=actif(ve) -armed=arm\u00e9(e) -busy=occup\u00e9(e) -checked=coch\u00e9e -collapsed=r\u00e9duit(e) +active=actif +armed=arm\u00E9 +busy=occup\u00E9 +checked=coch\u00E9 +collapsed=r\u00E9duit editable=modifiable expandable=extensible -expanded=d\u00e9velopp\u00e9(e) -enabled=activ\u00e9(e) -focusable=zone d''entr\u00e9e possible -focused=avec zone d''entr\u00e9e -iconified=r\u00e9duit(e) \u00e0 une ic\u00f4ne -modal=modal(e) +expanded=d\u00E9velopp\u00E9 +enabled=activ\u00E9 +focusable=zone d'entr\u00E9e possible +focused=avec zone d'entr\u00E9e +iconified=r\u00E9duit \u00E0 une ic\u00F4ne +modal=modal multiline=ligne multiple -multiselectable=multis\u00e9lectionnable +multiselectable=multis\u00E9lectionnable opaque=opaque -pressed=enfonc\u00e9 +pressed=enfonc\u00E9 resizable=redimensionnable -selectable=s\u00e9lectionnable -selected=s\u00e9lectionn\u00e9(e) +selectable=s\u00E9lectionnable +selected=s\u00E9lectionn\u00E9 showing=montrant singleline=ligne unique -transient=transitoire +transient=non persistant visible=visible -vertical=vertical(e) -horizontal=horizontal(e) +vertical=vertical +horizontal=horizontal # # accessible actions # -toggle expand=basculer le d\u00e9veloppement +toggle expand=basculer le d\u00E9veloppement # new relations, roles and states for J2SE 1.5.0 @@ -111,35 +111,35 @@ toggle expand=basculer le d\u00e9veloppement # flowsTo=flux vers flowsFrom=flux depuis -subwindowOf=sous-fen\u00eatre de -parentWindowOf=fen\u00eatre parente de +subwindowOf=sous-fen\u00EAtre de +parentWindowOf=fen\u00EAtre parente de embeds=incorpore -embeddedBy=incorpor\u00e9 par -childNodeOf=n\u0153ud enfant de +embeddedBy=incorpor\u00E9 par +childNodeOf=noeud enfant de # # accessible roles # -header=en-t\u00eate +header=en-t\u00EAte footer=pied de page paragraph=paragraphe -ruler=r\u00e8gle -editbar=barre d'\u00e9dition -progressMonitor=contr\u00f4le de la progression +ruler=r\u00E8gle +editbar=barre d'\u00E9dition +progressMonitor=contr\u00F4le de la progression # # accessible states # -managesDescendants=g\u00e8re les descendants -indeterminate=ind\u00e9termin\u00e9 -truncated=tronqu\u00e9 +managesDescendants=g\u00E8re les descendants +indeterminate=ind\u00E9termin\u00E9 +truncated=tronqu\u00E9 # new for J2SE 1.6.0 # # accessible roles # -htmlcontainer=Conteneur HTML +htmlcontainer=conteneur HTML # # END OF MATERIAL TO LOCALIZE diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties index 54b888e7ed8..2d5cfa39504 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_it.properties @@ -13,45 +13,45 @@ # # accessible roles # -alert=allarme +alert=avviso awtcomponent=componente AWT checkbox=casella di controllo colorchooser=selezione colori columnheader=intestazione colonna -combobox=casella -canvas=area di disegno -desktopicon=icona del desktop -desktoppane=sottofinestra del desktop +combobox=casella combinata +canvas=sfondo +desktopicon=icona desktop +desktoppane=riquadro desktop dialog=finestra di dialogo -directorypane=sottofinestra della directory -glasspane=sottofinestra trasparente +directorypane=riquadro directory +glasspane=riquadro trasparente filechooser=selezione file -filler=utilit\u00e0 riempimento +filler=utilit\u00E0 riempimento frame=cornice internalframe=cornice interna label=etichetta -layeredpane=sottofinestra a livelli -list=elenco -listitem=voce di elenco +layeredpane=riquadro a livelli +list=lista +listitem=voce lista menubar=barra dei menu menu=menu menuitem=voce di menu -optionpane=sottofinestra delle opzioni +optionpane=riquadro opzioni pagetab=scheda pagina -pagetablist=elenco schede pagina +pagetablist=lista schede pagina panel=pannello passwordtext=testo della password -popupmenu=menu a comparsa +popupmenu=menu popup progressbar=barra di avanzamento pushbutton=pulsante radiobutton=pulsante di scelta -rootpane=sottofinestra root +rootpane=riquadro root rowheader=intestazione di riga scrollbar=barra di scorrimento -scrollpane=scorri sottofinestra +scrollpane=riquadro scorrimento separator=separatore -slider=cursore -splitpane=sottofinestra doppia +slider=dispositivo di scorrimento +splitpane=riquadro doppio swingcomponent=componente swing table=tabella text=testo @@ -68,8 +68,8 @@ window=finestra labelFor=etichetta per labeledBy=etichetta di memberOf=membro di -controlledBy=controllato da -controllerFor=controllore per +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # @@ -77,11 +77,11 @@ active=attivo armed=abilitato busy=occupato checked=verificato -collapsed=ingrandito +collapsed=compresso editable=modificabile expandable=espandibile expanded=espanso -enabled=attivato +enabled=abilitato focusable=attivabile in primo piano focused=in primo piano iconified=ridotto a icona @@ -121,7 +121,7 @@ childNodeOf=nodo figlio di # accessible roles # header=intestazione -footer=pi\u00e8 di pagina +footer=pi\u00E8 di pagina paragraph=paragrafo ruler=righello editbar=barra di modifica diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties index 7843ab31bc9..91bfc942117 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ja.properties @@ -13,133 +13,133 @@ # # accessible roles # -alert=\u8b66\u544a -awtcomponent=AWT \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 -checkbox=\u30c1\u30a7\u30c3\u30af\u30dc\u30c3\u30af\u30b9 -colorchooser=\u30ab\u30e9\u30fc\u30c1\u30e5\u30fc\u30b6 -columnheader=\u5217\u30d8\u30c3\u30c0 -combobox=\u30b3\u30f3\u30dc\u30dc\u30c3\u30af\u30b9 -canvas=\u30ad\u30e3\u30f3\u30d0\u30b9 -desktopicon=\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u30a2\u30a4\u30b3\u30f3 -desktoppane=\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\u533a\u753b -dialog=\u30c0\u30a4\u30a2\u30ed\u30b0 -directorypane=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u533a\u753b -glasspane=\u30ac\u30e9\u30b9\u533a\u753b -filechooser=\u30d5\u30a1\u30a4\u30eb\u30c1\u30e5\u30fc\u30b6 -filler=\u30d5\u30a3\u30e9\u30fc -frame=\u30d5\u30ec\u30fc\u30e0 -internalframe=\u5185\u90e8\u30d5\u30ec\u30fc\u30e0 -label=\u30e9\u30d9\u30eb -layeredpane=\u968e\u5c64\u5316\u3055\u308c\u305f\u533a\u753b -list=\u30ea\u30b9\u30c8 -listitem=\u30ea\u30b9\u30c8\u9805\u76ee -menubar=\u30e1\u30cb\u30e5\u30fc\u30d0\u30fc -menu=\u30e1\u30cb\u30e5\u30fc -menuitem=\u30e1\u30cb\u30e5\u30fc\u9805\u76ee -optionpane=\u30aa\u30d7\u30b7\u30e7\u30f3\u533a\u753b -pagetab=\u30da\u30fc\u30b8\u30bf\u30d6 -pagetablist=\u30da\u30fc\u30b8\u30bf\u30d6\u30ea\u30b9\u30c8 -panel=\u30d1\u30cd\u30eb -passwordtext=\u30d1\u30b9\u30ef\u30fc\u30c9\u30c6\u30ad\u30b9\u30c8 -popupmenu=\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u30e1\u30cb\u30e5\u30fc -progressbar=\u9032\u6357\u30d0\u30fc -pushbutton=\u30d7\u30c3\u30b7\u30e5\u30dc\u30bf\u30f3 -radiobutton=\u30e9\u30b8\u30aa\u30dc\u30bf\u30f3 -rootpane=\u30eb\u30fc\u30c8\u533a\u753b -rowheader=\u884c\u30d8\u30c3\u30c0 -scrollbar=\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc -scrollpane=\u30b9\u30af\u30ed\u30fc\u30eb\u533a\u753b -separator=\u30bb\u30d1\u30ec\u30fc\u30bf -slider=\u30b9\u30e9\u30a4\u30c0 -splitpane=\u5206\u5272\u533a\u753b -swingcomponent=Swing \u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8 -table=\u30c6\u30fc\u30d6\u30eb -text=\u30c6\u30ad\u30b9\u30c8 -tree=\u30c4\u30ea\u30fc -togglebutton=\u30c8\u30b0\u30eb\u30dc\u30bf\u30f3 -toolbar=\u30c4\u30fc\u30eb\u30d0\u30fc -tooltip=\u30c4\u30fc\u30eb\u30d2\u30f3\u30c8 -unknown=\u672a\u77e5 -viewport=\u30d3\u30e5\u30fc\u30dd\u30fc\u30c8 -window=\u30a6\u30a3\u30f3\u30c9\u30a6 +alert=\u30A2\u30E9\u30FC\u30C8 +awtcomponent=AWT\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 +checkbox=\u30C1\u30A7\u30C3\u30AF\u30FB\u30DC\u30C3\u30AF\u30B9 +colorchooser=\u30AB\u30E9\u30FC\u30FB\u30C1\u30E5\u30FC\u30B6 +columnheader=\u5217\u30D8\u30C3\u30C0\u30FC +combobox=\u30B3\u30F3\u30DC\u30FB\u30DC\u30C3\u30AF\u30B9 +canvas=\u30AD\u30E3\u30F3\u30D0\u30B9 +desktopicon=\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u30FB\u30A2\u30A4\u30B3\u30F3 +desktoppane=\u30C7\u30B9\u30AF\u30C8\u30C3\u30D7\u533A\u753B +dialog=\u30C0\u30A4\u30A2\u30ED\u30B0 +directorypane=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u533A\u753B +glasspane=\u30AC\u30E9\u30B9\u533A\u753B +filechooser=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6 +filler=\u30D5\u30A3\u30E9\u30FC +frame=\u30D5\u30EC\u30FC\u30E0 +internalframe=\u5185\u90E8\u30D5\u30EC\u30FC\u30E0 +label=\u30E9\u30D9\u30EB +layeredpane=\u968E\u5C64\u5316\u3055\u308C\u305F\u533A\u753B +list=\u30EA\u30B9\u30C8 +listitem=\u30EA\u30B9\u30C8\u9805\u76EE +menubar=\u30E1\u30CB\u30E5\u30FC\u30FB\u30D0\u30FC +menu=\u30E1\u30CB\u30E5\u30FC +menuitem=\u30E1\u30CB\u30E5\u30FC\u9805\u76EE +optionpane=\u30AA\u30D7\u30B7\u30E7\u30F3\u533A\u753B +pagetab=\u30DA\u30FC\u30B8\u30FB\u30BF\u30D6 +pagetablist=\u30DA\u30FC\u30B8\u30FB\u30BF\u30D6\u30FB\u30EA\u30B9\u30C8 +panel=\u30D1\u30CD\u30EB +passwordtext=\u30D1\u30B9\u30EF\u30FC\u30C9\u30FB\u30C6\u30AD\u30B9\u30C8 +popupmenu=\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7\u30FB\u30E1\u30CB\u30E5\u30FC +progressbar=\u9032\u6357\u30D0\u30FC +pushbutton=\u30D7\u30C3\u30B7\u30E5\u30FB\u30DC\u30BF\u30F3 +radiobutton=\u30E9\u30B8\u30AA\u30FB\u30DC\u30BF\u30F3 +rootpane=\u30EB\u30FC\u30C8\u533A\u753B +rowheader=\u884C\u30D8\u30C3\u30C0\u30FC +scrollbar=\u30B9\u30AF\u30ED\u30FC\u30EB\u30FB\u30D0\u30FC +scrollpane=\u30B9\u30AF\u30ED\u30FC\u30EB\u533A\u753B +separator=\u30BB\u30D1\u30EC\u30FC\u30BF +slider=\u30B9\u30E9\u30A4\u30C0 +splitpane=\u5206\u5272\u533A\u753B +swingcomponent=Swing\u30B3\u30F3\u30DD\u30FC\u30CD\u30F3\u30C8 +table=\u8868 +text=\u30C6\u30AD\u30B9\u30C8 +tree=\u30C4\u30EA\u30FC +togglebutton=\u30C8\u30B0\u30EB\u30FB\u30DC\u30BF\u30F3 +toolbar=\u30C4\u30FC\u30EB\u30D0\u30FC +tooltip=\u30C4\u30FC\u30EB\u30C1\u30C3\u30D7 +unknown=\u4E0D\u660E +viewport=\u30D3\u30E5\u30FC\u30DD\u30FC\u30C8 +window=\u30A6\u30A3\u30F3\u30C9\u30A6 # # accessible relations # -labelFor=\u30e9\u30d9\u30eb\u5143 -labeledBy=\u30e9\u30d9\u30eb\u5148 -memberOf=\u6240\u5c5e\u30e1\u30f3\u30d0 -controlledBy=\u5236\u5fa1\u5bfe\u8c61 -controllerFor=\u5236\u5fa1\u5143 +labelFor=label for +labeledBy=labeled by +memberOf=member of +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # -active=\u30a2\u30af\u30c6\u30a3\u30d6 -armed=\u4f5c\u52d5\u6e96\u5099\u5b8c\u4e86 -busy=\u30d3\u30b8\u30fc -checked=\u30c1\u30a7\u30c3\u30af -collapsed=\u77ed\u7e2e -editable=\u7de8\u96c6\u53ef\u80fd -expandable=\u5c55\u958b\u53ef\u80fd -expanded=\u5c55\u958b -enabled=\u6709\u52b9 -focusable=\u30d5\u30a9\u30fc\u30ab\u30b9\u53ef\u80fd -focused=\u30d5\u30a9\u30fc\u30ab\u30b9 -iconified=\u30a2\u30a4\u30b3\u30f3\u5316 -modal=\u30e2\u30fc\u30c0\u30eb -multiline=\u8907\u6570\u884c -multiselectable=\u8907\u6570\u9078\u629e\u53ef\u80fd -opaque=\u4e0d\u900f\u660e -pressed=\u62bc\u4e0b -resizable=\u30b5\u30a4\u30ba\u5909\u66f4\u53ef\u80fd -selectable=\u9078\u629e\u53ef\u80fd -selected=\u9078\u629e -showing=\u8868\u793a -singleline=\u5358\u4e00\u884c -transient=\u4e00\u6642 -visible=\u53ef\u8996 -vertical=\u5782\u76f4 -horizontal=\u6c34\u5e73 +active=\u30A2\u30AF\u30C6\u30A3\u30D6 +armed=\u4F5C\u52D5\u6E96\u5099\u5B8C\u4E86 +busy=\u30D3\u30B8\u30FC +checked=\u30C1\u30A7\u30C3\u30AF +collapsed=\u77ED\u7E2E +editable=\u7DE8\u96C6\u53EF\u80FD +expandable=\u5C55\u958B\u53EF\u80FD +expanded=\u5C55\u958B +enabled=\u6709\u52B9 +focusable=\u30D5\u30A9\u30FC\u30AB\u30B9\u53EF\u80FD +focused=\u30D5\u30A9\u30FC\u30AB\u30B9 +iconified=\u30A2\u30A4\u30B3\u30F3\u5316 +modal=\u30E2\u30FC\u30C0\u30EB +multiline=\u8907\u6570\u884C +multiselectable=\u8907\u6570\u9078\u629E\u53EF\u80FD +opaque=\u4E0D\u900F\u660E +pressed=\u62BC\u4E0B +resizable=\u30B5\u30A4\u30BA\u5909\u66F4\u53EF\u80FD +selectable=\u9078\u629E\u53EF\u80FD +selected=\u9078\u629E +showing=\u8868\u793A +singleline=\u5358\u4E00\u884C +transient=\u4E00\u6642 +visible=\u53EF\u8996 +vertical=\u5782\u76F4 +horizontal=\u6C34\u5E73 # # accessible actions # -toggle expand=\u30c8\u30b0\u30eb\u5c55\u958b +toggle expand=\u30C8\u30B0\u30EB\u5C55\u958B # new relations, roles and states for J2SE 1.5.0 # # accessible relations # -flowsTo=\u30d5\u30ed\u30fc\u5148 -flowsFrom=\u30d5\u30ed\u30fc\u5143 -subwindowOf=\u30b5\u30d6\u30a6\u30a3\u30f3\u30c9\u30a6 -parentWindowOf=\u89aa\u30a6\u30a3\u30f3\u30c9\u30a6 -embeds=\u57cb\u3081\u8fbc\u307f -embeddedBy=\u57cb\u3081\u8fbc\u307f\u5143 -childNodeOf=\u5b50\u30ce\u30fc\u30c9 +flowsTo=flows to +flowsFrom=flows from +subwindowOf=subwindow of +parentWindowOf=parent window of +embeds=\u57CB\u8FBC\u307F +embeddedBy=embedded by +childNodeOf=child node of # # accessible roles # -header=\u30d8\u30c3\u30c0 -footer=\u30d5\u30c3\u30bf -paragraph=\u30d1\u30e9\u30b0\u30e9\u30d5 -ruler=\u30eb\u30fc\u30e9 -editbar=\u7de8\u96c6\u30d0\u30fc -progressMonitor=\u9032\u6357\u30e2\u30cb\u30bf +header=\u30D8\u30C3\u30C0\u30FC +footer=\u30D5\u30C3\u30BF\u30FC +paragraph=\u6BB5\u843D +ruler=\u30EB\u30FC\u30E9\u30FC +editbar=\u7DE8\u96C6\u30D0\u30FC +progressMonitor=\u9032\u6357\u30E2\u30CB\u30BF\u30FC # # accessible states # -managesDescendants=\u5b50\u5b6b\u3092\u7ba1\u7406 -indeterminate=\u4e0d\u78ba\u5b9a -truncated=\u4e0d\u5b8c\u5168 +managesDescendants=\u5B50\u5B6B\u3092\u7BA1\u7406 +indeterminate=\u4E0D\u78BA\u5B9A +truncated=\u4E0D\u5B8C\u5168 # new for J2SE 1.6.0 # # accessible roles # -htmlcontainer=HTML \u30b3\u30f3\u30c6\u30ca +htmlcontainer=HTML\u30B3\u30F3\u30C6\u30CA # # END OF MATERIAL TO LOCALIZE diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties index 8f94f54e0ff..bb4e95d1cc0 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_ko.properties @@ -13,133 +13,133 @@ # # accessible roles # -alert=\uacbd\uace0 -awtcomponent=AWT \uad6c\uc131\uc694\uc18c -checkbox=\ud655\uc778\ub780 -colorchooser=\uc0c9\uc0c1 \uc120\ud0dd\uae30 -columnheader=\uc5f4 \uba38\ub9ac\uae00 -combobox=\ucf64\ubcf4 \uc0c1\uc790 -canvas=\uce94\ubc84\uc2a4 -desktopicon=\ub370\uc2a4\ud06c\ud0d1 \uc544\uc774\ucf58 -desktoppane=\ub370\uc2a4\ud06c\ud0d1 \ud45c\uc2dc \uc601\uc5ed -dialog=\ub300\ud654 \uc0c1\uc790 -directorypane=\ub514\ub809\ud1a0\ub9ac \ud45c\uc2dc \uc601\uc5ed -glasspane=\uae00\ub798\uc2a4 \ud45c\uc2dc \uc601\uc5ed -filechooser=\ud30c\uc77c \uc120\ud0dd\uae30 -filler=\ud544\ub7ec -frame=\ud504\ub808\uc784 -internalframe=\ub0b4\ubd80 \ud504\ub808\uc784 -label=\ub808\uc774\ube14 -layeredpane=\uacc4\uce35 \ud45c\uc2dc \uc601\uc5ed -list=\ubaa9\ub85d -listitem=\ubaa9\ub85d \ud56d\ubaa9 -menubar=\uba54\ub274 \ud45c\uc2dc\uc904 -menu=\uba54\ub274 -menuitem=\uba54\ub274 \ud56d\ubaa9 -optionpane=\uc635\uc158 \ud45c\uc2dc \uc601\uc5ed -pagetab=\ud398\uc774\uc9c0 \ud0ed -pagetablist=\ud398\uc774\uc9c0 \ud0ed \ubaa9\ub85d -panel=\ud328\ub110 -passwordtext=\uc554\ud638 \ud14d\uc2a4\ud2b8 -popupmenu=\ud31d\uc5c5 \uba54\ub274 -progressbar=\uc9c4\ud589 \ub9c9\ub300 -pushbutton=\ub204\ub984 \ubc84\ud2bc -radiobutton=\ub77c\ub514\uc624 \ubc84\ud2bc -rootpane=\ub8e8\ud2b8 \ud45c\uc2dc \uc601\uc5ed -rowheader=\ud589 \uba38\ub9ac\uae00 -scrollbar=\uc2a4\ud06c\ub864 \ub9c9\ub300 -scrollpane=\uc2a4\ud06c\ub864 \ud45c\uc2dc \uc601\uc5ed -separator=\uad6c\ubd84\uc790 -slider=\uc2ac\ub77c\uc774\ub354 -splitpane=\ubd84\ud560 \ud45c\uc2dc \uc601\uc5ed -swingcomponent=swing \uad6c\uc131\uc694\uc18c -table=\ud14c\uc774\ube14 -text=\ud14d\uc2a4\ud2b8 -tree=\ud2b8\ub9ac -togglebutton=\ud1a0\uae00 \ubc84\ud2bc -toolbar=\ub3c4\uad6c \ubaa8\uc74c -tooltip=\ub3c4\uad6c \ud301 -unknown=\uc54c\uc218 \uc5c6\uc74c -viewport=\ubdf0\ud3ec\ud2b8 -window=\ucc3d +alert=\uACBD\uBCF4 +awtcomponent=AWT \uAD6C\uC131 \uC694\uC18C +checkbox=\uCCB4\uD06C \uBC15\uC2A4 +colorchooser=\uC0C9\uC0C1 \uC120\uD0DD\uAE30 +columnheader=\uC5F4 \uBA38\uB9AC\uAE00 +combobox=\uCF64\uBCF4 \uC0C1\uC790 +canvas=\uCE94\uBC84\uC2A4 +desktopicon=\uBC14\uD0D5 \uD654\uBA74 \uC544\uC774\uCF58 +desktoppane=\uBC14\uD0D5 \uD654\uBA74 \uCC3D +dialog=\uB300\uD654\uC0C1\uC790 +directorypane=\uB514\uB809\uD1A0\uB9AC \uCC3D +glasspane=\uAE00\uB798\uC2A4 \uCC3D +filechooser=\uD30C\uC77C \uC120\uD0DD\uAE30 +filler=\uD544\uB7EC +frame=\uD504\uB808\uC784 +internalframe=\uB0B4\uBD80 \uD504\uB808\uC784 +label=\uB808\uC774\uBE14 +layeredpane=\uACC4\uCE35\uC801 \uCC3D +list=\uBAA9\uB85D +listitem=\uBAA9\uB85D \uD56D\uBAA9 +menubar=\uBA54\uB274 \uD45C\uC2DC\uC904 +menu=\uBA54\uB274 +menuitem=\uBA54\uB274 \uD56D\uBAA9 +optionpane=\uC635\uC158 \uCC3D +pagetab=\uD398\uC774\uC9C0 \uD0ED +pagetablist=\uD398\uC774\uC9C0 \uD0ED \uBAA9\uB85D +panel=\uD328\uB110 +passwordtext=\uBE44\uBC00\uBC88\uD638 \uD14D\uC2A4\uD2B8 +popupmenu=\uD31D\uC5C5 \uBA54\uB274 +progressbar=\uC9C4\uD589 \uB9C9\uB300 +pushbutton=\uB204\uB984 \uB2E8\uCD94 +radiobutton=\uB77C\uB514\uC624 \uB2E8\uCD94 +rootpane=\uB8E8\uD2B8 \uCC3D +rowheader=\uD589 \uBA38\uB9AC\uAE00 +scrollbar=\uC2A4\uD06C\uB864 \uB9C9\uB300 +scrollpane=\uC2A4\uD06C\uB864 \uCC3D +separator=\uAD6C\uBD84 \uAE30\uD638 +slider=\uC2AC\uB77C\uC774\uB354 +splitpane=\uBD84\uD560 \uCC3D +swingcomponent=\uD68C\uC804 \uAD6C\uC131 \uC694\uC18C +table=\uD14C\uC774\uBE14 +text=\uD14D\uC2A4\uD2B8 +tree=\uD2B8\uB9AC +togglebutton=\uD1A0\uAE00 \uB2E8\uCD94 +toolbar=\uB3C4\uAD6C \uBAA8\uC74C +tooltip=\uB3C4\uAD6C \uC124\uBA85 +unknown=\uC54C \uC218 \uC5C6\uC74C +viewport=\uBDF0\uD3EC\uD2B8 +window=\uCC3D # # accessible relations # -labelFor=\ub808\uc774\ube14 \ub300\uc0c1 -labeledBy=\ub808\uc774\ube14 \uc9c0\uc815\uc790 -memberOf=\ub2e4\uc74c\uc758 \uad6c\uc131\uc6d0 -controlledBy=\uc81c\uc5b4\uc790 -controllerFor=\uc81c\uc5b4\uae30 \ub300\uc0c1 +labelFor=\uB808\uC774\uBE14 \uB300\uC0C1 +labeledBy=\uB808\uC774\uBE14 \uC9C0\uC815\uC790 +memberOf=\uC18C\uC18D \uADF8\uB8F9 +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # -active=\ud65c\uc131 -armed=\ud06c\uae30 -busy=\uc0ac\uc6a9 \uc911 -checked=\uc120\ud0dd\ub428 -collapsed=\ucd95\uc18c\ub428 -editable=\ud3b8\uc9d1 \uac00\ub2a5 -expandable=\ud655\uc7a5 \uac00\ub2a5 -expanded=\ud655\uc7a5\ub428 -enabled=\ud65c\uc131\ud654\ub428 -focusable=\ud3ec\ucee4\uc2a4 \uac00\ub2a5 -focused=\ud3ec\ucee4\uc2a4 \uc9c0\uc815\ub428 -iconified=\uc544\uc774\ucf58\ud654\ub428 -modal=\ubaa8\ub2ec -multiline=\ubcf5\uc218 \ud589 -multiselectable=\ubcf5\uc218\ub85c \uc120\ud0dd \uac00\ub2a5 -opaque=\ubd88\ud22c\uba85 -pressed=\ub204\ub984 -resizable=\ud06c\uae30 \uc870\uc815 \uac00\ub2a5 -selectable=\uc120\ud0dd \uac00\ub2a5 -selected=\uc120\ud0dd\ub428 -showing=\ud45c\uc2dc -singleline=\ub2e8\uc120 -transient=\uc77c\uc2dc -visible=\uac00\uc2dc -vertical=\uc218\uc9c1 -horizontal=\uc218\ud3c9 +active=\uD65C\uC131 +armed=\uD06C\uAE30 +busy=\uC0AC\uC6A9 \uC911 +checked=\uC120\uD0DD\uB428 +collapsed=\uCD95\uC18C\uB428 +editable=\uD3B8\uC9D1 \uAC00\uB2A5 +expandable=\uD655\uC7A5 \uAC00\uB2A5 +expanded=\uD655\uC7A5\uB428 +enabled=\uC0AC\uC6A9 +focusable=\uD3EC\uCEE4\uC2A4 \uAC00\uB2A5 +focused=\uD3EC\uCEE4\uC2A4\uB428 +iconified=\uC544\uC774\uCF58\uD654\uB428 +modal=\uBAA8\uB2EC +multiline=\uBCF5\uC218 \uD589 +multiselectable=\uB2E4\uC911 \uC120\uD0DD \uAC00\uB2A5 +opaque=\uBD88\uD22C\uBA85 +pressed=\uB204\uB984 +resizable=\uD06C\uAE30 \uC870\uC815 \uAC00\uB2A5 +selectable=\uC120\uD0DD \uAC00\uB2A5 +selected=\uC120\uD0DD\uB428 +showing=\uD45C\uC2DC +singleline=\uD55C \uC904 +transient=\uC77C\uC2DC +visible=\uD45C\uC2DC \uAC00\uB2A5 +vertical=\uC138\uB85C +horizontal=\uAC00\uB85C # # accessible actions # -toggle expand=\ud1a0\uae00 \ud655\uc7a5 +toggle \uD655\uC7A5=\uD1A0\uAE00 \uD655\uC7A5 # new relations, roles and states for J2SE 1.5.0 # # accessible relations # -flowsTo=(\uc73c)\ub85c \ud750\ub984 -flowsFrom=\uc5d0\uc11c \ud750\ub984 -subwindowOf=\ud558\uc704 \ucc3d -parentWindowOf=\uc0c1\uc704 \ucc3d -embeds=\uc744(\ub97c) \ud3ec\ud568 -embeddedBy=\uc5d0 \ud3ec\ud568 -childNodeOf=\ud558\uc704 \ub178\ub4dc +flowsTo=\uD750\uB984 \uB300\uC0C1 +flowsFrom=\uD750\uB984 \uCD9C\uCC98 +subwindowOf=\uD558\uC704 \uCC3D +parentWindowOf=\uC0C1\uC704 \uCC3D +embeds=\uD3EC\uD568 +embeddedBy=\uD3EC\uD568 \uC8FC\uCCB4 +childNodeOf=\uD558\uC704 \uB178\uB4DC # # accessible roles # -header=\uba38\ub9ac\ub9d0 -footer=\uaf2c\ub9ac\ub9d0 -paragraph=\ub2e8\ub77d -ruler=\ub208\uae08\uc790 -editbar=\ud3b8\uc9d1 \ub3c4\uad6c -progressMonitor=\uc9c4\ud589 \ubaa8\ub2c8\ud130 +header=\uBA38\uB9AC\uAE00 +footer=\uBC14\uB2E5\uAE00 +paragraph=\uB2E8\uB77D +ruler=\uB208\uAE08\uC790 +editbar=\uD3B8\uC9D1 \uB3C4\uAD6C +progressMonitor=\uC9C4\uD589 \uBAA8\uB2C8\uD130 # # accessible states # -managesDescendants=\ud558\uc704 \ud56d\ubaa9 \uad00\ub9ac -indeterminate=\ubd80\uc815 -truncated=\uc0dd\ub7b5 +managesDescendants=\uC885\uC18D \uD56D\uBAA9 \uAD00\uB9AC +indeterminate=\uD655\uC815\uB418\uC9C0 \uC54A\uC74C +truncated=\uC798\uB9BC # new for J2SE 1.6.0 # # accessible roles # -htmlcontainer=HTML \ucee8\ud14c\uc774\ub108 +htmlcontainer=HTML \uCEE8\uD14C\uC774\uB108 # # END OF MATERIAL TO LOCALIZE diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties index 8cd9de0b253..cad33b19f01 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_pt_BR.properties @@ -15,38 +15,38 @@ # alert=alerta awtcomponent=componente AWT -checkbox=caixa de sele\u00e7\u00e3o +checkbox=caixa de sele\u00E7\u00E3o colorchooser=seletor de cores -columnheader=cabe\u00e7alho da coluna -combobox=caixa de combina\u00e7\u00e3o +columnheader=cabe\u00E7alho da coluna +combobox=caixa de combina\u00E7\u00E3o canvas=tela -desktopicon=\u00edcone da \u00e1rea de trabalho -desktoppane=painel da \u00e1rea de trabalho -dialog=caixa de di\u00e1logo -directorypane=painel do diret\u00f3rio +desktopicon=\u00EDcone da \u00E1rea de trabalho +desktoppane=painel da \u00E1rea de trabalho +dialog=caixa de di\u00E1logo +directorypane=painel do diret\u00F3rio glasspane=painel transparente filechooser=seletor de arquivos -filler=preenchimento +filler=preenchedor frame=quadro internalframe=quadro interno -label=r\u00f3tulo +label=r\u00F3tulo layeredpane=painel em camadas list=lista listitem=item da lista menubar=barra de menus menu=menu menuitem=item do menu -optionpane=painel de op\u00e7\u00f5es -pagetab=aba da p\u00e1gina -pagetablist=lista de abas da p\u00e1gina +optionpane=painel de op\u00E7\u00F5es +pagetab=guia da p\u00E1gina +pagetablist=lista de guias da p\u00E1gina panel=painel passwordtext=texto da senha popupmenu=menu pop-up progressbar=barra de progresso -pushbutton=bot\u00e3o de a\u00e7\u00e3o -radiobutton=bot\u00e3o de op\u00e7\u00e3o +pushbutton=bot\u00E3o de a\u00E7\u00E3o +radiobutton=bot\u00E3o de op\u00E7\u00E3o rootpane=painel base -rowheader=cabe\u00e7alho da linha +rowheader=cabe\u00E7alho da linha scrollbar=barra de rolagem scrollpane=painel de rolagem separator=separador @@ -55,19 +55,19 @@ splitpane=painel dividido swingcomponent=componente swing table=tabela text=texto -tree=\u00e1rvore -togglebutton=bot\u00e3o de altern\u00e2ncia +tree=\u00E1rvore +togglebutton=bot\u00E3o de altern\u00E2ncia toolbar=barra de ferramentas tooltip=dica de ferramenta unknown=desconhecido -viewport=janela de visualiza\u00e7\u00e3o +viewport=janela de visualiza\u00E7\u00E3o window=janela # # accessible relations # -labelFor=r\u00f3tulo de +labelFor=r\u00F3tulo de labeledBy=rotulado por -memberOf=membro de +memberOf=membro de controlledBy=controlledBy controllerFor=controllerFor # @@ -78,31 +78,31 @@ armed=armado busy=ocupado checked=selecionado collapsed=recolhido -editable=edit\u00e1vel -expandable=expans\u00edvel +editable=edit\u00E1vel +expandable=expans\u00EDvel expanded=expandido -enabled=habilitado -focusable=focaliz\u00e1vel +enabled=ativado +focusable=focaliz\u00E1vel focused=focalizado iconified=iconizado modal=modal -multiline=v\u00e1rias linhas -multiselectable=m\u00faltipla escolha +multiline=v\u00E1rias linhas +multiselectable=m\u00FAltipla escolha opaque=opaco pressed=pressionado -resizable=redimension\u00e1vel -selectable=selecion\u00e1vel +resizable=redimension\u00E1vel +selectable=selecion\u00E1vel selected=selecionado -showing=exibindo -singleline=linha \u00fanica -transient=transit\u00f3rio -visible=vis\u00edvel +showing=mostrando +singleline=linha \u00FAnica +transient=transit\u00F3rio +visible=vis\u00EDvel vertical=vertical horizontal=horizontal # # accessible actions # -toggle expandir=alternar expandir +toggle expandir=alternar expans\u00E3o # new relations, roles and states for J2SE 1.5.0 @@ -115,16 +115,16 @@ subwindowOf=subjanela de parentWindowOf=janela pai de embeds=integra embeddedBy=integrado por -childNodeOf=n\u00f3 filho de +childNodeOf=n\u00F3 filho de # # accessible roles # -header=cabe\u00e7alho -footer=rodap\u00e9 -paragraph=par\u00e1grafo -ruler=r\u00e9gua -editbar=barra de edi\u00e7\u00e3o +header=cabe\u00E7alho +footer=rodap\u00E9 +paragraph=par\u00E1grafo +ruler=r\u00E9gua +editbar=barra de edi\u00E7\u00E3o progressMonitor=monitor de progresso # @@ -139,7 +139,7 @@ truncated=truncado # # accessible roles # -htmlcontainer=cont\u00eainer HTML +htmlcontainer=Container de HTML # # END OF MATERIAL TO LOCALIZE diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties index f028855d65f..337b6720d9e 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_sv.properties @@ -13,109 +13,109 @@ # # accessible roles # -alert=varning +alert=avisering awtcomponent=AWT-komponent checkbox=kryssruta -colorchooser=f\u00e4rgv\u00e4ljare +colorchooser=f\u00E4rgv\u00E4ljare columnheader=kolumnrubrik combobox=kombinationsruta -canvas=bakgrund +canvas=rityta desktopicon=skrivbordsikon desktoppane=skrivbordsruta dialog=dialogruta directorypane=katalogruta glasspane=glasruta -filechooser=filv\u00e4ljare +filechooser=filv\u00E4ljare filler=utfyllnad frame=ram internalframe=intern ram label=etikett layeredpane=staplad ruta list=lista -listitem=listelement -menubar=menylist +listitem=listobjekt +menubar=menyrad menu=meny menuitem=menyalternativ optionpane=alternativruta pagetab=sidflik pagetablist=sidflikslista panel=panel -passwordtext=l\u00f6senordstext +passwordtext=l\u00F6senordstext popupmenu=snabbmeny -progressbar=statuslist +progressbar=statusrad pushbutton=knapp -radiobutton=envalsknapp +radiobutton=alternativknapp rootpane=grundruta -rowheader=radhuvud -scrollbar=bl\u00e4ddringslist -scrollpane=bl\u00e4dderruta +rowheader=radrubrik +scrollbar=rullningslist +scrollpane=rullningsruta separator=avskiljare slider=skjutreglage splitpane=delad ruta swingcomponent=swing-komponent table=tabell text=text -tree=tr\u00e4d -togglebutton=v\u00e4xlingsknapp +tree=tr\u00E4d +togglebutton=v\u00E4xlingsknapp toolbar=verktygsrad tooltip=knappbeskrivning -unknown=ok\u00e4nd +unknown=ok\u00E4nd viewport=vyport -window=f\u00f6nster +window=f\u00F6nster # # accessible relations # -labelFor=etikett f\u00f6r +labelFor=etikett f\u00F6r labeledBy=etikett av memberOf=medlem i -controlledBy=kontrolleratAv -controllerFor=styrenhetF\u00f6r +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # active=aktiv -armed=anv\u00e4nd +armed=redo busy=upptagen checked=markerad -collapsed=inf\u00e4lld +collapsed=komprimerad editable=redigerbar -expandable=ut\u00f6kningsbar -expanded=ut\u00f6kad +expandable=ut\u00F6kningsbar +expanded=ut\u00F6kad enabled=aktiverad focusable=fokuseringsbar focused=fokuserad iconified=minimerad -modal=tillst\u00e5ndsberoende -multiline=flera linjer -multiselectable=multivalbar -opaque=ogenomskinlig +modal=modal +multiline=flera rader +multiselectable=flerval +opaque=t\u00E4ckande pressed=nedtryckt -resizable=storleks\u00e4ndringsbar -selectable=markeringsbar +resizable=storleks\u00E4ndringsbar +selectable=valbar selected=vald -showing=visa +showing=visas singleline=en rad -transient=flytande +transient=tillf\u00E4llig visible=synlig vertical=vertikal horizontal=horisontell # # accessible actions # -toggle expand=v\u00e4xla ut\u00f6ka +toggle ut\u00F6ka=v\u00E4xla ut\u00F6ka # new relations, roles and states for J2SE 1.5.0 # # accessible relations # -flowsTo=fl\u00f6dar till -flowsFrom=fl\u00f6dar fr\u00e5n -subwindowOf=delf\u00f6nster av -parentWindowOf=\u00f6verordnat f\u00f6nster f\u00f6r -embeds=b\u00e4ddar in -embeddedBy=b\u00e4ddas in av -childNodeOf=underordnad nod f\u00f6r +flowsTo=fl\u00F6dar till +flowsFrom=fl\u00F6dar fr\u00E5n +subwindowOf=delf\u00F6nster av +parentWindowOf=\u00F6verordnat f\u00F6nster f\u00F6r +embeds=b\u00E4ddar in +embeddedBy=b\u00E4ddas in av +childNodeOf=underordnad nod f\u00F6r # # accessible roles @@ -125,14 +125,14 @@ footer=sidfot paragraph=stycke ruler=linjal editbar=redigeringslist -progressMonitor=f\u00f6rloppsindikator +progressMonitor=f\u00F6rlopps\u00F6vervakare # # accessible states # -managesDescendants=hanterar efterf\u00f6ljare -indeterminate=obest\u00e4mt -truncated=avklippt +managesDescendants=hanterar underordnade +indeterminate=obest\u00E4mt +truncated=kapad # new for J2SE 1.6.0 diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties index 13501058c80..755736a8885 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_CN.properties @@ -13,133 +13,133 @@ # # accessible roles # -alert=\u8b66\u62a5 -awtcomponent=AWT \u7ec4\u4ef6 -checkbox=\u590d\u9009\u6846 -colorchooser=\u989c\u8272\u9009\u62e9\u5668 +alert=\u9884\u8B66 +awtcomponent=AWT \u7EC4\u4EF6 +checkbox=\u590D\u9009\u6846 +colorchooser=\u989C\u8272\u9009\u62E9\u5668 columnheader=\u5217\u6807\u9898 -combobox=\u7ec4\u5408\u6846 -canvas=\u753b\u5e03 -desktopicon=\u684c\u9762\u56fe\u6807 -desktoppane=\u684c\u9762\u7a97\u683c -dialog=\u5bf9\u8bdd -directorypane=\u76ee\u5f55\u7a97\u683c -glasspane=\u73bb\u7483\u7a97\u683c -filechooser=\u6587\u4ef6\u9009\u62e9\u5668 -filler=\u6f0f\u6597 -frame=\u5e27 -internalframe=\u5185\u90e8\u5e27 -label=\u6807\u7b7e -layeredpane=\u5206\u5c42\u7a97\u683c +combobox=\u7EC4\u5408\u6846 +canvas=\u753B\u5E03 +desktopicon=\u684C\u9762\u56FE\u6807 +desktoppane=\u684C\u9762\u7A97\u683C +dialog=\u5BF9\u8BDD +directorypane=\u76EE\u5F55\u7A97\u683C +glasspane=\u73BB\u7483\u7A97\u683C +filechooser=\u6587\u4EF6\u9009\u62E9\u5668 +filler=\u6F0F\u6597 +frame=\u5E27 +internalframe=\u5185\u90E8\u5E27 +label=\u6807\u7B7E +layeredpane=\u5206\u5C42\u7A97\u683C list=\u5217\u8868 listitem=\u5217\u8868\u9879 -menubar=\u83dc\u5355\u680f -menu=\u83dc\u5355 -menuitem=\u83dc\u5355\u9879 -optionpane=\u9009\u9879\u7a97\u683c -pagetab=\u9875\u6807\u7b7e -pagetablist=\u9875\u6807\u7b7e\u5217\u8868 -panel=\u9762\u677f -passwordtext=\u5bc6\u7801\u6587\u672c -popupmenu=\u5f39\u51fa\u5f0f\u83dc\u5355 -progressbar=\u8fdb\u5ea6\u6761 -pushbutton=\u6309\u94ae -radiobutton=\u5355\u9009\u6309\u94ae -rootpane=\u6839\u7a97\u683c -rowheader=\u884c\u6807\u9898 -scrollbar=\u6eda\u52a8\u6761 -scrollpane=\u6eda\u52a8\u7a97\u683c +menubar=\u83DC\u5355\u680F +menu=\u83DC\u5355 +menuitem=\u83DC\u5355\u9879 +optionpane=\u9009\u9879\u7A97\u683C +pagetab=\u9875\u6807\u7B7E +pagetablist=\u9875\u6807\u7B7E\u5217\u8868 +panel=\u9762\u677F +passwordtext=\u53E3\u4EE4\u6587\u672C +popupmenu=\u5F39\u51FA\u5F0F\u83DC\u5355 +progressbar=\u8FDB\u5EA6\u680F +pushbutton=\u6309\u94AE +radiobutton=\u5355\u9009\u6309\u94AE +rootpane=\u6839\u7A97\u683C +rowheader=\u884C\u6807\u9898 +scrollbar=\u6EDA\u52A8\u6761 +scrollpane=\u6EDA\u52A8\u7A97\u683C separator=\u5206\u9694\u6761 -slider=\u6ed1\u5757 -splitpane=\u62c6\u5206\u7a97\u683c -swingcomponent=\u65cb\u8f6c\u7ec4\u4ef6 +slider=\u6ED1\u5757 +splitpane=\u62C6\u5206\u7A97\u683C +swingcomponent=\u65CB\u8F6C\u7EC4\u4EF6 table=\u8868 -text=\u6587\u672c +text=\u6587\u672C tree=\u6811 -togglebutton=\u5207\u6362\u6309\u94ae -toolbar=\u5de5\u5177\u680f -tooltip=\u5de5\u5177\u63d0\u793a -unknown=\u672a\u77e5 -viewport=\u89c6\u53e3 -window=\u7a97\u53e3 +togglebutton=\u5207\u6362\u6309\u94AE +toolbar=\u5DE5\u5177\u680F +tooltip=\u5DE5\u5177\u63D0\u793A +unknown=\u672A\u77E5 +viewport=\u89C6\u7A97 +window=\u7A97\u53E3 # # accessible relations # -labelFor=\u6807\u7b7e\u5c5e\u4e8e -labeledBy=\u6807\u7b7e\u5236\u4f5c\u8005 -memberOf=\u5c5e\u4e8e -controlledBy=\u63a7\u5236\u8005 -controllerFor=\u63a7\u5236\u5bf9\u8c61 +labelFor=\u6807\u7B7E\u5C5E\u4E8E +labeledBy=\u6807\u7B7E\u5236\u4F5C\u8005 +memberOf=\u5C5E\u4E8E +controlledBy=controlledBy +controllerFor=controllerFor # # accessible states # -active=\u6d3b\u52a8 -armed=\u5f85\u547d -busy=\u5fd9 -checked=\u5df2\u9009\u4e2d -collapsed=\u5df2\u6536\u7f29 -editable=\u53ef\u7f16\u8f91 -expandable=\u53ef\u5c55\u5f00 -expanded=\u5df2\u5c55\u5f00 -enabled=\u5df2\u542f\u7528 -focusable=\u53ef\u96c6\u4e2d -focused=\u5df2\u96c6\u4e2d -iconified=\u56fe\u6807\u5f0f -modal=\u6a21\u6001 -multiline=\u591a\u884c -multiselectable=\u591a\u9009\u62e9 -opaque=\u4e0d\u900f\u660e -pressed=\u5df2\u6309\u4e0b -resizable=\u5927\u5c0f\u53ef\u8c03 -selectable=\u53ef\u9009\u62e9 -selected=\u5df2\u9009\u5b9a -showing=\u6b63\u5728\u663e\u793a -singleline=\u5355\u884c -transient=\u77ac\u65f6 -visible=\u53ef\u89c1 -vertical=\u5782\u76f4 -horizontal=\u6c34\u5e73 +active=\u6D3B\u52A8 +armed=\u5F85\u547D +busy=\u5FD9 +checked=\u5DF2\u9009\u4E2D +collapsed=\u5DF2\u6536\u7F29 +editable=\u53EF\u7F16\u8F91 +expandable=\u53EF\u5C55\u5F00 +expanded=\u5DF2\u5C55\u5F00 +enabled=\u542F\u7528 +focusable=\u53EF\u96C6\u4E2D +focused=\u5DF2\u96C6\u4E2D +iconified=\u56FE\u6807\u5F0F +modal=\u6A21\u6001 +multiline=\u591A\u884C +multiselectable=\u591A\u9009\u62E9 +opaque=\u4E0D\u900F\u660E +pressed=\u5DF2\u6309\u4E0B +resizable=\u53EF\u8C03\u6574\u5927\u5C0F +selectable=\u53EF\u9009\u62E9 +selected=\u6240\u9009 +showing=\u6B63\u5728\u663E\u793A +singleline=\u5355\u884C +transient=\u77AC\u65F6 +visible=\u53EF\u89C1 +vertical=\u5782\u76F4 +horizontal=\u6C34\u5E73 # # accessible actions # -toggle expand=\u5207\u6362\u5c55\u5f00 +toggle expand=\u5207\u6362\u5C55\u5F00 # new relations, roles and states for J2SE 1.5.0 # # accessible relations # -flowsTo=\u6d41\u5411 -flowsFrom=\u6d41\u81ea -subwindowOf=\u5b50\u7a97\u53e3 -parentWindowOf=\u7236\u7a97\u53e3 -embeds=\u5d4c\u5165\u9879 -embeddedBy=\u5d4c\u5165\u8005 -childNodeOf=\u5b50\u8282\u70b9 +flowsTo=\u6D41\u5411 +flowsFrom=\u6D41\u81EA +subwindowOf=\u5B50\u7A97\u53E3 +parentWindowOf=\u7236\u7A97\u53E3 +embeds=\u5D4C\u5165\u9879 +embeddedBy=\u5D4C\u5165\u8005 +childNodeOf=\u5B50\u8282\u70B9 # # accessible roles # header=\u9875\u7709 -footer=\u9875\u811a -paragraph=\u6bb5\u843d -ruler=\u6807\u5c3a -editbar=\u7f16\u8f91\u680f -progressMonitor=\u8fdb\u5ea6\u76d1\u89c6\u5668 +footer=\u9875\u811A +paragraph=\u6BB5\u843D +ruler=\u6807\u5C3A +editbar=\u7F16\u8F91\u680F +progressMonitor=\u8FDB\u5EA6\u76D1\u89C6\u5668 # # accessible states # -managesDescendants=\u7ba1\u7406\u5b50\u5b59 -indeterminate=\u4e0d\u786e\u5b9a -truncated=\u5df2\u622a\u65ad +managesDescendants=\u7BA1\u7406\u5B50\u9879 +indeterminate=\u4E0D\u786E\u5B9A +truncated=\u5DF2\u622A\u65AD # new for J2SE 1.6.0 # # accessible roles # -htmlcontainer=HTML \u5bb9\u5668 +htmlcontainer=HTML \u5BB9\u5668 # # END OF MATERIAL TO LOCALIZE diff --git a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties index 4c2c87e407c..f4d11b45411 100644 --- a/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/accessibility/internal/resources/accessibility_zh_TW.properties @@ -13,133 +13,133 @@ # # accessible roles # -alert=\u8b66\u793a -awtcomponent=AWT \u5143\u4ef6 -checkbox=\u6838\u53d6\u65b9\u584a -colorchooser=\u8272\u5f69\u9078\u64c7\u5668 -columnheader=\u76f4\u6b04\u6a19\u984c -combobox=\u4e0b\u62c9\u5f0f\u6e05\u55ae\u65b9\u584a -canvas=\u756b\u5e03 -desktopicon=\u684c\u9762\u5716\u793a -desktoppane=\u684c\u9762\u7a97\u683c -dialog=\u5c0d\u8a71\u65b9\u584a -directorypane=\u76ee\u9304\u7a97\u683c -glasspane=\u6aa2\u8996\u7a97\u683c -filechooser=\u6a94\u6848\u9078\u64c7\u5668 -filler=\u586b\u5145\u7269 -frame=\u6846\u67b6 -internalframe=\u5167\u90e8\u6846\u67b6 -label=\u6a19\u7c64 -layeredpane=\u5206\u5c64\u7a97\u683c -list=\u6e05\u55ae -listitem=\u6e05\u55ae\u9805\u76ee -menubar=\u529f\u80fd\u8868\u5217 -menu=\u529f\u80fd\u8868 -menuitem=\u529f\u80fd\u8868\u9805\u76ee -optionpane=\u9078\u9805\u7a97\u683c -pagetab=\u9801\u9762\u6a19\u7c64 -pagetablist=\u9801\u9762\u6a19\u7c64\u6e05\u55ae -panel=\u9762\u677f -passwordtext=\u5bc6\u78bc\u6587\u5b57 -popupmenu=\u8e66\u73fe\u5f0f\u529f\u80fd\u8868 -progressbar=\u9032\u5ea6\u5217 -pushbutton=\u4e0b\u58d3\u6309\u9215 -radiobutton=\u55ae\u9078\u9215 -rootpane=root \u7a97\u683c -rowheader=\u5217\u6a19\u984c -scrollbar=\u6372\u8ef8 -scrollpane=\u6372\u52d5\u7a97\u683c +alert=\u8B66\u793A +awtcomponent=AWT \u5143\u4EF6 +checkbox=\u6838\u53D6\u65B9\u584A +colorchooser=\u8272\u5F69\u9078\u64C7\u5668 +columnheader=\u76F4\u6B04\u6A19\u984C +combobox=\u4E0B\u62C9\u5F0F\u6E05\u55AE\u65B9\u584A +canvas=\u756B\u5E03 +desktopicon=\u684C\u9762\u5716\u793A +desktoppane=\u684C\u9762\u7A97\u683C +dialog=\u5C0D\u8A71\u65B9\u584A +directorypane=\u76EE\u9304\u7A97\u683C +glasspane=\u6AA2\u8996\u7A97\u683C +filechooser=\u6A94\u6848\u9078\u64C7\u5668 +filler=\u586B\u5145\u7269 +frame=\u6846\u67B6 +internalframe=\u5167\u90E8\u6846\u67B6 +label=\u6A19\u7C64 +layeredpane=\u5206\u5C64\u7A97\u683C +list=\u6E05\u55AE +listitem=\u6E05\u55AE\u9805\u76EE +menubar=\u529F\u80FD\u8868\u5217 +menu=\u529F\u80FD\u8868 +menuitem=\u529F\u80FD\u8868\u9805\u76EE +optionpane=\u9078\u9805\u7A97\u683C +pagetab=\u9801\u9762\u9801\u7C64 +pagetablist=\u9801\u9762\u9801\u7C64\u6E05\u55AE +panel=\u9762\u677F +passwordtext=\u5BC6\u78BC\u6587\u5B57 +popupmenu=\u5373\u73FE\u5F0F\u529F\u80FD\u8868 +progressbar=\u9032\u5EA6\u5217 +pushbutton=\u4E0B\u58D3\u6309\u9215 +radiobutton=\u55AE\u9078\u9215 +rootpane=root \u7A97\u683C +rowheader=\u5217\u6A19\u984C +scrollbar=\u6372\u8EF8 +scrollpane=\u6372\u52D5\u7A97\u683C separator=\u5206\u9694\u5143 -slider=\u6ed1\u52d5\u8ef8 -splitpane=\u5206\u5272\u7a97\u683c -swingcomponent=Swing \u5143\u4ef6 -table=\u8868\u683c -text=\u6587\u5b57 -tree=\u6a39\u72c0\u7d50\u69cb -togglebutton=\u5207\u63db\u6309\u9215 -toolbar=\u5de5\u5177\u5217 -tooltip=\u5de5\u5177\u63d0\u793a -unknown=\u672a\u77e5 -viewport=\u6aa2\u8996\u5340 -window=\u8996\u7a97 +slider=\u6ED1\u52D5\u8EF8 +splitpane=\u5206\u5272\u7A97\u683C +swingcomponent=Swing \u5143\u4EF6 +table=\u8868\u683C +text=\u6587\u5B57 +tree=\u6A39\u72C0\u7D50\u69CB +togglebutton=\u5207\u63DB\u6309\u9215 +toolbar=\u5DE5\u5177\u5217 +tooltip=\u5DE5\u5177\u63D0\u793A +unknown=\u4E0D\u660E\u7684 +viewport=\u6AA2\u8996\u5340 +window=\u8996\u7A97 # # accessible relations # -labelFor=\u6a19\u793a\u5c0d\u8c61 -labeledBy=\u6a19\u793a\u8005 -memberOf=\u6240\u5c6c\u6210\u54e1 -controlledBy=\u63a7\u5236\u8005 -controllerFor=\u63a7\u5236\u5c0d\u8c61 +labelFor=\u6A19\u793A\u5C0D\u8C61 +labeledBy=\u6A19\u793A\u8005 +memberOf=\u6240\u5C6C\u6210\u54E1 +controlledBy=\u63A7\u5236\u8005 +controllerFor=\u63A7\u5236\u5C0D\u8C61 # # accessible states # -active=\u4f5c\u7528\u4e2d -armed=\u5df2\u914d\u5099 -busy=\u5fd9\u788c\u4e2d -checked=\u5df2\u6838\u9078 -collapsed=\u5df2\u6536\u7e2e -editable=\u53ef\u7de8\u8f2f -expandable=\u53ef\u64f4\u5c55 -expanded=\u5df2\u64f4\u5c55 -enabled=\u5df2\u555f\u52d5 -focusable=\u53ef\u805a\u7126 -focused=\u5df2\u805a\u7126 -iconified=\u5df2\u5716\u793a\u5316 -modal=\u6a21\u614b -multiline=\u591a\u884c -multiselectable=\u53ef\u591a\u91cd\u9078\u53d6 -opaque=\u4e0d\u900f\u660e -pressed=\u5df2\u6309\u4e0b -resizable=\u53ef\u8abf\u6574\u5927\u5c0f -selectable=\u53ef\u9078\u53d6 -selected=\u5df2\u9078\u53d6 -showing=\u986f\u793a -singleline=\u55ae\u884c -transient=\u66ab\u6642\u7684 -visible=\u53ef\u898b\u7684 -vertical=\u5782\u76f4 -horizontal=\u6c34\u5e73 +active=\u4F5C\u7528\u4E2D +armed=\u5DF2\u914D\u5099 +busy=\u5FD9\u788C\u4E2D +checked=\u5DF2\u6838\u9078 +collapsed=\u5DF2\u6536\u7E2E +editable=\u53EF\u7DE8\u8F2F +expandable=\u53EF\u64F4\u5C55 +expanded=\u5DF2\u64F4\u5C55 +enabled=\u5DF2\u555F\u7528 +focusable=\u53EF\u805A\u7126 +focused=\u5DF2\u805A\u7126 +iconified=\u5DF2\u5716\u793A\u5316 +modal=\u6A21\u614B +multiline=\u591A\u884C +multiselectable=\u53EF\u591A\u91CD\u9078\u53D6 +opaque=\u4E0D\u900F\u660E +pressed=\u5DF2\u6309\u4E0B +resizable=\u53EF\u8ABF\u6574\u5927\u5C0F +selectable=\u53EF\u9078\u53D6 +selected=\u5DF2\u9078\u53D6 +showing=\u986F\u793A +singleline=\u55AE\u884C +transient=\u66AB\u6642\u7684 +visible=\u53EF\u898B\u7684 +vertical=\u5782\u76F4 +horizontal=\u6C34\u5E73 # # accessible actions # -toggle expand=\u5207\u63db\u64f4\u5c55 +toggle expand=\u5207\u63DB\u64F4\u5C55 # new relations, roles and states for J2SE 1.5.0 # # accessible relations # -flowsTo=\u6d41\u52d5\u81f3 -flowsFrom=\u6d41\u52d5\u81ea -subwindowOf=\u5b50\u8996\u7a97 -parentWindowOf=\u7236\u7cfb\u8996\u7a97 -embeds=\u5167\u5d4c -embeddedBy=\u5167\u5d4c\u8005 -childNodeOf=\u5b50\u7bc0\u9ede +flowsTo=\u6D41\u52D5\u81F3 +flowsFrom=\u6D41\u52D5\u81EA +subwindowOf=\u5B50\u8996\u7A97 +parentWindowOf=\u7236\u7CFB\u8996\u7A97 +embeds=\u5167\u5D4C +embeddedBy=\u5167\u5D4C\u8005 +childNodeOf=\u5B50\u7BC0\u9EDE # # accessible roles # header=\u9801\u9996 -footer=\u9801\u5c3e -paragraph=\u6bb5\u843d -ruler=\u6a19\u5c3a -editbar=\u7de8\u8f2f\u5217 -progressMonitor=\u9032\u5ea6\u76e3\u8996\u5668 +footer=\u9801\u5C3E +paragraph=\u6BB5\u843D +ruler=\u5C3A\u898F +editbar=\u7DE8\u8F2F\u5217 +progressMonitor=\u9032\u5EA6\u76E3\u8996\u5668 # # accessible states # -managesDescendants=\u7ba1\u7406\u5b50\u4ee3 -indeterminate=\u4e0d\u78ba\u5b9a -truncated=\u5df2\u622a\u65b7 +managesDescendants=\u7BA1\u7406\u5B50\u4EE3 +indeterminate=\u4E0D\u78BA\u5B9A +truncated=\u5DF2\u622A\u65B7 # new for J2SE 1.6.0 # # accessible roles # -htmlcontainer=HTML \u5bb9\u5668 +htmlcontainer=HTML \u5BB9\u5668 # # END OF MATERIAL TO LOCALIZE diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties index 9b15608c2be..3440d8f542e 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_de.properties @@ -21,19 +21,19 @@ GTKColorChooserPanel.mnemonic=71 # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. GTKColorChooserPanel.hueText=Farbton: -GTKColorChooserPanel.hueMnemonic=70 +GTKColorChooserPanel.hueMnemonic=72 GTKColorChooserPanel.redText=Rot: -GTKColorChooserPanel.redMnemonic=82 +GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=S\u00e4ttigung: +GTKColorChooserPanel.saturationText=S\u00E4ttigung: GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=Gr\u00fcn: +GTKColorChooserPanel.greenText=Gr\u00FCn: GTKColorChooserPanel.greenMnemonic=71 GTKColorChooserPanel.valueText=Wert: -GTKColorChooserPanel.valueMnemonic=87 +GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.blueText=Blau: GTKColorChooserPanel.blueMnemonic=66 @@ -49,35 +49,35 @@ FileChooser.acceptAllFileFilterText=Alle Dateien FileChooser.newFolderButtonText=Neuer Ordner FileChooser.newFolderButtonMnemonic=78 FileChooser.newFolderDialogText=Ordnername: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory -FileChooser.deleteFileButtonText=Datei l\u00f6schen +FileChooser.newFolderNoDirectoryErrorTitleText=Fehler +FileChooser.newFolderNoDirectoryErrorText=Fehler beim Erstellen von Verzeichnis "{0}": Datei oder Verzeichnis nicht vorhanden +FileChooser.deleteFileButtonText=Datei l\u00F6schen FileChooser.deleteFileButtonMnemonic=76 FileChooser.renameFileButtonText=Datei umbenennen -FileChooser.renameFileButtonMnemonic=87 +FileChooser.renameFileButtonMnemonic=82 FileChooser.cancelButtonText=Abbrechen -FileChooser.cancelButtonMnemonic=83 -FileChooser.saveButtonText=Speichern -FileChooser.saveButtonMnemonic=69 +FileChooser.cancelButtonMnemonic=67 +FileChooser.saveButtonText=OK +FileChooser.saveButtonMnemonic=79 FileChooser.openButtonText=OK FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Speichern -FileChooser.openDialogTitleText=\u00d6ffnen +FileChooser.openDialogTitleText=\u00D6ffnen FileChooser.pathLabelText=Auswahl: FileChooser.filterLabelText=Filter: FileChooser.pathLabelMnemonic=83 FileChooser.foldersLabelText=Ordner -FileChooser.foldersLabelMnemonic=82 +FileChooser.foldersLabelMnemonic=68 FileChooser.filesLabelText=Dateien FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=Farbauswahl abbrechen -FileChooser.saveButtonToolTipText=Ausgew\u00e4hlte Datei speichern -FileChooser.openButtonToolTipText=Ausgew\u00e4hlte Datei \u00f6ffnen +FileChooser.cancelButtonToolTipText=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. +FileChooser.saveButtonToolTipText=Ausgew\u00E4hlte Datei speichern. +FileChooser.openButtonToolTipText=Ausgew\u00E4hlte Datei \u00F6ffnen. FileChooser.renameFileDialogText=Datei "{0}" umbenennen in FileChooser.renameFileErrorTitle=Fehler FileChooser.renameFileErrorText=Fehler beim Umbenennen der Datei "{0}" in "{1}" OptionPane.okButtonMnemonic=79 -OptionPane.cancelButtonMnemonic=83 +OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties index c87f88f8ead..ed024c8ccdf 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_es.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=Selector de color para GTK +GTKColorChooserPanel.nameText=Selector de Color para GTK # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -20,64 +20,64 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=Tono: -GTKColorChooserPanel.hueMnemonic=84 +GTKColorChooserPanel.hueText=Matiz: +GTKColorChooserPanel.hueMnemonic=72 GTKColorChooserPanel.redText=Rojo: -GTKColorChooserPanel.redMnemonic=82 +GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=Saturaci\u00f3n: +GTKColorChooserPanel.saturationText=Saturaci\u00F3n: GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.greenText=Verde: -GTKColorChooserPanel.greenMnemonic=86 +GTKColorChooserPanel.greenMnemonic=71 GTKColorChooserPanel.valueText=Valor: -GTKColorChooserPanel.valueMnemonic=65 +GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.blueText=Azul: -GTKColorChooserPanel.blueMnemonic=65 +GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=Nombre del color: +GTKColorChooserPanel.colorNameText=Nombre del Color: GTKColorChooserPanel.colorNameMnemonic=78 ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=Todos los archivos -FileChooser.newFolderButtonText=Nueva carpeta +FileChooser.acceptAllFileFilterText=Todos los Archivos +FileChooser.newFolderButtonText=Nueva Carpeta FileChooser.newFolderButtonMnemonic=78 -FileChooser.newFolderDialogText=Nombre de la carpeta: +FileChooser.newFolderDialogText=Nombre de la Carpeta: FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory -FileChooser.deleteFileButtonText=Eliminar archivo +FileChooser.newFolderNoDirectoryErrorText=Error al crear el directorio "{0}": no existe dicho archivo o directorio +FileChooser.deleteFileButtonText=Suprimir Archivo FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=Renombrar archivo +FileChooser.renameFileButtonText=Cambiar Nombre a Archivo FileChooser.renameFileButtonMnemonic=82 FileChooser.cancelButtonText=Cancelar FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=Guardar -FileChooser.saveButtonMnemonic=82 +FileChooser.saveButtonText=Aceptar +FileChooser.saveButtonMnemonic=79 FileChooser.openButtonText=Aceptar FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Guardar FileChooser.openDialogTitleText=Abrir -FileChooser.pathLabelText=Selecci\u00f3n: +FileChooser.pathLabelText=Selecci\u00F3n: FileChooser.filterLabelText=Filtro: FileChooser.pathLabelMnemonic=83 FileChooser.foldersLabelText=Carpetas -FileChooser.foldersLabelMnemonic=74 +FileChooser.foldersLabelMnemonic=68 FileChooser.filesLabelText=Archivos FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=Cancelar cuadro de di\u00e1logo de selecci\u00f3n de archivos. +FileChooser.cancelButtonToolTipText=Abortar cuadro de di\u00E1logo del selector de archivos. FileChooser.saveButtonToolTipText=Guardar el archivo seleccionado. FileChooser.openButtonToolTipText=Abrir el archivo seleccionado. FileChooser.renameFileDialogText=Cambiar el nombre del archivo "{0}" por FileChooser.renameFileErrorTitle=Error -FileChooser.renameFileErrorText=Error al cambiar el nombre del archivo "{0}" por "{1}" +FileChooser.renameFileErrorText=Error al cambiar el nombre del archivo "{0}" a "{1}" OptionPane.okButtonMnemonic=79 OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties index 3ed6b451192..33d21c8ae6d 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_fr.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=S\u00e9lectionneur de couleur GTK +GTKColorChooserPanel.nameText=S\u00E9lecteur de couleurs GTK # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -20,25 +20,25 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=Teinte\u00a0: -GTKColorChooserPanel.hueMnemonic=84 +GTKColorChooserPanel.hueText=Teinte\u00A0: +GTKColorChooserPanel.hueMnemonic=72 -GTKColorChooserPanel.redText=Rouge\u00a0: -GTKColorChooserPanel.redMnemonic=82 +GTKColorChooserPanel.redText=Rouge\u00A0: +GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=Saturation\u00a0: +GTKColorChooserPanel.saturationText=Saturation\u00A0: GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=Vert\u00a0: -GTKColorChooserPanel.greenMnemonic=69 +GTKColorChooserPanel.greenText=Vert\u00A0: +GTKColorChooserPanel.greenMnemonic=71 -GTKColorChooserPanel.valueText=Valeur\u00a0: +GTKColorChooserPanel.valueText=Valeur\u00A0: GTKColorChooserPanel.valueMnemonic=86 -GTKColorChooserPanel.blueText=Bleu\u00a0: +GTKColorChooserPanel.blueText=Bleu\u00A0: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=Nom de la couleur\u00a0: +GTKColorChooserPanel.colorNameText=Nom de la couleur\u00A0: GTKColorChooserPanel.colorNameMnemonic=78 @@ -48,34 +48,34 @@ GTKColorChooserPanel.colorNameMnemonic=78 FileChooser.acceptAllFileFilterText=Tous les fichiers FileChooser.newFolderButtonText=Nouveau dossier FileChooser.newFolderButtonMnemonic=78 -FileChooser.newFolderDialogText=Nom de dossier: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory +FileChooser.newFolderDialogText=Nom du dossier : +FileChooser.newFolderNoDirectoryErrorTitleText=Erreur +FileChooser.newFolderNoDirectoryErrorText=Erreur lors de la cr\u00E9ation du r\u00E9pertoire "{0}" : ce fichier ou r\u00E9pertoire n''existe pas FileChooser.deleteFileButtonText=Supprimer le fichier FileChooser.deleteFileButtonMnemonic=76 FileChooser.renameFileButtonText=Renommer le fichier FileChooser.renameFileButtonMnemonic=82 FileChooser.cancelButtonText=Annuler -FileChooser.cancelButtonMnemonic=70 -FileChooser.saveButtonText=Enregistrer +FileChooser.cancelButtonMnemonic=67 +FileChooser.saveButtonText=OK FileChooser.saveButtonMnemonic=79 FileChooser.openButtonText=OK FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Enregistrer FileChooser.openDialogTitleText=Ouvrir -FileChooser.pathLabelText=S\u00e9lection\u00a0: +FileChooser.pathLabelText=S\u00E9lection\u00A0: FileChooser.filterLabelText=Filtre : FileChooser.pathLabelMnemonic=83 FileChooser.foldersLabelText=Dossiers -FileChooser.foldersLabelMnemonic=71 +FileChooser.foldersLabelMnemonic=68 FileChooser.filesLabelText=Fichiers FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=Abandonner la bo\u00eete de dialogue du s\u00e9lectionneur de fichier. -FileChooser.saveButtonToolTipText=Enregistrer le fichier s\u00e9lectionn\u00e9. -FileChooser.openButtonToolTipText=Ouvrir le fichier s\u00e9lectionn\u00e9. +FileChooser.cancelButtonToolTipText=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers. +FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00E9lectionn\u00E9. +FileChooser.openButtonToolTipText=Ouvre le fichier s\u00E9lectionn\u00E9. -FileChooser.renameFileDialogText=Renommer le fichier "{0}" en +FileChooser.renameFileDialogText=Renomme le fichier "{0}" en FileChooser.renameFileErrorTitle=Erreur FileChooser.renameFileErrorText=Erreur lors du changement de nom du fichier "{0}" en "{1}" diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties index 84d4cf1a1ca..6a91c9040ce 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_it.properties @@ -20,17 +20,17 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=Tonalit\u00e0: -GTKColorChooserPanel.hueMnemonic=84 +GTKColorChooserPanel.hueText=Tonalit\u00E0: +GTKColorChooserPanel.hueMnemonic=72 GTKColorChooserPanel.redText=Rosso: -GTKColorChooserPanel.redMnemonic=82 +GTKColorChooserPanel.redMnemonic=69 GTKColorChooserPanel.saturationText=Saturazione: GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.greenText=Verde: -GTKColorChooserPanel.greenMnemonic=69 +GTKColorChooserPanel.greenMnemonic=71 GTKColorChooserPanel.valueText=Valore: GTKColorChooserPanel.valueMnemonic=86 @@ -49,16 +49,16 @@ FileChooser.acceptAllFileFilterText=Tutti i file FileChooser.newFolderButtonText=Nuova cartella FileChooser.newFolderButtonMnemonic=78 FileChooser.newFolderDialogText=Nome della cartella: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory +FileChooser.newFolderNoDirectoryErrorTitleText=Errore +FileChooser.newFolderNoDirectoryErrorText=Errore durante la creazione della directory "{0}": file o directory inesistente FileChooser.deleteFileButtonText=Elimina file FileChooser.deleteFileButtonMnemonic=76 FileChooser.renameFileButtonText=Rinomina file FileChooser.renameFileButtonMnemonic=82 FileChooser.cancelButtonText=Annulla FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=Salva -FileChooser.saveButtonMnemonic=82 +FileChooser.saveButtonText=OK +FileChooser.saveButtonMnemonic=79 FileChooser.openButtonText=OK FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Salva @@ -67,17 +67,17 @@ FileChooser.pathLabelText=Selezione: FileChooser.filterLabelText=Filtro: FileChooser.pathLabelMnemonic=83 FileChooser.foldersLabelText=Cartelle -FileChooser.foldersLabelMnemonic=79 +FileChooser.foldersLabelMnemonic=68 FileChooser.filesLabelText=File FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=Chiude la finestra di dialogo di selezione colore. +FileChooser.cancelButtonToolTipText=Chiude la finestra di dialogo di selezione file. FileChooser.saveButtonToolTipText=Salva il file selezionato. FileChooser.openButtonToolTipText=Apre il file selezionato. -FileChooser.renameFileDialogText=Rinomina del file "{0}" in +FileChooser.renameFileDialogText=Rinomina file "{0}" in FileChooser.renameFileErrorTitle=Errore -FileChooser.renameFileErrorText=Errore nella rinomina del file "{0}" in "{1}" +FileChooser.renameFileErrorText=Errore durante la ridenominazione del file "{0}" in "{1}" OptionPane.okButtonMnemonic=79 OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties index 9d9c14f7e30..97501cd1cf6 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ja.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=GTK \u30ab\u30e9\u30fc\u30c1\u30e5\u30fc\u30b6 +GTKColorChooserPanel.nameText=GTK\u30AB\u30E9\u30FC\u30FB\u30C1\u30E5\u30FC\u30B6 # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -20,64 +20,64 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=\u8272\u5408\u3044(H): +GTKColorChooserPanel.hueText=\u8272\u76F8: GTKColorChooserPanel.hueMnemonic=72 -GTKColorChooserPanel.redText=\u8d64(E): +GTKColorChooserPanel.redText=\u8D64: GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=\u5f69\u5ea6(S): +GTKColorChooserPanel.saturationText=\u5F69\u5EA6: GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=\u7dd1(G): +GTKColorChooserPanel.greenText=\u7DD1: GTKColorChooserPanel.greenMnemonic=71 -GTKColorChooserPanel.valueText=\u5024(V): +GTKColorChooserPanel.valueText=\u5024: GTKColorChooserPanel.valueMnemonic=86 -GTKColorChooserPanel.blueText=\u9752(B): +GTKColorChooserPanel.blueText=\u9752: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=\u8272\u540d(N): +GTKColorChooserPanel.colorNameText=\u8272\u540D: GTKColorChooserPanel.colorNameMnemonic=78 ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb -FileChooser.newFolderButtonText=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 +FileChooser.acceptAllFileFilterText=\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB +FileChooser.newFolderButtonText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 FileChooser.newFolderButtonMnemonic=78 -FileChooser.newFolderDialogText=\u30d5\u30a9\u30eb\u30c0\u540d: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory -FileChooser.deleteFileButtonText=\u30d5\u30a1\u30a4\u30eb\u3092\u524a\u9664 +FileChooser.newFolderDialogText=\u30D5\u30A9\u30EB\u30C0\u540D: +FileChooser.newFolderNoDirectoryErrorTitleText=\u30A8\u30E9\u30FC +FileChooser.newFolderNoDirectoryErrorText=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA"{0}"\u306E\u4F5C\u6210\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F: \u3053\u306E\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306F\u5B58\u5728\u3057\u307E\u305B\u3093 +FileChooser.deleteFileButtonText=\u30D5\u30A1\u30A4\u30EB\u306E\u524A\u9664 FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5909\u66f4 +FileChooser.renameFileButtonText=\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u5909\u66F4 FileChooser.renameFileButtonMnemonic=82 -FileChooser.cancelButtonText=\u53d6\u6d88\u3057 +FileChooser.cancelButtonText=\u53D6\u6D88 FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\u4fdd\u5b58 +FileChooser.saveButtonText=OK FileChooser.saveButtonMnemonic=79 -FileChooser.openButtonText=\u4e86\u89e3 +FileChooser.openButtonText=OK FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\u4fdd\u5b58 -FileChooser.openDialogTitleText=\u958b\u304f -FileChooser.pathLabelText=\u9078\u629e: -FileChooser.filterLabelText=\u30d5\u30a3\u30eb\u30bf: +FileChooser.saveDialogTitleText=\u4FDD\u5B58 +FileChooser.openDialogTitleText=\u958B\u304F +FileChooser.pathLabelText=\u9078\u629E: +FileChooser.filterLabelText=\u30D5\u30A3\u30EB\u30BF: FileChooser.pathLabelMnemonic=83 -FileChooser.foldersLabelText=\u30d5\u30a9\u30eb\u30c0 +FileChooser.foldersLabelText=\u30D5\u30A9\u30EB\u30C0 FileChooser.foldersLabelMnemonic=68 -FileChooser.filesLabelText=\u30d5\u30a1\u30a4\u30eb +FileChooser.filesLabelText=\u30D5\u30A1\u30A4\u30EB FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=\u30d5\u30a1\u30a4\u30eb\u30c1\u30e5\u30fc\u30b6\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u5f37\u5236\u7d42\u4e86 -FileChooser.saveButtonToolTipText=\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58 -FileChooser.openButtonToolTipText=\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f +FileChooser.cancelButtonToolTipText=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002 +FileChooser.saveButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002 +FileChooser.openButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059\u3002 -FileChooser.renameFileDialogText=\u30d5\u30a1\u30a4\u30eb "{0}" \u306e\u540d\u524d\u3092\u5909\u66f4: -FileChooser.renameFileErrorTitle=\u30a8\u30e9\u30fc -FileChooser.renameFileErrorText=\u30d5\u30a1\u30a4\u30eb "{0}" \u3092 "{1}" \u3078\u5909\u66f4\u6642\u306b\u30a8\u30e9\u30fc +FileChooser.renameFileDialogText=\u30D5\u30A1\u30A4\u30EB"{0}"\u3092\u6B21\u306E\u540D\u524D\u306B\u5909\u66F4: +FileChooser.renameFileErrorTitle=\u30A8\u30E9\u30FC +FileChooser.renameFileErrorText=\u30D5\u30A1\u30A4\u30EB"{0}"\u306E"{1}"\u3078\u306E\u5909\u66F4\u4E2D\u306B\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F OptionPane.okButtonMnemonic=79 OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties index 68586a64b77..7c9af7a73c2 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_ko.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=GTK \uc0c9 \uc120\ud0dd +GTKColorChooserPanel.nameText=GTK \uC0C9\uC0C1 \uC120\uD0DD\uAE30 # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -20,64 +20,64 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=\uc0c9\uc0c1(H): +GTKColorChooserPanel.hueText=\uC0C9\uC870: GTKColorChooserPanel.hueMnemonic=72 -GTKColorChooserPanel.redText=\ube68\uac15(E): +GTKColorChooserPanel.redText=\uBE68\uAC04\uC0C9: GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=\ucc44\ub3c4(S): +GTKColorChooserPanel.saturationText=\uCC44\uB3C4: GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=\ub179\uc0c9(G): +GTKColorChooserPanel.greenText=\uB179\uC0C9: GTKColorChooserPanel.greenMnemonic=71 -GTKColorChooserPanel.valueText=\uac12(V): +GTKColorChooserPanel.valueText=\uAC12: GTKColorChooserPanel.valueMnemonic=86 -GTKColorChooserPanel.blueText=\ud30c\ub791(B): +GTKColorChooserPanel.blueText=\uD30C\uB780\uC0C9: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=\uc0c9 \uc774\ub984(N): +GTKColorChooserPanel.colorNameText=\uC0C9\uC0C1 \uC774\uB984: GTKColorChooserPanel.colorNameMnemonic=78 ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=\ubaa8\ub4e0 \ud30c\uc77c -FileChooser.newFolderButtonText=\uc0c8 \ud3f4\ub354 +FileChooser.acceptAllFileFilterText=\uBAA8\uB4E0 \uD30C\uC77C +FileChooser.newFolderButtonText=\uC0C8 \uD3F4\uB354 FileChooser.newFolderButtonMnemonic=78 -FileChooser.newFolderDialogText=\ud3f4\ub354 \uc774\ub984: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory -FileChooser.deleteFileButtonText=\ud30c\uc77c \uc0ad\uc81c +FileChooser.newFolderDialogText=\uD3F4\uB354 \uC774\uB984: +FileChooser.newFolderNoDirectoryErrorTitleText=\uC624\uB958 +FileChooser.newFolderNoDirectoryErrorText="{0}" \uB514\uB809\uD1A0\uB9AC\uB97C \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: \uD574\uB2F9 \uD30C\uC77C \uB610\uB294 \uB514\uB809\uD1A0\uB9AC\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4. +FileChooser.deleteFileButtonText=\uD30C\uC77C \uC0AD\uC81C FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=\ud30c\uc77c \uc774\ub984 \ubc14\uafb8\uae30 +FileChooser.renameFileButtonText=\uD30C\uC77C \uC774\uB984 \uBC14\uAFB8\uAE30 FileChooser.renameFileButtonMnemonic=82 -FileChooser.cancelButtonText=\ucde8\uc18c +FileChooser.cancelButtonText=\uCDE8\uC18C FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\uc800\uc7a5 +FileChooser.saveButtonText=\uD655\uC778 FileChooser.saveButtonMnemonic=79 -FileChooser.openButtonText=\ud655\uc778 +FileChooser.openButtonText=\uD655\uC778 FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\uc800\uc7a5 -FileChooser.openDialogTitleText=\uc5f4\uae30 -FileChooser.pathLabelText=\uc120\ud0dd: -FileChooser.filterLabelText=\ud544\ud130: +FileChooser.saveDialogTitleText=\uC800\uC7A5 +FileChooser.openDialogTitleText=\uC5F4\uAE30 +FileChooser.pathLabelText=\uC120\uD0DD: +FileChooser.filterLabelText=\uD544\uD130: FileChooser.pathLabelMnemonic=83 -FileChooser.foldersLabelText=\ud3f4\ub354 +FileChooser.foldersLabelText=\uD3F4\uB354 FileChooser.foldersLabelMnemonic=68 -FileChooser.filesLabelText=\ud30c\uc77c +FileChooser.filesLabelText=\uD30C\uC77C FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=\ud30c\uc77c \uc120\ud0dd \ub300\ud654 \uc0c1\uc790\ub97c \uc911\ub2e8\ud569\ub2c8\ub2e4. -FileChooser.saveButtonToolTipText=\uc120\ud0dd\ud55c \ud30c\uc77c\uc744 \uc800\uc7a5\ud569\ub2c8\ub2e4. -FileChooser.openButtonToolTipText=\uc120\ud0dd\ud55c \ud30c\uc77c\uc744 \uc5fd\ub2c8\ub2e4. +FileChooser.cancelButtonToolTipText=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4. +FileChooser.saveButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4. +FileChooser.openButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4. -FileChooser.renameFileDialogText=\ud30c\uc77c "{0}"\uc744 \ub2e4\uc74c\uc73c\ub85c \uc774\ub984 \ubc14\uafb8\uae30 -FileChooser.renameFileErrorTitle=\uc624\ub958 -FileChooser.renameFileErrorText="{0}"\uc5d0\uc11c "{1}"\ub85c \uc774\ub984 \ubc14\uafb8\uae30 \uc624\ub958 +FileChooser.renameFileDialogText="{0}" \uD30C\uC77C\uC758 \uC774\uB984 \uBC14\uAFB8\uAE30 +FileChooser.renameFileErrorTitle=\uC624\uB958 +FileChooser.renameFileErrorText="{0}" \uD30C\uC77C\uC758 \uC774\uB984\uC744 "{1}"(\uC73C)\uB85C \uBC14\uAFB8\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. OptionPane.okButtonMnemonic=79 OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties index dff6f6f1528..3ca20897106 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_pt_BR.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=Seletor de cores do GTK +GTKColorChooserPanel.nameText=Seletor de Cores do GTK # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -26,7 +26,7 @@ GTKColorChooserPanel.hueMnemonic=72 GTKColorChooserPanel.redText=Vermelho: GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=Satura\u00e7\u00e3o: +GTKColorChooserPanel.saturationText=Satura\u00E7\u00E3o: GTKColorChooserPanel.saturationMnemonic=83 GTKColorChooserPanel.greenText=Verde: @@ -38,20 +38,22 @@ GTKColorChooserPanel.valueMnemonic=86 GTKColorChooserPanel.blueText=Azul: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=Nome da cor: +GTKColorChooserPanel.colorNameText=Nome da Cor: GTKColorChooserPanel.colorNameMnemonic=78 ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=Todos os arquivos -FileChooser.newFolderButtonText=Nova pasta +FileChooser.acceptAllFileFilterText=Todos os Arquivos +FileChooser.newFolderButtonText=Nova Pasta FileChooser.newFolderButtonMnemonic=78 FileChooser.newFolderDialogText=Nome da pasta: -FileChooser.deleteFileButtonText=Excluir arquivo +FileChooser.newFolderNoDirectoryErrorTitleText=Erro +FileChooser.newFolderNoDirectoryErrorText=Erro ao criar o diret\u00F3rio "{0}": N\u00E3o h\u00E1 arquivo ou diret\u00F3rio +FileChooser.deleteFileButtonText=Deletar Arquivo FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=Renomear arquivo +FileChooser.renameFileButtonText=Renomear Arquivo FileChooser.renameFileButtonMnemonic=82 FileChooser.cancelButtonText=Cancelar FileChooser.cancelButtonMnemonic=67 @@ -61,7 +63,7 @@ FileChooser.openButtonText=OK FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Salvar FileChooser.openDialogTitleText=Abrir -FileChooser.pathLabelText=Sele\u00e7\u00e3o: +FileChooser.pathLabelText=Sele\u00E7\u00E3o: FileChooser.filterLabelText=Filtro: FileChooser.pathLabelMnemonic=83 FileChooser.foldersLabelText=Pastas @@ -69,7 +71,7 @@ FileChooser.foldersLabelMnemonic=68 FileChooser.filesLabelText=Arquivos FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=Anular caixa de di\u00e1logo do seletor de arquivos. +FileChooser.cancelButtonToolTipText=Abortar caixa de di\u00E1logo do seletor de arquivos. FileChooser.saveButtonToolTipText=Salvar arquivo selecionado. FileChooser.openButtonToolTipText=Abrir arquivo selecionado. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties index 672be192091..0bda01d0318 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_sv.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=GTK F\u00e4rgv\u00e4ljaren +GTKColorChooserPanel.nameText=GTK-f\u00E4rgv\u00E4ljaren # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -21,25 +21,25 @@ GTKColorChooserPanel.mnemonic=71 # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. GTKColorChooserPanel.hueText=Nyans: -GTKColorChooserPanel.hueMnemonic=78 +GTKColorChooserPanel.hueMnemonic=72 -GTKColorChooserPanel.redText=R\u00f6d: -GTKColorChooserPanel.redMnemonic=82 +GTKColorChooserPanel.redText=R\u00F6d: +GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=M\u00e4ttnad: -GTKColorChooserPanel.saturationMnemonic=77 +GTKColorChooserPanel.saturationText=M\u00E4ttnad: +GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=Gr\u00f6n: +GTKColorChooserPanel.greenText=Gr\u00F6n: GTKColorChooserPanel.greenMnemonic=71 -GTKColorChooserPanel.valueText=V\u00e4rde: +GTKColorChooserPanel.valueText=V\u00E4rde: GTKColorChooserPanel.valueMnemonic=86 -GTKColorChooserPanel.blueText=Bl\u00e5: +GTKColorChooserPanel.blueText=Bl\u00E5: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=F\u00e4rgnamn: -GTKColorChooserPanel.colorNameMnemonic=70 +GTKColorChooserPanel.colorNameText=F\u00E4rg: +GTKColorChooserPanel.colorNameMnemonic=78 @@ -47,37 +47,37 @@ GTKColorChooserPanel.colorNameMnemonic=70 FileChooser.acceptAllFileFilterText=Alla filer FileChooser.newFolderButtonText=Ny mapp -FileChooser.newFolderButtonMnemonic=70 +FileChooser.newFolderButtonMnemonic=78 FileChooser.newFolderDialogText=Mapp: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory +FileChooser.newFolderNoDirectoryErrorTitleText=Fel +FileChooser.newFolderNoDirectoryErrorText=Ett fel intr\u00E4ffade vid f\u00F6rs\u00F6k att skapa katalogen "{0}": Filen eller katalogen finns inte FileChooser.deleteFileButtonText=Ta bort fil FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=Byt namn p\u00e5 fil -FileChooser.renameFileButtonMnemonic=84 +FileChooser.renameFileButtonText=Namn\u00E4ndra fil +FileChooser.renameFileButtonMnemonic=82 FileChooser.cancelButtonText=Avbryt -FileChooser.cancelButtonMnemonic=83 -FileChooser.saveButtonText=Spara -FileChooser.saveButtonMnemonic=80 +FileChooser.cancelButtonMnemonic=67 +FileChooser.saveButtonText=OK +FileChooser.saveButtonMnemonic=79 FileChooser.openButtonText=OK FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Spara -FileChooser.openDialogTitleText=\u00d6ppna -FileChooser.pathLabelText=Markeringen: +FileChooser.openDialogTitleText=\u00D6ppna +FileChooser.pathLabelText=Val: FileChooser.filterLabelText=Filter: -FileChooser.pathLabelMnemonic=77 +FileChooser.pathLabelMnemonic=83 FileChooser.foldersLabelText=Mappar -FileChooser.foldersLabelMnemonic=82 +FileChooser.foldersLabelMnemonic=68 FileChooser.filesLabelText=Filer FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=St\u00e4ng dialogrutan f\u00f6r filval. -FileChooser.saveButtonToolTipText=Spara den markerade filen. -FileChooser.openButtonToolTipText=\u00d6ppna den markerade filen. +FileChooser.cancelButtonToolTipText=Avbryt dialogrutan Filv\u00E4ljare. +FileChooser.saveButtonToolTipText=Spara vald fil. +FileChooser.openButtonToolTipText=\u00D6ppna vald fil. -FileChooser.renameFileDialogText=Byt namn p\u00e5 fil "{0}" till +FileChooser.renameFileDialogText=Namn\u00E4ndra fil "{0}" till FileChooser.renameFileErrorTitle=Fel -FileChooser.renameFileErrorText=Det gick inte att byta namn p\u00e5 fil "{0}" till "{1}" +FileChooser.renameFileErrorText=Fel vid namn\u00E4ndring av fil "{0}" till "{1}" OptionPane.okButtonMnemonic=79 -OptionPane.cancelButtonMnemonic=83 +OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties index 8a7d74cb576..425f6add749 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_CN.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=GTK Color Chooser +GTKColorChooserPanel.nameText=GTK \u989C\u8272\u9009\u62E9\u5668 # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -20,64 +20,64 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=\u8272\u8c03(H)\uff1a +GTKColorChooserPanel.hueText=\u8272\u8C03: GTKColorChooserPanel.hueMnemonic=72 -GTKColorChooserPanel.redText=\u7ea2(E)\uff1a +GTKColorChooserPanel.redText=\u7EA2: GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=\u9971\u548c\u5ea6(S)\uff1a +GTKColorChooserPanel.saturationText=\u9971\u548C\u5EA6: GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=\u7eff(G)\uff1a +GTKColorChooserPanel.greenText=\u7EFF: GTKColorChooserPanel.greenMnemonic=71 -GTKColorChooserPanel.valueText=\u503c(V)\uff1a +GTKColorChooserPanel.valueText=\u503C: GTKColorChooserPanel.valueMnemonic=86 -GTKColorChooserPanel.blueText=\u84dd(B)\uff1a +GTKColorChooserPanel.blueText=\u84DD: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=\u989c\u8272\u540d\u79f0(N)\uff1a +GTKColorChooserPanel.colorNameText=\u989C\u8272\u540D\u79F0: GTKColorChooserPanel.colorNameMnemonic=78 ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=\u6240\u6709\u6587\u4ef6 -FileChooser.newFolderButtonText=\u65b0\u5efa\u6587\u4ef6\u5939 +FileChooser.acceptAllFileFilterText=\u6240\u6709\u6587\u4EF6 +FileChooser.newFolderButtonText=\u65B0\u5EFA\u6587\u4EF6\u5939 FileChooser.newFolderButtonMnemonic=78 -FileChooser.newFolderDialogText=\u6587\u4ef6\u5939\u540d\uff1a -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory -FileChooser.deleteFileButtonText=\u5220\u9664\u6587\u4ef6 +FileChooser.newFolderDialogText=\u6587\u4EF6\u5939\u540D: +FileChooser.newFolderNoDirectoryErrorTitleText=\u9519\u8BEF +FileChooser.newFolderNoDirectoryErrorText=\u521B\u5EFA\u76EE\u5F55 "{0}" \u65F6\u51FA\u9519: \u6CA1\u6709\u6B64\u7C7B\u6587\u4EF6\u6216\u76EE\u5F55 +FileChooser.deleteFileButtonText=\u5220\u9664\u6587\u4EF6 FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=\u91cd\u547d\u540d\u6587\u4ef6 +FileChooser.renameFileButtonText=\u91CD\u547D\u540D\u6587\u4EF6 FileChooser.renameFileButtonMnemonic=82 -FileChooser.cancelButtonText=\u53d6\u6d88 +FileChooser.cancelButtonText=\u53D6\u6D88 FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\u4fdd\u5b58 +FileChooser.saveButtonText=\u786E\u5B9A FileChooser.saveButtonMnemonic=79 -FileChooser.openButtonText=\u786e\u5b9a +FileChooser.openButtonText=\u786E\u5B9A FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\u4fdd\u5b58 -FileChooser.openDialogTitleText=\u6253\u5f00 -FileChooser.pathLabelText=\u9009\u62e9\uff1a -FileChooser.filterLabelText=\u8fc7\u6ee4\u5668\uff1a +FileChooser.saveDialogTitleText=\u4FDD\u5B58 +FileChooser.openDialogTitleText=\u6253\u5F00 +FileChooser.pathLabelText=\u9009\u62E9: +FileChooser.filterLabelText=\u7B5B\u9009\u5668: FileChooser.pathLabelMnemonic=83 -FileChooser.foldersLabelText=\u6587\u4ef6\u5939 +FileChooser.foldersLabelText=\u6587\u4EF6\u5939 FileChooser.foldersLabelMnemonic=68 -FileChooser.filesLabelText=\u6587\u4ef6 +FileChooser.filesLabelText=\u6587\u4EF6 FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=\u7ec8\u6b62\u6587\u4ef6\u9009\u62e9\u5668\u5bf9\u8bdd\u6846\u3002 -FileChooser.saveButtonToolTipText=\u4fdd\u5b58\u9009\u5b9a\u7684\u6587\u4ef6\u3002 -FileChooser.openButtonToolTipText=\u6253\u5f00\u9009\u5b9a\u7684\u6587\u4ef6\u3002 +FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002 +FileChooser.saveButtonToolTipText=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6\u3002 +FileChooser.openButtonToolTipText=\u6253\u5F00\u6240\u9009\u6587\u4EF6\u3002 -FileChooser.renameFileDialogText=\u5c06\u6587\u4ef6\u201c{0}\u201d\u91cd\u547d\u540d\u4e3a -FileChooser.renameFileErrorTitle=\u9519\u8bef -FileChooser.renameFileErrorText=\u5c06\u6587\u4ef6\u201c{0}\u201d\u91cd\u547d\u540d\u4e3a\u201c{1}\u201d\u65f6\u51fa\u9519 +FileChooser.renameFileDialogText=\u5C06\u6587\u4EF6 "{0}" \u91CD\u547D\u540D\u4E3A +FileChooser.renameFileErrorTitle=\u9519\u8BEF +FileChooser.renameFileErrorText=\u5C06\u6587\u4EF6 "{0}" \u91CD\u547D\u540D\u4E3A "{1}" \u65F6\u51FA\u9519 OptionPane.okButtonMnemonic=79 OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties index d43facb6be0..84d1d20f407 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/resources/gtk_zh_TW.properties @@ -6,7 +6,7 @@ # GTK specific properties # GTK color chooser properties: -GTKColorChooserPanel.nameText=GTK Color Chooser +GTKColorChooserPanel.nameText=GTK \u8272\u5F69\u9078\u64C7\u5668 # mnemonic as a VK_ constant GTKColorChooserPanel.mnemonic=71 # Can also define GTKColorChooserPanel.dispalyedMnemonicIndex if you @@ -20,64 +20,64 @@ GTKColorChooserPanel.mnemonic=71 # GTKColorChooserPanel.hueMnemonicIndex=1 would indicate the second # character of GTKColorChooserPanel.hueText should be underlined to # represent the mnemonic. -GTKColorChooserPanel.hueText=\u8272\u8abf(H): +GTKColorChooserPanel.hueText=\u8272\u8ABF: GTKColorChooserPanel.hueMnemonic=72 -GTKColorChooserPanel.redText=\u7d05(E): +GTKColorChooserPanel.redText=\u7D05: GTKColorChooserPanel.redMnemonic=69 -GTKColorChooserPanel.saturationText=\u98fd\u548c(S): +GTKColorChooserPanel.saturationText=\u98FD\u548C: GTKColorChooserPanel.saturationMnemonic=83 -GTKColorChooserPanel.greenText=\u7da0(G): +GTKColorChooserPanel.greenText=\u7DA0: GTKColorChooserPanel.greenMnemonic=71 -GTKColorChooserPanel.valueText=\u503c(V): +GTKColorChooserPanel.valueText=\u503C: GTKColorChooserPanel.valueMnemonic=86 -GTKColorChooserPanel.blueText=\u85cd(B): +GTKColorChooserPanel.blueText=\u85CD: GTKColorChooserPanel.blueMnemonic=66 -GTKColorChooserPanel.colorNameText=\u984f\u8272\u540d\u7a31(N): +GTKColorChooserPanel.colorNameText=\u984F\u8272\u540D\u7A31: GTKColorChooserPanel.colorNameMnemonic=78 ############ FILE CHOOSER STRINGS ############# -FileChooser.acceptAllFileFilterText=\u6240\u6709\u6a94\u6848 -FileChooser.newFolderButtonText=\u65b0\u6a94\u6848\u593e +FileChooser.acceptAllFileFilterText=\u6240\u6709\u6A94\u6848 +FileChooser.newFolderButtonText=\u65B0\u8CC7\u6599\u593E FileChooser.newFolderButtonMnemonic=78 -FileChooser.newFolderDialogText=\u6a94\u6848\u593e\u540d\u7a31: -FileChooser.newFolderNoDirectoryErrorTitleText=Error -FileChooser.newFolderNoDirectoryErrorText=Error creating directory "{0}": No such file or directory -FileChooser.deleteFileButtonText=\u522a\u9664\u6a94\u6848 +FileChooser.newFolderDialogText=\u8CC7\u6599\u593E\u540D\u7A31: +FileChooser.newFolderNoDirectoryErrorTitleText=\u932F\u8AA4 +FileChooser.newFolderNoDirectoryErrorText=\u5EFA\u7ACB\u76EE\u9304 "{0}" \u6642\u767C\u751F\u932F\u8AA4: \u6C92\u6709\u6B64\u6A94\u6848\u6216\u76EE\u9304 +FileChooser.deleteFileButtonText=\u522A\u9664\u6A94\u6848 FileChooser.deleteFileButtonMnemonic=76 -FileChooser.renameFileButtonText=\u91cd\u65b0\u547d\u540d\u6a94\u6848 +FileChooser.renameFileButtonText=\u91CD\u65B0\u547D\u540D\u6A94\u6848 FileChooser.renameFileButtonMnemonic=82 -FileChooser.cancelButtonText=\u53d6\u6d88 +FileChooser.cancelButtonText=\u53D6\u6D88 FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\u5132\u5b58 +FileChooser.saveButtonText=\u78BA\u5B9A FileChooser.saveButtonMnemonic=79 -FileChooser.openButtonText=\u78ba\u5b9a +FileChooser.openButtonText=\u78BA\u5B9A FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\u5132\u5b58 -FileChooser.openDialogTitleText=\u958b\u555f -FileChooser.pathLabelText=\u9078\u53d6: -FileChooser.filterLabelText=\u904e\u6ffe\u5668: +FileChooser.saveDialogTitleText=\u5132\u5B58 +FileChooser.openDialogTitleText=\u958B\u555F +FileChooser.pathLabelText=\u9078\u53D6: +FileChooser.filterLabelText=\u7BE9\u9078: FileChooser.pathLabelMnemonic=83 -FileChooser.foldersLabelText=\u6a94\u6848\u593e +FileChooser.foldersLabelText=\u8CC7\u6599\u593E FileChooser.foldersLabelMnemonic=68 -FileChooser.filesLabelText=\u6a94\u6848 +FileChooser.filesLabelText=\u6A94\u6848 FileChooser.filesLabelMnemonic=70 -FileChooser.cancelButtonToolTipText=\u4e2d\u65b7\u6a94\u6848\u9078\u64c7\u7a0b\u5f0f\u5c0d\u8a71\u65b9\u584a\u3002 -FileChooser.saveButtonToolTipText=\u5132\u5b58\u9078\u53d6\u7684\u6a94\u6848\u3002 -FileChooser.openButtonToolTipText=\u958b\u555f\u9078\u53d6\u7684\u6a94\u6848\u3002 +FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002 +FileChooser.saveButtonToolTipText=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848\u3002 +FileChooser.openButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848\u3002 -FileChooser.renameFileDialogText=\u5c07\u6a94\u6848 "{0}" \u91cd\u65b0\u547d\u540d\u70ba -FileChooser.renameFileErrorTitle=\u932f\u8aa4 -FileChooser.renameFileErrorText=\u5c07\u6a94\u6848 "{0}" \u91cd\u65b0\u547d\u540d\u70ba "{1}" \u6642\u51fa\u73fe\u932f\u8aa4 +FileChooser.renameFileDialogText=\u5C07\u6A94\u6848 "{0}" \u91CD\u65B0\u547D\u540D\u70BA +FileChooser.renameFileErrorTitle=\u932F\u8AA4 +FileChooser.renameFileErrorText=\u5C07\u6A94\u6848 "{0}" \u91CD\u65B0\u547D\u540D\u70BA "{1}" \u6642\u51FA\u73FE\u932F\u8AA4 OptionPane.okButtonMnemonic=79 OptionPane.cancelButtonMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties index 9396ee98d95..f1ee7ed76b1 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_de.properties @@ -23,18 +23,18 @@ FileChooser.cancelButtonText=Abbrechen FileChooser.saveButtonText=Speichern FileChooser.openButtonText=OK FileChooser.saveDialogTitleText=Speichern -FileChooser.openDialogTitleText=\u00d6ffnen +FileChooser.openDialogTitleText=\u00D6ffnen FileChooser.updateButtonText=Aktualisieren FileChooser.helpButtonText=Hilfe FileChooser.pathLabelText=Pfad- oder Ordnernamen eingeben: FileChooser.filterLabelText=Filter FileChooser.foldersLabelText=Ordner FileChooser.filesLabelText=Dateien -FileChooser.enterFileNameLabelText=Filternamen eingeben: -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.enterFileNameLabelText=Dateinamen eingeben: +FileChooser.enterFolderNameLabelText=Ordnernamen eingeben: -FileChooser.cancelButtonToolTipText=Dialogfeld f\u00fcr Dateiauswahl abbrechen -FileChooser.saveButtonToolTipText=Ausgew\u00e4hlte Datei speichern -FileChooser.openButtonToolTipText=Ausgew\u00e4hlte Datei \u00f6ffnen -FileChooser.updateButtonToolTipText=Verzeichnisliste aktualisieren -FileChooser.helpButtonToolTipText=Hilfe f\u00fcr Dateiauswahl +FileChooser.cancelButtonToolTipText=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen. +FileChooser.saveButtonToolTipText=Ausgew\u00E4hlte Datei speichern. +FileChooser.openButtonToolTipText=Ausgew\u00E4hlte Datei \u00F6ffnen. +FileChooser.updateButtonToolTipText=Verzeichnisliste aktualisieren. +FileChooser.helpButtonToolTipText=FileChooser-Hilfe. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties index 67918e80980..c4e9108ff0e 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_es.properties @@ -26,15 +26,15 @@ FileChooser.saveDialogTitleText=Guardar FileChooser.openDialogTitleText=Abrir FileChooser.updateButtonText=Actualizar FileChooser.helpButtonText=Ayuda -FileChooser.pathLabelText=Introducir v\u00eda de acceso o nombre de carpeta: +FileChooser.pathLabelText=Introducir nombre de la ruta de acceso o carpeta: FileChooser.filterLabelText=Filtro FileChooser.foldersLabelText=Carpetas FileChooser.filesLabelText=Archivos FileChooser.enterFileNameLabelText=Introducir nombre de archivo: -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.enterFolderNameLabelText=Introducir nombre de carpeta: -FileChooser.cancelButtonToolTipText=Cuadro de di\u00e1logo para cancelar elector de archivo. +FileChooser.cancelButtonToolTipText=Abortar cuadro de di\u00E1logo del selector de archivos. FileChooser.saveButtonToolTipText=Guardar archivo seleccionado. FileChooser.openButtonToolTipText=Abrir archivo seleccionado. FileChooser.updateButtonToolTipText=Actualizar lista de directorios. -FileChooser.helpButtonToolTipText=Ayuda elector de archivos. +FileChooser.helpButtonToolTipText=Ayuda del selector de archivos. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties index d92428272ac..8644dea7930 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_fr.properties @@ -24,17 +24,17 @@ FileChooser.saveButtonText=Enregistrer FileChooser.openButtonText=OK FileChooser.saveDialogTitleText=Enregistrer FileChooser.openDialogTitleText=Ouvrir -FileChooser.updateButtonText=Mise \u00e0 jour +FileChooser.updateButtonText=Mettre \u00E0 jour FileChooser.helpButtonText=Aide FileChooser.pathLabelText=Entrez le chemin ou le nom du dossier : FileChooser.filterLabelText=Filtre FileChooser.foldersLabelText=Dossiers FileChooser.filesLabelText=Fichiers FileChooser.enterFileNameLabelText=Entrez le nom du fichier : -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.enterFolderNameLabelText=Entrez le nom du dossier : -FileChooser.cancelButtonToolTipText=Ferme la bo\u00eete de dialogue du s\u00e9lecteur de fichiers -FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00e9lectionn\u00e9 -FileChooser.openButtonToolTipText=Ouvre le fichier s\u00e9lectionn\u00e9 -FileChooser.updateButtonToolTipText=Met \u00e0 jour la liste des r\u00e9pertoires -FileChooser.helpButtonToolTipText=Aide sur le s\u00e9lecteur de fichiers +FileChooser.cancelButtonToolTipText=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers. +FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00E9lectionn\u00E9. +FileChooser.openButtonToolTipText=Ouvre le fichier s\u00E9lectionn\u00E9. +FileChooser.updateButtonToolTipText=Met \u00E0 jour la liste des r\u00E9pertoires. +FileChooser.helpButtonToolTipText=Aide du s\u00E9lecteur de fichiers diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties index bc0ba15f4c6..e637d6b5e8e 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_it.properties @@ -31,10 +31,10 @@ FileChooser.filterLabelText=Filtro FileChooser.foldersLabelText=Cartelle FileChooser.filesLabelText=File FileChooser.enterFileNameLabelText=Nome file: -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.enterFolderNameLabelText=Nome cartella: -FileChooser.cancelButtonToolTipText=Finestra di dialogo Interrompi Selezione file. -FileChooser.saveButtonToolTipText=Salva file selezionato. -FileChooser.openButtonToolTipText=Apri file selezionato. -FileChooser.updateButtonToolTipText=Aggiorna elenco directory. -FileChooser.helpButtonToolTipText=Guida di Selezione file. +FileChooser.cancelButtonToolTipText=Chiude la finestra di dialogo di selezione file. +FileChooser.saveButtonToolTipText=Salva il file selezionato. +FileChooser.openButtonToolTipText=Apre il file selezionato. +FileChooser.updateButtonToolTipText=Aggiorna lista directory. +FileChooser.helpButtonToolTipText=Guida FileChooser. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties index 4ec2f48e0df..68342cc8544 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ja.properties @@ -19,22 +19,22 @@ ############ FILE CHOOSER STRINGS ############# FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\u53d6\u6d88\u3057 -FileChooser.saveButtonText=\u4fdd\u5b58 -FileChooser.openButtonText=\u4e86\u89e3 -FileChooser.saveDialogTitleText=\u4fdd\u5b58 -FileChooser.openDialogTitleText=\u958b\u304f -FileChooser.updateButtonText=\u66f4\u65b0 -FileChooser.helpButtonText=\u30d8\u30eb\u30d7 -FileChooser.pathLabelText=\u30d1\u30b9\u307e\u305f\u306f\u30d5\u30a9\u30eb\u30c0\u540d\u3092\u5165\u529b: -FileChooser.filterLabelText=\u30d5\u30a3\u30eb\u30bf -FileChooser.foldersLabelText=\u30d5\u30a9\u30eb\u30c0 -FileChooser.filesLabelText=\u30d5\u30a1\u30a4\u30eb -FileChooser.enterFileNameLabelText=\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u5165\u529b: -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.cancelButtonText=\u53D6\u6D88 +FileChooser.saveButtonText=\u4FDD\u5B58 +FileChooser.openButtonText=OK +FileChooser.saveDialogTitleText=\u4FDD\u5B58 +FileChooser.openDialogTitleText=\u958B\u304F +FileChooser.updateButtonText=\u66F4\u65B0 +FileChooser.helpButtonText=\u30D8\u30EB\u30D7 +FileChooser.pathLabelText=\u30D1\u30B9\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B: +FileChooser.filterLabelText=\u30D5\u30A3\u30EB\u30BF +FileChooser.foldersLabelText=\u30D5\u30A9\u30EB\u30C0 +FileChooser.filesLabelText=\u30D5\u30A1\u30A4\u30EB +FileChooser.enterFileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u5165\u529B: +FileChooser.enterFolderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D\u3092\u5165\u529B: -FileChooser.cancelButtonToolTipText=\u30d5\u30a1\u30a4\u30eb\u30c1\u30e5\u30fc\u30b6\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u7d42\u4e86 -FileChooser.saveButtonToolTipText=\u9078\u629e\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u306b\u4fdd\u5b58 -FileChooser.openButtonToolTipText=\u9078\u629e\u3055\u308c\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f -FileChooser.updateButtonToolTipText=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u8868\u793a\u3092\u66f4\u65b0 -FileChooser.helpButtonToolTipText=\u30d5\u30a1\u30a4\u30eb\u30c1\u30e5\u30fc\u30b6\u306e\u30d8\u30eb\u30d7 +FileChooser.cancelButtonToolTipText=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059\u3002 +FileChooser.saveButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059\u3002 +FileChooser.openButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059\u3002 +FileChooser.updateButtonToolTipText=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3092\u66F4\u65B0\u3057\u307E\u3059\u3002 +FileChooser.helpButtonToolTipText=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059\u3002 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties index 067711cf219..f522359b907 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_ko.properties @@ -19,22 +19,22 @@ ############ FILE CHOOSER STRINGS ############# FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\ucde8\uc18c -FileChooser.saveButtonText=\uc800\uc7a5 -FileChooser.openButtonText=\ud655\uc778 -FileChooser.saveDialogTitleText=\uc800\uc7a5 -FileChooser.openDialogTitleText=\uc5f4\uae30 -FileChooser.updateButtonText=\uc5c5\ub370\uc774\ud2b8 -FileChooser.helpButtonText=\ub3c4\uc6c0\ub9d0 -FileChooser.pathLabelText=\uacbd\ub85c \ub610\ub294 \ud3f4\ub354 \uc774\ub984\uc744 \uc785\ub825\ud558\uc2ed\uc2dc\uc624: -FileChooser.filterLabelText=\ud544\ud130 -FileChooser.foldersLabelText=\ud3f4\ub354 -FileChooser.filesLabelText=\ud30c\uc77c -FileChooser.enterFileNameLabelText=\ud30c\uc77c \uc774\ub984\uc744 \uc785\ub825\ud558\uc2ed\uc2dc\uc624: -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.cancelButtonText=\uCDE8\uC18C +FileChooser.saveButtonText=\uC800\uC7A5 +FileChooser.openButtonText=\uD655\uC778 +FileChooser.saveDialogTitleText=\uC800\uC7A5 +FileChooser.openDialogTitleText=\uC5F4\uAE30 +FileChooser.updateButtonText=\uAC31\uC2E0 +FileChooser.helpButtonText=\uB3C4\uC6C0\uB9D0 +FileChooser.pathLabelText=\uACBD\uB85C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uC785\uB825: +FileChooser.filterLabelText=\uD544\uD130 +FileChooser.foldersLabelText=\uD3F4\uB354 +FileChooser.filesLabelText=\uD30C\uC77C +FileChooser.enterFileNameLabelText=\uD30C\uC77C \uC774\uB984 \uC785\uB825: +FileChooser.enterFolderNameLabelText=\uD3F4\uB354 \uC774\uB984 \uC785\uB825: -FileChooser.cancelButtonToolTipText=\ud30c\uc77c \uc120\ud0dd \ub300\ud654\uc0c1\uc790\ub97c \uc911\uc9c0\ud569\ub2c8\ub2e4. -FileChooser.saveButtonToolTipText=\uc120\ud0dd\ub41c \ud30c\uc77c\uc744 \uc800\uc7a5\ud569\ub2c8\ub2e4. -FileChooser.openButtonToolTipText=\uc120\ud0dd\ub41c \ud30c\uc77c\uc744 \uc5fd\ub2c8\ub2e4. -FileChooser.updateButtonToolTipText=\ub514\ub809\ud1a0\ub9ac \ubaa9\ub85d\uc744 \uc5c5\ub370\uc774\ud2b8\ud569\ub2c8\ub2e4. -FileChooser.helpButtonToolTipText=FileChooser \ub3c4\uc6c0\ub9d0. +FileChooser.cancelButtonToolTipText=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790\uB97C \uC911\uB2E8\uD569\uB2C8\uB2E4. +FileChooser.saveButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC800\uC7A5\uD569\uB2C8\uB2E4. +FileChooser.openButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C\uC744 \uC5FD\uB2C8\uB2E4. +FileChooser.updateButtonToolTipText=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D\uC744 \uAC31\uC2E0\uD569\uB2C8\uB2E4. +FileChooser.helpButtonToolTipText=FileChooser \uB3C4\uC6C0\uB9D0\uC785\uB2C8\uB2E4. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties index fd5a50264f3..63b5d9d0c2f 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_pt_BR.properties @@ -26,14 +26,15 @@ FileChooser.saveDialogTitleText=Salvar FileChooser.openDialogTitleText=Abrir FileChooser.updateButtonText=Atualizar FileChooser.helpButtonText=Ajuda -FileChooser.pathLabelText=Inserir caminho ou nome da pasta: +FileChooser.pathLabelText=Informar caminho ou nome da pasta: FileChooser.filterLabelText=Filtro FileChooser.foldersLabelText=Pastas FileChooser.filesLabelText=Arquivos -FileChooser.enterFileNameLabelText=Inserir nome de arquivo: +FileChooser.enterFileNameLabelText=Informar nome do arquivo: +FileChooser.enterFolderNameLabelText=Informar nome da pasta: -FileChooser.cancelButtonToolTipText=Anular caixa de di\u00e1logo do seletor de arquivos. +FileChooser.cancelButtonToolTipText=Abortar caixa de di\u00E1logo do seletor de arquivos. FileChooser.saveButtonToolTipText=Salvar arquivo selecionado. FileChooser.openButtonToolTipText=Abrir arquivo selecionado. -FileChooser.updateButtonToolTipText=Atualizar lista de diret\u00f3rios. +FileChooser.updateButtonToolTipText=Atualizar lista de diret\u00F3rios. FileChooser.helpButtonToolTipText=Ajuda do FileChooser. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties index dcf5ec59741..67a6c078768 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_sv.properties @@ -23,18 +23,18 @@ FileChooser.cancelButtonText=Avbryt FileChooser.saveButtonText=Spara FileChooser.openButtonText=OK FileChooser.saveDialogTitleText=Spara -FileChooser.openDialogTitleText=\u00d6ppna +FileChooser.openDialogTitleText=\u00D6ppna FileChooser.updateButtonText=Uppdatera -FileChooser.helpButtonText=Hj\u00e4lp -FileChooser.pathLabelText=Ange s\u00f6kv\u00e4g eller mappnamn: +FileChooser.helpButtonText=Hj\u00E4lp +FileChooser.pathLabelText=Ange s\u00F6kv\u00E4g eller mappnamn: FileChooser.filterLabelText=Filter FileChooser.foldersLabelText=Mappar FileChooser.filesLabelText=Filer FileChooser.enterFileNameLabelText=Ange filnamn: -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.enterFolderNameLabelText=Ange ett mappnamn: -FileChooser.cancelButtonToolTipText=Avbryt \u00d6ppna fil. -FileChooser.saveButtonToolTipText=Spara markerad fil. -FileChooser.openButtonToolTipText=\u00d6ppna markerad fil. +FileChooser.cancelButtonToolTipText=Avbryt dialogrutan Filv\u00E4ljare. +FileChooser.saveButtonToolTipText=Spara vald fil. +FileChooser.openButtonToolTipText=\u00D6ppna vald fil. FileChooser.updateButtonToolTipText=Uppdatera kataloglistan. -FileChooser.helpButtonToolTipText=Hj\u00e4lp - Filv\u00e4ljare. +FileChooser.helpButtonToolTipText=Hj\u00E4lp - Filv\u00E4ljare. diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties index 9f1fdb8e929..a1576618dca 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_CN.properties @@ -19,22 +19,22 @@ ############ FILE CHOOSER STRINGS ############# FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\u53d6\u6d88 -FileChooser.saveButtonText=\u4fdd\u5b58 -FileChooser.openButtonText=\u786e\u5b9a -FileChooser.saveDialogTitleText=\u4fdd\u5b58 -FileChooser.openDialogTitleText=\u6253\u5f00 -FileChooser.updateButtonText=\u66f4\u65b0 -FileChooser.helpButtonText=\u5e2e\u52a9 -FileChooser.pathLabelText=\u952e\u5165\u8def\u5f84\u6216\u6587\u4ef6\u5939\u540d\uff1a -FileChooser.filterLabelText=\u8fc7\u6ee4\u5668 -FileChooser.foldersLabelText=\u6587\u4ef6\u5939 -FileChooser.filesLabelText=\u6587\u4ef6 -FileChooser.enterFileNameLabelText=\u952e\u5165\u6587\u4ef6\u540d\uff1a -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.cancelButtonText=\u53D6\u6D88 +FileChooser.saveButtonText=\u4FDD\u5B58 +FileChooser.openButtonText=\u786E\u5B9A +FileChooser.saveDialogTitleText=\u4FDD\u5B58 +FileChooser.openDialogTitleText=\u6253\u5F00 +FileChooser.updateButtonText=\u66F4\u65B0 +FileChooser.helpButtonText=\u5E2E\u52A9 +FileChooser.pathLabelText=\u952E\u5165\u8DEF\u5F84\u6216\u6587\u4EF6\u5939\u540D: +FileChooser.filterLabelText=\u7B5B\u9009\u5668 +FileChooser.foldersLabelText=\u6587\u4EF6\u5939 +FileChooser.filesLabelText=\u6587\u4EF6 +FileChooser.enterFileNameLabelText=\u952E\u5165\u6587\u4EF6\u540D: +FileChooser.enterFolderNameLabelText=\u8F93\u5165\u6587\u4EF6\u5939\u540D: -FileChooser.cancelButtonToolTipText=\u7ec8\u6b62\u6587\u4ef6\u9009\u62e9\u5668\u5bf9\u8bdd\u6846 -FileChooser.saveButtonToolTipText=\u4fdd\u5b58\u9009\u62e9\u7684\u6587\u4ef6 -FileChooser.openButtonToolTipText=\u6253\u5f00\u9009\u62e9\u7684\u6587\u4ef6 -FileChooser.updateButtonToolTipText=\u66f4\u65b0\u76ee\u5f55\u5217\u8868 -FileChooser.helpButtonToolTipText=\u6587\u4ef6\u9009\u62e9\u5668\u5e2e\u52a9 +FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846\u3002 +FileChooser.saveButtonToolTipText=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6\u3002 +FileChooser.openButtonToolTipText=\u6253\u5F00\u6240\u9009\u6587\u4EF6\u3002 +FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u5F55\u5217\u8868\u3002 +FileChooser.helpButtonToolTipText=FileChooser \u5E2E\u52A9\u3002 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties index b42af948713..f2985492b1a 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/motif/resources/motif_zh_TW.properties @@ -19,22 +19,22 @@ ############ FILE CHOOSER STRINGS ############# FileChooser.acceptAllFileFilterText=* -FileChooser.cancelButtonText=\u53d6\u6d88 -FileChooser.saveButtonText=\u5132\u5b58 -FileChooser.openButtonText=\u78ba\u5b9a -FileChooser.saveDialogTitleText=\u5132\u5b58 -FileChooser.openDialogTitleText=\u958b\u555f -FileChooser.updateButtonText=\u66f4\u65b0 -FileChooser.helpButtonText=\u8aaa\u660e -FileChooser.pathLabelText=\u8f38\u5165\u8def\u5f91\u6216\u6a94\u6848\u593e\u540d\u7a31\ufe55 -FileChooser.filterLabelText=\u904e\u6ffe\u5668 -FileChooser.foldersLabelText=\u6a94\u6848\u593e -FileChooser.filesLabelText=\u6a94\u6848 -FileChooser.enterFileNameLabelText=\u8f38\u5165\u6a94\u6848\u540d\u7a31\ufe55 -FileChooser.enterFolderNameLabelText=Enter folder name: +FileChooser.cancelButtonText=\u53D6\u6D88 +FileChooser.saveButtonText=\u5132\u5B58 +FileChooser.openButtonText=\u78BA\u5B9A +FileChooser.saveDialogTitleText=\u5132\u5B58 +FileChooser.openDialogTitleText=\u958B\u555F +FileChooser.updateButtonText=\u66F4\u65B0 +FileChooser.helpButtonText=\u8AAA\u660E +FileChooser.pathLabelText=\u8F38\u5165\u8DEF\u5F91\u6216\u8CC7\u6599\u593E\u540D\u7A31: +FileChooser.filterLabelText=\u7BE9\u9078 +FileChooser.foldersLabelText=\u8CC7\u6599\u593E +FileChooser.filesLabelText=\u6A94\u6848 +FileChooser.enterFileNameLabelText=\u8F38\u5165\u6A94\u6848\u540D\u7A31: +FileChooser.enterFolderNameLabelText=\u8F38\u5165\u8CC7\u6599\u593E\u540D\u7A31: -FileChooser.cancelButtonToolTipText=\u4e2d\u65b7\u300c\u6a94\u6848\u9078\u64c7\u5668\u300d\u5c0d\u8a71\u65b9\u584a\u3002 -FileChooser.saveButtonToolTipText=\u5132\u5b58\u9078\u53d6\u7684\u6a94\u6848\u3002 -FileChooser.openButtonToolTipText=\u958b\u555f\u9078\u53d6\u7684\u6a94\u6848\u3002 -FileChooser.updateButtonToolTipText=\u66f4\u65b0\u76ee\u9304\u6e05\u55ae\u3002 -FileChooser.helpButtonToolTipText=\u300c\u6a94\u6848\u9078\u64c7\u5668\u300d\u8aaa\u660e\u3002 +FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A\u3002 +FileChooser.saveButtonToolTipText=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848\u3002 +FileChooser.openButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848\u3002 +FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u9304\u6E05\u55AE\u3002 +FileChooser.helpButtonToolTipText=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E\u3002 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties index c08a39e5a1c..993b26445f3 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_de.properties @@ -21,10 +21,10 @@ FileChooser.lookInLabelText=Suchen in: FileChooser.saveInLabelText=Speichern in: FileChooser.fileNameLabelText=Dateiname: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Ordnername: FileChooser.filesOfTypeLabelText=Dateityp: -FileChooser.upFolderToolTipText=Eine Ebene h\u00f6her -FileChooser.upFolderAccessibleName=H\u00f6her +FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her +FileChooser.upFolderAccessibleName=Nach oben FileChooser.homeFolderToolTipText=Home FileChooser.homeFolderAccessibleName=Home FileChooser.newFolderToolTipText=Neuen Ordner erstellen @@ -35,13 +35,13 @@ FileChooser.listViewButtonAccessibleName=Liste FileChooser.listViewActionLabelText=Liste FileChooser.detailsViewButtonToolTipText=Details FileChooser.detailsViewButtonAccessibleName=Details -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu +FileChooser.viewMenuButtonToolTipText = Ansichtsmen\u00FC +FileChooser.viewMenuButtonAccessibleName = Ansichtsmen\u00FC FileChooser.detailsViewActionLabelText=Details FileChooser.refreshActionLabelText=Aktualisieren FileChooser.viewMenuLabelText=Ansicht -FileChooser.fileNameHeaderText=Dateiname -FileChooser.fileSizeHeaderText=Gr\u00f6\u00dfe +FileChooser.fileNameHeaderText=Name +FileChooser.fileSizeHeaderText=Gr\u00F6\u00DFe FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=Ge\u00e4ndert -FileChooser.fileAttrHeaderText=Attribut +FileChooser.fileDateHeaderText=Ge\u00E4ndert +FileChooser.fileAttrHeaderText=Attribute diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties index 1e413749e46..adf964b0013 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_es.properties @@ -20,28 +20,28 @@ FileChooser.lookInLabelText=Buscar en: FileChooser.saveInLabelText=Guardar en: -FileChooser.fileNameLabelText=Nombre de archivo: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=Archivos de tipo: -FileChooser.upFolderToolTipText=Subir un nivel +FileChooser.fileNameLabelText=Nombre de Archivo: +FileChooser.folderNameLabelText=Nombre de la Carpeta: +FileChooser.filesOfTypeLabelText=Archivos de Tipo: +FileChooser.upFolderToolTipText=Subir un Nivel FileChooser.upFolderAccessibleName=Arriba -FileChooser.homeFolderToolTipText=Principal -FileChooser.homeFolderAccessibleName=Principal -FileChooser.newFolderToolTipText=Crear carpeta nueva -FileChooser.newFolderAccessibleName=Carpeta nueva -FileChooser.newFolderActionLabelText=Carpeta nueva +FileChooser.homeFolderToolTipText=Inicio +FileChooser.homeFolderAccessibleName=Inicio +FileChooser.newFolderToolTipText=Crear Nueva Carpeta +FileChooser.newFolderAccessibleName=Nueva Carpeta +FileChooser.newFolderActionLabelText=Nueva Carpeta FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Detalles FileChooser.detailsViewButtonAccessibleName=Detalles -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu +FileChooser.viewMenuButtonToolTipText = Men\u00FA Ver +FileChooser.viewMenuButtonAccessibleName = Men\u00FA Ver FileChooser.detailsViewActionLabelText=Detalles -FileChooser.refreshActionLabelText=Renovar +FileChooser.refreshActionLabelText=Refrescar FileChooser.viewMenuLabelText=Ver FileChooser.fileNameHeaderText=Nombre -FileChooser.fileSizeHeaderText=Tama\u00f1o +FileChooser.fileSizeHeaderText=Tama\u00F1o FileChooser.fileTypeHeaderText=Tipo FileChooser.fileDateHeaderText=Modificado FileChooser.fileAttrHeaderText=Atributos diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties index 3fdc78cd06e..d4561daaadb 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_fr.properties @@ -20,28 +20,28 @@ FileChooser.lookInLabelText=Rechercher dans : FileChooser.saveInLabelText=Enregistrer dans : -FileChooser.fileNameLabelText=Nom de fichier : -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=Fichiers du type : +FileChooser.fileNameLabelText=Nom du fichier : +FileChooser.folderNameLabelText=Nom du dossier : +FileChooser.filesOfTypeLabelText=Fichiers de type : FileChooser.upFolderToolTipText=Remonte d'un niveau. -FileChooser.upFolderAccessibleName=Vers le haut -FileChooser.homeFolderToolTipText=R\u00e9pertoire d'accueil -FileChooser.homeFolderAccessibleName=Accueil -FileChooser.newFolderToolTipText=Cr\u00e9e un nouveau dossier. +FileChooser.upFolderAccessibleName=Monter +FileChooser.homeFolderToolTipText=R\u00E9pertoire d'origine +FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine +FileChooser.newFolderToolTipText=Cr\u00E9e un dossier. FileChooser.newFolderAccessibleName=Nouveau dossier FileChooser.newFolderActionLabelText=Nouveau dossier FileChooser.listViewButtonToolTipText=Liste FileChooser.listViewButtonAccessibleName=Liste FileChooser.listViewActionLabelText=Liste -FileChooser.detailsViewButtonToolTipText=D\u00e9tails -FileChooser.detailsViewButtonAccessibleName=D\u00e9tails -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=D\u00e9tails +FileChooser.detailsViewButtonToolTipText=D\u00E9tails +FileChooser.detailsViewButtonAccessibleName=D\u00E9tails +FileChooser.viewMenuButtonToolTipText = Menu Affichage +FileChooser.viewMenuButtonAccessibleName = Menu Affichage +FileChooser.detailsViewActionLabelText=D\u00E9tails FileChooser.refreshActionLabelText=Actualiser FileChooser.viewMenuLabelText=Affichage FileChooser.fileNameHeaderText=Nom FileChooser.fileSizeHeaderText=Taille FileChooser.fileTypeHeaderText=Type -FileChooser.fileDateHeaderText=Modifi\u00e9 +FileChooser.fileDateHeaderText=Modifi\u00E9 FileChooser.fileAttrHeaderText=Attributs diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties index 40777cc9792..4edf194a173 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_it.properties @@ -21,22 +21,22 @@ FileChooser.lookInLabelText=Cerca in: FileChooser.saveInLabelText=Salva in: FileChooser.fileNameLabelText=Nome file: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Nome della cartella: FileChooser.filesOfTypeLabelText=Tipo file: FileChooser.upFolderToolTipText=Cartella superiore FileChooser.upFolderAccessibleName=Superiore -FileChooser.homeFolderToolTipText=Principale -FileChooser.homeFolderAccessibleName=Principale +FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderAccessibleName=Home FileChooser.newFolderToolTipText=Crea nuova cartella FileChooser.newFolderAccessibleName=Nuova cartella FileChooser.newFolderActionLabelText=Nuova cartella -FileChooser.listViewButtonToolTipText=Elenco -FileChooser.listViewButtonAccessibleName=Elenco -FileChooser.listViewActionLabelText=Elenco +FileChooser.listViewButtonToolTipText=Lista +FileChooser.listViewButtonAccessibleName=Lista +FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Dettagli FileChooser.detailsViewButtonAccessibleName=Dettagli -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu +FileChooser.viewMenuButtonToolTipText = Visualizza menu +FileChooser.viewMenuButtonAccessibleName = Visualizza menu FileChooser.detailsViewActionLabelText=Dettagli FileChooser.refreshActionLabelText=Aggiorna FileChooser.viewMenuLabelText=Visualizza diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties index 6613739e4cd..7c6c3053372 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ja.properties @@ -18,33 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u53c2\u7167: -FileChooser.saveInLabelText=\u4fdd\u5b58: -FileChooser.fileNameLabelText=\u30d5\u30a1\u30a4\u30eb\u540d: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7: -FileChooser.upFolderToolTipText=1 \u30ec\u30d9\u30eb\u4e0a\u3078 -FileChooser.upFolderAccessibleName=\u4e0a\u3078 -FileChooser.homeFolderToolTipText=\u30db\u30fc\u30e0 -FileChooser.homeFolderAccessibleName=\u30db\u30fc\u30e0 -FileChooser.newFolderToolTipText=\u30d5\u30a9\u30eb\u30c0\u306e\u65b0\u898f\u4f5c\u6210 -FileChooser.newFolderAccessibleName=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.newFolderActionLabelText=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.listViewButtonToolTipText=\u30ea\u30b9\u30c8 -FileChooser.listViewButtonAccessibleName=\u30ea\u30b9\u30c8 -FileChooser.listViewActionLabelText=\u30ea\u30b9\u30c8 -FileChooser.detailsViewButtonToolTipText=\u8a73\u7d30 -FileChooser.detailsViewButtonAccessibleName=\u8a73\u7d30 -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=\u8a73\u7d30 -FileChooser.refreshActionLabelText=\u66f4\u65b0 -FileChooser.viewMenuLabelText=\u8868\u793a -FileChooser.fileNameHeaderText=\u540d\u524d -FileChooser.fileSizeHeaderText=\u30b5\u30a4\u30ba -FileChooser.fileTypeHeaderText=\u30bf\u30a4\u30d7 -FileChooser.fileDateHeaderText=\u66f4\u65b0\u65e5 -FileChooser.fileAttrHeaderText=\u5c5e\u6027 -FileChooser.directoryOpenButtonText=\u958b\u304f(O) -FileChooser.openButtonText=\u958b\u304f(O) -FileChooser.saveButtonText=\u4fdd\u5b58(S) +FileChooser.lookInLabelText=\u53C2\u7167: +FileChooser.saveInLabelText=\u4FDD\u5B58: +FileChooser.fileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D: +FileChooser.folderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D: +FileChooser.filesOfTypeLabelText=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7: +FileChooser.upFolderToolTipText=1\u30EC\u30D9\u30EB\u4E0A\u3078 +FileChooser.upFolderAccessibleName=\u4E0A\u3078 +FileChooser.homeFolderToolTipText=\u30DB\u30FC\u30E0 +FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0 +FileChooser.newFolderToolTipText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210 +FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.newFolderActionLabelText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.listViewButtonToolTipText=\u30EA\u30B9\u30C8 +FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8 +FileChooser.listViewActionLabelText=\u30EA\u30B9\u30C8 +FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30 +FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30 +FileChooser.viewMenuButtonToolTipText = \u8868\u793A\u30E1\u30CB\u30E5\u30FC +FileChooser.viewMenuButtonAccessibleName = \u8868\u793A\u30E1\u30CB\u30E5\u30FC +FileChooser.detailsViewActionLabelText=\u8A73\u7D30 +FileChooser.refreshActionLabelText=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5 +FileChooser.viewMenuLabelText=\u8868\u793A +FileChooser.fileNameHeaderText=\u540D\u524D +FileChooser.fileSizeHeaderText=\u30B5\u30A4\u30BA +FileChooser.fileTypeHeaderText=\u30BF\u30A4\u30D7 +FileChooser.fileDateHeaderText=\u4FEE\u6B63\u65E5 +FileChooser.fileAttrHeaderText=\u5C5E\u6027 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties index b53c21aaff1..53dedb4d672 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_ko.properties @@ -18,33 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\uac80\uc0c9 \uc704\uce58: -FileChooser.saveInLabelText=\uc800\uc7a5 \uc704\uce58: -FileChooser.fileNameLabelText=\ud30c\uc77c \uc774\ub984: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\ud30c\uc77c \uc885\ub958: -FileChooser.upFolderToolTipText=\ud55c \ub2e8\uacc4 \uc704\ub85c -FileChooser.upFolderAccessibleName=\uc704 -FileChooser.homeFolderToolTipText=\ud648 -FileChooser.homeFolderAccessibleName=\ud648 -FileChooser.newFolderToolTipText=\uc0c8 \ud3f4\ub354 \uc791\uc131 -FileChooser.newFolderAccessibleName=\uc0c8 \ud3f4\ub354 -FileChooser.newFolderActionLabelText=\uc0c8 \ud3f4\ub354 -FileChooser.listViewButtonToolTipText=\ubaa9\ub85d -FileChooser.listViewButtonAccessibleName=\ubaa9\ub85d -FileChooser.listViewActionLabelText=\ubaa9\ub85d -FileChooser.detailsViewButtonToolTipText=\uc790\uc138\ud788 -FileChooser.detailsViewButtonAccessibleName=\uc790\uc138\ud788 -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=\uc790\uc138\ud788 -FileChooser.refreshActionLabelText=\uac31\uc2e0 -FileChooser.viewMenuLabelText=\ubcf4\uae30 -FileChooser.fileNameHeaderText=\uc774\ub984 -FileChooser.fileSizeHeaderText=\ud06c\uae30 -FileChooser.fileTypeHeaderText=\uc885\ub958 -FileChooser.fileDateHeaderText=\uc218\uc815 -FileChooser.fileAttrHeaderText=\uc18d\uc131 -FileChooser.directoryOpenButtonText=\uc5f4\uae30(O) -FileChooser.openButtonText=\uc5f4\uae30(O) -FileChooser.saveButtonText=\uc800\uc7a5(S) +FileChooser.lookInLabelText=\uAC80\uC0C9 \uC704\uCE58: +FileChooser.saveInLabelText=\uC800\uC7A5 \uC704\uCE58: +FileChooser.fileNameLabelText=\uD30C\uC77C \uC774\uB984: +FileChooser.folderNameLabelText=\uD3F4\uB354 \uC774\uB984: +FileChooser.filesOfTypeLabelText=\uD30C\uC77C \uC720\uD615: +FileChooser.upFolderToolTipText=\uD55C \uB808\uBCA8 \uC704\uB85C +FileChooser.upFolderAccessibleName=\uC704\uB85C +FileChooser.homeFolderToolTipText=\uD648 +FileChooser.homeFolderAccessibleName=\uD648 +FileChooser.newFolderToolTipText=\uC0C8 \uD3F4\uB354 \uC0DD\uC131 +FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354 +FileChooser.newFolderActionLabelText=\uC0C8 \uD3F4\uB354 +FileChooser.listViewButtonToolTipText=\uBAA9\uB85D +FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D +FileChooser.listViewActionLabelText=\uBAA9\uB85D +FileChooser.detailsViewButtonToolTipText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 +FileChooser.viewMenuButtonToolTipText = \uBCF4\uAE30 \uBA54\uB274 +FileChooser.viewMenuButtonAccessibleName = \uBCF4\uAE30 \uBA54\uB274 +FileChooser.detailsViewActionLabelText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.refreshActionLabelText=\uC0C8\uB85C \uACE0\uCE68 +FileChooser.viewMenuLabelText=\uBCF4\uAE30 +FileChooser.fileNameHeaderText=\uC774\uB984 +FileChooser.fileSizeHeaderText=\uD06C\uAE30 +FileChooser.fileTypeHeaderText=\uC720\uD615 +FileChooser.fileDateHeaderText=\uC218\uC815 \uB0A0\uC9DC +FileChooser.fileAttrHeaderText=\uC18D\uC131 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties index b7c7e14edec..526a0f9e5f1 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_pt_BR.properties @@ -20,20 +20,23 @@ FileChooser.lookInLabelText=Consultar em: FileChooser.saveInLabelText=Salvar em: -FileChooser.fileNameLabelText=Nome de arquivo: -FileChooser.filesOfTypeLabelText=Arquivos de tipo: -FileChooser.upFolderToolTipText=Um n\u00edvel acima +FileChooser.fileNameLabelText=Nome do arquivo: +FileChooser.folderNameLabelText=Nome da pasta: +FileChooser.filesOfTypeLabelText=Arquivos do tipo: +FileChooser.upFolderToolTipText=Um N\u00EDvel Acima FileChooser.upFolderAccessibleName=Acima -FileChooser.homeFolderToolTipText=In\u00edcio -FileChooser.homeFolderAccessibleName=In\u00edcio -FileChooser.newFolderToolTipText=Criar nova pasta -FileChooser.newFolderAccessibleName=Nova pasta -FileChooser.newFolderActionLabelText=Nova pasta +FileChooser.homeFolderToolTipText=In\u00EDcio +FileChooser.homeFolderAccessibleName=In\u00EDcio +FileChooser.newFolderToolTipText=Criar Nova Pasta +FileChooser.newFolderAccessibleName=Nova Pasta +FileChooser.newFolderActionLabelText=Nova Pasta FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Detalhes FileChooser.detailsViewButtonAccessibleName=Detalhes +FileChooser.viewMenuButtonToolTipText = Exibir Menu +FileChooser.viewMenuButtonAccessibleName = Exibir Menu FileChooser.detailsViewActionLabelText=Detalhes FileChooser.refreshActionLabelText=Atualizar FileChooser.viewMenuLabelText=Exibir diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties index 632e54e204a..fc8358df46d 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_sv.properties @@ -21,9 +21,9 @@ FileChooser.lookInLabelText=Leta i: FileChooser.saveInLabelText=Spara i: FileChooser.fileNameLabelText=Filnamn: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Mapp: FileChooser.filesOfTypeLabelText=Filformat: -FileChooser.upFolderToolTipText=Upp en niv\u00e5 +FileChooser.upFolderToolTipText=Upp en niv\u00E5 FileChooser.upFolderAccessibleName=Upp FileChooser.homeFolderToolTipText=Hem FileChooser.homeFolderAccessibleName=Hem @@ -33,15 +33,15 @@ FileChooser.newFolderActionLabelText=Ny mapp FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista -FileChooser.detailsViewButtonToolTipText=Detaljerad lista -FileChooser.detailsViewButtonAccessibleName=Detaljerad lista -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=Detaljerad lista -FileChooser.refreshActionLabelText=Uppdatera +FileChooser.detailsViewButtonToolTipText=Detaljer +FileChooser.detailsViewButtonAccessibleName=Detaljer +FileChooser.viewMenuButtonToolTipText = Menyn Visa +FileChooser.viewMenuButtonAccessibleName = Menyn Visa +FileChooser.detailsViewActionLabelText=Detaljer +FileChooser.refreshActionLabelText=F\u00F6rnya FileChooser.viewMenuLabelText=Vy FileChooser.fileNameHeaderText=Namn FileChooser.fileSizeHeaderText=Storlek FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=\u00c4ndrad +FileChooser.fileDateHeaderText=\u00C4ndrad FileChooser.fileAttrHeaderText=Attribut diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties index b9d2a7ea9c8..ae6fe8033cb 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_CN.properties @@ -18,33 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67e5\u770b\uff1a -FileChooser.saveInLabelText=\u4fdd\u5b58\uff1a -FileChooser.fileNameLabelText=\u6587\u4ef6\u540d\uff1a -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u6587\u4ef6\u7c7b\u578b\uff1a -FileChooser.upFolderToolTipText=\u5411\u4e0a\u4e00\u5c42 -FileChooser.upFolderAccessibleName=\u5411\u4e0a -FileChooser.homeFolderToolTipText=\u8d77\u59cb\u76ee\u5f55 -FileChooser.homeFolderAccessibleName=\u8d77\u59cb\u76ee\u5f55 -FileChooser.newFolderToolTipText=\u521b\u5efa\u65b0\u7684\u6587\u4ef6\u5939 -FileChooser.newFolderAccessibleName=\u65b0\u5efa\u6587\u4ef6\u5939 -FileChooser.newFolderActionLabelText=\u65b0\u5efa\u6587\u4ef6\u5939 +FileChooser.lookInLabelText=\u67E5\u770B: +FileChooser.saveInLabelText=\u4FDD\u5B58: +FileChooser.fileNameLabelText=\u6587\u4EF6\u540D: +FileChooser.folderNameLabelText=\u6587\u4EF6\u5939\u540D: +FileChooser.filesOfTypeLabelText=\u6587\u4EF6\u7C7B\u578B: +FileChooser.upFolderToolTipText=\u5411\u4E0A\u4E00\u7EA7 +FileChooser.upFolderAccessibleName=\u5411\u4E0A +FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u5F55 +FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55 +FileChooser.newFolderToolTipText=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939 +FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939 +FileChooser.newFolderActionLabelText=\u65B0\u5EFA\u6587\u4EF6\u5939 FileChooser.listViewButtonToolTipText=\u5217\u8868 FileChooser.listViewButtonAccessibleName=\u5217\u8868 FileChooser.listViewActionLabelText=\u5217\u8868 -FileChooser.detailsViewButtonToolTipText=\u8be6\u7ec6\u4fe1\u606f -FileChooser.detailsViewButtonAccessibleName=\u8be6\u7ec6\u4fe1\u606f -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=\u8be6\u7ec6\u4fe1\u606f -FileChooser.refreshActionLabelText=\u5237\u65b0 -FileChooser.viewMenuLabelText=\u89c6\u56fe -FileChooser.fileNameHeaderText=\u540d\u79f0 -FileChooser.fileSizeHeaderText=\u5927\u5c0f -FileChooser.fileTypeHeaderText=\u7c7b\u578b -FileChooser.fileDateHeaderText=\u4fee\u8ba2\u7248 -FileChooser.fileAttrHeaderText=\u5c5e\u6027 -FileChooser.directoryOpenButtonText=\u6253\u5f00(O) -FileChooser.openButtonText=\u6253\u5f00(O) -FileChooser.saveButtonText=\u4fdd\u5b58(S) +FileChooser.detailsViewButtonToolTipText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.viewMenuButtonToolTipText = \u67E5\u770B\u83DC\u5355 +FileChooser.viewMenuButtonAccessibleName = \u67E5\u770B\u83DC\u5355 +FileChooser.detailsViewActionLabelText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.refreshActionLabelText=\u5237\u65B0 +FileChooser.viewMenuLabelText=\u89C6\u56FE +FileChooser.fileNameHeaderText=\u540D\u79F0 +FileChooser.fileSizeHeaderText=\u5927\u5C0F +FileChooser.fileTypeHeaderText=\u7C7B\u578B +FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeaderText=\u5C5E\u6027 diff --git a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties index 03cbc52dd48..fe18bdc2fa2 100644 --- a/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/java/swing/plaf/windows/resources/windows_zh_TW.properties @@ -18,33 +18,30 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67e5\u770b\ufe55 -FileChooser.saveInLabelText=\u5132\u5b58\u65bc\uff1a -FileChooser.fileNameLabelText=\u6a94\u6848\u540d\u7a31\ufe55 -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u6a94\u6848\u985e\u578b\ufe55 -FileChooser.upFolderToolTipText=\u5f80\u4e0a\u4e00\u5c64 -FileChooser.upFolderAccessibleName=\u5f80\u4e0a -FileChooser.homeFolderToolTipText=\u56de\u4e3b\u76ee\u9304 -FileChooser.homeFolderAccessibleName=\u4e3b\u76ee\u9304 -FileChooser.newFolderToolTipText=\u5efa\u7acb\u65b0\u8cc7\u6599\u593e -FileChooser.newFolderAccessibleName=\u65b0\u8cc7\u6599\u593e -FileChooser.newFolderActionLabelText=\u65b0\u8cc7\u6599\u593e -FileChooser.listViewButtonToolTipText=\u6a94\u6848\u6e05\u55ae -FileChooser.listViewButtonAccessibleName=\u6e05\u55ae -FileChooser.listViewActionLabelText=\u6e05\u55ae -FileChooser.detailsViewButtonToolTipText=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.detailsViewButtonAccessibleName=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.viewMenuButtonToolTipText = View Menu -FileChooser.viewMenuButtonAccessibleName = View Menu -FileChooser.detailsViewActionLabelText=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.refreshActionLabelText=\u66f4\u65b0 -FileChooser.viewMenuLabelText=\u6aa2\u8996 -FileChooser.fileNameHeaderText=\u540d\u7a31 -FileChooser.fileSizeHeaderText=\u5927\u5c0f -FileChooser.fileTypeHeaderText=\u985e\u578b -FileChooser.fileDateHeaderText=\u4fee\u6539 -FileChooser.fileAttrHeaderText=\u5c6c\u6027 -FileChooser.directoryOpenButtonText=\u958b\u555f(O) -FileChooser.openButtonText=\u958b\u555f(O) -FileChooser.saveButtonText=\u5132\u5b58(S) +FileChooser.lookInLabelText=\u67E5\u8A62: +FileChooser.saveInLabelText=\u5132\u5B58\u65BC: +FileChooser.fileNameLabelText=\u6A94\u6848\u540D\u7A31: +FileChooser.folderNameLabelText=\u8CC7\u6599\u593E\u540D\u7A31: +FileChooser.filesOfTypeLabelText=\u6A94\u6848\u985E\u578B: +FileChooser.upFolderToolTipText=\u5F80\u4E0A\u4E00\u5C64 +FileChooser.upFolderAccessibleName=\u5F80\u4E0A +FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u9304 +FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304 +FileChooser.newFolderToolTipText=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderActionLabelText=\u65B0\u8CC7\u6599\u593E +FileChooser.listViewButtonToolTipText=\u6E05\u55AE +FileChooser.listViewButtonAccessibleName=\u6E05\u55AE +FileChooser.listViewActionLabelText=\u6E05\u55AE +FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.viewMenuButtonToolTipText = \u6AA2\u8996\u529F\u80FD\u8868 +FileChooser.viewMenuButtonAccessibleName = \u6AA2\u8996\u529F\u80FD\u8868 +FileChooser.detailsViewActionLabelText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.refreshActionLabelText=\u91CD\u65B0\u6574\u7406 +FileChooser.viewMenuLabelText=\u6AA2\u8996 +FileChooser.fileNameHeaderText=\u540D\u7A31 +FileChooser.fileSizeHeaderText=\u5927\u5C0F +FileChooser.fileTypeHeaderText=\u985E\u578B +FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeaderText=\u5C6C\u6027 diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties index ccf8de47aad..41e23d770e9 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_de.properties @@ -24,145 +24,147 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = Ung\u00fcltiges Objekt ResultSet zum Auff\u00fcllen der Methode -cachedrowsetimpl.invalidp = Ung\u00fcltiger Best\u00e4ndigkeits-Provider generiert -cachedrowsetimpl.nullhash = Instanz CachedRowSetImpl konnte nicht instanziiert werden. Hash-Tabelle mit Nullwert f\u00fcr Konstruktor angegeben -cachedrowsetimpl.invalidop = Ung\u00fcltiger Vorgang beim Zeileneinf\u00fcgen -cachedrowsetimpl.accfailed = acceptChanges fehlgeschlagen -cachedrowsetimpl.invalidcp = Ung\u00fcltige Cursorposition -cachedrowsetimpl.illegalop = Ung\u00fcltiger Vorgang bei nicht eingef\u00fcgter Zeile -cachedrowsetimpl.clonefail = Fehler bei Klon: {0} -cachedrowsetimpl.invalidcol = Ung\u00fcltiger Spaltenindex -cachedrowsetimpl.invalcolnm = Ung\u00fcltiger Spaltenname -cachedrowsetimpl.boolfail = getBoolen bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.bytefail = getByte bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.shortfail = getShort bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.intfail = getInt bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.longfail = getLong bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.floatfail = getFloat bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.doublefail = getDouble bei Wert ( {0} ) in Spalte {1} fehlgeschlagen -cachedrowsetimpl.dtypemismt = Keine Datentyp\u00fcbereinstimmung -cachedrowsetimpl.datefail = getDate bei Wert ( {0} ) in Spalte {1} fehlgeschlagen; keine Konvertierung m\u00f6glich -cachedrowsetimpl.timefail = getTime bei Wert ( {0} ) in Spalte {1} fehlgeschlagen; keine Konvertierung m\u00f6glich -cachedrowsetimpl.posupdate = Positionierte Aktualisierungen werden nicht unterst\u00fctzt -cachedrowsetimpl.unableins = Keine Instanziierung m\u00f6glich: {0} -cachedrowsetimpl.beforefirst = beforeFirst : Ung\u00fcltiger Cursorvorgang -cachedrowsetimpl.first = First : Ung\u00fcltiger Cursorvorgang -cachedrowsetimpl.last = last : TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute: Ung\u00fcltige Cursorposition -cachedrowsetimpl.relative = relative: Ung\u00fcltige Cursorposition -cachedrowsetimpl.asciistream = Lesen von ASCII-Strom fehlgeschlagen -cachedrowsetimpl.binstream = Lesen von Bin\u00e4rstrom fehlgeschlagen -cachedrowsetimpl.failedins = Fehler beim Zeileneinf\u00fcgen -cachedrowsetimpl.updateins = Aufrufen von updateRow beim Zeileneinf\u00fcgen +cachedrowsetimpl.populate = Ung\u00FCltiges ResultSet-Objekt zum Auff\u00FCllen der Methode angegeben +cachedrowsetimpl.invalidp = Ung\u00FCltiger Persistence-Provider generiert +cachedrowsetimpl.nullhash = CachedRowSetImpl-Instanz kann nicht instanziiert werden. Null-Hash-Tabelle f\u00FCr Constructor angegeben +cachedrowsetimpl.invalidop = Ung\u00FCltiger Vorgang beim Zeileneinf\u00FCgen +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.invalidcol = Ung\u00FCltiger Spaltenindex +cachedrowsetimpl.invalcolnm = Ung\u00FCltiger Spaltenname +cachedrowsetimpl.boolfail = getBoolen bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.bytefail = getByte bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.shortfail = getShort bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.intfail = getInt bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.longfail = getLong bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.floatfail = getFloat bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.doublefail = getDouble bei Wert ( {0} ) in Spalte {1} nicht erfolgreich +cachedrowsetimpl.dtypemismt = Keine Datentyp\u00FCbereinstimmung +cachedrowsetimpl.datefail = getDate bei Wert ( {0} ) in Spalte {1} nicht erfolgreich. Keine Konvertierung m\u00F6glich +cachedrowsetimpl.timefail = getTime bei Wert ( {0} ) in Spalte {1} nicht erfolgreich. Keine Konvertierung m\u00F6glich +cachedrowsetimpl.posupdate = Positionierte Updates werden nicht unterst\u00FCtzt +cachedrowsetimpl.unableins = Keine Instanziierung m\u00F6glich: {0} +cachedrowsetimpl.beforefirst = beforeFirst: Ung\u00FCltiger Cursorvorgang +cachedrowsetimpl.first = First: Ung\u00FCltiger Cursorvorgang +cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY +cachedrowsetimpl.absolute = absolute: Ung\u00FCltige Cursorposition +cachedrowsetimpl.relative = relative: Ung\u00FCltige Cursorposition +cachedrowsetimpl.asciistream = Lesen von ASCII-Stream nicht erfolgreich +cachedrowsetimpl.binstream = Lesen von Bin\u00E4r-Stream nicht erfolgreich +cachedrowsetimpl.failedins = Fehler beim Zeileneinf\u00FCgen +cachedrowsetimpl.updateins = updateRow beim Zeileneinf\u00FCgen aufgerufen cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY cachedrowsetimpl.movetoins1 = moveToInsertRow: keine Metadaten -cachedrowsetimpl.movetoins2 = moveToInsertRow: ung\u00fcltige Spaltenanzahl -cachedrowsetimpl.tablename = Tabellenname darf nicht Null sein -cachedrowsetimpl.keycols = Ung\u00fcltige Schl\u00fcsselspalten -cachedrowsetimpl.opnotsupp = Datenbank unterst\u00fctzt Vorgang nicht -cachedrowsetimpl.matchcols = \u00dcbereinstimmende Spalten entsprechen nicht den definierten Spalten -cachedrowsetimpl.setmatchcols = \u00dcbereinstimmende Spalten m\u00fcssen vor dem Abrufen definiert werden -cachedrowsetimpl.matchcols1 = Wert f\u00fcr \u00fcbereinstimmende Spalten muss gr\u00f6\u00dfer als 0 sein -cachedrowsetimpl.matchcols2 = \u00dcbereinstimmende Spalten m\u00fcssen leer sein oder eine Nullzeichenfolge aufweisen -cachedrowsetimpl.unsetmatch = Spalten ohne definierten Wert entsprechen nicht Spalten mit definiertem Wert -cachedrowsetimpl.unsetmatch1 = Spaltenname als Argument f\u00fcr unsetMatchColumn verwenden -cachedrowsetimpl.unsetmatch2 = Spalten-ID als Argument f\u00fcr unsetMatchColumn verwenden -cachedrowsetimpl.numrows = Zeilenanzahl ist kleiner als Null oder kleiner als Abrufgr\u00f6\u00dfe +cachedrowsetimpl.movetoins2 = moveToInsertRow: ung\u00FCltige Spaltenanzahl +cachedrowsetimpl.tablename = Tabellenname darf nicht null sein +cachedrowsetimpl.keycols = Ung\u00FCltige Schl\u00FCsselspalten +cachedrowsetimpl.invalidcol = Ung\u00FCltiger Spaltenindex +cachedrowsetimpl.opnotsupp = Vorgang nicht von Datenbank unterst\u00FCtzt +cachedrowsetimpl.matchcols = \u00DCbereinstimmungsspalten entsprechen nicht den festgelegten Spalten +cachedrowsetimpl.setmatchcols = \u00DCbereinstimmungsspalten m\u00FCssen vor dem Abrufen festgelegt werden +cachedrowsetimpl.matchcols1 = Wert f\u00FCr \u00DCbereinstimmungsspalten muss gr\u00F6\u00DFer als 0 sein +cachedrowsetimpl.matchcols2 = \u00DCbereinstimmungsspalten m\u00FCssen leer sein oder eine Nullzeichenfolge aufweisen +cachedrowsetimpl.unsetmatch = Spalten, deren Wert aufgehoben wird, entsprechen nicht den festgelegten Spalten +cachedrowsetimpl.unsetmatch1 = Spaltenname als Argument f\u00FCr unsetMatchColumn verwenden +cachedrowsetimpl.unsetmatch2 = Spalten-ID als Argument f\u00FCr unsetMatchColumn verwenden +cachedrowsetimpl.numrows = Zeilenanzahl ist kleiner als null oder kleiner als Abrufgr\u00F6\u00DFe cachedrowsetimpl.startpos = Startposition darf keinen Negativwert aufweisen -cachedrowsetimpl.nextpage = Daten m\u00fcssen vor dem Abrufen ausgef\u00fcllt werden -cachedrowsetimpl.pagesize = Seitengr\u00f6\u00dfe darf nicht kleiner als Null sein -cachedrowsetimpl.pagesize1 = Seitengr\u00f6\u00dfe darf nicht gr\u00f6\u00dfer als maxRows sein -cachedrowsetimpl.fwdonly = ResultSet kann nur vorw\u00e4rts gerichtet sein -cachedrowsetimpl.type = Typ : {0} -cachedrowsetimpl.opnotysupp = Vorgang noch nicht unterst\u00fctzt -cachedrowsetimpl.featnotsupp = Funktion nicht unterst\u00fctzt +cachedrowsetimpl.nextpage = Daten m\u00FCssen vor dem Aufruf ausgef\u00FCllt werden +cachedrowsetimpl.pagesize = Seitengr\u00F6\u00DFe darf nicht kleiner als null sein +cachedrowsetimpl.pagesize1 = Seitengr\u00F6\u00DFe darf nicht gr\u00F6\u00DFer als maxRows sein +cachedrowsetimpl.fwdonly = ResultSet kann nur vorw\u00E4rts gerichtet sein +cachedrowsetimpl.type = Typ ist: {0} +cachedrowsetimpl.opnotysupp = Vorgang noch nicht unterst\u00FCtzt +cachedrowsetimpl.featnotsupp = Feature nicht unterst\u00FCtzt # WebRowSetImpl exceptions -webrowsetimpl.nullhash = Instanz WebRowSetImpl konnte nicht instanziiert werden. Hash-Tabelle mit Nullwert f\u00fcr Konstruktor angegeben -webrowsetimpl.invalidwr = Ung\u00fcltiger Schreiber -webrowsetimpl.invalidrd = Ung\u00fcltiger Leser +webrowsetimpl.nullhash = WebRowSetImpl-Instanz kann nicht instanziiert werden. Null-Hash-Tabelle f\u00FCr Constructor angegeben +webrowsetimpl.invalidwr = Ung\u00FCltiger Writer +webrowsetimpl.invalidrd = Ung\u00FCltiger Reader #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative: Ung\u00fcltiger Cursorvorgang -filteredrowsetimpl.absolute = absolute: Ung\u00fcltiger Cursorvorgang -filteredrowsetimpl.notallowed = Kein zul\u00e4ssiger Wert im Filter +filteredrowsetimpl.relative = relative: Ung\u00FCltiger Cursorvorgang +filteredrowsetimpl.absolute = absolute: Ung\u00FCltiger Cursorvorgang +filteredrowsetimpl.notallowed = Kein zul\u00E4ssiger Wert im Filter #JoinRowSetImpl exceptions joinrowsetimpl.notinstance = Keine Instanz von rowset -joinrowsetimpl.matchnotset = \u00dcbereinstimmende Spalte wurde nicht f\u00fcr Verkn\u00fcpfung definiert -joinrowsetimpl.numnotequal = Elementanzahl in rowset nicht gleich \u00fcbereinstimmende Spalte -joinrowsetimpl.notdefined = Kein definierter Verkn\u00fcpfungstyp -joinrowsetimpl.notsupported = Verkn\u00fcpfungstyp wird nicht unterst\u00fctzt -joinrowsetimpl.initerror = Initialisierungsfehler bei JoinRowSet +joinrowsetimpl.matchnotset = \u00DCbereinstimmungsspalte wurde nicht f\u00FCr Join festgelegt +joinrowsetimpl.numnotequal = Elementanzahl in rowset nicht gleich \u00DCbereinstimmungsspalte +joinrowsetimpl.notdefined = Kein definierter Join-Typ +joinrowsetimpl.notsupported = Join-Typ wird nicht unterst\u00FCtzt +joinrowsetimpl.initerror = JoinRowSet-Initialisierungsfehler joinrowsetimpl.genericerr = Generischer Anfangsfehler bei joinrowset -joinrowsetimpl.emptyrowset = Leeres rowset kann nicht zu diesem JoinRowSet hinzugef\u00fcgt werden +joinrowsetimpl.emptyrowset = Leeres rowset kann nicht zu diesem JoinRowSet hinzugef\u00FCgt werden #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = Ung\u00fcltiger Status -jdbcrowsetimpl.connect = JdbcRowSet (verbinden), keine JNDI-Verbindung m\u00f6glich -jdbcrowsetimpl.paramtype = Parametertyp konnte nicht abgeleitet werden -jdbcrowsetimpl.matchcols = \u00dcbereinstimmende Spalten entsprechen nicht den definierten Spalten -jdbcrowsetimpl.setmatchcols = \u00dcbereinstimmende Spalten m\u00fcssen vor dem Abrufen definiert werden -jdbcrowsetimpl.matchcols1 = Wert f\u00fcr \u00fcbereinstimmende Spalten muss gr\u00f6\u00dfer als 0 sein -jdbcrowsetimpl.matchcols2 = \u00dcbereinstimmende Spalten k\u00f6nnen keine Null- oder leere Zeichenfolge aufweisen -jdbcrowsetimpl.unsetmatch = Spalten ohne definierten Wert entsprechen nicht Spalten mit definiertem Wert -jdbcrowsetimpl.usecolname = Spaltenname als Argument f\u00fcr unsetMatchColumn verwenden -jdbcrowsetimpl.usecolid = Spalten-ID als Argument f\u00fcr unsetMatchColumn verwenden +jdbcrowsetimpl.invalstate = Ung\u00FCltiger Status +jdbcrowsetimpl.connect = JdbcRowSet (verbinden), keine JNDI-Verbindung m\u00F6glich +jdbcrowsetimpl.paramtype = Parametertyp kann nicht abgeleitet werden +jdbcrowsetimpl.matchcols = \u00DCbereinstimmungsspalten entsprechen nicht den festgelegten Spalten +jdbcrowsetimpl.setmatchcols = \u00DCbereinstimmungsspalten m\u00FCssen vor dem Abrufen festgelegt werden +jdbcrowsetimpl.matchcols1 = Wert f\u00FCr \u00DCbereinstimmungsspalten muss gr\u00F6\u00DFer als 0 sein +jdbcrowsetimpl.matchcols2 = \u00DCbereinstimmungsspalten k\u00F6nnen keine Null- oder leere Zeichenfolge aufweisen +jdbcrowsetimpl.unsetmatch = Spalten, deren Wert aufgehoben wird, entsprechen nicht den festgelegten Spalten +jdbcrowsetimpl.usecolname = Spaltenname als Argument f\u00FCr unsetMatchColumn verwenden +jdbcrowsetimpl.usecolid = Spalten-ID als Argument f\u00FCr unsetMatchColumn verwenden jdbcrowsetimpl.resnotupd = ResultSet kann nicht aktualisiert werden -jdbcrowsetimpl.opnotysupp = Vorgang noch nicht unterst\u00fctzt -jdbcrowsetimpl.featnotsupp = Funktion nicht unterst\u00fctzt +jdbcrowsetimpl.opnotysupp = Vorgang noch nicht unterst\u00FCtzt +jdbcrowsetimpl.featnotsupp = Feature nicht unterst\u00FCtzt #CachedRowSetReader exceptions -crsreader.connect = (JNDI) Verbindung nicht m\u00f6glich -crsreader.paramtype = Parametertyp konnte nicht abgeleitet werden +crsreader.connect = (JNDI) Verbindung nicht m\u00F6glich +crsreader.paramtype = Parametertyp kann nicht abgeleitet werden crsreader.connecterr = Interner Fehler in RowSetReader: Keine Verbindung oder kein Befehl crsreader.datedetected = Datum festgestellt crsreader.caldetected = Kalender festgestellt #CachedRowSetWriter exceptions -crswriter.connect = Verbindung konnte nicht hergestellt werden -crswriter.tname = writeData kann Tabellennamen nicht feststellen -crswriter.params1 = Wert f\u00fcr params1: {0} -crswriter.params2 = Wert f\u00fcr params2: {0} -crswriter.conflictsno = Konflikt beim Synchronisieren +crswriter.connect = Verbindung kann nicht hergestellt werden +crswriter.tname = writeData kann Tabellennamen nicht bestimmen +crswriter.params1 = Wert f\u00FCr params1: {0} +crswriter.params2 = Wert f\u00FCr params2: {0} +crswriter.conflictsno = Konflikte beim Synchronisieren #InsertRow exceptions -insertrow.novalue = Es wurde kein Wert eingef\u00fcgt +insertrow.novalue = Es wurde kein Wert eingef\u00FCgt #SyncResolverImpl exceptions -syncrsimpl.indexval = Indexwert liegt au\u00dferhalb des Bereichs +syncrsimpl.indexval = Indexwert liegt au\u00DFerhalb des Bereichs syncrsimpl.noconflict = Kein Konflikt bei dieser Spalte -syncrsimpl.syncnotpos = Keine Synchronisation m\u00f6glich -syncrsimpl.valtores = Aufzul\u00f6sender Wert befindet sich entweder in der Datenbank oder in cachedrowset +syncrsimpl.syncnotpos = Keine Synchronisierung m\u00F6glich +syncrsimpl.valtores = Aufzul\u00F6sender Wert kann sich entweder in der Datenbank oder in cachedrowset befinden #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = Ende von RowSet wurde erreicht. Ung\u00fcltige Cursorposition +wrsxmlreader.invalidcp = Ende von RowSet wurde erreicht. Ung\u00FCltige Cursorposition wrsxmlreader.readxml = readXML: {0} -wrsxmlreader.parseerr = ** Parsing-Fehler: {0}, Zeile: {1} , uri: {2} +wrsxmlreader.parseerr = ** Parsing-Fehler: {0}, Zeile: {1} , URI: {2} #WebRowSetXmlWriter exceptions wrsxmlwriter.ioex = IOException: {0} wrsxmlwriter.sqlex = SQLException: {0} -wrsxmlwriter.failedwrite = Schreiben des Werts fehlgeschlagen -wsrxmlwriter.notproper = Kein zul\u00e4ssiger Typ +wrsxmlwriter.failedwrite = Schreiben des Wertes nicht erfolgreich +wsrxmlwriter.notproper = Kein zul\u00E4ssiger Typ #XmlReaderContentHandler exceptions -xmlrch.errmap = Fehler beim Definieren der Zuordnung: {0} -xmlrch.errmetadata = Fehler beim Definieren der Metadaten: {0} -xmlrch.errinsertval = Fehler beim Einf\u00fcgen der Werte: {0} +xmlrch.errmap = Fehler beim Festlegen der Zuordnung: {0} +xmlrch.errmetadata = Fehler beim Festlegen der Metadaten: {0} +xmlrch.errinsertval = Fehler beim Einf\u00FCgen der Werte: {0} xmlrch.errconstr = Fehler beim Erstellen der Zeile: {0} -xmlrch.errdel = Fehler beim L\u00f6schen der Zeile: {0} -xmlrch.errinsdel = Fehler beim Erstellen der Einf\u00fcge- oder L\u00f6schzeile: {0} -xmlrch.errupdate = Fehler beim Erstellen der Aktualisierungszeile: {0} +xmlrch.errdel = Fehler beim L\u00F6schen der Zeile: {0} +xmlrch.errinsert = Fehler beim Erstellen der Einf\u00FCgezeile: {0} +xmlrch.errinsdel = Fehler beim Erstellen der Einf\u00FCge- oder L\u00F6schzeile: {0} +xmlrch.errupdate = Fehler beim Erstellen der Updatezeile: {0} xmlrch.errupdrow = Fehler beim Aktualisieren der Zeile: {0} xmlrch.chars = Zeichen: -xmlrch.badvalue = Fehlerhafter Wert; Eigenschaft darf nicht Null sein. -xmlrch.badvalue1 = Fehlerhafter Wert; Metadaten d\u00fcrfen nicht Null sein. -xmlrch.warning = ** Warnung: {0}, Zeile: {1} , uri: {2} +xmlrch.badvalue = Ung\u00FCltiger Wert. Eigenschaft kann nicht auf null gesetzt werden +xmlrch.badvalue1 = Ung\u00FCltiger Wert. Metadaten k\u00F6nnen nicht auf null gesetzt werden +xmlrch.warning = ** Warnung: {0}, Zeile: {1} , URI: {2} #RIOptimisticProvider Exceptions -riop.locking = Sperren der Klassifizierung wird nicht unterst\u00fctzt +riop.locking = Sperren der Klassifizierung wird nicht unterst\u00FCtzt #RIXMLProvider exceptions -rixml.unsupp = Keine Unterst\u00fctzung f\u00fcr RIXMLProvider +rixml.unsupp = Keine Unterst\u00FCtzung bei RIXMLProvider diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_es.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_es.properties index d1cfca8ab23..683429d8d27 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_es.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_es.properties @@ -24,16 +24,16 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = Objeto ResultSet no v\u00e1lido para m\u00e9todo de relleno -cachedrowsetimpl.invalidp = El proveedor de persistencia generado no es v\u00e1lido -cachedrowsetimpl.nullhash = La instancia CachedRowSetImpl no se puede crear. Hashtable nula proporcionada al constructor -cachedrowsetimpl.invalidop = Operaci\u00f3n no v\u00e1lida al insertar fila +cachedrowsetimpl.populate = Se ha proporcionado un objeto ResultSet no v\u00E1lido para el m\u00E9todo de relleno +cachedrowsetimpl.invalidp = El proveedor de persistencia generado no es v\u00E1lido +cachedrowsetimpl.nullhash = La instancia CachedRowSetImpl no se puede crear. Se ha proporcionado una tabla hash nula al constructor +cachedrowsetimpl.invalidop = Operaci\u00F3n no v\u00E1lida al insertar fila cachedrowsetimpl.accfailed = Fallo de acceptChanges -cachedrowsetimpl.invalidcp = Posici\u00f3n de cursor no v\u00e1lida -cachedrowsetimpl.illegalop = Operaci\u00f3n no permitida en fila no insertada -cachedrowsetimpl.clonefail = Fallo en la clonaci\u00f3n: {0} -cachedrowsetimpl.invalidcol = \u00cdndice de columnas no v\u00e1lido -cachedrowsetimpl.invalcolnm = Nombre de columna no v\u00e1lido +cachedrowsetimpl.invalidcp = Posici\u00F3n de cursor no v\u00E1lida +cachedrowsetimpl.illegalop = Operaci\u00F3n no permitida en fila no insertada +cachedrowsetimpl.clonefail = Fallo en la clonaci\u00F3n: {0} +cachedrowsetimpl.invalidcol = \u00CDndice de columnas no v\u00E1lido +cachedrowsetimpl.invalcolnm = Nombre de columna no v\u00E1lido cachedrowsetimpl.boolfail = Fallo de getBoolen en valor ( {0} ) de columna {1} cachedrowsetimpl.bytefail = Fallo de getByte en valor ( {0} ) de columna {1} cachedrowsetimpl.shortfail = Fallo de getShort en valor ( {0} ) de columna {1} @@ -41,128 +41,130 @@ cachedrowsetimpl.intfail = Fallo de getInt en valor ( {0} ) de columna {1} cachedrowsetimpl.longfail = Fallo de getLong en valor ( {0} ) de columna {1} cachedrowsetimpl.floatfail = Fallo de getFloat en valor ( {0} ) de columna {1} cachedrowsetimpl.doublefail = Fallo de getDouble en valor ( {0} ) de columna {1} -cachedrowsetimpl.dtypemismt = Discordancia entre tipos de datos -cachedrowsetimpl.datefail = Fallo de getDate en valor ( {0} ) de columna {1} no es posible convertir -cachedrowsetimpl.timefail = Fallo de getTime en valor ( {0} ) de columna {1} no es posible convertir -cachedrowsetimpl.posupdate = Actualizaciones posicionadas incompatibles -cachedrowsetimpl.unableins = No se puede crear instancia: {0} -cachedrowsetimpl.beforefirst = beforeFirst: Operaci\u00f3n de cursor no v\u00e1lida -cachedrowsetimpl.first = First: Operaci\u00f3n de cursor no v\u00e1lida -cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute: Posici\u00f3n de cursor no v\u00e1lida -cachedrowsetimpl.relative = relative: Posici\u00f3n de cursor no v\u00e1lida +cachedrowsetimpl.dtypemismt = Discordancia entre Tipos de Datos +cachedrowsetimpl.datefail = Fallo de getDate en valor ( {0} ) de columna {1}. No es posible convertir +cachedrowsetimpl.timefail = Fallo de getTime en valor ( {0} ) de columna {1}. No es posible convertir +cachedrowsetimpl.posupdate = Actualizaciones posicionadas no soportadas +cachedrowsetimpl.unableins = No se ha podido crear la instancia: {0} +cachedrowsetimpl.beforefirst = beforeFirst: Operaci\u00F3n de cursor no v\u00E1lida +cachedrowsetimpl.first = First: Operaci\u00F3n de cursor no v\u00E1lida +cachedrowsetimpl.last = last : TYPE_FORWARD_ONLY +cachedrowsetimpl.absolute = absolute: Posici\u00F3n de cursor no v\u00E1lida +cachedrowsetimpl.relative = relative: Posici\u00F3n de cursor no v\u00E1lida cachedrowsetimpl.asciistream = fallo en lectura de flujo de caracteres ascii cachedrowsetimpl.binstream = fallo de lectura de flujo binario -cachedrowsetimpl.failedins = Fallo en inserci\u00f3n de fila +cachedrowsetimpl.failedins = Fallo en inserci\u00F3n de fila cachedrowsetimpl.updateins = llamada a updateRow mientras se insertaba fila -cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY +cachedrowsetimpl.movetoins = moveToInsertRow : CONCUR_READ_ONLY cachedrowsetimpl.movetoins1 = moveToInsertRow: no hay metadatos -cachedrowsetimpl.movetoins2 = moveToInsertRow: n\u00famero de columnas no v\u00e1lido +cachedrowsetimpl.movetoins2 = moveToInsertRow: n\u00FAmero de columnas no v\u00E1lido cachedrowsetimpl.tablename = El nombre de la tabla no puede ser nulo -cachedrowsetimpl.keycols = Columnas clave no v\u00e1lidas -cachedrowsetimpl.opnotsupp = La base de datos no admite esta operaci\u00f3n -cachedrowsetimpl.matchcols = Las columnas emparejadas no concuerdan con las definidas -cachedrowsetimpl.setmatchcols = Configurar emparejamiento de columnas antes de obtenerlas -cachedrowsetimpl.matchcols1 = Las columnas emparejadas deben ser mayores que 0 -cachedrowsetimpl.matchcols2 = Las columnas emparejadas deben estar vac\u00edas o ser una cadena nula -cachedrowsetimpl.unsetmatch = Las columnas que se est\u00e1n desconfigurando no coinciden con las configuradas -cachedrowsetimpl.unsetmatch1 = Usar nombre de columna como argumento en unsetMatchColumn -cachedrowsetimpl.unsetmatch2 = Usar ID de columna como argumento en unsetMatchColumn -cachedrowsetimpl.numrows = El n\u00famero de filas es menor que cero o menor que el tama\u00f1o obtenido -cachedrowsetimpl.startpos = La posici\u00f3n de inicio no puede ser negativa -cachedrowsetimpl.nextpage = Rellenar datos antes de realizar llamada -cachedrowsetimpl.pagesize = El tama\u00f1o de p\u00e1gina no puede ser menor que cero -cachedrowsetimpl.pagesize1 = El tama\u00f1o de p\u00e1gina no puede ser mayor que maxRows -cachedrowsetimpl.fwdonly = ResultSet s\u00f3lo se reenv\u00eda +cachedrowsetimpl.keycols = Columnas clave no v\u00E1lidas +cachedrowsetimpl.invalidcol = \u00CDndice de columnas no v\u00E1lido +cachedrowsetimpl.opnotsupp = La base de datos no admite esta operaci\u00F3n +cachedrowsetimpl.matchcols = Las columnas coincidentes no concuerdan con las definidas +cachedrowsetimpl.setmatchcols = Defina las columnas coincidentes antes de obtenerlas +cachedrowsetimpl.matchcols1 = Las columnas coincidentes deben ser mayores que 0 +cachedrowsetimpl.matchcols2 = Las columnas coincidentes deben estar vac\u00EDas o ser una cadena nula +cachedrowsetimpl.unsetmatch = Las columnas cuya definici\u00F3n se est\u00E1 anulando no concuerdan con las definidas +cachedrowsetimpl.unsetmatch1 = Use el nombre de columna como argumento en unsetMatchColumn +cachedrowsetimpl.unsetmatch2 = Use el identificador de columna como argumento en unsetMatchColumn +cachedrowsetimpl.numrows = El n\u00FAmero de filas es menor que cero o menor que el tama\u00F1o recuperado +cachedrowsetimpl.startpos = La posici\u00F3n de inicio no puede ser negativa +cachedrowsetimpl.nextpage = Rellene los datos antes de realizar la llamada +cachedrowsetimpl.pagesize = El tama\u00F1o de p\u00E1gina no puede ser menor que cero +cachedrowsetimpl.pagesize1 = El tama\u00F1o de p\u00E1gina no puede ser mayor que maxRows +cachedrowsetimpl.fwdonly = ResultSet s\u00F3lo se reenv\u00EDa cachedrowsetimpl.type = El tipo es: {0} -cachedrowsetimpl.opnotysupp = Operaci\u00f3n no admitida todav\u00eda -cachedrowsetimpl.featnotsupp = Funci\u00f3n no admitida +cachedrowsetimpl.opnotysupp = Operaci\u00F3n no soportada todav\u00EDa +cachedrowsetimpl.featnotsupp = Funci\u00F3n no soportada # WebRowSetImpl exceptions -webrowsetimpl.nullhash = La instancia WebRowSetImpl no se puede crear. Hashtable nula proporcionada al constructor -webrowsetimpl.invalidwr = Escritor no v\u00e1lido -webrowsetimpl.invalidrd = Lector no v\u00e1lido +webrowsetimpl.nullhash = La instancia WebRowSetImpl no se puede crear. Se ha proporcionado una tabla hash nula al constructor +webrowsetimpl.invalidwr = Escritor no v\u00E1lido +webrowsetimpl.invalidrd = Lector no v\u00E1lido #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative: Operaci\u00f3n de cursor no v\u00e1lida -filteredrowsetimpl.absolute = absolute: Operaci\u00f3n de cursor no v\u00e1lida +filteredrowsetimpl.relative = relative: Operaci\u00F3n de cursor no v\u00E1lida +filteredrowsetimpl.absolute = absolute: Operaci\u00F3n de cursor no v\u00E1lida filteredrowsetimpl.notallowed = El filtro no admite este valor #JoinRowSetImpl exceptions joinrowsetimpl.notinstance = No es una instancia de rowset -joinrowsetimpl.matchnotset = Emparejamiento de columnas no configurado para unir -joinrowsetimpl.numnotequal = El n\u00famero de elementos de rowset y el de emparejamiento de columnas no es el mismo -joinrowsetimpl.notdefined = No es un tipo de uni\u00f3n definido -joinrowsetimpl.notsupported = Este tipo de uni\u00f3n no es compatible -joinrowsetimpl.initerror = Error de inicio de JoinRowSet -joinrowsetimpl.genericerr = Error de Genric joinrowset intial -joinrowsetimpl.emptyrowset = No se puede a\u00f1adir un rowset vac\u00edo a este JoinRowSet +joinrowsetimpl.matchnotset = Las columnas coincidentes no est\u00E1n definidas para la uni\u00F3n +joinrowsetimpl.numnotequal = El n\u00FAmero de elementos de rowset y el de columnas coincidentes no es el mismo +joinrowsetimpl.notdefined = No es un tipo de uni\u00F3n definido +joinrowsetimpl.notsupported = Este tipo de uni\u00F3n no est\u00E1 soportado +joinrowsetimpl.initerror = Error de inicializaci\u00F3n de JoinRowSet +joinrowsetimpl.genericerr = Error de inicializaci\u00F3n gen\u00E9rico de joinrowset +joinrowsetimpl.emptyrowset = No se puede agregar un juego de filas vac\u00EDo a este JoinRowSet #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = Estado no v\u00e1lido -jdbcrowsetimpl.connect = JdbcRowSet (conectar) JNDI no se puede conectar -jdbcrowsetimpl.paramtype = No se puede deducir tipo de par\u00e1metro -jdbcrowsetimpl.matchcols = Las columnas emparejadas no concuerdan con las definidas -jdbcrowsetimpl.setmatchcols = Configurar emparejamiento de columnas antes de obtenerlas -jdbcrowsetimpl.matchcols1 = Las columnas emparejadas deben ser mayores que 0 -jdbcrowsetimpl.matchcols2 = Las columnas emparejadas no pueden estar vac\u00edas ni ser una cadena nula -jdbcrowsetimpl.unsetmatch = Las columnas que se est\u00e1n desconfigurando no son las mismas que las configuradas -jdbcrowsetimpl.usecolname = Usar nombre de columna como argumento en unsetMatchColumn -jdbcrowsetimpl.usecolid = Usar ID de columna como argumento en unsetMatchColumn +jdbcrowsetimpl.invalstate = Estado no v\u00E1lido +jdbcrowsetimpl.connect = JdbcRowSet (connect): JNDI no se puede conectar +jdbcrowsetimpl.paramtype = No se puede deducir el tipo de par\u00E1metro +jdbcrowsetimpl.matchcols = Las columnas coincidentes no concuerdan con las definidas +jdbcrowsetimpl.setmatchcols = Defina las columnas coincidentes antes de obtenerlas +jdbcrowsetimpl.matchcols1 = Las columnas coincidentes deben ser mayores que 0 +jdbcrowsetimpl.matchcols2 = Las columnas coincidentes no pueden estar vac\u00EDas ni ser una cadena nula +jdbcrowsetimpl.unsetmatch = Las columnas cuya definici\u00F3n se est\u00E1 anulando no concuerdan con las definidas +jdbcrowsetimpl.usecolname = Use el nombre de columna como argumento en unsetMatchColumn +jdbcrowsetimpl.usecolid = Use el identificador de columna como argumento en unsetMatchColumn jdbcrowsetimpl.resnotupd = ResultSet no se puede actualizar -jdbcrowsetimpl.opnotysupp = Operaci\u00f3n no admitida todav\u00eda -jdbcrowsetimpl.featnotsupp = Funci\u00f3n no admitida +jdbcrowsetimpl.opnotysupp = Operaci\u00F3n no soportada todav\u00EDa +jdbcrowsetimpl.featnotsupp = Funci\u00F3n no soportada #CachedRowSetReader exceptions -crsreader.connect = (JNDI) No se puede conectar -crsreader.paramtype = No se puede deducir tipo de par\u00e1metro -crsreader.connecterr = Error interno en RowSetReader: no hay conexi\u00f3n o comando -crsreader.datedetected = Fecha detectada -crsreader.caldetected = Calendario detectado +crsreader.connect = (JNDI) No se ha podido conectar +crsreader.paramtype = No se ha podido deducir el tipo de par\u00E1metro +crsreader.connecterr = Error interno en RowSetReader: no hay conexi\u00F3n o comando +crsreader.datedetected = Fecha Detectada +crsreader.caldetected = Calendario Detectado #CachedRowSetWriter exceptions -crswriter.connect = No se puede obtener una conexi\u00f3n +crswriter.connect = No se ha podido obtener una conexi\u00F3n crswriter.tname = writeData no puede determinar el nombre de tabla crswriter.params1 = Valor de params1: {0} crswriter.params2 = Valor de params2: {0} -crswriter.conflictsno = conflictos en la sincronizaci\u00f3n +crswriter.conflictsno = conflictos en la sincronizaci\u00F3n #InsertRow exceptions -insertrow.novalue = No se ha insertado ning\u00fan valor +insertrow.novalue = No se ha insertado ning\u00FAn valor #SyncResolverImpl exceptions -syncrsimpl.indexval = El valor de \u00edndice est\u00e1 fuera del intervalo -syncrsimpl.noconflict = Esta columna no est\u00e1 en conflicto +syncrsimpl.indexval = El valor de \u00EDndice est\u00E1 fuera de rango +syncrsimpl.noconflict = Esta columna no est\u00E1 en conflicto syncrsimpl.syncnotpos = No se puede sincronizar -syncrsimpl.valtores = El valor que se debe definir puede estar en la base de datos o en cachedrowset +syncrsimpl.valtores = El valor que se debe resolver puede estar en la base de datos o en cachedrowset #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = Se ha llegado al final de RowSet. Posici\u00f3n de cursor no v\u00e1lida -wrsxmlreader.readxml = readXML: {0} -wrsxmlreader.parseerr = ** Error de an\u00e1lisis: {0} , l\u00ednea: {1} , uri: {2} +wrsxmlreader.invalidcp = Se ha llegado al final de RowSet. Posici\u00F3n de cursor no v\u00E1lida +wrsxmlreader.readxml = readXML : {0} +wrsxmlreader.parseerr = ** Error de an\u00E1lisis: {0} , l\u00EDnea: {1} , uri: {2} #WebRowSetXmlWriter exceptions -wrsxmlwriter.ioex = IOException: {0} -wrsxmlwriter.sqlex = SQLException: {0} -wrsxmlwriter.failedwrite = No se pudo escribir valor +wrsxmlwriter.ioex = IOException : {0} +wrsxmlwriter.sqlex = SQLException : {0} +wrsxmlwriter.failedwrite = Error al escribir el valor wsrxmlwriter.notproper = Tipo incorrecto #XmlReaderContentHandler exceptions -xmlrch.errmap = Error al configurar la asignaci\u00f3n: {0} -xmlrch.errmetadata = Error al configurar metadatos: {0} +xmlrch.errmap = Error al definir la asignaci\u00F3n: {0} +xmlrch.errmetadata = Error al definir metadatos: {0} xmlrch.errinsertval = Error al insertar los valores: {0} -xmlrch.errconstr = Error al construir fila: {0} -xmlrch.errdel = Error al borrar fila: {0} -xmlrch.errinsdel = Error al construir insertar o suprimir fila: {0} -xmlrch.errupdate = Error al construir actualizar fila: {0} +xmlrch.errconstr = Error al construir la fila: {0} +xmlrch.errdel = Error al suprimir la fila: {0} +xmlrch.errinsert = Error al construir la fila de inserci\u00F3n: {0} +xmlrch.errinsdel = Error al construir la fila de inserci\u00F3n o supresi\u00F3n: {0} +xmlrch.errupdate = Error al construir la fila de actualizaci\u00F3n: {0} xmlrch.errupdrow = Error al actualizar la fila: {0} xmlrch.chars = caracteres: xmlrch.badvalue = Valor incorrecto; la propiedad no puede ser nula xmlrch.badvalue1 = Valor incorrecto; los metadatos no pueden ser nulos -xmlrch.warning = ** Advertencia: {0} , l\u00ednea: {1} , uri: {2} +xmlrch.warning = ** Advertencia: {0} , l\u00EDnea: {1} , uri: {2} #RIOptimisticProvider Exceptions -riop.locking = No se permite bloquear la clasificaci\u00f3n +riop.locking = No se permite bloquear la clasificaci\u00F3n #RIXMLProvider exceptions -rixml.unsupp = No compatible con RIXMLProvider +rixml.unsupp = No soportado con RIXMLProvider diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_fr.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_fr.properties index 009a580e0a6..7793e88fe57 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_fr.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_fr.properties @@ -24,117 +24,118 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = L'objet ResultSet fourni en entr\u00e9e de la m\u00e9thode n'est pas valide -cachedrowsetimpl.invalidp = Le fournisseur de persistance g\u00e9n\u00e9r\u00e9 n'est pas valide -cachedrowsetimpl.nullhash = Impossible de cr\u00e9er une instance de CachedRowSetImpl. Table de hachage null fournie au constructeur -cachedrowsetimpl.invalidop = Op\u00e9ration non valide lors de l'insertion de ligne -cachedrowsetimpl.accfailed = \u00c9chec de acceptChanges +cachedrowsetimpl.populate = L'objet ResultSet fourni en entr\u00E9e de la m\u00E9thode n'est pas valide +cachedrowsetimpl.invalidp = Le fournisseur de persistance g\u00E9n\u00E9r\u00E9 n'est pas valide +cachedrowsetimpl.nullhash = Impossible de cr\u00E9er une instance de CachedRowSetImpl. Table de hachage NULL fournie au constructeur +cachedrowsetimpl.invalidop = Op\u00E9ration non valide lors de l'insertion de ligne +cachedrowsetimpl.accfailed = Echec de acceptChanges cachedrowsetimpl.invalidcp = Position du curseur non valide -cachedrowsetimpl.illegalop = Op\u00e9ration non autoris\u00e9e sur ligne non ins\u00e9r\u00e9e -cachedrowsetimpl.clonefail = \u00c9chec du clonage : {0} +cachedrowsetimpl.illegalop = Op\u00E9ration non admise sur une ligne non ins\u00E9r\u00E9e +cachedrowsetimpl.clonefail = Echec du clonage : {0} cachedrowsetimpl.invalidcol = Index de colonne non valide cachedrowsetimpl.invalcolnm = Nom de colonne non valide -cachedrowsetimpl.boolfail = \u00c9chec de getBoolen pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.bytefail = \u00c9chec de getByte pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.shortfail = \u00c9chec de getShort pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.intfail = \u00c9chec de getInt pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.longfail = \u00c9chec de getLong pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.floatfail = \u00c9chec de getFloat pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.doublefail = \u00c9chec de getDouble pour la valeur ({0}) de la colonne {1} -cachedrowsetimpl.dtypemismt = Le type de donn\u00e9es ne correspond pas -cachedrowsetimpl.datefail = \u00c9chec de getDate pour la valeur ({0}) de la colonne {1} - Aucune conversion possible -cachedrowsetimpl.timefail = \u00c9chec de getDate pour la valeur ({0}) de la colonne {1} - Aucune conversion possible -cachedrowsetimpl.posupdate = Mises \u00e0 jour choisies non prises en charge +cachedrowsetimpl.boolfail = Echec de getBoolen pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.bytefail = Echec de getByte pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.shortfail = Echec de getShort pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.intfail = Echec de getInt pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.longfail = Echec de getLong pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.floatfail = Echec de getFloat pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.doublefail = Echec de getDouble pour la valeur ({0}) de la colonne {1} +cachedrowsetimpl.dtypemismt = Le type de donn\u00E9es ne correspond pas +cachedrowsetimpl.datefail = Echec de getDate pour la valeur ({0}) de la colonne {1} - Aucune conversion possible +cachedrowsetimpl.timefail = Echec de getTime pour la valeur ({0}) de la colonne {1} - Aucune conversion possible +cachedrowsetimpl.posupdate = Mises \u00E0 jour choisies non prises en charge cachedrowsetimpl.unableins = Instanciation impossible : {0} -cachedrowsetimpl.beforefirst = beforeFirst : op\u00e9ration de curseur non valide -cachedrowsetimpl.first = First : op\u00e9ration de curseur non valide +cachedrowsetimpl.beforefirst = beforeFirst : op\u00E9ration de curseur non valide +cachedrowsetimpl.first = First : op\u00E9ration de curseur non valide cachedrowsetimpl.last = last : TYPE_FORWARD_ONLY cachedrowsetimpl.absolute = absolute : position de curseur non valide cachedrowsetimpl.relative = relative : position de curseur non valide -cachedrowsetimpl.asciistream = \u00e9chec de la lecture pour le flux ascii -cachedrowsetimpl.binstream = \u00e9chec de la lecture pour le flux binaire -cachedrowsetimpl.failedins = \u00c9chec de l'insertion de ligne +cachedrowsetimpl.asciistream = \u00E9chec de la lecture pour le flux ASCII +cachedrowsetimpl.binstream = \u00E9chec de la lecture pour le flux binaire +cachedrowsetimpl.failedins = Echec de l'insertion de ligne cachedrowsetimpl.updateins = appel de updateRow lors de l'insertion de ligne cachedrowsetimpl.movetoins = moveToInsertRow : CONCUR_READ_ONLY -cachedrowsetimpl.movetoins1 = moveToInsertRow : aucune m\u00e9tadonn\u00e9e -cachedrowsetimpl.movetoins2 = moveToInsertRow : Nombre de colonnes non valide -cachedrowsetimpl.tablename = Le nom du tableau ne peut pas \u00eatre null -cachedrowsetimpl.keycols = Colonnes de cl\u00e9 non valides -cachedrowsetimpl.opnotsupp = Op\u00e9ration non prise en charge par la base de donn\u00e9es -cachedrowsetimpl.matchcols = Les colonnes correspondantes ne sont pas les m\u00eames que les colonnes d\u00e9finies -cachedrowsetimpl.setmatchcols = D\u00e9finissez les colonnes correspondantes avant de les prendre -cachedrowsetimpl.matchcols1 = Les colonnes correspondantes doivent \u00eatre sup\u00e9rieures \u00e0 z\u00e9ro -cachedrowsetimpl.matchcols2 = Les colonnes correspondantes doivent \u00eatres vides ou ne contenir que des cha\u00eenes vides -cachedrowsetimpl.unsetmatch = Les colonnes d\u00e9finies et non d\u00e9finies sont diff\u00e9rentes -cachedrowsetimpl.unsetmatch1 = Utilisez le nom de la colonne en argument de unsetMatchColumn -cachedrowsetimpl.unsetmatch2 = Utilisez l'ID de la colonne en argument de unsetMatchColumn -cachedrowsetimpl.numrows = Le nombre de lignes est inf\u00e9rieur \u00e0 z\u00e9ro ou \u00e0 la taille d'extraction -cachedrowsetimpl.startpos = La position de d\u00e9part ne peut pas \u00eatre n\u00e9gative -cachedrowsetimpl.nextpage = Entrez les donn\u00e9es avant l'appel -cachedrowsetimpl.pagesize = La taille de la page ne peut pas \u00eatre n\u00e9gative -cachedrowsetimpl.pagesize1 = La taille de la page ne peut pas \u00eatre sup\u00e9rieure \u00e0 maxRows -cachedrowsetimpl.fwdonly = ResultSet est en avant seulement +cachedrowsetimpl.movetoins1 = moveToInsertRow : aucune m\u00E9tadonn\u00E9e +cachedrowsetimpl.movetoins2 = moveToInsertRow : nombre de colonnes non valide +cachedrowsetimpl.tablename = Le nom de la table ne peut pas \u00EAtre NULL +cachedrowsetimpl.keycols = Colonnes de cl\u00E9 non valides +cachedrowsetimpl.invalidcol = Index de colonne non valide +cachedrowsetimpl.opnotsupp = Op\u00E9ration non prise en charge par la base de donn\u00E9es +cachedrowsetimpl.matchcols = Les colonnes correspondantes ne sont pas les m\u00EAmes que les colonnes d\u00E9finies +cachedrowsetimpl.setmatchcols = D\u00E9finir les colonnes correspondantes avant de les prendre +cachedrowsetimpl.matchcols1 = Les colonnes correspondantes doivent \u00EAtre sup\u00E9rieures \u00E0 z\u00E9ro +cachedrowsetimpl.matchcols2 = Les colonnes correspondantes doivent \u00EAtres vides ou ne contenir que des cha\u00EEnes NULL +cachedrowsetimpl.unsetmatch = Les colonnes d\u00E9finies et non d\u00E9finies sont diff\u00E9rentes +cachedrowsetimpl.unsetmatch1 = Utiliser le nom de colonne comme argument pour unsetMatchColumn +cachedrowsetimpl.unsetmatch2 = Utiliser l'ID de colonne comme argument pour unsetMatchColumn +cachedrowsetimpl.numrows = Le nombre de lignes est inf\u00E9rieur \u00E0 z\u00E9ro ou \u00E0 la taille d'extraction +cachedrowsetimpl.startpos = La position de d\u00E9part ne peut pas \u00EAtre n\u00E9gative +cachedrowsetimpl.nextpage = Entrer les donn\u00E9es avant l'appel +cachedrowsetimpl.pagesize = La taille de la page ne peut pas \u00EAtre n\u00E9gative +cachedrowsetimpl.pagesize1 = La taille de la page ne peut pas \u00EAtre sup\u00E9rieure \u00E0 maxRows +cachedrowsetimpl.fwdonly = ResultSet va en avant seulement cachedrowsetimpl.type = Le type est : {0} -cachedrowsetimpl.opnotysupp = Op\u00e9ration non encore prise en charge -cachedrowsetimpl.featnotsupp = Fonction non prise en charge +cachedrowsetimpl.opnotysupp = Op\u00E9ration non encore prise en charge +cachedrowsetimpl.featnotsupp = Fonctionnalit\u00E9 non prise en charge # WebRowSetImpl exceptions -webrowsetimpl.nullhash = Impossible de cr\u00e9er une instance de WebRowSetImpl. Table de hachage null fournie au constructeur -webrowsetimpl.invalidwr = G\u00e9n\u00e9rateur non valide -webrowsetimpl.invalidrd = Lecteur non valide +webrowsetimpl.nullhash = Impossible de cr\u00E9er une instance de WebRowSetImpl. Table de hachage NULL fournie au constructeur +webrowsetimpl.invalidwr = Processus d'\u00E9criture non valide +webrowsetimpl.invalidrd = Processus de lecture non valide #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative : op\u00e9ration de curseur non valide -filteredrowsetimpl.absolute = absolute : op\u00e9ration de curseur non valide -filteredrowsetimpl.notallowed = Cette valeur n'est pas autoris\u00e9e via le filtre +filteredrowsetimpl.relative = relative : op\u00E9ration de curseur non valide +filteredrowsetimpl.absolute = absolute : op\u00E9ration de curseur non valide +filteredrowsetimpl.notallowed = Cette valeur n'est pas autoris\u00E9e via le filtre #JoinRowSetImpl exceptions joinrowsetimpl.notinstance = N'est pas une instance de RowSet -joinrowsetimpl.matchnotset = Les colonnes correspondantes ne sont pas group\u00e9es pour jointure -joinrowsetimpl.numnotequal = Le nombre d'\u00e9l\u00e9ments dans RowSet est diff\u00e9rent du nombre de colonnes correspondantes -joinrowsetimpl.notdefined = Ce n'est pas un type de jointure d\u00e9fini +joinrowsetimpl.matchnotset = Les colonnes correspondantes ne sont pas d\u00E9finies pour la jointure +joinrowsetimpl.numnotequal = Le nombre d'\u00E9l\u00E9ments dans RowSet est diff\u00E9rent du nombre de colonnes correspondantes +joinrowsetimpl.notdefined = Ce n'est pas un type de jointure d\u00E9fini joinrowsetimpl.notsupported = Ce type de jointure n'est pas pris en charge joinrowsetimpl.initerror = Erreur d'initialisation de JoinRowSet -joinrowsetimpl.genericerr = Erreur initiale g\u00e9n\u00e9rique de JoinRowSet -joinrowsetimpl.emptyrowset = Impossible d'ajouter un objet RowSet vide \u00e0 ce JoinRowSet +joinrowsetimpl.genericerr = Erreur initiale g\u00E9n\u00E9rique de JoinRowSet +joinrowsetimpl.emptyrowset = Impossible d'ajouter un objet RowSet vide \u00E0 ce JoinRowSet #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = \u00c9tat non valide +jdbcrowsetimpl.invalstate = Etat non valide jdbcrowsetimpl.connect = Impossible de connecter JNDI JdbcRowSet (connexion) -jdbcrowsetimpl.paramtype = Impossible de d\u00e9duire le type de param\u00e8tre -jdbcrowsetimpl.matchcols = Les colonnes correspondantes ne sont pas les m\u00eames que les colonnes d\u00e9finies -jdbcrowsetimpl.setmatchcols = D\u00e9finissez les colonnes correspondantes avant de les prendre -jdbcrowsetimpl.matchcols1 = Le nombre de colonnes correspondantes doit \u00eatre sup\u00e9rieur \u00e0 z\u00e9ro -jdbcrowsetimpl.matchcols2 = Les colonnes correspondantes ne doivent pas \u00eatres vides ni contenir des cha\u00eenes vides -jdbcrowsetimpl.unsetmatch = Les colonnes non d\u00e9finies ne sont pas les m\u00eames que les colonnes d\u00e9finies -jdbcrowsetimpl.usecolname = Utilisez le nom de la colonne en argument de unsetMatchColumn -jdbcrowsetimpl.usecolid = Utilisez l'ID de la colonne en argument de unsetMatchColumn -jdbcrowsetimpl.resnotupd = La mise \u00e0 jour de ResultSet est interdite -jdbcrowsetimpl.opnotysupp = Op\u00e9ration non encore prise en charge -jdbcrowsetimpl.featnotsupp = Fonction non prise en charge +jdbcrowsetimpl.paramtype = Impossible de d\u00E9duire le type de param\u00E8tre +jdbcrowsetimpl.matchcols = Les colonnes correspondantes ne sont pas les m\u00EAmes que les colonnes d\u00E9finies +jdbcrowsetimpl.setmatchcols = D\u00E9finir les colonnes correspondantes avant de les prendre +jdbcrowsetimpl.matchcols1 = Les colonnes correspondantes doivent \u00EAtre sup\u00E9rieures \u00E0 z\u00E9ro +jdbcrowsetimpl.matchcols2 = Les colonnes correspondantes ne doivent pas \u00EAtres NULL ni contenir des cha\u00EEnes vides +jdbcrowsetimpl.unsetmatch = Les colonnes non d\u00E9finies ne sont pas les m\u00EAmes que les colonnes d\u00E9finies +jdbcrowsetimpl.usecolname = Utiliser le nom de colonne comme argument pour unsetMatchColumn +jdbcrowsetimpl.usecolid = Utiliser l'ID de colonne comme argument pour unsetMatchColumn +jdbcrowsetimpl.resnotupd = La mise \u00E0 jour de ResultSet est interdite +jdbcrowsetimpl.opnotysupp = Op\u00E9ration non encore prise en charge +jdbcrowsetimpl.featnotsupp = Fonctionnalit\u00E9 non prise en charge #CachedRowSetReader exceptions crsreader.connect = Impossible de connecter (JNDI) -crsreader.paramtype = Impossible de d\u00e9duire le type de param\u00e8tre -crsreader.connecterr = Erreur interne dans RowSetReader\u00a0: pas de connexion ni de commande -crsreader.datedetected = Une date a \u00e9t\u00e9 d\u00e9tect\u00e9e -crsreader.caldetected = Un calendrier a \u00e9t\u00e9 d\u00e9tect\u00e9 +crsreader.paramtype = Impossible de d\u00E9duire le type de param\u00E8tre +crsreader.connecterr = Erreur interne dans RowSetReader\u00A0: pas de connexion ni de commande +crsreader.datedetected = Une date a \u00E9t\u00E9 d\u00E9tect\u00E9e +crsreader.caldetected = Un calendrier a \u00E9t\u00E9 d\u00E9tect\u00E9 #CachedRowSetWriter exceptions crswriter.connect = Impossible d'obtenir la connexion -crswriter.tname = writeData ne peut pas d\u00e9terminer le nom du tableau +crswriter.tname = writeData ne peut pas d\u00E9terminer le nom de la table crswriter.params1 = Valeur de params1 : {0} crswriter.params2 = Valeur de params2 : {0} crswriter.conflictsno = conflits lors de la synchronisation #InsertRow exceptions -insertrow.novalue = Aucune valeur n'a \u00e9t\u00e9 ins\u00e9r\u00e9e +insertrow.novalue = Aucune valeur n'a \u00E9t\u00E9 ins\u00E9r\u00E9e #SyncResolverImpl exceptions syncrsimpl.indexval = Valeur d'index hors plage syncrsimpl.noconflict = Cette colonne n'est pas en conflit syncrsimpl.syncnotpos = La synchronisation est impossible -syncrsimpl.valtores = La valeur \u00e0 r\u00e9soudre peut \u00eatre soit dans la base de donn\u00e9es soit dans CachedrowSet +syncrsimpl.valtores = La valeur \u00E0 r\u00E9soudre peut \u00EAtre soit dans la base de donn\u00E9es, soit dans CachedrowSet #WebRowSetXmlReader exception wrsxmlreader.invalidcp = Fin de RowSet atteinte. Position de curseur non valide @@ -142,23 +143,24 @@ wrsxmlreader.readxml = readXML : {0} wrsxmlreader.parseerr = ** Erreur d''analyse : {0} , ligne : {1} , URI : {2} #WebRowSetXmlWriter exceptions -wrsxmlwriter.ioex = IOException : {0} -wrsxmlwriter.sqlex = SQLException : {0} -wrsxmlwriter.failedwrite = \u00c9chec d'\u00e9criture de la valeur +wrsxmlwriter.ioex = Exception d''E/S : {0} +wrsxmlwriter.sqlex = Exception SQL : {0} +wrsxmlwriter.failedwrite = Echec d'\u00E9criture de la valeur wsrxmlwriter.notproper = N'est pas un type correct #XmlReaderContentHandler exceptions -xmlrch.errmap = Erreur lors de la d\u00e9finition de Map : {0} -xmlrch.errmetadata = Erreur lors de la d\u00e9finition des m\u00e9tadonn\u00e9es : {0} -xmlrch.errinsertval = Erreur lors de l''insertion des valeurs\u00a0: {0} +xmlrch.errmap = Erreur lors de la d\u00E9finition du mappage : {0} +xmlrch.errmetadata = Erreur lors de la d\u00E9finition des m\u00E9tadonn\u00E9es : {0} +xmlrch.errinsertval = Erreur lors de l''insertion des valeurs\u00A0: {0} xmlrch.errconstr = Erreur lors de la construction de la ligne : {0} xmlrch.errdel = Erreur lors de la suppression de la ligne : {0} +xmlrch.errinsert = Erreur lors de la construction de la ligne \u00E0 ins\u00E9rer : {0} xmlrch.errinsdel = Erreur lors de la construction de la ligne insdel : {0} -xmlrch.errupdate = Erreur lors de la construction de la ligne \u00e0 mettre \u00e0 jour : {0} -xmlrch.errupdrow = Erreur lors de la mise \u00e0 jour de la ligne\u00a0: {0} -xmlrch.chars = caract\u00e8res : -xmlrch.badvalue = Valeur incorrecte ; null impossible pour cette propri\u00e9t\u00e9 -xmlrch.badvalue1 = Valeur incorrecte ; null impossible pour ces m\u00e9tadonn\u00e9es +xmlrch.errupdate = Erreur lors de la construction de la ligne \u00E0 mettre \u00E0 jour : {0} +xmlrch.errupdrow = Erreur lors de la mise \u00E0 jour de la ligne\u00A0: {0} +xmlrch.chars = caract\u00E8res : +xmlrch.badvalue = Valeur incorrecte ; cette propri\u00E9t\u00E9 ne peut pas \u00EAtre NULL +xmlrch.badvalue1 = Valeur incorrecte ; ces m\u00E9tadonn\u00E9es ne peuvent pas \u00EAtre NULL xmlrch.warning = ** Avertissement : {0} , ligne : {1} , URI : {2} #RIOptimisticProvider Exceptions diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_it.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_it.properties index 7501a76454b..916db678bae 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_it.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_it.properties @@ -25,13 +25,13 @@ # CacheRowSetImpl exceptions cachedrowsetimpl.populate = Oggetto ResultSet non valido fornito per l'inserimento dati nel metodo -cachedrowsetimpl.invalidp = Generato fornitore di persistenza non valido -cachedrowsetimpl.nullhash = Impossibile istanziare l'istanza CachedRowSetImpl. Tabella hash nulla fornita al costruttore +cachedrowsetimpl.invalidp = Generato provider di persistenza non valido +cachedrowsetimpl.nullhash = Impossibile creare istanza CachedRowSetImpl. Tabella hash nulla fornita al costruttore cachedrowsetimpl.invalidop = Operazione non valida nella riga di inserimento cachedrowsetimpl.accfailed = acceptChanges non riuscito cachedrowsetimpl.invalidcp = Posizione cursore non valida -cachedrowsetimpl.illegalop = Operazione non consentita nella riga non inserita -cachedrowsetimpl.clonefail = Clone non riuscito: {0} +cachedrowsetimpl.illegalop = Operazione non valida nella riga non inserita +cachedrowsetimpl.clonefail = Copia non riuscita: {0} cachedrowsetimpl.invalidcol = Indice di colonna non valido cachedrowsetimpl.invalcolnm = Nome di colonna non valido cachedrowsetimpl.boolfail = getBoolen non riuscito per il valore ( {0} ) nella colonna {1} @@ -41,11 +41,11 @@ cachedrowsetimpl.intfail = getInt non riuscito per il valore ( {0} ) nella colon cachedrowsetimpl.longfail = getLong non riuscito per il valore ( {0} ) nella colonna {1} cachedrowsetimpl.floatfail = getFloat non riuscito per il valore ( {0} ) nella colonna {1} cachedrowsetimpl.doublefail = getDouble non riuscito per il valore ( {0} ) nella colonna {1} -cachedrowsetimpl.dtypemismt = Mancata corrispondenza dei tipi di dati +cachedrowsetimpl.dtypemismt = Mancata corrispondenza tipo di dati cachedrowsetimpl.datefail = getDate non riuscito per il valore ( {0} ) nella colonna {1}. Nessuna conversione disponibile. cachedrowsetimpl.timefail = getTime non riuscito per il valore ( {0} ) nella colonna {1}. Nessuna conversione disponibile. cachedrowsetimpl.posupdate = Aggiornamenti posizionati non supportati -cachedrowsetimpl.unableins = Impossibile istanziare: {0} +cachedrowsetimpl.unableins = Impossibile creare istanza: {0} cachedrowsetimpl.beforefirst = beforeFirst: operazione cursore non valida cachedrowsetimpl.first = First: operazione cursore non valida cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY @@ -58,8 +58,9 @@ cachedrowsetimpl.updateins = updateRow chiamato nella riga di inserimento cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY cachedrowsetimpl.movetoins1 = moveToInsertRow: nessun metadato cachedrowsetimpl.movetoins2 = moveToInsertRow: numero di colonne non valido -cachedrowsetimpl.tablename = Il nome di tabella non pu\u00f2 essere nullo +cachedrowsetimpl.tablename = Il nome di tabella non pu\u00F2 essere nullo cachedrowsetimpl.keycols = Colonne chiave non valide +cachedrowsetimpl.invalidcol = Indice di colonna non valido cachedrowsetimpl.opnotsupp = Operazione non supportata dal database cachedrowsetimpl.matchcols = Le colonne di corrispondenza non coincidono con le colonne impostate cachedrowsetimpl.setmatchcols = Impostare le colonne di corrispondenza prima di recuperarle @@ -68,32 +69,32 @@ cachedrowsetimpl.matchcols2 = Le colonne di corrispondenza devono essere una str cachedrowsetimpl.unsetmatch = Le colonne rimosse non coincidono con le colonne impostate cachedrowsetimpl.unsetmatch1 = Utilizzare il nome di colonna come argomento per unsetMatchColumn cachedrowsetimpl.unsetmatch2 = Utilizzare l'ID di colonna come argomento per unsetMatchColumn -cachedrowsetimpl.numrows = Il numero di righe \u00e8 inferiore a zero o alla dimensione di recupero -cachedrowsetimpl.startpos = La posizione iniziale non pu\u00f2 essere negativa +cachedrowsetimpl.numrows = Il numero di righe \u00E8 inferiore a zero o alla dimensione di recupero +cachedrowsetimpl.startpos = La posizione iniziale non pu\u00F2 essere negativa cachedrowsetimpl.nextpage = Inserire i dati prima di chiamare -cachedrowsetimpl.pagesize = La dimensione della pagina non pu\u00f2 essere inferiore a zero -cachedrowsetimpl.pagesize1 = La dimensione della pagina non pu\u00f2 essere superiore a maxRows -cachedrowsetimpl.fwdonly = ResultSet \u00e8 a solo inoltro -cachedrowsetimpl.type = Il tipo \u00e8: {0} +cachedrowsetimpl.pagesize = La dimensione della pagina non pu\u00F2 essere inferiore a zero +cachedrowsetimpl.pagesize1 = La dimensione della pagina non pu\u00F2 essere superiore a maxRows +cachedrowsetimpl.fwdonly = ResultSet \u00E8 a solo inoltro +cachedrowsetimpl.type = Il tipo \u00E8: {0} cachedrowsetimpl.opnotysupp = Operazione attualmente non supportata -cachedrowsetimpl.featnotsupp = Funzionalit\u00e0 non supportata +cachedrowsetimpl.featnotsupp = Funzione non supportata # WebRowSetImpl exceptions -webrowsetimpl.nullhash = Impossibile istanziare l'istanza WebRowSetImpl. Tabella hash nulla fornita al costruttore -webrowsetimpl.invalidwr = Autore non valido -webrowsetimpl.invalidrd = Lettore non valido +webrowsetimpl.nullhash = Impossibile creare istanza WebRowSetImpl. Tabella hash nulla fornita al costruttore +webrowsetimpl.invalidwr = Processo di scrittura non valido +webrowsetimpl.invalidrd = Processo di lettura non valido #FilteredRowSetImpl exceptions filteredrowsetimpl.relative = relative: operazione cursore non valida filteredrowsetimpl.absolute = absolute: operazione cursore non valida -filteredrowsetimpl.notallowed = Questo valore non \u00e8 consentito nel filtro +filteredrowsetimpl.notallowed = Questo valore non \u00E8 consentito nel filtro #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = Non \u00e8 un'istanza di rowset +joinrowsetimpl.notinstance = Non \u00E8 un'istanza di rowset joinrowsetimpl.matchnotset = Colonna di corrispondenza non impostata per l'unione joinrowsetimpl.numnotequal = Numero di elementi in rowset diverso dalla colonna di corrispondenza -joinrowsetimpl.notdefined = Non \u00e8 un tipo di unione definito -joinrowsetimpl.notsupported = Questo tipo di unione non \u00e8 supportato +joinrowsetimpl.notdefined = Non \u00E8 un tipo di unione definito +joinrowsetimpl.notsupported = Questo tipo di unione non \u00E8 supportato joinrowsetimpl.initerror = Errore di inizializzazione di JoinRowSet joinrowsetimpl.genericerr = Errore iniziale di joinrowset generico joinrowsetimpl.emptyrowset = Impossibile aggiungere un set di righe vuoto al JoinRowSet corrente @@ -109,16 +110,16 @@ jdbcrowsetimpl.matchcols2 = Le colonne di corrispondenza non possono essere una jdbcrowsetimpl.unsetmatch = Le colonne rimosse non coincidono con le colonne impostate jdbcrowsetimpl.usecolname = Utilizzare il nome di colonna come argomento per unsetMatchColumn jdbcrowsetimpl.usecolid = Utilizzare l'ID di colonna come argomento per unsetMatchColumn -jdbcrowsetimpl.resnotupd = ResultSet non \u00e8 aggiornabile +jdbcrowsetimpl.resnotupd = ResultSet non \u00E8 aggiornabile jdbcrowsetimpl.opnotysupp = Operazione attualmente non supportata -jdbcrowsetimpl.featnotsupp = Funzionalit\u00e0 non supportata +jdbcrowsetimpl.featnotsupp = Funzione non supportata #CachedRowSetReader exceptions crsreader.connect = (JNDI) Impossibile stabilire una connessione crsreader.paramtype = Impossibile dedurre il tipo di parametro crsreader.connecterr = Errore interno in RowSetReader: nessuna connessione o comando -crsreader.datedetected = \u00c8 stata rilevata una data -crsreader.caldetected = \u00c8 stato rilevato un calendario +crsreader.datedetected = \u00C8 stata rilevata una data +crsreader.caldetected = \u00C8 stato rilevato un calendario #CachedRowSetWriter exceptions crswriter.connect = Impossibile stabilire una connessione @@ -128,13 +129,13 @@ crswriter.params2 = Valore dei parametri 2: {0} crswriter.conflictsno = Conflitti durante la sincronizzazione #InsertRow exceptions -insertrow.novalue = Non \u00e8 stato inserito alcun valore +insertrow.novalue = Non \u00E8 stato inserito alcun valore #SyncResolverImpl exceptions -syncrsimpl.indexval = Il valore di indice non rientra nell'intervallo -syncrsimpl.noconflict = Questa colonna non \u00e8 in conflitto +syncrsimpl.indexval = Valore indice non compreso nell'intervallo +syncrsimpl.noconflict = Questa colonna non \u00E8 in conflitto syncrsimpl.syncnotpos = Impossibile eseguire la sincronizzazione -syncrsimpl.valtores = Il valore da risolvere pu\u00f2 essere nel database o in cachedrowset +syncrsimpl.valtores = Il valore da risolvere pu\u00F2 essere nel database o in cachedrowset #WebRowSetXmlReader exception wrsxmlreader.invalidcp = Raggiunta la fine di RowSet. Posizione cursore non valida @@ -153,16 +154,17 @@ xmlrch.errmetadata = Errore durante l''impostazione dei metadati: {0} xmlrch.errinsertval = Errore durante l''inserimento dei valori: {0} xmlrch.errconstr = Errore durante la costruzione della riga: {0} xmlrch.errdel = Errore durante l''eliminazione della riga: {0} +xmlrch.errinsert = Errore durante la costruzione della riga di inserimento: {0} xmlrch.errinsdel = Errore durante la costruzione della riga insdel: {0} xmlrch.errupdate = Errore durante la costruzione della riga di aggiornamento: {0} xmlrch.errupdrow = Errore durante l''aggiornamento della riga: {0} xmlrch.chars = caratteri: -xmlrch.badvalue = valore non valido; propriet\u00e0 non annullabile +xmlrch.badvalue = valore non valido; propriet\u00E0 non annullabile xmlrch.badvalue1 = valore non valido; metadati non annullabili -xmlrch.warning = **Avviso: {0}, riga: {1}, URI: {2} +xmlrch.warning = **Avvertenza: {0}, riga: {1}, URI: {2} #RIOptimisticProvider Exceptions -riop.locking = La classificazione di blocco non \u00e8 supportata +riop.locking = La classificazione di blocco non \u00E8 supportata #RIXMLProvider exceptions rixml.unsupp = Non supportato con RIXMLProvider diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ja.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ja.properties index 883c96a6174..7580131926d 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ja.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ja.properties @@ -24,145 +24,147 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = populate \u30e1\u30bd\u30c3\u30c9\u306b\u7121\u52b9\u306a ResultSet \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f7f\u7528\u3055\u308c\u307e\u3057\u305f\u3002 -cachedrowsetimpl.invalidp = \u7121\u52b9\u306a\u6301\u7d9a\u6027\u30d7\u30ed\u30d0\u30a4\u30c0\u304c\u751f\u6210\u3055\u308c\u307e\u3057\u305f\u3002 -cachedrowsetimpl.nullhash = CachedRowSetImpl \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u307e\u305b\u3093\u3002\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b null \u306e Hashtable \u304c\u4f7f\u7528\u3055\u308c\u307e\u3057\u305f\u3002 -cachedrowsetimpl.invalidop = \u633f\u5165\u884c\u3067\u306e\u7121\u52b9\u306a\u64cd\u4f5c -cachedrowsetimpl.accfailed = acceptChanges \u306e\u5931\u6557 -cachedrowsetimpl.invalidcp = \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u4f4d\u7f6e -cachedrowsetimpl.illegalop = \u633f\u5165\u3055\u308c\u306a\u304b\u3063\u305f\u884c\u306e\u4e0d\u6b63\u306a\u64cd\u4f5c -cachedrowsetimpl.clonefail = \u8907\u88fd\u306e\u5931\u6557 : {0} -cachedrowsetimpl.invalidcol = \u7121\u52b9\u306a\u5217\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 -cachedrowsetimpl.invalcolnm = \u7121\u52b9\u306a\u5217\u540d -cachedrowsetimpl.boolfail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getBoolen \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.bytefail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getByte \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.shortfail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getShort \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.intfail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getInt \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.longfail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getLong \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.floatfail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getFloat \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.doublefail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getDouble \u304c\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.dtypemismt = \u30c7\u30fc\u30bf\u578b\u306e\u30df\u30b9\u30de\u30c3\u30c1 -cachedrowsetimpl.datefail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getDate \u304c\u5931\u6557\u3002\u5909\u63db\u3067\u304d\u307e\u305b\u3093\u3002 -cachedrowsetimpl.timefail = \u5217 {1} \u306e\u5024 ( {0} ) \u3067 getTime \u304c\u5931\u6557\u3002\u5909\u63db\u3067\u304d\u307e\u305b\u3093\u3002 -cachedrowsetimpl.posupdate = \u4f4d\u7f6e\u6c7a\u3081\u3055\u308c\u305f\u66f4\u65b0\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u305b\u3093\u3002 -cachedrowsetimpl.unableins = \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u306a\u3044 : {0} -cachedrowsetimpl.beforefirst = beforeFirst : \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u64cd\u4f5c -cachedrowsetimpl.first = First : \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u64cd\u4f5c -cachedrowsetimpl.last = last : TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute : \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u64cd\u4f5c -cachedrowsetimpl.relative = relative : \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u64cd\u4f5c -cachedrowsetimpl.asciistream = ascii \u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.binstream = \u30d0\u30a4\u30ca\u30ea\u30b9\u30c8\u30ea\u30fc\u30e0\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -cachedrowsetimpl.failedins = \u884c\u306e\u633f\u5165\u306b\u5931\u6557 -cachedrowsetimpl.updateins = \u633f\u5165\u884c\u306b\u3066 updateRow \u304c\u547c\u3073\u51fa\u3055\u308c\u307e\u3057\u305f\u3002 -cachedrowsetimpl.movetoins = moveToInsertRow : CONCUR_READ_ONLY -cachedrowsetimpl.movetoins1 = moveToInsertRow : \u30e1\u30bf\u30c7\u30fc\u30bf\u306a\u3057 -cachedrowsetimpl.movetoins2 = moveToInsertRow : \u7121\u52b9\u306a\u5217\u6570 -cachedrowsetimpl.tablename = \u8868\u540d\u306b null \u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002 -cachedrowsetimpl.keycols = \u7121\u52b9\u306a\u30ad\u30fc\u5217 -cachedrowsetimpl.opnotsupp = \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u306a\u3044\u64cd\u4f5c -cachedrowsetimpl.matchcols = \u4e00\u81f4\u5217\u304c\u5217\u306e\u30bb\u30c3\u30c8\u3068\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -cachedrowsetimpl.setmatchcols = \u4e00\u81f4\u5217\u3092\u53d6\u5f97\u3059\u308b\u524d\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -cachedrowsetimpl.matchcols1 = \u4e00\u81f4\u5217\u306f 0 \u3088\u308a\u5927\u304d\u3044\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -cachedrowsetimpl.matchcols2 = \u4e00\u81f4\u5217\u306f\u7a7a\u304b null \u6587\u5b57\u5217\u3067\u3042\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -cachedrowsetimpl.unsetmatch = \u8a2d\u5b9a\u89e3\u9664\u3055\u308c\u3066\u3044\u308b\u5217\u306f\u30bb\u30c3\u30c8\u3068\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -cachedrowsetimpl.unsetmatch1 = unsetMatchColumn \u3078\u306e\u5f15\u6570\u3068\u3057\u3066\u5217\u540d\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -cachedrowsetimpl.unsetmatch2 = unsetMatchColumn \u3078\u306e\u5f15\u6570\u3068\u3057\u3066\u5217 ID \u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -cachedrowsetimpl.numrows = \u884c\u6570\u304c\u30bc\u30ed\u307e\u305f\u306f\u30d5\u30a7\u30c3\u30c1\u30b5\u30a4\u30ba\u3088\u308a\u5c0f\u3055\u3044\u3067\u3059\u3002 -cachedrowsetimpl.startpos = \u958b\u59cb\u4f4d\u7f6e\u306f\u8ca0\u3067\u306f\u306a\u308a\u307e\u305b\u3093\u3002 -cachedrowsetimpl.nextpage = \u547c\u3073\u51fa\u3057\u524d\u306b\u30c7\u30fc\u30bf\u3092\u751f\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -cachedrowsetimpl.pagesize = \u30da\u30fc\u30b8\u30b5\u30a4\u30ba\u306f\u30bc\u30ed\u3088\u308a\u5c0f\u3055\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 -cachedrowsetimpl.pagesize1 = \u30da\u30fc\u30b8\u30b5\u30a4\u30ba\u306f maxRows \u3088\u308a\u5927\u304d\u304f\u3066\u306f\u306a\u308a\u307e\u305b\u3093\u3002 -cachedrowsetimpl.fwdonly = ResultSet \u306f\u9806\u65b9\u5411\u306e\u307f\u3067\u3059\u3002 -cachedrowsetimpl.type = \u578b : {0} -cachedrowsetimpl.opnotysupp = \u307e\u3060\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u64cd\u4f5c -cachedrowsetimpl.featnotsupp = \u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u6a5f\u80fd +cachedrowsetimpl.populate = populate\u30E1\u30BD\u30C3\u30C9\u306B\u7121\u52B9\u306AResultSet\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F +cachedrowsetimpl.invalidp = \u7121\u52B9\u306A\u6C38\u7D9A\u6027\u30D7\u30ED\u30D0\u30A4\u30C0\u304C\u751F\u6210\u3055\u308C\u307E\u3057\u305F +cachedrowsetimpl.nullhash = CachedRowSetImpl\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093\u3002\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306Bnull\u306EHashtable\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F +cachedrowsetimpl.invalidop = \u633F\u5165\u884C\u3067\u306E\u7121\u52B9\u306A\u64CD\u4F5C +cachedrowsetimpl.accfailed = acceptChanges\u306E\u5931\u6557 +cachedrowsetimpl.invalidcp = \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u4F4D\u7F6E +cachedrowsetimpl.illegalop = \u633F\u5165\u3055\u308C\u306A\u304B\u3063\u305F\u884C\u306E\u4E0D\u6B63\u306A\u64CD\u4F5C +cachedrowsetimpl.clonefail = \u30AF\u30ED\u30FC\u30F3\u306E\u5931\u6557: {0} +cachedrowsetimpl.invalidcol = \u7121\u52B9\u306A\u5217\u7D22\u5F15 +cachedrowsetimpl.invalcolnm = \u7121\u52B9\u306A\u5217\u540D +cachedrowsetimpl.boolfail = \u5217{1}\u306E\u5024({0})\u3067getBoolean\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.bytefail = \u5217{1}\u306E\u5024({0})\u3067getByte\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.shortfail = \u5217{1}\u306E\u5024({0})\u3067getShort\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.intfail = \u5217{1}\u306E\u5024({0})\u3067getInt\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.longfail = \u5217{1}\u306E\u5024({0})\u3067getLong\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.floatfail = \u5217{1}\u306E\u5024({0})\u3067getFloat\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.doublefail = \u5217{1}\u306E\u5024({0})\u3067getDouble\u304C\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.dtypemismt = \u30C7\u30FC\u30BF\u578B\u306E\u4E0D\u4E00\u81F4 +cachedrowsetimpl.datefail = \u5217{1}\u306E\u5024({0})\u3067getDate\u304C\u5931\u6557\u3002\u5909\u63DB\u3067\u304D\u307E\u305B\u3093 +cachedrowsetimpl.timefail = \u5217{1}\u306E\u5024({0})\u3067getTime\u304C\u5931\u6557\u3002\u5909\u63DB\u3067\u304D\u307E\u305B\u3093 +cachedrowsetimpl.posupdate = \u4F4D\u7F6E\u6C7A\u3081\u3055\u308C\u305F\u66F4\u65B0\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u307E\u305B\u3093 +cachedrowsetimpl.unableins = \u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u306A\u3044: {0} +cachedrowsetimpl.beforefirst = beforeFirst: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u64CD\u4F5C +cachedrowsetimpl.first = First: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u64CD\u4F5C +cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY +cachedrowsetimpl.absolute = absolute: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u4F4D\u7F6E +cachedrowsetimpl.relative = relative: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u4F4D\u7F6E +cachedrowsetimpl.asciistream = ascii\u30B9\u30C8\u30EA\u30FC\u30E0\u306E\u8AAD\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.binstream = \u30D0\u30A4\u30CA\u30EA\u30FB\u30B9\u30C8\u30EA\u30FC\u30E0\u306E\u8AAD\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F +cachedrowsetimpl.failedins = \u884C\u306E\u633F\u5165\u306B\u5931\u6557 +cachedrowsetimpl.updateins = \u633F\u5165\u884C\u306B\u304A\u3044\u3066updateRow\u304C\u547C\u3073\u51FA\u3055\u308C\u307E\u3057\u305F +cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY +cachedrowsetimpl.movetoins1 = moveToInsertRow: \u30E1\u30BF\u30C7\u30FC\u30BF\u306A\u3057 +cachedrowsetimpl.movetoins2 = moveToInsertRow: \u7121\u52B9\u306A\u5217\u6570 +cachedrowsetimpl.tablename = \u8868\u540D\u306Bnull\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093 +cachedrowsetimpl.keycols = \u7121\u52B9\u306A\u30AD\u30FC\u5217 +cachedrowsetimpl.invalidcol = \u7121\u52B9\u306A\u5217\u7D22\u5F15 +cachedrowsetimpl.opnotsupp = \u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3067\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u306A\u3044\u64CD\u4F5C +cachedrowsetimpl.matchcols = \u4E00\u81F4\u5217\u304C\u5217\u306E\u30BB\u30C3\u30C8\u3068\u540C\u3058\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +cachedrowsetimpl.setmatchcols = \u4E00\u81F4\u5217\u3092\u53D6\u5F97\u3059\u308B\u524D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 +cachedrowsetimpl.matchcols1 = \u4E00\u81F4\u5217\u306F0\u3088\u308A\u5927\u304D\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +cachedrowsetimpl.matchcols2 = \u4E00\u81F4\u5217\u306F\u7A7A\u304Bnull\u6587\u5B57\u5217\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +cachedrowsetimpl.unsetmatch = \u8A2D\u5B9A\u89E3\u9664\u3055\u308C\u3066\u3044\u308B\u5217\u306F\u30BB\u30C3\u30C8\u3068\u540C\u3058\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +cachedrowsetimpl.unsetmatch1 = unsetMatchColumn\u3078\u306E\u5F15\u6570\u3068\u3057\u3066\u5217\u540D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +cachedrowsetimpl.unsetmatch2 = unsetMatchColumn\u3078\u306E\u5F15\u6570\u3068\u3057\u3066\u5217ID\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +cachedrowsetimpl.numrows = \u884C\u6570\u304C\u30BC\u30ED\u307E\u305F\u306F\u30D5\u30A7\u30C3\u30C1\u30FB\u30B5\u30A4\u30BA\u3088\u308A\u5C0F\u3055\u3044\u3067\u3059 +cachedrowsetimpl.startpos = \u958B\u59CB\u4F4D\u7F6E\u3092\u8CA0\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +cachedrowsetimpl.nextpage = \u547C\u51FA\u3057\u524D\u306B\u30C7\u30FC\u30BF\u3092\u79FB\u5165\u3057\u307E\u3059 +cachedrowsetimpl.pagesize = \u30DA\u30FC\u30B8\u30FB\u30B5\u30A4\u30BA\u3092\u30BC\u30ED\u3088\u308A\u5C0F\u3055\u304F\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +cachedrowsetimpl.pagesize1 = \u30DA\u30FC\u30B8\u30FB\u30B5\u30A4\u30BA\u3092maxRows\u3088\u308A\u5927\u304D\u304F\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093 +cachedrowsetimpl.fwdonly = ResultSet\u306F\u9806\u65B9\u5411\u306E\u307F\u3067\u3059 +cachedrowsetimpl.type = \u30BF\u30A4\u30D7: {0} +cachedrowsetimpl.opnotysupp = \u307E\u3060\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u64CD\u4F5C +cachedrowsetimpl.featnotsupp = \u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u6A5F\u80FD # WebRowSetImpl exceptions -webrowsetimpl.nullhash = WebRowSetImpl \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u307e\u305b\u3093\u3002\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u306b null \u306e Hashtable \u304c\u4f7f\u7528\u3055\u308c\u307e\u3057\u305f\u3002 -webrowsetimpl.invalidwr = \u7121\u52b9\u306a\u30e9\u30a4\u30bf\u30fc -webrowsetimpl.invalidrd = \u7121\u52b9\u306a\u30ea\u30fc\u30c0\u30fc +webrowsetimpl.nullhash = WebRowSetImpl\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3092\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u5316\u3067\u304D\u307E\u305B\u3093\u3002\u30B3\u30F3\u30B9\u30C8\u30E9\u30AF\u30BF\u306Bnull\u306EHashtable\u304C\u4F7F\u7528\u3055\u308C\u307E\u3057\u305F +webrowsetimpl.invalidwr = \u7121\u52B9\u306A\u30E9\u30A4\u30BF\u30FC +webrowsetimpl.invalidrd = \u7121\u52B9\u306A\u30EA\u30FC\u30C0\u30FC #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative : \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u64cd\u4f5c -filteredrowsetimpl.absolute = absolute : \u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u64cd\u4f5c -filteredrowsetimpl.notallowed = \u3053\u306e\u5024\u306f\u30d5\u30a3\u30eb\u30bf\u3067\u8a31\u5bb9\u3055\u308c\u307e\u305b\u3093\u3002 +filteredrowsetimpl.relative = relative: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u64CD\u4F5C +filteredrowsetimpl.absolute = absolute: \u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u64CD\u4F5C +filteredrowsetimpl.notallowed = \u3053\u306E\u5024\u306F\u30D5\u30A3\u30EB\u30BF\u3067\u8A31\u5BB9\u3055\u308C\u307E\u305B\u3093 #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = \u884c\u30bb\u30c3\u30c8\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -joinrowsetimpl.matchnotset = \u4e00\u81f4\u5217\u304c\u7d50\u5408\u7528\u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 -joinrowsetimpl.numnotequal = \u884c\u30bb\u30c3\u30c8\u306e\u8981\u7d20\u6570\u304c\u4e00\u81f4\u5217\u3068\u7b49\u3057\u304f\u3042\u308a\u307e\u305b\u3093\u3002 -joinrowsetimpl.notdefined = \u5b9a\u7fa9\u3055\u308c\u305f\u7d50\u5408\u306e\u578b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -joinrowsetimpl.notsupported = \u3053\u306e\u578b\u306e\u7d50\u5408\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 -joinrowsetimpl.initerror = JoinRowSet \u521d\u671f\u5316\u30a8\u30e9\u30fc -joinrowsetimpl.genericerr = \u6c4e\u7528 joinrowset \u306e\u521d\u671f\u30a8\u30e9\u30fc -joinrowsetimpl.emptyrowset = \u3053\u306e JoinRowSet \u306b\u7a7a\u306e\u884c\u30bb\u30c3\u30c8\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002 +joinrowsetimpl.notinstance = \u884C\u30BB\u30C3\u30C8\u306E\u30A4\u30F3\u30B9\u30BF\u30F3\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +joinrowsetimpl.matchnotset = \u4E00\u81F4\u5217\u304C\u7D50\u5408\u7528\u306B\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +joinrowsetimpl.numnotequal = \u884C\u30BB\u30C3\u30C8\u306E\u8981\u7D20\u6570\u304C\u4E00\u81F4\u5217\u3068\u7B49\u3057\u304F\u3042\u308A\u307E\u305B\u3093 +joinrowsetimpl.notdefined = \u5B9A\u7FA9\u3055\u308C\u305F\u7D50\u5408\u306E\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +joinrowsetimpl.notsupported = \u3053\u306E\u30BF\u30A4\u30D7\u306E\u7D50\u5408\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 +joinrowsetimpl.initerror = JoinRowSet\u521D\u671F\u5316\u30A8\u30E9\u30FC +joinrowsetimpl.genericerr = \u6C4E\u7528joinrowset\u306E\u521D\u671F\u30A8\u30E9\u30FC +joinrowsetimpl.emptyrowset = \u3053\u306EJoinRowSet\u306B\u7A7A\u306E\u884C\u30BB\u30C3\u30C8\u3092\u8FFD\u52A0\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = \u7121\u52b9\u306a\u72b6\u614b -jdbcrowsetimpl.connect = JdbcRowSet (connect) JNDI \u304c\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3002 -jdbcrowsetimpl.paramtype = \u30d1\u30e9\u30e1\u30fc\u30bf\u578b\u3092\u63a8\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002 -jdbcrowsetimpl.matchcols = \u4e00\u81f4\u5217\u304c\u5217\u306e\u30bb\u30c3\u30c8\u3068\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -jdbcrowsetimpl.setmatchcols = \u4e00\u81f4\u5217\u3092\u53d6\u5f97\u3059\u308b\u524d\u306b\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -jdbcrowsetimpl.matchcols1 = \u4e00\u81f4\u5217\u306f 0 \u3088\u308a\u5927\u304d\u3044\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002 -jdbcrowsetimpl.matchcols2 = \u4e00\u81f4\u5217\u306f\u7a7a\u3084 null \u6587\u5b57\u5217\u3067\u306f\u306a\u308a\u307e\u305b\u3093\u3002 -jdbcrowsetimpl.unsetmatch = \u8a2d\u5b9a\u89e3\u9664\u3055\u308c\u3066\u3044\u308b\u5217\u306f\u30bb\u30c3\u30c8\u3068\u540c\u3058\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 -jdbcrowsetimpl.usecolname = unsetMatchColumn \u3078\u306e\u5f15\u6570\u3068\u3057\u3066\u5217\u540d\u3092\u4f7f\u7528\u3066\u304f\u3060\u3055\u3044\u3002 -jdbcrowsetimpl.usecolid = unsetMatchColumn \u3078\u306e\u5f15\u6570\u3068\u3057\u3066\u5217 ID \u3092\u4f7f\u7528\u3066\u304f\u3060\u3055\u3044\u3002 -jdbcrowsetimpl.resnotupd = ResultSet \u306f\u66f4\u65b0\u3067\u304d\u307e\u305b\u3093\u3002 -jdbcrowsetimpl.opnotysupp = \u307e\u3060\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u64cd\u4f5c -jdbcrowsetimpl.featnotsupp = \u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u306a\u3044\u6a5f\u80fd +jdbcrowsetimpl.invalstate = \u7121\u52B9\u306A\u72B6\u614B +jdbcrowsetimpl.connect = JdbcRowSet(connect): JNDI\u304C\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093 +jdbcrowsetimpl.paramtype = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093 +jdbcrowsetimpl.matchcols = \u4E00\u81F4\u5217\u304C\u5217\u306E\u30BB\u30C3\u30C8\u3068\u540C\u3058\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +jdbcrowsetimpl.setmatchcols = \u4E00\u81F4\u5217\u3092\u53D6\u5F97\u3059\u308B\u524D\u306B\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044 +jdbcrowsetimpl.matchcols1 = \u4E00\u81F4\u5217\u306F0\u3088\u308A\u5927\u304D\u3044\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059 +jdbcrowsetimpl.matchcols2 = \u4E00\u81F4\u5217\u3092\u7A7A\u307E\u305F\u306Fnull\u6587\u5B57\u5217\u306B\u3059\u308B\u3053\u3068\u306F\u3067\u304D\u307E\u305B\u3093 +jdbcrowsetimpl.unsetmatch = \u8A2D\u5B9A\u89E3\u9664\u3055\u308C\u3066\u3044\u308B\u5217\u306F\u30BB\u30C3\u30C8\u3068\u540C\u3058\u3067\u306F\u3042\u308A\u307E\u305B\u3093 +jdbcrowsetimpl.usecolname = unsetMatchColumn\u3078\u306E\u5F15\u6570\u3068\u3057\u3066\u5217\u540D\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +jdbcrowsetimpl.usecolid = unsetMatchColumn\u3078\u306E\u5F15\u6570\u3068\u3057\u3066\u5217ID\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044 +jdbcrowsetimpl.resnotupd = ResultSet\u306F\u66F4\u65B0\u3067\u304D\u307E\u305B\u3093 +jdbcrowsetimpl.opnotysupp = \u307E\u3060\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u64CD\u4F5C +jdbcrowsetimpl.featnotsupp = \u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u6A5F\u80FD #CachedRowSetReader exceptions -crsreader.connect = (JNDI) \u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093\u3002 -crsreader.paramtype = \u30d1\u30e9\u30e1\u30fc\u30bf\u578b\u3092\u63a8\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002 -crsreader.connecterr = RowSetReader \u306e\u5185\u90e8\u30a8\u30e9\u30fc: \u63a5\u7d9a\u307e\u305f\u306f\u30b3\u30de\u30f3\u30c9\u306a\u3057 -crsreader.datedetected = \u65e5\u4ed8\u3092\u691c\u51fa\u3057\u307e\u3057\u305f\u3002 -crsreader.caldetected = \u30ab\u30ec\u30f3\u30c0\u3092\u691c\u51fa\u3057\u307e\u3057\u305f\u3002 +crsreader.connect = (JNDI)\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093 +crsreader.paramtype = \u30D1\u30E9\u30E1\u30FC\u30BF\u30FB\u30BF\u30A4\u30D7\u3092\u63A8\u5B9A\u3067\u304D\u307E\u305B\u3093 +crsreader.connecterr = RowSetReader\u306E\u5185\u90E8\u30A8\u30E9\u30FC: \u63A5\u7D9A\u307E\u305F\u306F\u30B3\u30DE\u30F3\u30C9\u306A\u3057 +crsreader.datedetected = \u65E5\u4ED8\u3092\u691C\u51FA\u3057\u307E\u3057\u305F +crsreader.caldetected = \u30AB\u30EC\u30F3\u30C0\u3092\u691C\u51FA\u3057\u307E\u3057\u305F #CachedRowSetWriter exceptions -crswriter.connect = \u63a5\u7d9a\u3092\u53d6\u5f97\u3067\u304d\u307e\u305b\u3093\u3002 -crswriter.tname = writeData \u304c\u8868\u540d\u3092\u5224\u5b9a\u3067\u304d\u307e\u305b\u3093\u3002 -crswriter.params1 = params1 \u306e\u5024 : {0} -crswriter.params2 = params2 \u306e\u5024 : {0} -crswriter.conflictsno = \u540c\u671f\u4e2d\u306b\u7af6\u5408\u304c\u767a\u751f\u3057\u307e\u3059\u3002 +crswriter.connect = \u63A5\u7D9A\u3092\u53D6\u5F97\u3067\u304D\u307E\u305B\u3093 +crswriter.tname = writeData\u304C\u8868\u540D\u3092\u5224\u5225\u3067\u304D\u307E\u305B\u3093 +crswriter.params1 = params1\u306E\u5024: {0} +crswriter.params2 = params2\u306E\u5024: {0} +crswriter.conflictsno = \u540C\u671F\u4E2D\u306B\u7AF6\u5408\u304C\u767A\u751F\u3057\u307E\u3059 #InsertRow exceptions -insertrow.novalue = \u5024\u306f\u633f\u5165\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 +insertrow.novalue = \u5024\u306F\u633F\u5165\u3055\u308C\u3066\u3044\u307E\u305B\u3093 #SyncResolverImpl exceptions -syncrsimpl.indexval = \u7bc4\u56f2\u5916\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u5024 -syncrsimpl.noconflict = \u3053\u306e\u5217\u306f\u7af6\u5408\u3057\u3066\u3044\u307e\u305b\u3093\u3002 -syncrsimpl.syncnotpos = \u540c\u671f\u3067\u304d\u307e\u305b\u3093\u3002 -syncrsimpl.valtores = \u89e3\u6c7a\u3055\u308c\u308b\u5024\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u304b cachedrowset \u306b\u3042\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +syncrsimpl.indexval = \u7BC4\u56F2\u5916\u306E\u7D22\u5F15\u5024 +syncrsimpl.noconflict = \u3053\u306E\u5217\u306F\u7AF6\u5408\u3057\u3066\u3044\u307E\u305B\u3093 +syncrsimpl.syncnotpos = \u540C\u671F\u3067\u304D\u307E\u305B\u3093 +syncrsimpl.valtores = \u89E3\u6C7A\u3055\u308C\u308B\u5024\u306F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u307E\u305F\u306Fcachedrowset\u306B\u3042\u308B\u53EF\u80FD\u6027\u304C\u3042\u308A\u307E\u3059 #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = RowSet \u306e\u6700\u5f8c\u306b\u5230\u9054\u3057\u307e\u3057\u305f\u3002\u7121\u52b9\u306a\u30ab\u30fc\u30bd\u30eb\u4f4d\u7f6e -wrsxmlreader.readxml = readXML : {0} -wrsxmlreader.parseerr = ** \u89e3\u6790\u30a8\u30e9\u30fc : {0} , \u884c : {1} , URI : {2} +wrsxmlreader.invalidcp = RowSet\u306E\u6700\u5F8C\u306B\u5230\u9054\u3057\u307E\u3057\u305F\u3002\u7121\u52B9\u306A\u30AB\u30FC\u30BD\u30EB\u4F4D\u7F6E +wrsxmlreader.readxml = readXML: {0} +wrsxmlreader.parseerr = **\u89E3\u6790\u30A8\u30E9\u30FC: {0}\u3001\u884C: {1}\u3001URI: {2} #WebRowSetXmlWriter exceptions -wrsxmlwriter.ioex = IOException : {0} -wrsxmlwriter.sqlex = SQLException : {0} -wrsxmlwriter.failedwrite = \u5024\u306e\u66f8\u304d\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -wsrxmlwriter.notproper = \u9069\u5207\u306a\u578b\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 +wrsxmlwriter.ioex = IOException: {0} +wrsxmlwriter.sqlex = SQLException: {0} +wrsxmlwriter.failedwrite = \u5024\u306E\u66F8\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F +wsrxmlwriter.notproper = \u9069\u5207\u306A\u30BF\u30A4\u30D7\u3067\u306F\u3042\u308A\u307E\u305B\u3093 #XmlReaderContentHandler exceptions -xmlrch.errmap = Map \u8a2d\u5b9a\u30a8\u30e9\u30fc : {0} -xmlrch.errmetadata = \u30e1\u30bf\u30c7\u30fc\u30bf\u8a2d\u5b9a\u30a8\u30e9\u30fc : {0} -xmlrch.errinsertval = \u5024\u306e\u633f\u5165\u30a8\u30e9\u30fc : {0} -xmlrch.errconstr = \u884c\u306e\u751f\u6210\u30a8\u30e9\u30fc : {0} -xmlrch.errdel = \u884c\u306e\u524a\u9664\u30a8\u30e9\u30fc : {0} -xmlrch.errinsdel = insdel \u884c\u306e\u751f\u6210\u30a8\u30e9\u30fc : {0} -xmlrch.errupdate = \u66f4\u65b0\u884c\u306e\u751f\u6210\u30a8\u30e9\u30fc : {0} -xmlrch.errupdrow = \u884c\u306e\u66f4\u65b0\u30a8\u30e9\u30fc : {0} -xmlrch.chars = \u6587\u5b57 : -xmlrch.badvalue = \u4e0d\u6b63\u306a\u5024 ; null \u306b\u3067\u304d\u306a\u3044\u30d7\u30ed\u30d1\u30c6\u30a3 -xmlrch.badvalue1 = \u4e0d\u6b63\u306a\u5024 ; null \u306b\u3067\u304d\u306a\u3044\u30e1\u30bf\u30c7\u30fc\u30bf -xmlrch.warning = ** \u8b66\u544a : {0} , \u884c : {1} , URI : {2} +xmlrch.errmap = Map\u8A2D\u5B9A\u30A8\u30E9\u30FC: {0} +xmlrch.errmetadata = \u30E1\u30BF\u30C7\u30FC\u30BF\u8A2D\u5B9A\u30A8\u30E9\u30FC: {0} +xmlrch.errinsertval = \u5024\u306E\u633F\u5165\u30A8\u30E9\u30FC: {0} +xmlrch.errconstr = \u884C\u306E\u751F\u6210\u30A8\u30E9\u30FC: {0} +xmlrch.errdel = \u884C\u306E\u524A\u9664\u30A8\u30E9\u30FC: {0} +xmlrch.errinsert = \u633F\u5165\u884C\u306E\u751F\u6210\u30A8\u30E9\u30FC: {0} +xmlrch.errinsdel = insdel\u884C\u306E\u751F\u6210\u30A8\u30E9\u30FC: {0} +xmlrch.errupdate = \u66F4\u65B0\u884C\u306E\u751F\u6210\u30A8\u30E9\u30FC: {0} +xmlrch.errupdrow = \u884C\u306E\u66F4\u65B0\u30A8\u30E9\u30FC: {0} +xmlrch.chars = \u6587\u5B57: +xmlrch.badvalue = \u4E0D\u6B63\u306A\u5024: null\u306B\u3067\u304D\u306A\u3044\u30D7\u30ED\u30D1\u30C6\u30A3 +xmlrch.badvalue1 = \u4E0D\u6B63\u306A\u5024: null\u306B\u3067\u304D\u306A\u3044\u30E1\u30BF\u30C7\u30FC\u30BF +xmlrch.warning = **\u8B66\u544A: {0}\u3001\u884C: {1}\u3001URI: {2} #RIOptimisticProvider Exceptions -riop.locking = \u30ed\u30c3\u30af\u306e\u5206\u985e\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 +riop.locking = \u30ED\u30C3\u30AF\u306E\u5206\u985E\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093 #RIXMLProvider exceptions -rixml.unsupp = RIXMLProvider \u3067\u306f\u672a\u30b5\u30dd\u30fc\u30c8 +rixml.unsupp = RIXMLProvider\u3067\u306F\u672A\u30B5\u30DD\u30FC\u30C8 diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties index 7901d9f840a..a730004c263 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_ko.properties @@ -24,145 +24,147 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = \uc798\ubabb\ub41c ResultSet \uac1d\uccb4\uac00 \uc81c\uacf5\ub418\uc5b4 \uba54\uc18c\ub4dc\ub97c \ucc44\uc6b8 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.invalidp = \uc798\ubabb\ub41c \uc9c0\uc18d\uc131 \uacf5\uae09\uc790\uac00 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.nullhash = CachedRowSetImpl \uc778\uc2a4\ud134\uc2a4\ub97c \uc778\uc2a4\ud134\uc2a4\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uad6c\uc131\uc790\uc5d0 \ub110 Hashtable\uc774 \uc81c\uacf5\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.invalidop = \ud589\uc744 \uc0bd\uc785\ud558\ub294 \ub3d9\uc548 \uc798\ubabb\ub41c \uc791\uc5c5\uc744 \uc218\ud589\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.accfailed = acceptChanges\uac00 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.invalidcp = \uc798\ubabb\ub41c \ucee4\uc11c \uc704\uce58\uc785\ub2c8\ub2e4. -cachedrowsetimpl.illegalop = \uc0bd\uc785\ub41c \ud589\uc774 \uc544\ub2cc \ud589\uc5d0\uc11c \uc798\ubabb\ub41c \uc791\uc5c5\uc744 \uc218\ud589\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.clonefail = \ubcf5\uc81c \uc2e4\ud328: {0} -cachedrowsetimpl.invalidcol = \uc798\ubabb\ub41c \uc5f4 \uc0c9\uc778\uc785\ub2c8\ub2e4. -cachedrowsetimpl.invalcolnm = \uc798\ubabb\ub41c \uc5f4 \uc774\ub984\uc785\ub2c8\ub2e4. -cachedrowsetimpl.boolfail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getBoolen\uc774 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.bytefail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getByte\uac00 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.shortfail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getShort\uac00 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.intfail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getInt\uac00 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.longfail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getLong\uc774 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.floatfail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getFloat\uac00 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.doublefail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getDouble\uc774 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.dtypemismt = \ub370\uc774\ud130 \uc720\ud615\uc774 \uc77c\uce58\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.datefail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getDate\uac00 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. \ubcc0\ud658\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.timefail = \uc5f4 {1}\uc758 \uac12({0})\uc5d0\uc11c getLong\uc774 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. \ubcc0\ud658\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.posupdate = \uc704\uce58 \uc9c0\uc815 \uc5c5\ub370\uc774\ud2b8\ub97c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.unableins = \uc778\uc2a4\ud134\uc2a4\ud654 \ud560 \uc218 \uc5c6\uc74c: {0} -cachedrowsetimpl.beforefirst = beforeFirst: \uc798\ubabb\ub41c \ucee4\uc11c \uc791\uc5c5\uc785\ub2c8\ub2e4. -cachedrowsetimpl.first = \ucc98\uc74c: \uc798\ubabb\ub41c \ucee4\uc11c \uc791\uc5c5\uc785\ub2c8\ub2e4. -cachedrowsetimpl.last = \ub9c8\uc9c0\ub9c9: TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = \uc808\ub300: \uc798\ubabb\ub41c \ucee4\uc11c \uc704\uce58\uc785\ub2c8\ub2e4. -cachedrowsetimpl.relative = \uc0c1\ub300: \uc798\ubabb\ub41c \ucee4\uc11c \uc704\uce58\uc785\ub2c8\ub2e4. -cachedrowsetimpl.asciistream = Ascii \uc2a4\ud2b8\ub9bc\uc744 \uc77d\ub294 \ub370 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.binstream = \uc774\uc9c4 \uc2a4\ud2b8\ub9bc\uc744 \uc77d\ub294 \ub370 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.failedins = \ud589\uc744 \uc0bd\uc785\ud558\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.updateins = \ud589\uc744 \uc0bd\uc785\ud558\ub294 \ub3d9\uc548 updateRow\uac00 \ud638\ucd9c\ub418\uc5c8\uc2b5\ub2c8\ub2e4. +cachedrowsetimpl.populate = \uBD80\uC801\uD569\uD55C ResultSet \uAC1D\uCCB4\uAC00 \uC81C\uACF5\uB418\uC5B4 \uBA54\uC18C\uB4DC\uB97C \uCC44\uC6B8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.invalidp = \uBD80\uC801\uD569\uD55C \uC9C0\uC18D\uC131 \uC81C\uACF5\uC790\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.nullhash = CachedRowSetImpl \uC778\uC2A4\uD134\uC2A4\uB97C \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0DD\uC131\uC790\uC5D0 \uB110 Hashtable\uC774 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.invalidop = \uD589\uC744 \uC0BD\uC785\uD558\uB294 \uC911 \uBD80\uC801\uD569\uD55C \uC791\uC5C5\uC774 \uC218\uD589\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.accfailed = acceptChanges\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.invalidcp = \uCEE4\uC11C \uC704\uCE58\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +cachedrowsetimpl.illegalop = \uC0BD\uC785\uB41C \uD589\uC774 \uC544\uB2CC \uD589\uC5D0\uC11C \uC798\uBABB\uB41C \uC791\uC5C5\uC774 \uC218\uD589\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.clonefail = \uBCF5\uC81C \uC2E4\uD328: {0} +cachedrowsetimpl.invalidcol = \uC5F4 \uC778\uB371\uC2A4\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +cachedrowsetimpl.invalcolnm = \uC5F4 \uC774\uB984\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +cachedrowsetimpl.boolfail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getBoolen\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.bytefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getByte\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.shortfail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getShort\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.intfail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getInt\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.longfail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getLong\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.floatfail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getFloat\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.doublefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getDouble\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.dtypemismt = \uB370\uC774\uD130 \uC720\uD615\uC774 \uC77C\uCE58\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.datefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getDate\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.timefail = {1} \uC5F4\uC758 \uAC12({0})\uC5D0\uC11C getTime\uC744 \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. \uBCC0\uD658\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.posupdate = \uC704\uCE58\uAC00 \uC9C0\uC815\uB41C \uAC31\uC2E0\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.unableins = \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC74C: {0} +cachedrowsetimpl.beforefirst = beforeFirst: \uCEE4\uC11C \uC791\uC5C5\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +cachedrowsetimpl.first = \uCC98\uC74C: \uCEE4\uC11C \uC791\uC5C5\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +cachedrowsetimpl.last = \uB9C8\uC9C0\uB9C9: TYPE_FORWARD_ONLY +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.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.movetoins2 = moveToInsertRow: \uc798\ubabb\ub41c \uc5f4 \uac1c\uc218\uc785\ub2c8\ub2e4. -cachedrowsetimpl.tablename = \ud14c\uc774\ube14 \uc774\ub984\uc740 \ub110\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.keycols = \uc798\ubabb\ub41c \ud0a4 \uc5f4\uc785\ub2c8\ub2e4. -cachedrowsetimpl.opnotsupp = \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c \uc9c0\uc6d0\ud558\uc9c0 \uc54a\ub294 \uc791\uc5c5\uc785\ub2c8\ub2e4. -cachedrowsetimpl.matchcols = \uc77c\uce58 \uc5f4\uc774 \uc124\uc815\ub41c \uc5f4\uacfc \uac19\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.setmatchcols = \uc77c\uce58 \uc5f4\uc744 \uc124\uc815\ud55c \ub2e4\uc74c\uc5d0 \uac00\uc838\uc624\uc2ed\uc2dc\uc624. -cachedrowsetimpl.matchcols1 = \uc77c\uce58 \uc5f4\uc774 0\uac1c \uc774\uc0c1\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4. -cachedrowsetimpl.matchcols2 = \uc77c\uce58 \uc5f4\uc740 \ube44\uc5b4 \uc788\uac70\ub098 \ub110 \ubb38\uc790\uc5f4\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4. -cachedrowsetimpl.unsetmatch = \uc124\uc815 \ud574\uc81c\ud560 \uc5f4\uc774 \uc124\uc815\ub41c \uc5f4\uacfc \uac19\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.unsetmatch1 = \uc5f4 \uc774\ub984\uc744 unsetMatchColumn\uc758 \uc778\uc218\ub85c \uc0ac\uc6a9\ud558\uc2ed\uc2dc\uc624. -cachedrowsetimpl.unsetmatch2 = \uc5f4 ID\ub97c unsetMatchColumn\uc758 \uc778\uc218\ub85c \uc0ac\uc6a9\ud558\uc2ed\uc2dc\uc624. -cachedrowsetimpl.numrows = \ud589 \uac1c\uc218\uac00 0\ubcf4\ub2e4 \uc791\uac70\ub098 \ubc18\uc785 \ud06c\uae30\ubcf4\ub2e4 \uc791\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.startpos = \uc2dc\uc791 \uc704\uce58\ub294 \uc74c\uc218\uc77c \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.nextpage = \ud638\ucd9c\ud558\uae30 \uc804\uc5d0 \ub370\uc774\ud130\ub97c \ucc44\uc6b0\uc2ed\uc2dc\uc624. -cachedrowsetimpl.pagesize = \ud398\uc774\uc9c0 \ud06c\uae30\ub294 0\ubcf4\ub2e4 \uc791\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.pagesize1 = \ud398\uc774\uc9c0 \ud06c\uae30\ub294 maxRows\ubcf4\ub2e4 \ud074 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -cachedrowsetimpl.fwdonly = ResultSet\ub294 \uc804\ub2ec \uc804\uc6a9\uc785\ub2c8\ub2e4. -cachedrowsetimpl.type = \uc720\ud615: {0} -cachedrowsetimpl.opnotysupp = \uc791\uc5c5\uc774 \uc544\uc9c1 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc74c -cachedrowsetimpl.featnotsupp = \uae30\ub2a5\uc774 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc74c +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. +cachedrowsetimpl.invalidcol = \uC5F4 \uC778\uB371\uC2A4\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +cachedrowsetimpl.opnotsupp = \uB370\uC774\uD130\uBCA0\uC774\uC2A4\uC5D0\uC11C \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC791\uC5C5\uC785\uB2C8\uB2E4. +cachedrowsetimpl.matchcols = \uC77C\uCE58 \uC5F4\uC774 \uC124\uC815\uB41C \uC5F4\uACFC \uB3D9\uC77C\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.setmatchcols = \uC77C\uCE58 \uC5F4\uC744 \uC124\uC815\uD55C \uD6C4 \uAC00\uC838\uC624\uC2ED\uC2DC\uC624. +cachedrowsetimpl.matchcols1 = \uC77C\uCE58 \uC5F4\uC740 0\uAC1C \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. +cachedrowsetimpl.matchcols2 = \uC77C\uCE58 \uC5F4\uC740 \uBE44\uC5B4 \uC788\uAC70\uB098 \uB110 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. +cachedrowsetimpl.unsetmatch = \uC124\uC815\uC744 \uD574\uC81C\uD558\uB824\uB294 \uC5F4\uC774 \uC124\uC815\uB41C \uC5F4\uACFC \uB2E4\uB985\uB2C8\uB2E4. +cachedrowsetimpl.unsetmatch1 = \uC5F4 \uC774\uB984\uC744 unsetMatchColumn\uC758 \uC778\uC218\uB85C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. +cachedrowsetimpl.unsetmatch2 = \uC5F4 ID\uB97C unsetMatchColumn\uC758 \uC778\uC218\uB85C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. +cachedrowsetimpl.numrows = \uD589 \uC218\uAC00 0\uBCF4\uB2E4 \uC791\uAC70\uB098 \uC778\uCD9C \uD06C\uAE30\uBCF4\uB2E4 \uC791\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.startpos = \uC2DC\uC791 \uC704\uCE58\uB294 \uC74C\uC218\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.nextpage = \uD638\uCD9C\uD558\uAE30 \uC804\uC5D0 \uB370\uC774\uD130\uB97C \uCC44\uC6B0\uC2ED\uC2DC\uC624. +cachedrowsetimpl.pagesize = \uD398\uC774\uC9C0 \uD06C\uAE30\uB294 0\uBCF4\uB2E4 \uC791\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.pagesize1 = \uD398\uC774\uC9C0 \uD06C\uAE30\uB294 maxRows\uBCF4\uB2E4 \uD074 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.fwdonly = ResultSet\uB294 \uC804\uB2EC \uC804\uC6A9\uC785\uB2C8\uB2E4. +cachedrowsetimpl.type = \uC720\uD615: {0} +cachedrowsetimpl.opnotysupp = \uC791\uC5C5\uC774 \uC544\uC9C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +cachedrowsetimpl.featnotsupp = \uAE30\uB2A5\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. # WebRowSetImpl exceptions -webrowsetimpl.nullhash = WebRowSetImpl \uc778\uc2a4\ud134\uc2a4\ub97c \uc778\uc2a4\ud134\uc2a4\ud654\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uad6c\uc131\uc790\uc5d0 \ub110 Hashtable\uc774 \uc81c\uacf5\ub418\uc5c8\uc2b5\ub2c8\ub2e4. -webrowsetimpl.invalidwr = \uc798\ubabb\ub41c \uae30\ub85d\uae30\uc785\ub2c8\ub2e4. -webrowsetimpl.invalidrd = \uc798\ubabb\ub41c \ud310\ub3c5\uae30\uc785\ub2c8\ub2e4. +webrowsetimpl.nullhash = WebRowSetImpl \uC778\uC2A4\uD134\uC2A4\uB97C \uC778\uC2A4\uD134\uC2A4\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC0DD\uC131\uC790\uC5D0 \uB110 Hashtable\uC774 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +webrowsetimpl.invalidwr = \uAE30\uB85D \uC7A5\uCE58\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +webrowsetimpl.invalidrd = \uC77D\uAE30 \uD504\uB85C\uADF8\uB7A8\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = \uc0c1\ub300: \uc798\ubabb\ub41c \ucee4\uc11c \uc791\uc5c5\uc785\ub2c8\ub2e4. -filteredrowsetimpl.absolute = \uc808\ub300: \uc798\ubabb\ub41c \ucee4\uc11c \uc791\uc5c5\uc785\ub2c8\ub2e4. -filteredrowsetimpl.notallowed = \uc774 \uac12\uc740 \ud544\ud130\ub97c \ud1b5\uacfc\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. +filteredrowsetimpl.relative = \uC0C1\uB300: \uCEE4\uC11C \uC791\uC5C5\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +filteredrowsetimpl.absolute = \uC808\uB300: \uCEE4\uC11C \uC791\uC5C5\uC774 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +filteredrowsetimpl.notallowed = \uC774 \uAC12\uC740 \uD544\uD130\uB97C \uD1B5\uACFC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = Rowset\uc758 \uc778\uc2a4\ud134\uc2a4\uac00 \uc544\ub2d9\ub2c8\ub2e4. -joinrowsetimpl.matchnotset = \uacb0\ud569\ud560 \uc77c\uce58 \uc5f4\uc744 \uc124\uc815\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4. -joinrowsetimpl.numnotequal = Rowset\uc758 \uc694\uc18c \uc218\uac00 \uc77c\uce58 \uc5f4\uacfc \uac19\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -joinrowsetimpl.notdefined = \uc815\uc758\ub41c \uacb0\ud569 \uc720\ud615\uc774 \uc544\ub2d9\ub2c8\ub2e4. -joinrowsetimpl.notsupported = \uc774 \uacb0\ud569 \uc720\ud615\uc740 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -joinrowsetimpl.initerror = JoinRowSet \ucd08\uae30\ud654 \uc624\ub958 -joinrowsetimpl.genericerr = \uc77c\ubc18 joinrowset \ucd08\uae30 \uc624\ub958 -joinrowsetimpl.emptyrowset = \ube48 rowset\uc744 \uc774 JoinRowSet\uc5d0 \ucd94\uac00\ud560 \uc218 \uc5c6\uc74c +joinrowsetimpl.notinstance = Rowset\uC758 \uC778\uC2A4\uD134\uC2A4\uAC00 \uC544\uB2D9\uB2C8\uB2E4. +joinrowsetimpl.matchnotset = \uC870\uC778\uD560 \uC77C\uCE58 \uC5F4\uC774 \uC124\uC815\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. +joinrowsetimpl.numnotequal = Rowset\uC758 \uC694\uC18C \uC218\uAC00 \uC77C\uCE58 \uC5F4\uACFC \uAC19\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +joinrowsetimpl.notdefined = \uC815\uC758\uB41C \uC870\uC778 \uC720\uD615\uC774 \uC544\uB2D9\uB2C8\uB2E4. +joinrowsetimpl.notsupported = \uC774 \uC870\uC778 \uC720\uD615\uC740 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +joinrowsetimpl.initerror = JoinRowSet \uCD08\uAE30\uD654 \uC624\uB958 +joinrowsetimpl.genericerr = \uC77C\uBC18 joinrowset \uCD08\uAE30 \uC624\uB958 +joinrowsetimpl.emptyrowset = \uBE48 rowset\uB97C \uC774 JoinRowSet\uC5D0 \uCD94\uAC00\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = \uc798\ubabb\ub41c \uc0c1\ud0dc\uc785\ub2c8\ub2e4. -jdbcrowsetimpl.connect = JdbcRowSet(\uc5f0\uacb0) JNDI\uac00 \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -jdbcrowsetimpl.paramtype = \ub9e4\uac1c \ubcc0\uc218 \uc720\ud615\uc744 \ucd94\ub860\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -jdbcrowsetimpl.matchcols = \uc77c\uce58 \uc5f4\uc774 \uc124\uc815\ub41c \uc5f4\uacfc \uac19\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -jdbcrowsetimpl.setmatchcols = \uc77c\uce58 \uc5f4\uc744 \uc124\uc815\ud55c \ub2e4\uc74c\uc5d0 \uac00\uc838\uc624\uc2ed\uc2dc\uc624. -jdbcrowsetimpl.matchcols1 = \uc77c\uce58 \uc5f4\uc740 0\uac1c \uc774\uc0c1\uc774\uc5b4\uc57c \ud569\ub2c8\ub2e4. -jdbcrowsetimpl.matchcols2 = \uc77c\uce58 \uc5f4\uc740 \ub110 \ub610\ub294 \ube48 \ubb38\uc790\uc5f4\uc77c \uc218\ub294 \uc5c6\uc2b5\ub2c8\ub2e4. -jdbcrowsetimpl.unsetmatch = \uc124\uc815 \ud574\uc81c\ud560 \uc5f4\uc774 \uc124\uc815\ub41c \uc5f4\uacfc \uac19\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -jdbcrowsetimpl.usecolname = \uc5f4 \uc774\ub984\uc744 unsetMatchColumn\uc758 \uc778\uc218\ub85c \uc0ac\uc6a9\ud558\uc2ed\uc2dc\uc624. -jdbcrowsetimpl.usecolid = \uc5f4 ID\ub97c unsetMatchColumn\uc758 \uc778\uc218\ub85c \uc0ac\uc6a9\ud558\uc2ed\uc2dc\uc624. -jdbcrowsetimpl.resnotupd = ResultSet\uc740 \uc5c5\ub370\uc774\ud2b8\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -jdbcrowsetimpl.opnotysupp = \uc791\uc5c5\uc774 \uc544\uc9c1 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc74c -jdbcrowsetimpl.featnotsupp = \uae30\ub2a5\uc774 \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc74c +jdbcrowsetimpl.invalstate = \uC0C1\uD0DC\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. +jdbcrowsetimpl.connect = JdbcRowSet(\uC811\uC18D) JNDI\uAC00 \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.paramtype = \uB9E4\uAC1C\uBCC0\uC218 \uC720\uD615\uC744 \uCD94\uB860\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.matchcols = \uC77C\uCE58 \uC5F4\uC774 \uC124\uC815\uB41C \uC5F4\uACFC \uB3D9\uC77C\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.setmatchcols = \uC77C\uCE58 \uC5F4\uC744 \uC124\uC815\uD55C \uD6C4 \uAC00\uC838\uC624\uC2ED\uC2DC\uC624. +jdbcrowsetimpl.matchcols1 = \uC77C\uCE58 \uC5F4\uC740 0\uAC1C \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. +jdbcrowsetimpl.matchcols2 = \uC77C\uCE58 \uC5F4\uC740 \uB110 \uB610\uB294 \uBE48 \uBB38\uC790\uC5F4\uC77C \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.unsetmatch = \uC124\uC815\uC744 \uD574\uC81C\uD558\uB824\uB294 \uC5F4\uC774 \uC124\uC815\uB41C \uC5F4\uACFC \uB2E4\uB985\uB2C8\uB2E4. +jdbcrowsetimpl.usecolname = \uC5F4 \uC774\uB984\uC744 unsetMatchColumn\uC758 \uC778\uC218\uB85C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. +jdbcrowsetimpl.usecolid = \uC5F4 ID\uB97C unsetMatchColumn\uC758 \uC778\uC218\uB85C \uC0AC\uC6A9\uD558\uC2ED\uC2DC\uC624. +jdbcrowsetimpl.resnotupd = ResultSet\uB97C \uAC31\uC2E0\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.opnotysupp = \uC791\uC5C5\uC774 \uC544\uC9C1 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +jdbcrowsetimpl.featnotsupp = \uAE30\uB2A5\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. #CachedRowSetReader exceptions -crsreader.connect = (JNDI) \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -crsreader.paramtype = \ub9e4\uac1c \ubcc0\uc218 \uc720\ud615\uc744 \ucd94\ub860\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -crsreader.connecterr = RowSetReader\uc758 \ub0b4\ubd80 \uc624\ub958: \uc5f0\uacb0 \ub610\ub294 \uba85\ub839\uc774 \uc5c6\uc74c -crsreader.datedetected = \ub0a0\uc9dc\uac00 \uac10\uc9c0\ub428 -crsreader.caldetected = \ub2ec\ub825\uc774 \uac10\uc9c0\ub428 +crsreader.connect = (JNDI) \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +crsreader.paramtype = \uB9E4\uAC1C\uBCC0\uC218 \uC720\uD615\uC744 \uCD94\uB860\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +crsreader.connecterr = RowSetReader\uC5D0 \uB0B4\uBD80 \uC624\uB958 \uBC1C\uC0DD: \uC811\uC18D \uB610\uB294 \uBA85\uB839\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. +crsreader.datedetected = \uB0A0\uC9DC\uB97C \uAC10\uC9C0\uD568 +crsreader.caldetected = \uB2EC\uB825\uC744 \uAC10\uC9C0\uD568 #CachedRowSetWriter exceptions -crswriter.connect = \uc5f0\uacb0\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -crswriter.tname = writeData\uc5d0\uc11c \ud14c\uc774\ube14 \uc774\ub984\uc744 \ud655\uc778\ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -crswriter.params1 = params1\uc758 \uac12: {0} -crswriter.params2 = params2\uc758 \uac12: {0} -crswriter.conflictsno = \ub3d9\uae30\ud654\ud558\ub294 \ub3d9\uc548 \ucda9\ub3cc\ud568 +crswriter.connect = \uC811\uC18D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +crswriter.tname = writeData\uC5D0\uC11C \uD14C\uC774\uBE14 \uC774\uB984\uC744 \uD655\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +crswriter.params1 = params1\uC758 \uAC12: {0} +crswriter.params2 = params2\uC758 \uAC12: {0} +crswriter.conflictsno = \uB3D9\uAE30\uD654\uD558\uB294 \uC911 \uCDA9\uB3CC\uD568 #InsertRow exceptions -insertrow.novalue = \uac12\uc774 \uc0bd\uc785\ub418\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4. +insertrow.novalue = \uAC12\uC774 \uC0BD\uC785\uB418\uC9C0 \uC54A\uC558\uC2B5\uB2C8\uB2E4. #SyncResolverImpl exceptions -syncrsimpl.indexval = \uc0c9\uc778 \uac12\uc774 \ubc94\uc704\ub97c \ubc97\uc5b4\ub0ac\uc2b5\ub2c8\ub2e4. -syncrsimpl.noconflict = \uc774 \uc5f4\uc740 \ucda9\ub3cc\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. -syncrsimpl.syncnotpos = \ub3d9\uae30\ud654\ub97c \ud560 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -syncrsimpl.valtores = \ud655\uc778\ud560 \uac12\uc774 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub098 cachedrowset\uc5d0 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. +syncrsimpl.indexval = \uC778\uB371\uC2A4 \uAC12\uC774 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4. +syncrsimpl.noconflict = \uC774 \uC5F4\uC740 \uCDA9\uB3CC\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +syncrsimpl.syncnotpos = \uB3D9\uAE30\uD654\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +syncrsimpl.valtores = \uBD84\uC11D\uD560 \uAC12\uC774 \uB370\uC774\uD130\uBCA0\uC774\uC2A4 \uB610\uB294 cachedrowset\uC5D0 \uC788\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4. #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = RowSet\uc758 \ub05d\uc5d0 \ub3c4\ub2ec\ud588\uc2b5\ub2c8\ub2e4. \uc798\ubabb\ub41c \ucee4\uc11c \uc704\uce58\uc785\ub2c8\ub2e4. +wrsxmlreader.invalidcp = RowSet\uC758 \uB05D\uC5D0 \uB3C4\uB2EC\uD588\uC2B5\uB2C8\uB2E4. \uCEE4\uC11C \uC704\uCE58\uAC00 \uBD80\uC801\uD569\uD569\uB2C8\uB2E4. wrsxmlreader.readxml = readXML: {0} -wrsxmlreader.parseerr = ** \uad6c\ubb38 \ubd84\uc11d \uc624\ub958 : {0} , \ud589 : {1} , uri : {2} +wrsxmlreader.parseerr = ** \uAD6C\uBB38 \uBD84\uC11D \uC624\uB958: {0}, \uD589: {1}, URI: {2} #WebRowSetXmlWriter exceptions -wrsxmlwriter.ioex = IOException: {0} -wrsxmlwriter.sqlex = SQLException: {0} -wrsxmlwriter.failedwrite = \uac12\uc744 \uc4f0\uc9c0 \ubabb\ud588\uc2b5\ub2c8\ub2e4. -wsrxmlwriter.notproper = \uc62c\ubc14\ub978 \uc720\ud615\uc774 \uc544\ub2d9\ub2c8\ub2e4. +wrsxmlwriter.ioex = IOException : {0} +wrsxmlwriter.sqlex = SQLException : {0} +wrsxmlwriter.failedwrite = \uAC12 \uC4F0\uAE30\uB97C \uC2E4\uD328\uD588\uC2B5\uB2C8\uB2E4. +wsrxmlwriter.notproper = \uC801\uC808\uD55C \uC720\uD615\uC774 \uC544\uB2D9\uB2C8\uB2E4. #XmlReaderContentHandler exceptions -xmlrch.errmap = \ub9e4\ud551\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.errinsertval = \ub2e4\uc74c \uac12\uc744 \uc0bd\uc785\ud558\ub294 \uc911 \uc624\ub958 \ubc1c\uc0dd : {0} -xmlrch.errconstr = \ud589\uc744 \ub9cc\ub4dc\ub294 \uc911 \uc624\ub958 \ubc1c\uc0dd: {0} -xmlrch.errdel = \ud589\uc744 \uc81c\uac70\ud558\ub294 \uc911 \uc624\ub958 \ubc1c\uc0dd: {0} -xmlrch.errinsdel = insdel \ud589\uc744 \ub9cc\ub4dc\ub294 \uc911 \uc624\ub958 \ubc1c\uc0dd: {0} -xmlrch.errupdate = update \ud589\uc744 \ub9cc\ub4dc\ub294 \uc911 \uc624\ub958 \ubc1c\uc0dd: {0} -xmlrch.errupdrow = \ub2e4\uc74c \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 \ub4f1\ub85d \uc815\ubcf4 -xmlrch.badvalue1 = \uc798\ubabb\ub41c \uac12; \ub110\uc77c \uc218 \uc5c6\ub294 \uba54\ud0c0\ub370\uc774\ud130 -xmlrch.warning = ** \uacbd\uace0 : {0} , \ud589 : {1} , uri : {2} +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.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} +xmlrch.errinsert = insert \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} +xmlrch.errinsdel = insdel \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} +xmlrch.errupdate = update \uD589\uC744 \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD: {0} +xmlrch.errupdrow = \uD589\uC744 \uAC31\uC2E0\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.warning = ** \uACBD\uACE0: {0}, \uD589: {1}, URI: {2} #RIOptimisticProvider Exceptions -riop.locking = \ub4f1\uae09 \uc7a0\uae08\uc744 \uc9c0\uc6d0\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. +riop.locking = \uBD84\uB958 \uC7A0\uAE08\uC774 \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. #RIXMLProvider exceptions -rixml.unsupp = RIXMLProvider\uc5d0\uc11c \uc9c0\uc6d0\ub418\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. +rixml.unsupp = RIXMLProvider\uC5D0\uC11C \uC9C0\uC6D0\uB418\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_pt_BR.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_pt_BR.properties index 4abf3f54ddb..32f6c296add 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_pt_BR.properties @@ -24,147 +24,147 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = Objeto ResultSet inv\u00e1lido fornecido para preencher o m\u00e9todo -cachedrowsetimpl.invalidp = Fornecedor de persist\u00eancias inv\u00e1lido gerado -cachedrowsetimpl.nullhash = N\u00e3o \u00e9 poss\u00edvel instanciar a inst\u00e2ncia CachedRowSetImpl. Hashtable nulo fornecido ao construtor -cachedrowsetimpl.invalidop = Opera\u00e7\u00e3o inv\u00e1lida durante a inser\u00e7\u00e3o de linha -cachedrowsetimpl.accfailed = acceptChanges falho -cachedrowsetimpl.invalidcp = Posi\u00e7\u00e3o inv\u00e1lida do cursor -cachedrowsetimpl.illegalop = Opera\u00e7\u00e3o ilegal em linha n\u00e3o inserida -cachedrowsetimpl.clonefail = Clone falho: {0} -cachedrowsetimpl.invalidcol = \u00cdndice de coluna inv\u00e1lido -cachedrowsetimpl.invalcolnm = Nome de coluna inv\u00e1lido -cachedrowsetimpl.boolfail = getBoolen falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.bytefail = getByte falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.shortfail = getShort falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.intfail = getInt falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.longfail = getLong falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.floatfail = getFloat falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.doublefail = getDouble falhou no valor ( {0} ) na coluna {1} -cachedrowsetimpl.dtypemismt = Tipo de dados incompat\u00edvel -cachedrowsetimpl.datefail = getDate falhou no valor ( {0} ) na coluna {1} sem convers\u00e3o dispon\u00edvel -cachedrowsetimpl.timefail = getTime falhou no valor ( {0} ) na coluna {1} sem convers\u00e3o dispon\u00edvel -cachedrowsetimpl.posupdate = Atualiza\u00e7\u00f5es posicionadas n\u00e3o suportadas -cachedrowsetimpl.unableins = N\u00e3o \u00e9 poss\u00edvel instanciar: {0} -cachedrowsetimpl.beforefirst = beforeFirst : posi\u00e7\u00e3o inv\u00e1lida do cursor -cachedrowsetimpl.first = First : opera\u00e7\u00e3o inv\u00e1lida do cursor +cachedrowsetimpl.populate = Objeto ResultSet inv\u00E1lido fornecido para preencher o m\u00E9todo +cachedrowsetimpl.invalidp = Fornecedor de persist\u00EAncias inv\u00E1lido gerado +cachedrowsetimpl.nullhash = N\u00E3o \u00E9 poss\u00EDvel instanciar a inst\u00E2ncia CachedRowSetImpl. Hashtable Nulo fornecido ao construtor +cachedrowsetimpl.invalidop = Opera\u00E7\u00E3o inv\u00E1lida durante a inser\u00E7\u00E3o de linha +cachedrowsetimpl.accfailed = Falha em acceptChanges +cachedrowsetimpl.invalidcp = Posi\u00E7\u00E3o inv\u00E1lida do cursor +cachedrowsetimpl.illegalop = Opera\u00E7\u00E3o inv\u00E1lida em linha n\u00E3o inserida +cachedrowsetimpl.clonefail = Falha ao clonar: {0} +cachedrowsetimpl.invalidcol = \u00CDndice de coluna inv\u00E1lido +cachedrowsetimpl.invalcolnm = Nome de coluna inv\u00E1lido +cachedrowsetimpl.boolfail = Falha em getBoolen no valor ( {0} ) na coluna {1} +cachedrowsetimpl.bytefail = Falha em getByte no valor ( {0} ) na coluna {1} +cachedrowsetimpl.shortfail = Falha em getShort no valor ( {0} ) na coluna {1} +cachedrowsetimpl.intfail = Falha em getInt no valor ( {0} ) na coluna {1} +cachedrowsetimpl.longfail = Falha em getLong no valor ( {0} ) na coluna {1} +cachedrowsetimpl.floatfail = Falha em getFloat no valor ( {0} ) na coluna {1} +cachedrowsetimpl.doublefail = Falha em getDouble no valor ( {0} ) na coluna {1} +cachedrowsetimpl.dtypemismt = Tipo de Dados Incompat\u00EDvel +cachedrowsetimpl.datefail = Falha em getDate no valor ( {0} ) na coluna {1} sem convers\u00E3o dispon\u00EDvel +cachedrowsetimpl.timefail = Falha em getTime no valor ( {0} ) na coluna {1} sem convers\u00E3o dispon\u00EDvel +cachedrowsetimpl.posupdate = Atualiza\u00E7\u00F5es posicionadas n\u00E3o suportadas +cachedrowsetimpl.unableins = N\u00E3o \u00E9 poss\u00EDvel instanciar : {0} +cachedrowsetimpl.beforefirst = beforeFirst : Opera\u00E7\u00E3o do cursor inv\u00E1lida +cachedrowsetimpl.first = First : Opera\u00E7\u00E3o inv\u00E1lida do cursor cachedrowsetimpl.last = last : TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute : posi\u00e7\u00e3o inv\u00e1lida do cursor -cachedrowsetimpl.relative = relative : posi\u00e7\u00e3o inv\u00e1lida do cursor -cachedrowsetimpl.asciistream = leitura falha do fluxo ascii -cachedrowsetimpl.binstream = leitura falha em fluxo bin\u00e1rio -cachedrowsetimpl.failedins = Falha ao inserir linha -cachedrowsetimpl.updateins = updateRow chamado durante a inser\u00e7\u00e3o de linha +cachedrowsetimpl.absolute = absolute : Posi\u00E7\u00E3o inv\u00E1lida do cursor +cachedrowsetimpl.relative = relative : Posi\u00E7\u00E3o inv\u00E1lida do cursor +cachedrowsetimpl.asciistream = falha na leitura do fluxo ascii +cachedrowsetimpl.binstream = falha na leitura do fluxo bin\u00E1rio +cachedrowsetimpl.failedins = Falha ao inserir a linha +cachedrowsetimpl.updateins = updateRow chamado durante a inser\u00E7\u00E3o de linha cachedrowsetimpl.movetoins = moveToInsertRow : CONCUR_READ_ONLY cachedrowsetimpl.movetoins1 = moveToInsertRow : sem metadados -cachedrowsetimpl.movetoins2 = moveToInsertRow : n\u00famero de colunas inv\u00e1lido -cachedrowsetimpl.tablename = O nome da tabela n\u00e3o pode ser nulo -cachedrowsetimpl.keycols = Colunas de chaves inv\u00e1lidas -cachedrowsetimpl.invalidcol = \u00cdndice de coluna inv\u00e1lido -cachedrowsetimpl.opnotsupp = Opera\u00e7\u00e3o n\u00e3o suportada pelo banco de dados -cachedrowsetimpl.matchcols = As colunas correspondentes n\u00e3o s\u00e3o iguais \u00e0s colunas definidas -cachedrowsetimpl.setmatchcols = Definir colunas correspondentes antes de obt\u00ea-las +cachedrowsetimpl.movetoins2 = moveToInsertRow : n\u00FAmero de colunas inv\u00E1lido +cachedrowsetimpl.tablename = O nome da tabela n\u00E3o pode ser nulo +cachedrowsetimpl.keycols = Colunas de chaves inv\u00E1lidas +cachedrowsetimpl.invalidcol = \u00CDndice de coluna inv\u00E1lido +cachedrowsetimpl.opnotsupp = Opera\u00E7\u00E3o n\u00E3o suportada pelo Banco de Dados +cachedrowsetimpl.matchcols = As colunas correspondentes n\u00E3o s\u00E3o iguais \u00E0s colunas definidas +cachedrowsetimpl.setmatchcols = Definir Colunas correspondentes antes de obt\u00EA-las cachedrowsetimpl.matchcols1 = As colunas correspondentes devem ser maior do que 0 -cachedrowsetimpl.matchcols2 = As colunas correspondentes devem ser sequ\u00eancias vazias ou nulas -cachedrowsetimpl.unsetmatch = As colunas n\u00e3o definidas n\u00e3o s\u00e3o iguais \u00e0s colunas definidas +cachedrowsetimpl.matchcols2 = As colunas correspondentes devem ser strings vazias ou nulas +cachedrowsetimpl.unsetmatch = As colunas n\u00E3o definidas n\u00E3o s\u00E3o iguais \u00E0s colunas definidas cachedrowsetimpl.unsetmatch1 = Usar o nome da coluna como argumento para unsetMatchColumn cachedrowsetimpl.unsetmatch2 = Usar o ID da coluna como argumento para unsetMatchColumn -cachedrowsetimpl.numrows = O n\u00famero de linhas \u00e9 menor do que zero ou menor do que o tamanho obtido -cachedrowsetimpl.startpos = A posi\u00e7\u00e3o de in\u00edcio n\u00e3o pode ser negativa +cachedrowsetimpl.numrows = O n\u00FAmero de linhas \u00E9 menor do que zero ou menor do que o tamanho obtido +cachedrowsetimpl.startpos = A posi\u00E7\u00E3o de in\u00EDcio n\u00E3o pode ser negativa cachedrowsetimpl.nextpage = Preencher dados antes de chamar -cachedrowsetimpl.pagesize = O tamanho da p\u00e1gina n\u00e3o pode ser menor do que zero -cachedrowsetimpl.pagesize1 = O tamanho da p\u00e1gina n\u00e3o pode ser maior do que maxRows -cachedrowsetimpl.fwdonly = ResultSet \u00e9 somente para frente -cachedrowsetimpl.type = O tipo \u00e9 : {0} -cachedrowsetimpl.opnotysupp = Opera\u00e7\u00e3o ainda n\u00e3o suportada -cachedrowsetimpl.featnotsupp = Recurso n\u00e3o suportado +cachedrowsetimpl.pagesize = O tamanho da p\u00E1gina n\u00E3o pode ser menor do que zero +cachedrowsetimpl.pagesize1 = O tamanho da p\u00E1gina n\u00E3o pode ser maior do que maxRows +cachedrowsetimpl.fwdonly = ResultSet \u00E9 somente para frente +cachedrowsetimpl.type = O tipo \u00E9 : {0} +cachedrowsetimpl.opnotysupp = Opera\u00E7\u00E3o ainda n\u00E3o suportada +cachedrowsetimpl.featnotsupp = Recurso n\u00E3o suportado # WebRowSetImpl exceptions -webrowsetimpl.nullhash = N\u00e3o \u00e9 poss\u00edvel instanciar a inst\u00e2ncia WebRowSetImpl. Hashtable nulo fornecido ao construtor -webrowsetimpl.invalidwr = Gravador inv\u00e1lido -webrowsetimpl.invalidrd = Leitor inv\u00e1lido +webrowsetimpl.nullhash = N\u00E3o \u00E9 poss\u00EDvel instanciar a inst\u00E2ncia WebRowSetImpl. Hashtable nulo fornecido ao construtor +webrowsetimpl.invalidwr = Gravador inv\u00E1lido +webrowsetimpl.invalidrd = Leitor inv\u00E1lido #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative : opera\u00e7\u00e3o inv\u00e1lida do cursor -filteredrowsetimpl.absolute = absolute : opera\u00e7\u00e3o inv\u00e1lida do cursor -filteredrowsetimpl.notallowed = Este valor n\u00e3o \u00e9 permitido no filtro +filteredrowsetimpl.relative = relative : Opera\u00E7\u00E3o inv\u00E1lida do cursor +filteredrowsetimpl.absolute = absolute : Opera\u00E7\u00E3o inv\u00E1lida do cursor +filteredrowsetimpl.notallowed = Este valor n\u00E3o \u00E9 permitido no filtro #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = N\u00e3o \u00e9 uma inst\u00e2ncia do conjunto de linhas -joinrowsetimpl.matchnotset = Coluna correspondente n\u00e3o definida para jun\u00e7\u00e3o -joinrowsetimpl.numnotequal = N\u00famero de elementos no conjunto de linhas diferente da coluna correspondente -joinrowsetimpl.notdefined = N\u00e3o \u00e9 um tipo definido de jun\u00e7\u00e3o -joinrowsetimpl.notsupported = Este tipo de jun\u00e7\u00e3o n\u00e3o \u00e9 suportada -joinrowsetimpl.initerror = Erro de inicializa\u00e7\u00e3o do JoinRowSet -joinrowsetimpl.genericerr = Erro inicial de joinrowset gen\u00e9rico -joinrowsetimpl.emptyrowset = O conjunto de linha vazio n\u00e3o pode ser adicionado a este JoinRowSet +joinrowsetimpl.notinstance = N\u00E3o \u00E9 uma inst\u00E2ncia do conjunto de linhas +joinrowsetimpl.matchnotset = Coluna Correspondente n\u00E3o definida para jun\u00E7\u00E3o +joinrowsetimpl.numnotequal = N\u00FAmero de elementos no conjunto de linhas diferente da coluna correspondente +joinrowsetimpl.notdefined = N\u00E3o \u00E9 um tipo definido de jun\u00E7\u00E3o +joinrowsetimpl.notsupported = Este tipo de jun\u00E7\u00E3o n\u00E3o \u00E9 suportada +joinrowsetimpl.initerror = Erro de inicializa\u00E7\u00E3o do JoinRowSet +joinrowsetimpl.genericerr = Erro inicial de joinrowset gen\u00E9rico +joinrowsetimpl.emptyrowset = O conjunto de linha vazio n\u00E3o pode ser adicionado a este JoinRowSet #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = Estado inv\u00e1lido -jdbcrowsetimpl.connect = N\u00e3o \u00e9 poss\u00edvel conectar JdbcRowSet (connect) a JNDI -jdbcrowsetimpl.paramtype = N\u00e3o \u00e9 poss\u00edvel deduzir o tipo de par\u00e2metro -jdbcrowsetimpl.matchcols = As colunas correspondentes n\u00e3o s\u00e3o iguais \u00e0s colunas definidas -jdbcrowsetimpl.setmatchcols = Definir as colunas correspondentes antes de obt\u00ea-las +jdbcrowsetimpl.invalstate = Estado inv\u00E1lido +jdbcrowsetimpl.connect = N\u00E3o \u00E9 poss\u00EDvel conectar JdbcRowSet (connect) a JNDI +jdbcrowsetimpl.paramtype = N\u00E3o \u00E9 poss\u00EDvel deduzir o tipo de par\u00E2metro +jdbcrowsetimpl.matchcols = As Colunas Correspondentes n\u00E3o s\u00E3o iguais \u00E0s colunas definidas +jdbcrowsetimpl.setmatchcols = Definir as colunas correspondentes antes de obt\u00EA-las jdbcrowsetimpl.matchcols1 = As colunas correspondentes devem ser maior do que 0 -jdbcrowsetimpl.matchcols2 = As colunas correspondentes n\u00e3o podem ser sequ\u00eancias vazias ou nulas -jdbcrowsetimpl.unsetmatch = As colunas n\u00e3o definidas n\u00e3o s\u00e3o iguais \u00e0s colunas definidas +jdbcrowsetimpl.matchcols2 = As colunas correspondentes n\u00E3o podem ser strings vazias ou nulas +jdbcrowsetimpl.unsetmatch = As colunas n\u00E3o definidas n\u00E3o s\u00E3o iguais \u00E0s colunas definidas jdbcrowsetimpl.usecolname = Usar o nome da coluna como argumento para unsetMatchColumn jdbcrowsetimpl.usecolid = Usar o ID da coluna como argumento para unsetMatchColumn -jdbcrowsetimpl.resnotupd = ResultSet n\u00e3o \u00e9 atualiz\u00e1vel -jdbcrowsetimpl.opnotysupp = Opera\u00e7\u00e3o ainda n\u00e3o suportada -jdbcrowsetimpl.featnotsupp = Recurso n\u00e3o suportado +jdbcrowsetimpl.resnotupd = ResultSet n\u00E3o \u00E9 atualiz\u00E1vel +jdbcrowsetimpl.opnotysupp = Opera\u00E7\u00E3o ainda n\u00E3o suportada +jdbcrowsetimpl.featnotsupp = Recurso n\u00E3o suportado #CachedRowSetReader exceptions -crsreader.connect = (JNDI) N\u00e3o \u00e9 poss\u00edvel conectar -crsreader.paramtype = N\u00e3o \u00e9 poss\u00edvel deduzir o tipo de par\u00e2metro -crsreader.connecterr = Erro interno no RowSetReader: sem conex\u00e3o ou comando -crsreader.datedetected = Data detectada -crsreader.caldetected = Calend\u00e1rio detectado +crsreader.connect = (JNDI) N\u00E3o \u00E9 poss\u00EDvel conectar +crsreader.paramtype = N\u00E3o \u00E9 poss\u00EDvel deduzir o tipo de par\u00E2metro +crsreader.connecterr = Erro Interno no RowSetReader: sem conex\u00E3o ou comando +crsreader.datedetected = Data Detectada +crsreader.caldetected = Calend\u00E1rio Detectado #CachedRowSetWriter exceptions -crswriter.connect = N\u00e3o \u00e9 poss\u00edvel obter a conex\u00e3o -crswriter.tname = writeData n\u00e3o pode determinar o nome da tabela +crswriter.connect = N\u00E3o \u00E9 poss\u00EDvel obter a conex\u00E3o +crswriter.tname = writeData n\u00E3o pode determinar o nome da tabela crswriter.params1 = Valor de params1 : {0} crswriter.params2 = Valor de params2 : {0} -crswriter.conflictsno = conflitos durante a sincroniza\u00e7\u00e3o +crswriter.conflictsno = conflitos durante a sincroniza\u00E7\u00E3o #InsertRow exceptions insertrow.novalue = Nenhum valor foi inserido #SyncResolverImpl exceptions -syncrsimpl.indexval = Valor de \u00edndice fora do intervalo -syncrsimpl.noconflict = Est\u00e1 coluna n\u00e3o est\u00e1 em conflito -syncrsimpl.syncnotpos = A sincroniza\u00e7\u00e3o n\u00e3o \u00e9 poss\u00edvel -syncrsimpl.valtores = O valor a ser decidido pode estar no banco de dados ou no conjunto de linhas armazenado em cache +syncrsimpl.indexval = Valor de \u00EDndice fora da faixa +syncrsimpl.noconflict = Est\u00E1 coluna n\u00E3o est\u00E1 em conflito +syncrsimpl.syncnotpos = A sincroniza\u00E7\u00E3o n\u00E3o \u00E9 poss\u00EDvel +syncrsimpl.valtores = O valor a ser decidido pode estar no banco de dados ou no conjunto de linhas armazenado no cache #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = Fim de RowSet atingido. Posi\u00e7\u00e3o inv\u00e1lida do cursor +wrsxmlreader.invalidcp = Fim de RowSet atingido. Posi\u00E7\u00E3o inv\u00E1lida do cursor wrsxmlreader.readxml = readXML : {0} -wrsxmlreader.parseerr = ** Analisando erro : {0} , linha : {1} , uri : {2} +wrsxmlreader.parseerr = ** Erro de Parse : {0} , linha : {1} , uri : {2} #WebRowSetXmlWriter exceptions wrsxmlwriter.ioex = IOException : {0} wrsxmlwriter.sqlex = SQLException : {0} -wrsxmlwriter.failedwrite = Falha ao gravar valor -wsrxmlwriter.notproper = N\u00e3o \u00e9 um tipo adequado +wrsxmlwriter.failedwrite = Falha ao gravar o valor +wsrxmlwriter.notproper = N\u00E3o \u00E9 um tipo adequado #XmlReaderContentHandler exceptions -xmlrch.errmap = Erro ao definir mapa : {0} +xmlrch.errmap = Erro ao definir o Mapa : {0} xmlrch.errmetadata = Erro ao definir metadados : {0} xmlrch.errinsertval = Erro ao inserir valores : {0} -xmlrch.errconstr = Erro ao construir linha : {0} -xmlrch.errdel = Erro ao excluir linha : {0} -xmlrch.errinsert = Erro ao construir linha de inser\u00e7\u00e3o : {0} -xmlrch.errinsdel = Erro ao construir linha insdel : {0} -xmlrch.errupdate = Erro ao construir linha de atualiza\u00e7\u00e3o : {0} -xmlrch.errupdrow = Erro ao atualizar linha : {0} +xmlrch.errconstr = Erro ao construir a linha : {0} +xmlrch.errdel = Erro ao deletar a linha : {0} +xmlrch.errinsert = Erro ao construir a linha de inser\u00E7\u00E3o : {0} +xmlrch.errinsdel = Erro ao construir a linha insdel : {0} +xmlrch.errupdate = Erro ao construir a linha de atualiza\u00E7\u00E3o : {0} +xmlrch.errupdrow = Erro ao atualizar a linha : {0} xmlrch.chars = caracteres : -xmlrch.badvalue = Valor incorreto ; propriedade n\u00e3o anul\u00e1vel -xmlrch.badvalue1 = Valor incorreto ; metadado n\u00e3o anul\u00e1vel -xmlrch.warning = ** Aviso : {0} , linha : {1} , uri : {2} +xmlrch.badvalue = Valor incorreto ; propriedade n\u00E3o anul\u00E1vel +xmlrch.badvalue1 = Valor incorreto ; metadado n\u00E3o anul\u00E1vel +xmlrch.warning = ** Advert\u00EAncia : {0} , linha : {1} , uri : {2} #RIOptimisticProvider Exceptions -riop.locking = O bloqueio de classifica\u00e7\u00e3o n\u00e3o \u00e9 suportado +riop.locking = O bloqueio de classifica\u00E7\u00E3o n\u00E3o \u00E9 suportado #RIXMLProvider exceptions -rixml.unsupp = N\u00e3o suportado com RIXMLProvider +rixml.unsupp = N\u00E3o suportado com RIXMLProvider diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties index 429c438f440..089dc281caf 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_sv.properties @@ -25,144 +25,146 @@ # CacheRowSetImpl exceptions cachedrowsetimpl.populate = Ifyllningsmetoden fick ett ogiltigt ResultSet-objekt -cachedrowsetimpl.invalidp = En ogiltig best\u00e4ndig leverant\u00f6r genererades -cachedrowsetimpl.nullhash = Det g\u00e5r inte att skapa instansen CachedRowSetImpl. Tom hashtabell skickades till konstrukt\u00f6r -cachedrowsetimpl.invalidop = En ogiltig \u00e5tg\u00e4rd utf\u00f6rdes i infogningsraden -cachedrowsetimpl.accfailed = acceptChanges misslyckades -cachedrowsetimpl.invalidcp = Mark\u00f6rpositionen \u00e4r ogiltig -cachedrowsetimpl.illegalop = En ogiltig \u00e5tg\u00e4rd utf\u00f6rdes p\u00e5 en icke infogad rad -cachedrowsetimpl.clonefail = Kloningen misslyckades: {0} -cachedrowsetimpl.invalidcol = Kolumnindexet \u00e4r ogiltigt -cachedrowsetimpl.invalcolnm = Kolumnnamnet \u00e4r ogiltigt -cachedrowsetimpl.boolfail = getBoolen misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} -cachedrowsetimpl.bytefail = getByte misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} -cachedrowsetimpl.shortfail = getShort misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} -cachedrowsetimpl.intfail = getInt misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} -cachedrowsetimpl.longfail = getLong misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} -cachedrowsetimpl.floatfail = getFloat misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} -cachedrowsetimpl.doublefail = getDouble misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.invalidp = En ogiltig best\u00E4ndig leverant\u00F6r genererades +cachedrowsetimpl.nullhash = Kan inte instansiera CachedRowSetImpl. Null-hashtabell skickades till konstruktor +cachedrowsetimpl.invalidop = En ogiltig \u00E5tg\u00E4rd utf\u00F6rdes p\u00E5 infogad rad +cachedrowsetimpl.accfailed = acceptChanges utf\u00F6rdes inte +cachedrowsetimpl.invalidcp = Mark\u00F6rpositionen \u00E4r ogiltig +cachedrowsetimpl.illegalop = En otill\u00E5ten \u00E5tg\u00E4rd utf\u00F6rdes p\u00E5 en icke infogad rad +cachedrowsetimpl.clonefail = Kloningen utf\u00F6rdes inte: {0} +cachedrowsetimpl.invalidcol = Kolumnindexet \u00E4r ogiltigt +cachedrowsetimpl.invalcolnm = Kolumnnamnet \u00E4r ogiltigt +cachedrowsetimpl.boolfail = getBoolen utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.bytefail = getByte utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.shortfail = getShort utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.intfail = getInt utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.longfail = getLong utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.floatfail = getFloat utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} +cachedrowsetimpl.doublefail = getDouble utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1} cachedrowsetimpl.dtypemismt = Inkompatibel datatyp -cachedrowsetimpl.datefail = getDate misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1}, ingen konvertering tillg\u00e4nglig -cachedrowsetimpl.timefail = getTime misslyckades f\u00f6r v\u00e4rdet ({0}) i kolumnen {1}, ingen konvertering tillg\u00e4nglig -cachedrowsetimpl.posupdate = Det finns inte st\u00f6d f\u00f6r positionerad uppdatering -cachedrowsetimpl.unableins = Det g\u00e5r inte att skapa {0} -cachedrowsetimpl.beforefirst = beforeFirst: Ogiltig mark\u00f6r\u00e5tg\u00e4rd -cachedrowsetimpl.first = First: Ogiltig mark\u00f6r\u00e5tg\u00e4rd +cachedrowsetimpl.datefail = getDate utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1}, ingen konvertering tillg\u00E4nglig +cachedrowsetimpl.timefail = getTime utf\u00F6rdes inte f\u00F6r v\u00E4rdet ({0}) i kolumnen {1}, ingen konvertering tillg\u00E4nglig +cachedrowsetimpl.posupdate = Det finns inte st\u00F6d f\u00F6r positionerad uppdatering +cachedrowsetimpl.unableins = Kan inte instansiera {0} +cachedrowsetimpl.beforefirst = beforeFirst: Ogiltig mark\u00F6r\u00E5tg\u00E4rd +cachedrowsetimpl.first = First: Ogiltig mark\u00F6r\u00E5tg\u00E4rd cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute: Mark\u00f6rpositionen \u00e4r ogiltig -cachedrowsetimpl.relative = relative: Mark\u00f6rpositionen \u00e4r ogiltig -cachedrowsetimpl.asciistream = det gick inte att l\u00e4sa ASCII-str\u00f6mmen -cachedrowsetimpl.binstream = det gick inte l\u00e4sa den bin\u00e4ra str\u00f6mmen -cachedrowsetimpl.failedins = Fel vid infogningsrad -cachedrowsetimpl.updateins = updateRow anropade vid infogningsrad +cachedrowsetimpl.absolute = absolute: Mark\u00F6rpositionen \u00E4r ogiltig +cachedrowsetimpl.relative = relative: Mark\u00F6rpositionen \u00E4r ogiltig +cachedrowsetimpl.asciistream = kunde inte l\u00E4sa ASCII-str\u00F6mmen +cachedrowsetimpl.binstream = kunde inte l\u00E4sa den bin\u00E4ra str\u00F6mmen +cachedrowsetimpl.failedins = Kunde inte infoga rad +cachedrowsetimpl.updateins = updateRow anropades fr\u00E5n infogad rad cachedrowsetimpl.movetoins = moveToInsertRow : CONCUR_READ_ONLY cachedrowsetimpl.movetoins1 = moveToInsertRow: inga metadata cachedrowsetimpl.movetoins2 = moveToInsertRow: ogiltigt antal kolumner -cachedrowsetimpl.tablename = Tabellnamnet kan inte vara tomt +cachedrowsetimpl.tablename = Tabellnamnet kan inte vara null cachedrowsetimpl.keycols = Ogiltiga nyckelkolumner -cachedrowsetimpl.opnotsupp = Databasen har inte st\u00f6d f\u00f6r denna \u00e5tg\u00e4rd -cachedrowsetimpl.matchcols = Matchningskolumnerna \u00e4r inte samma som de som st\u00e4llts in -cachedrowsetimpl.setmatchcols = St\u00e4ll in matchningskolumnerna innan du h\u00e4mtar dem -cachedrowsetimpl.matchcols1 = Matchningskolumnerna m\u00e5ste vara st\u00f6rre \u00e4n 0 -cachedrowsetimpl.matchcols2 = Matchningskolumnerna m\u00e5ste vara tomma eller en nollstr\u00e4ng -cachedrowsetimpl.unsetmatch = Kolumnerna som \u00e5terst\u00e4lls \u00e4r inte samma som de som st\u00e4llts in -cachedrowsetimpl.unsetmatch1 = Anv\u00e4nd kolumnnamn som argument f\u00f6r unsetMatchColumn -cachedrowsetimpl.unsetmatch2 = Anv\u00e4nd kolumnn-id som argument f\u00f6r unsetMatchColumn -cachedrowsetimpl.numrows = Antalet rader understiger noll eller \u00e4r mindre \u00e4n h\u00e4mtningsstorleken -cachedrowsetimpl.startpos = Startpositionen f\u00e5r inte vara negativ +cachedrowsetimpl.invalidcol = Kolumnindexet \u00E4r ogiltigt +cachedrowsetimpl.opnotsupp = Databasen har inte st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd +cachedrowsetimpl.matchcols = Matchningskolumnerna \u00E4r inte samma som de som st\u00E4llts in +cachedrowsetimpl.setmatchcols = St\u00E4ll in matchningskolumnerna innan du h\u00E4mtar dem +cachedrowsetimpl.matchcols1 = Matchningskolumnerna m\u00E5ste vara st\u00F6rre \u00E4n 0 +cachedrowsetimpl.matchcols2 = Matchningskolumnerna m\u00E5ste vara tomma eller en null-str\u00E4ng +cachedrowsetimpl.unsetmatch = Kolumnerna som \u00E5terst\u00E4lls \u00E4r inte samma som de som st\u00E4llts in +cachedrowsetimpl.unsetmatch1 = Anv\u00E4nd kolumnnamn som argument f\u00F6r unsetMatchColumn +cachedrowsetimpl.unsetmatch2 = Anv\u00E4nd kolumn-id som argument f\u00F6r unsetMatchColumn +cachedrowsetimpl.numrows = Antalet rader understiger noll eller \u00E4r mindre \u00E4n h\u00E4mtningsstorleken +cachedrowsetimpl.startpos = Startpositionen f\u00E5r inte vara negativ cachedrowsetimpl.nextpage = Fyll i data innan anrop -cachedrowsetimpl.pagesize = Sidstorleken f\u00e5r inte understiga noll -cachedrowsetimpl.pagesize1 = Sidstorleken f\u00e5r inte \u00f6verstiga maxRows -cachedrowsetimpl.fwdonly = ResultSet kan endast g\u00e5 fram\u00e5t +cachedrowsetimpl.pagesize = Sidstorleken f\u00E5r inte understiga noll +cachedrowsetimpl.pagesize1 = Sidstorleken f\u00E5r inte \u00F6verstiga maxRows +cachedrowsetimpl.fwdonly = ResultSet kan endast g\u00E5 fram\u00E5t cachedrowsetimpl.type = Typ: {0} -cachedrowsetimpl.opnotysupp = Det finns \u00e4nnu inget st\u00f6d f\u00f6r denna \u00e5tg\u00e4rd -cachedrowsetimpl.featnotsupp = Det finns inget st\u00f6d f\u00f6r denna funktion +cachedrowsetimpl.opnotysupp = Det finns \u00E4nnu inget st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd +cachedrowsetimpl.featnotsupp = Det finns inget st\u00F6d f\u00F6r denna funktion # WebRowSetImpl exceptions -webrowsetimpl.nullhash = Det g\u00e5r inte att skapa instansen WebRowSetImpl. Tom hashtabell skickades till konstrukt\u00f6r. -webrowsetimpl.invalidwr = Ogiltig f\u00f6rfattare -webrowsetimpl.invalidrd = Ogiltig l\u00e4sare +webrowsetimpl.nullhash = Kan inte instansiera WebRowSetImpl. Null-hashtabell skickades till konstruktor. +webrowsetimpl.invalidwr = Ogiltig f\u00F6rfattare +webrowsetimpl.invalidrd = Ogiltig l\u00E4sare #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative: Ogiltig mark\u00f6r\u00e5tg\u00e4rd -filteredrowsetimpl.absolute = absolute: Ogiltig mark\u00f6r\u00e5tg\u00e4rd -filteredrowsetimpl.notallowed = Detta v\u00e4rde kommer att filtreras bort +filteredrowsetimpl.relative = relative: Ogiltig mark\u00F6r\u00E5tg\u00E4rd +filteredrowsetimpl.absolute = absolute: Ogiltig mark\u00F6r\u00E5tg\u00E4rd +filteredrowsetimpl.notallowed = Detta v\u00E4rde kommer att filtreras bort #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = Detta \u00e4r inte en instans av rowset -joinrowsetimpl.matchnotset = Matchningskolumnen \u00e4r inte inst\u00e4lld p\u00e5 koppling -joinrowsetimpl.numnotequal = Antalet element i RowSet \u00e4r inte lika med matchningskolumnens -joinrowsetimpl.notdefined = Detta \u00e4r inte n\u00e5gon definierad kopplingstyp -joinrowsetimpl.notsupported = Det finns inget st\u00f6d f\u00f6r denna kopplingstyp -joinrowsetimpl.initerror = Initieringsfel f\u00f6r JoinRowSet -joinrowsetimpl.genericerr = Allm\u00e4nt initieringsfel f\u00f6r JoinRowSet -joinrowsetimpl.emptyrowset = Tomma radupps\u00e4ttningar kan inte l\u00e4ggas till i denna JoinRowSet +joinrowsetimpl.notinstance = Detta \u00E4r inte en instans av radupps\u00E4ttning +joinrowsetimpl.matchnotset = Matchningskolumnen \u00E4r inte inst\u00E4lld p\u00E5 koppling +joinrowsetimpl.numnotequal = Antal objekt i radupps\u00E4ttning st\u00E4mmer inte med matchningskolumnens +joinrowsetimpl.notdefined = Detta \u00E4r inte n\u00E5gon definierad kopplingstyp +joinrowsetimpl.notsupported = Det finns inget st\u00F6d f\u00F6r denna kopplingstyp +joinrowsetimpl.initerror = Initieringsfel f\u00F6r JoinRowSet +joinrowsetimpl.genericerr = Allm\u00E4nt initieringsfel f\u00F6r JoinRowSet +joinrowsetimpl.emptyrowset = Tomma radupps\u00E4ttningar kan inte l\u00E4ggas till i denna JoinRowSet #JdbcRowSetImpl exceptions jdbcrowsetimpl.invalstate = Ogiltig status jdbcrowsetimpl.connect = JdbcRowSet (anslut) JNDI kan inte anslutas -jdbcrowsetimpl.paramtype = Det g\u00e5r inte att fastst\u00e4lla parametertypen -jdbcrowsetimpl.matchcols = Matchningskolumnerna \u00e4r inte samma som de som st\u00e4llts in -jdbcrowsetimpl.setmatchcols = St\u00e4ll in matchningskolumnerna innan du h\u00e4mtar dem -jdbcrowsetimpl.matchcols1 = Matchningskolumnerna m\u00e5ste vara st\u00f6rre \u00e4n 0 -jdbcrowsetimpl.matchcols2 = Matchningskolumnerna kan inte vara en nollstr\u00e4ng eller tomma -jdbcrowsetimpl.unsetmatch = Kolumnerna som \u00e5terst\u00e4lls \u00e4r inte samma som de som st\u00e4llts in -jdbcrowsetimpl.usecolname = Anv\u00e4nd kolumnnamn som argument f\u00f6r unsetMatchColumn -jdbcrowsetimpl.usecolid = Anv\u00e4nd kolumnn-id som argument f\u00f6r unsetMatchColumn -jdbcrowsetimpl.resnotupd = ResultSet \u00e4r inte uppdateringsbart -jdbcrowsetimpl.opnotysupp = Det finns \u00e4nnu inget st\u00f6d f\u00f6r denna \u00e5tg\u00e4rd -jdbcrowsetimpl.featnotsupp = Det finns inget st\u00f6d f\u00f6r denna funktion +jdbcrowsetimpl.paramtype = Kan inte h\u00E4rleda parametertypen +jdbcrowsetimpl.matchcols = Matchningskolumnerna \u00E4r inte samma som de som st\u00E4llts in +jdbcrowsetimpl.setmatchcols = St\u00E4ll in matchningskolumnerna innan du h\u00E4mtar dem +jdbcrowsetimpl.matchcols1 = Matchningskolumnerna m\u00E5ste vara st\u00F6rre \u00E4n 0 +jdbcrowsetimpl.matchcols2 = Matchningskolumnerna kan inte vara en null-str\u00E4ng eller tomma +jdbcrowsetimpl.unsetmatch = Kolumnerna som \u00E5terst\u00E4lls \u00E4r inte samma som de som st\u00E4llts in +jdbcrowsetimpl.usecolname = Anv\u00E4nd kolumnnamn som argument f\u00F6r unsetMatchColumn +jdbcrowsetimpl.usecolid = Anv\u00E4nd kolumn-id som argument f\u00F6r unsetMatchColumn +jdbcrowsetimpl.resnotupd = ResultSet \u00E4r inte uppdateringsbart +jdbcrowsetimpl.opnotysupp = Det finns \u00E4nnu inget st\u00F6d f\u00F6r denna \u00E5tg\u00E4rd +jdbcrowsetimpl.featnotsupp = Det finns inget st\u00F6d f\u00F6r denna funktion #CachedRowSetReader exceptions crsreader.connect = (JNDI) kan inte anslutas -crsreader.paramtype = Det g\u00e5r inte att fastst\u00e4lla parametertypen +crsreader.paramtype = Kan inte h\u00E4rleda parametertypen crsreader.connecterr = Internt fel i RowSetReader: ingen anslutning eller inget kommando crsreader.datedetected = Ett datum har identifierats crsreader.caldetected = En kalender har identifierats #CachedRowSetWriter exceptions -crswriter.connect = Det g\u00e5r inte att uppr\u00e4tta n\u00e5gon anslutning -crswriter.tname = writeData kan inte fastst\u00e4lla tabellnamnet -crswriter.params1 = Parameterv\u00e4rde1: {0} -crswriter.params2 = Parameterv\u00e4rde2: {0} -crswriter.conflictsno = konflikter under synkronisering +crswriter.connect = Kan inte uppr\u00E4tta n\u00E5gon anslutning +crswriter.tname = writeData kan inte fastst\u00E4lla tabellnamnet +crswriter.params1 = Parameterv\u00E4rde1: {0} +crswriter.params2 = Parameterv\u00E4rde2: {0} +crswriter.conflictsno = orsakar konflikt vid synkronisering #InsertRow exceptions -insertrow.novalue = Inget v\u00e4rde har infogats +insertrow.novalue = Inget v\u00E4rde har infogats #SyncResolverImpl exceptions -syncrsimpl.indexval = Indexv\u00e4rdet ligger utanf\u00f6r intervallet -syncrsimpl.noconflict = Denna kolumn st\u00e5r inte i konflikt -syncrsimpl.syncnotpos = Synkronisering \u00e4r inte m\u00f6jlig -syncrsimpl.valtores = V\u00e4rdet som ska analyseras kan antingen finnas i databasen eller i cachedrowset +syncrsimpl.indexval = Indexv\u00E4rdet ligger utanf\u00F6r intervallet +syncrsimpl.noconflict = Kolumnen orsakar ingen konflikt +syncrsimpl.syncnotpos = Synkronisering \u00E4r inte m\u00F6jlig +syncrsimpl.valtores = V\u00E4rdet som ska fastst\u00E4llas kan antingen finnas i databasen eller i cachedrowset #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = Slutet p\u00e5 RowSet har n\u00e5tts. Mark\u00f6rpositionen \u00e4r ogiltig. +wrsxmlreader.invalidcp = Slutet p\u00E5 RowSet har n\u00E5tts. Mark\u00F6rpositionen \u00E4r ogiltig. wrsxmlreader.readxml = readXML: {0} wrsxmlreader.parseerr = ** Tolkningsfel: {0}, rad: {1}, URI: {2} #WebRowSetXmlWriter exceptions wrsxmlwriter.ioex = IOException: {0} wrsxmlwriter.sqlex = SQLException: {0} -wrsxmlwriter.failedwrite = Det gick inte att skriva v\u00e4rdet +wrsxmlwriter.failedwrite = Kunde inte skriva v\u00E4rdet wsrxmlwriter.notproper = Ingen riktig typ #XmlReaderContentHandler exceptions -xmlrch.errmap = Ett fel uppstod vid inst\u00e4llningen av f\u00f6ljande bild: {0} -xmlrch.errmetadata = Ett fel uppstod vid inst\u00e4llningen av f\u00f6ljande metadata: {0} -xmlrch.errinsertval = Ett fel uppstod n\u00e4r f\u00f6ljande v\u00e4rden skulle infogas: {0} -xmlrch.errconstr = Ett fel uppstod n\u00e4r f\u00f6ljande rad skulle skapas: {0} -xmlrch.errdel = Ett fel uppstod n\u00e4r f\u00f6ljande rad skulle raderas: {0} -xmlrch.errinsdel = Ett fel uppstod n\u00e4r raden insdel skulle skapas: {0} -xmlrch.errupdate = Ett fel uppstod n\u00e4r f\u00f6ljande uppdateringsrad skulle skapas: {0} -xmlrch.errupdrow = Ett fel uppstod n\u00e4r f\u00f6ljande rad skulle uppdateras: {0} +xmlrch.errmap = Fel uppstod vid inst\u00E4llning av mappning: {0} +xmlrch.errmetadata = Fel uppstod vid inst\u00E4llning av metadata: {0} +xmlrch.errinsertval = Fel uppstod vid infogning av v\u00E4rden: {0} +xmlrch.errconstr = Fel uppstod vid konstruktion av rad: {0} +xmlrch.errdel = Fel uppstod vid borttagning av rad: {0} +xmlrch.errinsert = Fel uppstod vid konstruktion av infogad rad: {0} +xmlrch.errinsdel = Fel uppstod vid konstruktion av insdel-rad: {0} +xmlrch.errupdate = Fel uppstod vid konstruktion av uppdateringsrad: {0} +xmlrch.errupdrow = Fel uppstod vid uppdatering av rad: {0} xmlrch.chars = tecken: -xmlrch.badvalue = Felaktigt v\u00e4rde; egenskapen kan inte ha ett tomt v\u00e4rde -xmlrch.badvalue1 = Felaktigt v\u00e4rde; metadatan kan inte ha ett tomt v\u00e4rde +xmlrch.badvalue = Felaktigt v\u00E4rde; egenskapen kan inte ha ett tomt v\u00E4rde +xmlrch.badvalue1 = Felaktigt v\u00E4rde; metadatan kan inte ha ett tomt v\u00E4rde xmlrch.warning = ** Varning! {0}, rad: {1}, URI: {2} #RIOptimisticProvider Exceptions -riop.locking = Det finns inte st\u00f6d f\u00f6r denna l\u00e5sningsklassifikation +riop.locking = Det finns inte st\u00F6d f\u00F6r denna l\u00E5sningsklassificering #RIXMLProvider exceptions -rixml.unsupp = RIXMLProvider har inte st\u00f6d f\u00f6r detta +rixml.unsupp = RIXMLProvider har inte st\u00F6d f\u00F6r detta diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties index b09b018312f..596d8ab7f44 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_CN.properties @@ -24,145 +24,147 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = \u63d0\u4f9b\u7ed9\u586b\u5145\u65b9\u6cd5\u7684 ResultSet \u5bf9\u8c61\u65e0\u6548 -cachedrowsetimpl.invalidp = \u751f\u6210\u7684\u6301\u4e45\u6027\u63d0\u4f9b\u8005\u65e0\u6548 -cachedrowsetimpl.nullhash = \u65e0\u6cd5\u5b9e\u4f8b\u5316 CachedRowSetImpl \u5b9e\u4f8b\u3002\u63d0\u4f9b\u7ed9\u6784\u9020\u51fd\u6570\u7684 Hashtable \u4e3a Null -cachedrowsetimpl.invalidop = \u5bf9\u63d2\u5165\u884c\u6267\u884c\u7684\u64cd\u4f5c\u65e0\u6548 -cachedrowsetimpl.accfailed = acceptChanges \u5931\u8d25 -cachedrowsetimpl.invalidcp = \u5149\u6807\u4f4d\u7f6e\u65e0\u6548 -cachedrowsetimpl.illegalop = \u5bf9\u975e\u63d2\u5165\u884c\u6267\u884c\u7684\u64cd\u4f5c\u975e\u6cd5 -cachedrowsetimpl.clonefail = \u514b\u9686\u5931\u8d25: {0} -cachedrowsetimpl.invalidcol = \u5217\u7d22\u5f15\u65e0\u6548 -cachedrowsetimpl.invalcolnm = \u5217\u540d\u65e0\u6548 -cachedrowsetimpl.boolfail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getBoolen \u5931\u8d25 -cachedrowsetimpl.bytefail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getByte \u5931\u8d25 -cachedrowsetimpl.shortfail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getShort \u5931\u8d25 -cachedrowsetimpl.intfail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getInt \u5931\u8d25 -cachedrowsetimpl.longfail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getLong \u5931\u8d25 -cachedrowsetimpl.floatfail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getFloat \u5931\u8d25 -cachedrowsetimpl.doublefail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getDouble \u5931\u8d25 -cachedrowsetimpl.dtypemismt = \u6570\u636e\u7c7b\u578b\u4e0d\u5339\u914d -cachedrowsetimpl.datefail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getDate \u5931\u8d25\uff0c\u65e0\u53ef\u7528\u8f6c\u6362 -cachedrowsetimpl.timefail = \u5bf9\u5217 {1} \u4e2d\u7684\u503c ({0}) \u6267\u884c getTime \u5931\u8d25\uff0c\u65e0\u53ef\u7528\u8f6c\u6362 -cachedrowsetimpl.posupdate = \u4e0d\u652f\u6301\u5b9a\u4f4d\u66f4\u65b0 -cachedrowsetimpl.unableins = \u65e0\u6cd5\u5b9e\u4f8b\u5316: {0} -cachedrowsetimpl.beforefirst = beforeFirst: \u5149\u6807\u64cd\u4f5c\u65e0\u6548 -cachedrowsetimpl.first = First: \u5149\u6807\u64cd\u4f5c\u65e0\u6548 +cachedrowsetimpl.populate = \u63D0\u4F9B\u7ED9\u586B\u5145\u65B9\u6CD5\u7684 ResultSet \u5BF9\u8C61\u65E0\u6548 +cachedrowsetimpl.invalidp = \u751F\u6210\u7684\u6301\u4E45\u6027\u63D0\u4F9B\u65B9\u65E0\u6548 +cachedrowsetimpl.nullhash = \u65E0\u6CD5\u5B9E\u4F8B\u5316 CachedRowSetImpl \u5B9E\u4F8B\u3002\u63D0\u4F9B\u7ED9\u6784\u9020\u5668\u7684 Hashtable \u4E3A\u7A7A\u503C +cachedrowsetimpl.invalidop = \u5BF9\u63D2\u5165\u884C\u6267\u884C\u7684\u64CD\u4F5C\u65E0\u6548 +cachedrowsetimpl.accfailed = acceptChanges \u5931\u8D25 +cachedrowsetimpl.invalidcp = \u5149\u6807\u4F4D\u7F6E\u65E0\u6548 +cachedrowsetimpl.illegalop = \u5BF9\u975E\u63D2\u5165\u884C\u6267\u884C\u7684\u64CD\u4F5C\u975E\u6CD5 +cachedrowsetimpl.clonefail = \u514B\u9686\u5931\u8D25: {0} +cachedrowsetimpl.invalidcol = \u5217\u7D22\u5F15\u65E0\u6548 +cachedrowsetimpl.invalcolnm = \u5217\u540D\u65E0\u6548 +cachedrowsetimpl.boolfail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getBoolen \u5931\u8D25 +cachedrowsetimpl.bytefail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getByte \u5931\u8D25 +cachedrowsetimpl.shortfail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getShort \u5931\u8D25 +cachedrowsetimpl.intfail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getInt \u5931\u8D25 +cachedrowsetimpl.longfail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getLong \u5931\u8D25 +cachedrowsetimpl.floatfail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getFloat \u5931\u8D25 +cachedrowsetimpl.doublefail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getDouble \u5931\u8D25 +cachedrowsetimpl.dtypemismt = \u6570\u636E\u7C7B\u578B\u4E0D\u5339\u914D +cachedrowsetimpl.datefail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getDate \u5931\u8D25, \u65E0\u53EF\u7528\u8F6C\u6362 +cachedrowsetimpl.timefail = \u5BF9\u5217 {1} \u4E2D\u7684\u503C ({0}) \u6267\u884C getTime \u5931\u8D25, \u65E0\u53EF\u7528\u8F6C\u6362 +cachedrowsetimpl.posupdate = \u4E0D\u652F\u6301\u5B9A\u4F4D\u66F4\u65B0 +cachedrowsetimpl.unableins = \u65E0\u6CD5\u5B9E\u4F8B\u5316: {0} +cachedrowsetimpl.beforefirst = beforeFirst: \u5149\u6807\u64CD\u4F5C\u65E0\u6548 +cachedrowsetimpl.first = First: \u5149\u6807\u64CD\u4F5C\u65E0\u6548 cachedrowsetimpl.last = last: TYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute: \u5149\u6807\u4f4d\u7f6e\u65e0\u6548 -cachedrowsetimpl.relative = relative: \u5149\u6807\u4f4d\u7f6e\u65e0\u6548 -cachedrowsetimpl.asciistream = \u8bfb\u53d6 ASCII \u6d41\u5931\u8d25 -cachedrowsetimpl.binstream = \u8bfb\u53d6\u4e8c\u8fdb\u5236\u6d41\u5931\u8d25 -cachedrowsetimpl.failedins = \u5bf9\u63d2\u5165\u884c\u6267\u884c\u64cd\u4f5c\u5931\u8d25 -cachedrowsetimpl.updateins = \u4e3a\u63d2\u5165\u884c\u8c03\u7528 updateRow +cachedrowsetimpl.absolute = absolute: \u5149\u6807\u4F4D\u7F6E\u65E0\u6548 +cachedrowsetimpl.relative = relative: \u5149\u6807\u4F4D\u7F6E\u65E0\u6548 +cachedrowsetimpl.asciistream = \u672A\u80FD\u8BFB\u53D6 ASCII \u6D41 +cachedrowsetimpl.binstream = \u672A\u80FD\u8BFB\u53D6\u4E8C\u8FDB\u5236\u6D41 +cachedrowsetimpl.failedins = \u5BF9\u63D2\u5165\u884C\u6267\u884C\u64CD\u4F5C\u5931\u8D25 +cachedrowsetimpl.updateins = \u4E3A\u63D2\u5165\u884C\u8C03\u7528 updateRow cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY -cachedrowsetimpl.movetoins1 = moveToInsertRow: \u65e0\u5143\u6570\u636e -cachedrowsetimpl.movetoins2 = moveToInsertRow: \u5217\u6570\u65e0\u6548 -cachedrowsetimpl.tablename = \u8868\u540d\u4e0d\u80fd\u4e3a Null -cachedrowsetimpl.keycols = \u952e\u5217\u65e0\u6548 -cachedrowsetimpl.opnotsupp = \u64cd\u4f5c\u4e0d\u53d7\u6570\u636e\u5e93\u652f\u6301 -cachedrowsetimpl.matchcols = \u5339\u914d\u5217\u4e0e\u8bbe\u7f6e\u7684\u90a3\u4e9b\u5339\u914d\u5217\u4e0d\u540c -cachedrowsetimpl.setmatchcols = \u5728\u83b7\u53d6\u5339\u914d\u5217\u4e4b\u524d\u5148\u8bbe\u7f6e\u5339\u914d\u5217 -cachedrowsetimpl.matchcols1 = \u5339\u914d\u5217\u6570\u5e94\u5f53\u5927\u4e8e 0 -cachedrowsetimpl.matchcols2 = \u5339\u914d\u5217\u6570\u5e94\u5f53\u4e3a\u7a7a\u6216 Null \u5b57\u7b26\u4e32 -cachedrowsetimpl.unsetmatch = \u8981\u590d\u539f\u7684\u5217\u4e0e\u8bbe\u7f6e\u7684\u4e0d\u540c -cachedrowsetimpl.unsetmatch1 = \u4f7f\u7528\u5217\u540d\u4f5c\u4e3a unsetMatchColumn \u7684\u53c2\u6570 -cachedrowsetimpl.unsetmatch2 = \u4f7f\u7528\u5217 ID \u4f5c\u4e3a unsetMatchColumn \u7684\u53c2\u6570 -cachedrowsetimpl.numrows = \u884c\u6570\u5c0f\u4e8e\u96f6\u6216\u5c0f\u4e8e\u8981\u63d0\u53d6\u7684\u884c\u6570 -cachedrowsetimpl.startpos = \u8d77\u59cb\u4f4d\u7f6e\u4e0d\u80fd\u4e3a\u8d1f\u6570 -cachedrowsetimpl.nextpage = \u5728\u8c03\u7528\u4e4b\u524d\u5148\u586b\u5145\u6570\u636e -cachedrowsetimpl.pagesize = \u9875\u9762\u5927\u5c0f\u4e0d\u80fd\u5c0f\u4e8e\u96f6 -cachedrowsetimpl.pagesize1 = \u9875\u9762\u5927\u5c0f\u4e0d\u80fd\u5927\u4e8e maxRows -cachedrowsetimpl.fwdonly = ResultSet \u7684\u7c7b\u578b\u4e3a\u4ec5\u5411\u524d\u7c7b\u578b -cachedrowsetimpl.type = \u7c7b\u578b\u4e3a: {0} -cachedrowsetimpl.opnotysupp = \u5c1a\u4e0d\u652f\u6301\u7684\u64cd\u4f5c -cachedrowsetimpl.featnotsupp = \u5c1a\u4e0d\u652f\u6301\u7684\u529f\u80fd +cachedrowsetimpl.movetoins1 = moveToInsertRow: \u65E0\u5143\u6570\u636E +cachedrowsetimpl.movetoins2 = moveToInsertRow: \u5217\u6570\u65E0\u6548 +cachedrowsetimpl.tablename = \u8868\u540D\u4E0D\u80FD\u4E3A\u7A7A\u503C +cachedrowsetimpl.keycols = \u5173\u952E\u5B57\u5217\u65E0\u6548 +cachedrowsetimpl.invalidcol = \u5217\u7D22\u5F15\u65E0\u6548 +cachedrowsetimpl.opnotsupp = \u64CD\u4F5C\u4E0D\u53D7\u6570\u636E\u5E93\u652F\u6301 +cachedrowsetimpl.matchcols = \u5339\u914D\u5217\u4E0E\u8BBE\u7F6E\u7684\u90A3\u4E9B\u5339\u914D\u5217\u4E0D\u540C +cachedrowsetimpl.setmatchcols = \u5728\u83B7\u53D6\u5339\u914D\u5217\u4E4B\u524D\u5148\u8BBE\u7F6E\u5339\u914D\u5217 +cachedrowsetimpl.matchcols1 = \u5339\u914D\u5217\u6570\u5E94\u5F53\u5927\u4E8E 0 +cachedrowsetimpl.matchcols2 = \u5339\u914D\u5217\u6570\u5E94\u5F53\u4E3A\u7A7A\u6216\u7A7A\u503C\u5B57\u7B26\u4E32 +cachedrowsetimpl.unsetmatch = \u8981\u53D6\u6D88\u8BBE\u7F6E\u7684\u5217\u4E0E\u8BBE\u7F6E\u7684\u5217\u4E0D\u540C +cachedrowsetimpl.unsetmatch1 = \u4F7F\u7528\u5217\u540D\u4F5C\u4E3A unsetMatchColumn \u7684\u53C2\u6570 +cachedrowsetimpl.unsetmatch2 = \u4F7F\u7528\u5217 ID \u4F5C\u4E3A unsetMatchColumn \u7684\u53C2\u6570 +cachedrowsetimpl.numrows = \u884C\u6570\u5C0F\u4E8E\u96F6\u6216\u5C0F\u4E8E\u8981\u63D0\u53D6\u7684\u884C\u6570 +cachedrowsetimpl.startpos = \u8D77\u59CB\u4F4D\u7F6E\u4E0D\u80FD\u4E3A\u8D1F\u6570 +cachedrowsetimpl.nextpage = \u5728\u8C03\u7528\u4E4B\u524D\u5148\u586B\u5145\u6570\u636E +cachedrowsetimpl.pagesize = \u9875\u9762\u5927\u5C0F\u4E0D\u80FD\u5C0F\u4E8E\u96F6 +cachedrowsetimpl.pagesize1 = \u9875\u9762\u5927\u5C0F\u4E0D\u80FD\u5927\u4E8E maxRows +cachedrowsetimpl.fwdonly = ResultSet \u7684\u7C7B\u578B\u4E3A\u4EC5\u5411\u524D\u7C7B\u578B +cachedrowsetimpl.type = \u7C7B\u578B\u4E3A: {0} +cachedrowsetimpl.opnotysupp = \u5C1A\u4E0D\u652F\u6301\u8BE5\u64CD\u4F5C +cachedrowsetimpl.featnotsupp = \u5C1A\u4E0D\u652F\u6301\u8BE5\u529F\u80FD # WebRowSetImpl exceptions -webrowsetimpl.nullhash = \u65e0\u6cd5\u5b9e\u4f8b\u5316 WebRowSetImpl \u5b9e\u4f8b\u3002\u63d0\u4f9b\u7ed9\u6784\u9020\u51fd\u6570\u7684 Hashtable \u4e3a Null -webrowsetimpl.invalidwr = \u7f16\u5199\u5668\u65e0\u6548 -webrowsetimpl.invalidrd = \u8bfb\u53d6\u5668\u65e0\u6548 +webrowsetimpl.nullhash = \u65E0\u6CD5\u5B9E\u4F8B\u5316 WebRowSetImpl \u5B9E\u4F8B\u3002\u63D0\u4F9B\u7ED9\u6784\u9020\u5668\u7684 Hashtable \u4E3A\u7A7A\u503C +webrowsetimpl.invalidwr = \u5199\u8FDB\u7A0B\u65E0\u6548 +webrowsetimpl.invalidrd = \u8BFB\u8FDB\u7A0B\u65E0\u6548 #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative: \u5149\u6807\u64cd\u4f5c\u65e0\u6548 -filteredrowsetimpl.absolute = absolute: \u5149\u6807\u64cd\u4f5c\u65e0\u6548 -filteredrowsetimpl.notallowed = \u4e0d\u5141\u8bb8\u6b64\u503c\u901a\u8fc7\u8fc7\u6ee4\u5668 +filteredrowsetimpl.relative = relative: \u5149\u6807\u64CD\u4F5C\u65E0\u6548 +filteredrowsetimpl.absolute = absolute: \u5149\u6807\u64CD\u4F5C\u65E0\u6548 +filteredrowsetimpl.notallowed = \u4E0D\u5141\u8BB8\u6B64\u503C\u901A\u8FC7\u7B5B\u9009\u5668 #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = \u4e0d\u662f RowSet \u7684\u5b9e\u4f8b -joinrowsetimpl.matchnotset = \u672a\u8bbe\u7f6e\u5339\u914d\u5217\u4ee5\u8fdb\u884c\u8fde\u63a5 -joinrowsetimpl.numnotequal = RowSet \u4e2d\u7684\u5143\u7d20\u4e2a\u6570\u4e0d\u7b49\u4e8e\u5339\u914d\u5217\u6570 -joinrowsetimpl.notdefined = \u8fd9\u4e0d\u662f\u5b9a\u4e49\u7684\u8fde\u63a5\u7c7b\u578b -joinrowsetimpl.notsupported = \u4e0d\u652f\u6301\u6b64\u8fde\u63a5\u7c7b\u578b -joinrowsetimpl.initerror = JoinRowSet \u521d\u59cb\u5316\u9519\u8bef -joinrowsetimpl.genericerr = \u4e00\u822c JoinRowSet \u521d\u59cb\u5316\u9519\u8bef -joinrowsetimpl.emptyrowset = \u65e0\u6cd5\u5c06\u7a7a RowSet \u6dfb\u52a0\u5230\u6b64 JoinRowSet +joinrowsetimpl.notinstance = \u4E0D\u662F RowSet \u7684\u5B9E\u4F8B +joinrowsetimpl.matchnotset = \u672A\u8BBE\u7F6E\u5339\u914D\u5217\u4EE5\u8FDB\u884C\u8054\u63A5 +joinrowsetimpl.numnotequal = RowSet \u4E2D\u7684\u5143\u7D20\u4E2A\u6570\u4E0D\u7B49\u4E8E\u5339\u914D\u5217\u6570 +joinrowsetimpl.notdefined = \u8FD9\u4E0D\u662F\u5B9A\u4E49\u7684\u8054\u63A5\u7C7B\u578B +joinrowsetimpl.notsupported = \u4E0D\u652F\u6301\u6B64\u8054\u63A5\u7C7B\u578B +joinrowsetimpl.initerror = JoinRowSet \u521D\u59CB\u5316\u9519\u8BEF +joinrowsetimpl.genericerr = \u4E00\u822C JoinRowSet \u521D\u59CB\u5316\u9519\u8BEF +joinrowsetimpl.emptyrowset = \u65E0\u6CD5\u5C06\u7A7A RowSet \u6DFB\u52A0\u5230\u6B64 JoinRowSet #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = \u72b6\u6001\u65e0\u6548 -jdbcrowsetimpl.connect = JdbcRowSet\uff08\u8fde\u63a5\uff09JNDI \u65e0\u6cd5\u8fde\u63a5 -jdbcrowsetimpl.paramtype = \u65e0\u6cd5\u63a8\u65ad\u53c2\u6570\u7c7b\u578b -jdbcrowsetimpl.matchcols = \u5339\u914d\u5217\u4e0e\u8bbe\u7f6e\u7684\u90a3\u4e9b\u5339\u914d\u5217\u4e0d\u540c -jdbcrowsetimpl.setmatchcols = \u5728\u83b7\u53d6\u5339\u914d\u5217\u4e4b\u524d\u5148\u8bbe\u7f6e\u5339\u914d\u5217 -jdbcrowsetimpl.matchcols1 = \u5339\u914d\u5217\u6570\u5e94\u5f53\u5927\u4e8e 0 -jdbcrowsetimpl.matchcols2 = \u5339\u914d\u5217\u4e0d\u80fd\u4e3a Null \u6216\u7a7a\u5b57\u7b26\u4e32 -jdbcrowsetimpl.unsetmatch = \u8981\u590d\u539f\u7684\u5217\u4e0e\u8bbe\u7f6e\u7684\u4e0d\u540c -jdbcrowsetimpl.usecolname = \u4f7f\u7528\u5217\u540d\u4f5c\u4e3a unsetMatchColumn \u7684\u53c2\u6570 -jdbcrowsetimpl.usecolid = \u4f7f\u7528\u5217 ID \u4f5c\u4e3a unsetMatchColumn \u7684\u53c2\u6570 -jdbcrowsetimpl.resnotupd = ResultSet \u4e0d\u53ef\u66f4\u65b0 -jdbcrowsetimpl.opnotysupp = \u5c1a\u4e0d\u652f\u6301\u7684\u64cd\u4f5c -jdbcrowsetimpl.featnotsupp = \u5c1a\u4e0d\u652f\u6301\u7684\u529f\u80fd +jdbcrowsetimpl.invalstate = \u72B6\u6001\u65E0\u6548 +jdbcrowsetimpl.connect = JdbcRowSet (\u8FDE\u63A5) JNDI \u65E0\u6CD5\u8FDE\u63A5 +jdbcrowsetimpl.paramtype = \u65E0\u6CD5\u63A8\u65AD\u53C2\u6570\u7C7B\u578B +jdbcrowsetimpl.matchcols = \u5339\u914D\u5217\u4E0E\u8BBE\u7F6E\u7684\u90A3\u4E9B\u5339\u914D\u5217\u4E0D\u540C +jdbcrowsetimpl.setmatchcols = \u5728\u83B7\u53D6\u5339\u914D\u5217\u4E4B\u524D\u5148\u8BBE\u7F6E\u5339\u914D\u5217 +jdbcrowsetimpl.matchcols1 = \u5339\u914D\u5217\u6570\u5E94\u5F53\u5927\u4E8E 0 +jdbcrowsetimpl.matchcols2 = \u5339\u914D\u5217\u4E0D\u80FD\u4E3A\u7A7A\u503C\u6216\u7A7A\u5B57\u7B26\u4E32 +jdbcrowsetimpl.unsetmatch = \u8981\u53D6\u6D88\u8BBE\u7F6E\u7684\u5217\u4E0E\u8BBE\u7F6E\u7684\u5217\u4E0D\u540C +jdbcrowsetimpl.usecolname = \u4F7F\u7528\u5217\u540D\u4F5C\u4E3A unsetMatchColumn \u7684\u53C2\u6570 +jdbcrowsetimpl.usecolid = \u4F7F\u7528\u5217 ID \u4F5C\u4E3A unsetMatchColumn \u7684\u53C2\u6570 +jdbcrowsetimpl.resnotupd = ResultSet \u4E0D\u53EF\u66F4\u65B0 +jdbcrowsetimpl.opnotysupp = \u5C1A\u4E0D\u652F\u6301\u8BE5\u64CD\u4F5C +jdbcrowsetimpl.featnotsupp = \u5C1A\u4E0D\u652F\u6301\u8BE5\u529F\u80FD #CachedRowSetReader exceptions -crsreader.connect = (JNDI) \u65e0\u6cd5\u8fde\u63a5 -crsreader.paramtype = \u65e0\u6cd5\u63a8\u65ad\u53c2\u6570\u7c7b\u578b -crsreader.connecterr = RowSetReader \u4e2d\u51fa\u73b0\u5185\u90e8\u9519\u8bef\uff1a\u65e0\u8fde\u63a5\u6216\u547d\u4ee4 -crsreader.datedetected = \u68c0\u6d4b\u5230\u65e5\u671f -crsreader.caldetected = \u68c0\u6d4b\u5230\u65e5\u5386 +crsreader.connect = (JNDI) \u65E0\u6CD5\u8FDE\u63A5 +crsreader.paramtype = \u65E0\u6CD5\u63A8\u65AD\u53C2\u6570\u7C7B\u578B +crsreader.connecterr = RowSetReader \u4E2D\u51FA\u73B0\u5185\u90E8\u9519\u8BEF: \u65E0\u8FDE\u63A5\u6216\u547D\u4EE4 +crsreader.datedetected = \u68C0\u6D4B\u5230\u65E5\u671F +crsreader.caldetected = \u68C0\u6D4B\u5230\u65E5\u5386 #CachedRowSetWriter exceptions -crswriter.connect = \u65e0\u6cd5\u8fdb\u884c\u8fde\u63a5 -crswriter.tname = writeData \u65e0\u6cd5\u786e\u5b9a\u8868\u540d -crswriter.params1 = params1 \u7684\u503c: {0} -crswriter.params2 = params2 \u7684\u503c: {0} -crswriter.conflictsno = \u540c\u6b65\u5316\u65f6\u53d1\u751f\u51b2\u7a81 +crswriter.connect = \u65E0\u6CD5\u83B7\u53D6\u8FDE\u63A5 +crswriter.tname = writeData \u65E0\u6CD5\u786E\u5B9A\u8868\u540D +crswriter.params1 = params1 \u7684\u503C: {0} +crswriter.params2 = params2 \u7684\u503C: {0} +crswriter.conflictsno = \u540C\u6B65\u65F6\u53D1\u751F\u51B2\u7A81 #InsertRow exceptions -insertrow.novalue = \u5c1a\u672a\u63d2\u5165\u4efb\u4f55\u503c +insertrow.novalue = \u5C1A\u672A\u63D2\u5165\u4EFB\u4F55\u503C #SyncResolverImpl exceptions -syncrsimpl.indexval = \u7d22\u5f15\u503c\u8d85\u51fa\u8303\u56f4 -syncrsimpl.noconflict = \u6b64\u5217\u4e0d\u51b2\u7a81 -syncrsimpl.syncnotpos = \u4e0d\u80fd\u540c\u6b65 -syncrsimpl.valtores = \u8981\u89e3\u6790\u7684\u503c\u53ef\u4ee5\u5728\u6570\u636e\u5e93\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5728 CachedRowSet \u4e2d +syncrsimpl.indexval = \u7D22\u5F15\u503C\u8D85\u51FA\u8303\u56F4 +syncrsimpl.noconflict = \u6B64\u5217\u4E0D\u51B2\u7A81 +syncrsimpl.syncnotpos = \u4E0D\u80FD\u540C\u6B65 +syncrsimpl.valtores = \u8981\u89E3\u6790\u7684\u503C\u53EF\u4EE5\u5728\u6570\u636E\u5E93\u4E2D, \u4E5F\u53EF\u4EE5\u5728 CachedRowSet \u4E2D #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = \u5df2\u5230\u8fbe RowSet \u7684\u7ed3\u5c3e\u3002\u5149\u6807\u4f4d\u7f6e\u65e0\u6548 +wrsxmlreader.invalidcp = \u5DF2\u5230\u8FBE RowSet \u7684\u7ED3\u5C3E\u3002\u5149\u6807\u4F4D\u7F6E\u65E0\u6548 wrsxmlreader.readxml = readXML: {0} -wrsxmlreader.parseerr = ** \u8bed\u6cd5\u89e3\u6790\u9519\u8bef: {0}\uff0c\u884c: {1}\uff0cURI: {2} +wrsxmlreader.parseerr = ** \u8BED\u6CD5\u5206\u6790\u9519\u8BEF: {0}, \u884C: {1}, URI: {2} #WebRowSetXmlWriter exceptions wrsxmlwriter.ioex = IOException: {0} wrsxmlwriter.sqlex = SQLException: {0} -wrsxmlwriter.failedwrite = \u65e0\u6cd5\u5199\u5165\u503c -wsrxmlwriter.notproper = \u7c7b\u578b\u4e0d\u6b63\u786e +wrsxmlwriter.failedwrite = \u65E0\u6CD5\u5199\u5165\u503C +wsrxmlwriter.notproper = \u7C7B\u578B\u4E0D\u6B63\u786E #XmlReaderContentHandler exceptions -xmlrch.errmap = \u8bbe\u7f6e\u6620\u5c04\u65f6\u51fa\u9519: {0} -xmlrch.errmetadata = \u8bbe\u7f6e\u5143\u6570\u636e\u65f6\u51fa\u9519: {0} -xmlrch.errinsertval = \u63d2\u5165\u503c\u65f6\u51fa\u9519: {0} -xmlrch.errconstr = \u6784\u9020\u884c\u65f6\u51fa\u9519: {0} -xmlrch.errdel = \u5220\u9664\u884c\u65f6\u51fa\u9519: {0} -xmlrch.errinsdel = \u6784\u9020 insdel \u884c\u65f6\u51fa\u9519: {0} -xmlrch.errupdate = \u6784\u9020\u66f4\u65b0\u884c\u65f6\u51fa\u9519: {0} -xmlrch.errupdrow = \u66f4\u65b0\u884c\u65f6\u51fa\u9519: {0} -xmlrch.chars = \u5b57\u7b26: -xmlrch.badvalue = \u503c\u9519\u8bef\uff1b\u5c5e\u6027\u4e0d\u53ef\u4e3a Null -xmlrch.badvalue1 = \u503c\u9519\u8bef\uff1b\u5143\u6570\u636e\u4e0d\u53ef\u4e3a Null -xmlrch.warning = ** \u8b66\u544a: {0}\uff0c\u884c: {1}\uff0cURI: {2} +xmlrch.errmap = \u8BBE\u7F6E\u6620\u5C04\u65F6\u51FA\u9519: {0} +xmlrch.errmetadata = \u8BBE\u7F6E\u5143\u6570\u636E\u65F6\u51FA\u9519: {0} +xmlrch.errinsertval = \u63D2\u5165\u503C\u65F6\u51FA\u9519: {0} +xmlrch.errconstr = \u6784\u9020\u884C\u65F6\u51FA\u9519: {0} +xmlrch.errdel = \u5220\u9664\u884C\u65F6\u51FA\u9519: {0} +xmlrch.errinsert = \u6784\u9020\u63D2\u5165\u884C\u65F6\u51FA\u9519: {0} +xmlrch.errinsdel = \u6784\u9020 insdel \u884C\u65F6\u51FA\u9519: {0} +xmlrch.errupdate = \u6784\u9020\u66F4\u65B0\u884C\u65F6\u51FA\u9519: {0} +xmlrch.errupdrow = \u66F4\u65B0\u884C\u65F6\u51FA\u9519: {0} +xmlrch.chars = \u5B57\u7B26: +xmlrch.badvalue = \u503C\u9519\u8BEF; \u5C5E\u6027\u4E0D\u53EF\u4E3A\u7A7A\u503C +xmlrch.badvalue1 = \u503C\u9519\u8BEF; \u5143\u6570\u636E\u4E0D\u53EF\u4E3A\u7A7A\u503C +xmlrch.warning = ** \u8B66\u544A: {0}, \u884C: {1}, URI: {2} #RIOptimisticProvider Exceptions -riop.locking = \u4e0d\u652f\u6301\u9501\u5b9a\u5206\u7c7b +riop.locking = \u4E0D\u652F\u6301\u9501\u5B9A\u5206\u7C7B #RIXMLProvider exceptions -rixml.unsupp = \u4e0d\u652f\u6301 RIXMLProvider +rixml.unsupp = \u4E0D\u652F\u6301 RIXMLProvider diff --git a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties index a52d73d4dbe..cb71246daa9 100644 --- a/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/rowset/RowSetResourceBundle_zh_TW.properties @@ -24,145 +24,147 @@ # # CacheRowSetImpl exceptions -cachedrowsetimpl.populate = \u70ba\u690d\u5165\u65b9\u6cd5\u63d0\u4f9b\u7684 ResultSet \u7269\u4ef6\u7121\u6548 -cachedrowsetimpl.invalidp = \u7522\u751f\u7684\u6301\u7e8c\u6027\u63d0\u4f9b\u8005\u7121\u6548 -cachedrowsetimpl.nullhash = \u7121\u6cd5\u5275\u8a2d CachedRowSetImpl \u5be6\u4f8b\u3002\u70ba\u5efa\u69cb\u5b50\u63d0\u4f9b\u7684 Hashtable \u70ba\u7a7a -cachedrowsetimpl.invalidop = \u5c0d\u63d2\u5165\u5217\u9032\u884c\u7684\u4f5c\u696d\u7121\u6548 +cachedrowsetimpl.populate = \u70BA\u690D\u5165\u65B9\u6CD5\u63D0\u4F9B\u7684 ResultSet \u7269\u4EF6\u7121\u6548 +cachedrowsetimpl.invalidp = \u7522\u751F\u7684\u6301\u7E8C\u6027\u63D0\u4F9B\u8005\u7121\u6548 +cachedrowsetimpl.nullhash = \u7121\u6CD5\u5EFA\u7ACB CachedRowSetImpl \u57F7\u884C\u8655\u7406\u3002\u70BA\u5EFA\u69CB\u5B50\u63D0\u4F9B\u7684 Hashtable \u70BA\u7A7A\u503C +cachedrowsetimpl.invalidop = \u63D2\u5165\u5217\u6642\u7684\u4F5C\u696D\u7121\u6548 cachedrowsetimpl.accfailed = acceptChanges \u5931\u6557 -cachedrowsetimpl.invalidcp = \u6e38\u6a19\u4f4d\u7f6e\u7121\u6548 -cachedrowsetimpl.illegalop = \u975e\u63d2\u5165\u5217\u4e0a\u5b58\u5728\u975e\u6cd5\u4f5c\u696d -cachedrowsetimpl.clonefail = \u8907\u88fd\u5931\u6557\uff1a{0} -cachedrowsetimpl.invalidcol = \u6b04\u7d22\u5f15\u7121\u6548 -cachedrowsetimpl.invalcolnm = \u6b04\u540d\u7121\u6548 -cachedrowsetimpl.boolfail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getBoolen \u5931\u6557 -cachedrowsetimpl.bytefail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getByte \u5931\u6557 -cachedrowsetimpl.shortfail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getShort \u5931\u6557 -cachedrowsetimpl.intfail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getInt \u5931\u6557 -cachedrowsetimpl.longfail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getLong \u5931\u6557 -cachedrowsetimpl.floatfail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getFloat \u5931\u6557 -cachedrowsetimpl.doublefail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getDouble \u5931\u6557 -cachedrowsetimpl.dtypemismt = \u8cc7\u6599\u985e\u578b\u4e0d\u5339\u914d -cachedrowsetimpl.datefail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getDate \u5931\u6557\uff0c\u672a\u9032\u884c\u8f49\u63db -cachedrowsetimpl.timefail = \u5c0d\u6b04 {1} \u4e2d\u7684\u503c ( {0} ) \u57f7\u884c getTime \u5931\u6557\uff0c\u672a\u9032\u884c\u8f49\u63db -cachedrowsetimpl.posupdate = \u4e0d\u652f\u63f4\u5b9a\u4f4d\u7684\u66f4\u65b0 -cachedrowsetimpl.unableins = \u7121\u6cd5\u5275\u8a2d\uff1a{0} -cachedrowsetimpl.beforefirst = beforeFirst\uff1a\u6e38\u6a19\u4f5c\u696d\u7121\u6548 -cachedrowsetimpl.first = First\uff1a\u6e38\u6a19\u4f5c\u696d\u7121\u6548 -cachedrowsetimpl.last = last\uff1aTYPE_FORWARD_ONLY -cachedrowsetimpl.absolute = absolute\uff1a\u6e38\u6a19\u4f4d\u7f6e\u7121\u6548 -cachedrowsetimpl.relative = relative\uff1a\u6e38\u6a19\u4f4d\u7f6e\u7121\u6548 -cachedrowsetimpl.asciistream = \u5c0d ascii \u4e32\u6d41\u57f7\u884c read \u5931\u6557 -cachedrowsetimpl.binstream = \u5c0d\u4e8c\u9032\u4f4d\u4e32\u6d41\u57f7\u884c read \u5931\u6557 -cachedrowsetimpl.failedins = \u5728\u63d2\u5165\u5217\u4e0a\u5931\u6557 -cachedrowsetimpl.updateins = \u5c0d\u63d2\u5165\u5217\u547c\u53eb updateRow -cachedrowsetimpl.movetoins = moveToInsertRow\uff1aCONCUR_READ_ONLY -cachedrowsetimpl.movetoins1 = moveToInsertRow\uff1a\u6c92\u6709\u5143\u8cc7\u6599 -cachedrowsetimpl.movetoins2 = moveToInsertRow\uff1a\u6b04\u6578\u7121\u6548 -cachedrowsetimpl.tablename = \u8868\u540d\u7a31\u4e0d\u80fd\u70ba\u7a7a -cachedrowsetimpl.keycols = \u95dc\u9375\u6b04\u7121\u6548 -cachedrowsetimpl.opnotsupp = \u8cc7\u6599\u5eab\u4e0d\u652f\u63f4\u4f5c\u696d -cachedrowsetimpl.matchcols = \u5339\u914d\u6b04\u548c\u8a2d\u5b9a\u7684\u6b04\u4e0d\u540c -cachedrowsetimpl.setmatchcols = \u5728\u53d6\u5f97\u5339\u914d\u6b04\u4e4b\u524d\u8a2d\u5b9a\u5b83\u5011 -cachedrowsetimpl.matchcols1 = \u5339\u914d\u6b04\u61c9\u5927\u65bc 0 -cachedrowsetimpl.matchcols2 = \u5339\u914d\u6b04\u61c9\u70ba\u7a7a\u767d\u5b57\u4e32\u6216\u7a7a\u5b57\u4e32 -cachedrowsetimpl.unsetmatch = \u672a\u8a2d\u5b9a\u7684\u6b04\u548c\u8a2d\u5b9a\u7684\u6b04\u4e0d\u540c -cachedrowsetimpl.unsetmatch1 = \u4f7f\u7528\u6b04\u540d\u505a\u70ba unsetMatchColumn \u7684\u5f15\u6578 -cachedrowsetimpl.unsetmatch2 = \u4f7f\u7528\u6b04 ID \u505a\u70ba unsetMatchColumn \u7684\u5f15\u6578 -cachedrowsetimpl.numrows = \u5217\u6578\u5c0f\u65bc\u96f6\u6216\u5c0f\u65bc\u64f7\u53d6\u5927\u5c0f -cachedrowsetimpl.startpos = \u8d77\u59cb\u4f4d\u7f6e\u4e0d\u80fd\u70ba\u8ca0 -cachedrowsetimpl.nextpage = \u5728\u547c\u53eb\u4e4b\u524d\u690d\u5165\u8cc7\u6599 -cachedrowsetimpl.pagesize = \u9801\u9762\u5927\u5c0f\u4e0d\u80fd\u5c0f\u65bc\u96f6 -cachedrowsetimpl.pagesize1 = \u9801\u9762\u5927\u5c0f\u4e0d\u80fd\u5927\u65bc maxRows -cachedrowsetimpl.fwdonly = ResultSet \u53ea\u80fd\u5411\u524d\u9032\u884c -cachedrowsetimpl.type = \u985e\u578b\u662f\uff1a{0} -cachedrowsetimpl.opnotysupp = \u5c1a\u4e0d\u652f\u63f4\u8a72\u4f5c\u696d -cachedrowsetimpl.featnotsupp = \u4e0d\u652f\u63f4\u8a72\u529f\u80fd +cachedrowsetimpl.invalidcp = \u6E38\u6A19\u4F4D\u7F6E\u7121\u6548 +cachedrowsetimpl.illegalop = \u975E\u63D2\u5165\u5217\u4E0A\u5B58\u5728\u7121\u6548\u4F5C\u696D +cachedrowsetimpl.clonefail = \u8907\u88FD\u5931\u6557: {0} +cachedrowsetimpl.invalidcol = \u6B04\u7D22\u5F15\u7121\u6548 +cachedrowsetimpl.invalcolnm = \u6B04\u540D\u7121\u6548 +cachedrowsetimpl.boolfail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getBoolen \u5931\u6557 +cachedrowsetimpl.bytefail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getByte \u5931\u6557 +cachedrowsetimpl.shortfail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getShort \u5931\u6557 +cachedrowsetimpl.intfail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getInt \u5931\u6557 +cachedrowsetimpl.longfail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getLong \u5931\u6557 +cachedrowsetimpl.floatfail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getFloat \u5931\u6557 +cachedrowsetimpl.doublefail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getDouble \u5931\u6557 +cachedrowsetimpl.dtypemismt = \u8CC7\u6599\u985E\u578B\u4E0D\u76F8\u7B26 +cachedrowsetimpl.datefail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getDate \u5931\u6557\uFF0C\u672A\u9032\u884C\u8F49\u63DB +cachedrowsetimpl.timefail = \u5C0D\u6B04 {1} \u4E2D\u7684\u503C ( {0} ) \u57F7\u884C getTime \u5931\u6557\uFF0C\u672A\u9032\u884C\u8F49\u63DB +cachedrowsetimpl.posupdate = \u4E0D\u652F\u63F4\u5B9A\u4F4D\u7684\u66F4\u65B0 +cachedrowsetimpl.unableins = \u7121\u6CD5\u5EFA\u7ACB: {0} +cachedrowsetimpl.beforefirst = beforeFirst: \u6E38\u6A19\u4F5C\u696D\u7121\u6548 +cachedrowsetimpl.first = First: \u6E38\u6A19\u4F5C\u696D\u7121\u6548 +cachedrowsetimpl.last = last : TYPE_FORWARD_ONLY +cachedrowsetimpl.absolute = absolute: \u6E38\u6A19\u4F4D\u7F6E\u7121\u6548 +cachedrowsetimpl.relative = relative: \u6E38\u6A19\u4F4D\u7F6E\u7121\u6548 +cachedrowsetimpl.asciistream = \u8B80\u53D6 ascii \u4E32\u6D41\u5931\u6557 +cachedrowsetimpl.binstream = \u8B80\u53D6\u4E8C\u9032\u4F4D\u4E32\u6D41\u5931\u6557 +cachedrowsetimpl.failedins = \u63D2\u5165\u5217\u5931\u6557 +cachedrowsetimpl.updateins = \u63D2\u5165\u5217\u6642\u547C\u53EB updateRow +cachedrowsetimpl.movetoins = moveToInsertRow: CONCUR_READ_ONLY +cachedrowsetimpl.movetoins1 = moveToInsertRow: \u6C92\u6709\u63CF\u8FF0\u8CC7\u6599 +cachedrowsetimpl.movetoins2 = moveToInsertRow: \u6B04\u6578\u7121\u6548 +cachedrowsetimpl.tablename = \u8868\u683C\u540D\u7A31\u4E0D\u80FD\u70BA\u7A7A\u503C +cachedrowsetimpl.keycols = \u95DC\u9375\u6B04\u7121\u6548 +cachedrowsetimpl.invalidcol = \u6B04\u7D22\u5F15\u7121\u6548 +cachedrowsetimpl.opnotsupp = \u8CC7\u6599\u5EAB\u4E0D\u652F\u63F4\u4F5C\u696D +cachedrowsetimpl.matchcols = \u5339\u914D\u6B04\u548C\u8A2D\u5B9A\u7684\u6B04\u4E0D\u540C +cachedrowsetimpl.setmatchcols = \u5728\u53D6\u5F97\u5339\u914D\u6B04\u4E4B\u524D\u8A2D\u5B9A\u5B83\u5011 +cachedrowsetimpl.matchcols1 = \u5339\u914D\u6B04\u61C9\u5927\u65BC 0 +cachedrowsetimpl.matchcols2 = \u5339\u914D\u6B04\u61C9\u70BA\u7A7A\u767D\u5B57\u4E32\u6216\u7A7A\u503C\u5B57\u4E32 +cachedrowsetimpl.unsetmatch = \u53D6\u6D88\u8A2D\u5B9A\u7684\u6B04\u548C\u8A2D\u5B9A\u7684\u6B04\u4E0D\u540C +cachedrowsetimpl.unsetmatch1 = \u4F7F\u7528\u6B04\u540D\u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 +cachedrowsetimpl.unsetmatch2 = \u4F7F\u7528\u6B04 ID \u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 +cachedrowsetimpl.numrows = \u5217\u6578\u5C0F\u65BC\u96F6\u6216\u5C0F\u65BC\u64F7\u53D6\u5927\u5C0F +cachedrowsetimpl.startpos = \u8D77\u59CB\u4F4D\u7F6E\u4E0D\u80FD\u70BA\u8CA0\u6578 +cachedrowsetimpl.nextpage = \u5728\u547C\u53EB\u4E4B\u524D\u690D\u5165\u8CC7\u6599 +cachedrowsetimpl.pagesize = \u9801\u9762\u5927\u5C0F\u4E0D\u80FD\u5C0F\u65BC\u96F6 +cachedrowsetimpl.pagesize1 = \u9801\u9762\u5927\u5C0F\u4E0D\u80FD\u5927\u65BC maxRows +cachedrowsetimpl.fwdonly = ResultSet \u53EA\u80FD\u5411\u524D\u9032\u884C +cachedrowsetimpl.type = \u985E\u578B\u662F: {0} +cachedrowsetimpl.opnotysupp = \u5C1A\u4E0D\u652F\u63F4\u8A72\u4F5C\u696D +cachedrowsetimpl.featnotsupp = \u4E0D\u652F\u63F4\u8A72\u529F\u80FD # WebRowSetImpl exceptions -webrowsetimpl.nullhash = \u7121\u6cd5\u5275\u8a2d WebRowSetImpl \u5be6\u4f8b\u3002\u70ba\u5efa\u69cb\u5b50\u63d0\u4f9b\u7684 Hashtable \u70ba\u7a7a -webrowsetimpl.invalidwr = \u5beb\u5165\u5668\u7121\u6548 -webrowsetimpl.invalidrd = \u8b80\u53d6\u5668\u7121\u6548 +webrowsetimpl.nullhash = \u7121\u6CD5\u5EFA\u7ACB WebRowSetImpl \u57F7\u884C\u8655\u7406\u3002\u70BA\u5EFA\u69CB\u5B50\u63D0\u4F9B\u7684 Hashtable \u70BA\u7A7A\u503C +webrowsetimpl.invalidwr = \u5BEB\u5165\u5668\u7121\u6548 +webrowsetimpl.invalidrd = \u8B80\u53D6\u5668\u7121\u6548 #FilteredRowSetImpl exceptions -filteredrowsetimpl.relative = relative\uff1a\u6e38\u6a19\u4f5c\u696d\u7121\u6548 -filteredrowsetimpl.absolute = absolute\uff1a\u6e38\u6a19\u4f5c\u696d\u7121\u6548 -filteredrowsetimpl.notallowed = \u4e0d\u5141\u8a31\u6b64\u503c\u901a\u904e\u904e\u6ffe\u5668 +filteredrowsetimpl.relative = relative: \u6E38\u6A19\u4F5C\u696D\u7121\u6548 +filteredrowsetimpl.absolute = absolute: \u6E38\u6A19\u4F5C\u696D\u7121\u6548 +filteredrowsetimpl.notallowed = \u4E0D\u5141\u8A31\u6B64\u503C\u901A\u904E\u7BE9\u9078 #JoinRowSetImpl exceptions -joinrowsetimpl.notinstance = \u4e0d\u662f rowset \u7684\u5be6\u4f8b -joinrowsetimpl.matchnotset = \u672a\u8a2d\u5b9a\u7528\u65bc\u9023\u7d50\u7684\u5339\u914d\u6b04 -joinrowsetimpl.numnotequal = rowset \u4e2d\u7684\u5143\u7d20\u6578\u4e0d\u7b49\u65bc\u5339\u914d\u6b04 -joinrowsetimpl.notdefined = \u9019\u4e0d\u662f\u9023\u7d50\u7684\u5df2\u5b9a\u7fa9\u985e\u578b -joinrowsetimpl.notsupported = \u4e0d\u652f\u63f4\u6b64\u985e\u9023\u7d50 -joinrowsetimpl.initerror = JoinRowSet \u521d\u59cb\u5316\u932f\u8aa4 -joinrowsetimpl.genericerr = \u5e38\u898f\u7684 joinrowset \u521d\u59cb\u5316\u932f\u8aa4 -joinrowsetimpl.emptyrowset = \u7121\u6cd5\u5c07\u7a7a rowset \u65b0\u589e\u81f3\u6b64 JoinRowSet +joinrowsetimpl.notinstance = \u4E0D\u662F rowset \u7684\u57F7\u884C\u8655\u7406 +joinrowsetimpl.matchnotset = \u672A\u8A2D\u5B9A\u7528\u65BC\u9023\u7D50\u7684\u5339\u914D\u6B04 +joinrowsetimpl.numnotequal = rowset \u4E2D\u7684\u5143\u7D20\u6578\u4E0D\u7B49\u65BC\u5339\u914D\u6B04 +joinrowsetimpl.notdefined = \u9019\u4E0D\u662F\u9023\u7D50\u7684\u5DF2\u5B9A\u7FA9\u985E\u578B +joinrowsetimpl.notsupported = \u4E0D\u652F\u63F4\u6B64\u985E\u9023\u7D50 +joinrowsetimpl.initerror = JoinRowSet \u521D\u59CB\u5316\u932F\u8AA4 +joinrowsetimpl.genericerr = \u4E00\u822C\u7684 joinrowset \u521D\u59CB\u5316\u932F\u8AA4 +joinrowsetimpl.emptyrowset = \u7121\u6CD5\u5C07\u7A7A rowset \u65B0\u589E\u81F3\u6B64 JoinRowSet #JdbcRowSetImpl exceptions -jdbcrowsetimpl.invalstate = \u72c0\u614b\u7121\u6548 -jdbcrowsetimpl.connect = JdbcRowSet (\u9023\u7dda) JNDI \u7121\u6cd5\u9023\u7dda -jdbcrowsetimpl.paramtype = \u7121\u6cd5\u63a8\u65b7\u53c3\u6578\u985e\u578b -jdbcrowsetimpl.matchcols = \u5339\u914d\u6b04\u548c\u8a2d\u5b9a\u7684\u6b04\u4e0d\u540c -jdbcrowsetimpl.setmatchcols = \u5728\u53d6\u5f97\u5339\u914d\u6b04\u4e4b\u524d\u8a2d\u5b9a\u5b83\u5011 -jdbcrowsetimpl.matchcols1 = \u5339\u914d\u6b04\u61c9\u5927\u65bc 0 -jdbcrowsetimpl.matchcols2 = \u5339\u914d\u6b04\u4e0d\u80fd\u70ba\u7a7a\u5b57\u4e32\u6216\u7a7a\u767d\u5b57\u4e32 -jdbcrowsetimpl.unsetmatch = \u672a\u8a2d\u5b9a\u7684\u6b04\u548c\u8a2d\u5b9a\u7684\u6b04\u4e0d\u540c -jdbcrowsetimpl.usecolname = \u4f7f\u7528\u6b04\u540d\u505a\u70ba unsetMatchColumn \u7684\u5f15\u6578 -jdbcrowsetimpl.usecolid = \u4f7f\u7528\u6b04 ID \u505a\u70ba unsetMatchColumn \u7684\u5f15\u6578 -jdbcrowsetimpl.resnotupd = ResultSet \u4e0d\u53ef\u66f4\u65b0 -jdbcrowsetimpl.opnotysupp = \u5c1a\u4e0d\u652f\u63f4\u8a72\u4f5c\u696d -jdbcrowsetimpl.featnotsupp = \u4e0d\u652f\u63f4\u8a72\u529f\u80fd +jdbcrowsetimpl.invalstate = \u72C0\u614B\u7121\u6548 +jdbcrowsetimpl.connect = JdbcRowSet (\u9023\u7DDA) JNDI \u7121\u6CD5\u9023\u7DDA +jdbcrowsetimpl.paramtype = \u7121\u6CD5\u63A8\u65B7\u53C3\u6578\u985E\u578B +jdbcrowsetimpl.matchcols = \u5339\u914D\u6B04\u548C\u8A2D\u5B9A\u7684\u6B04\u4E0D\u540C +jdbcrowsetimpl.setmatchcols = \u8981\u5148\u8A2D\u5B9A\u5339\u914D\u6B04\uFF0C\u624D\u80FD\u53D6\u5F97\u5B83\u5011 +jdbcrowsetimpl.matchcols1 = \u5339\u914D\u6B04\u61C9\u5927\u65BC 0 +jdbcrowsetimpl.matchcols2 = \u5339\u914D\u6B04\u4E0D\u80FD\u70BA\u7A7A\u767D\u5B57\u4E32\u6216\u7A7A\u503C\u5B57\u4E32 +jdbcrowsetimpl.unsetmatch = \u53D6\u6D88\u8A2D\u5B9A\u7684\u6B04\u548C\u8A2D\u5B9A\u7684\u6B04\u4E0D\u540C +jdbcrowsetimpl.usecolname = \u4F7F\u7528\u6B04\u540D\u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 +jdbcrowsetimpl.usecolid = \u4F7F\u7528\u6B04 ID \u505A\u70BA unsetMatchColumn \u7684\u5F15\u6578 +jdbcrowsetimpl.resnotupd = ResultSet \u4E0D\u53EF\u66F4\u65B0 +jdbcrowsetimpl.opnotysupp = \u5C1A\u4E0D\u652F\u63F4\u8A72\u4F5C\u696D +jdbcrowsetimpl.featnotsupp = \u4E0D\u652F\u63F4\u8A72\u529F\u80FD #CachedRowSetReader exceptions -crsreader.connect = (JNDI) \u7121\u6cd5\u9023\u7dda -crsreader.paramtype = \u7121\u6cd5\u63a8\u65b7\u53c3\u6578\u985e\u578b -crsreader.connecterr = RowSetReader \u4e2d\u51fa\u73fe\u5167\u90e8\u932f\u8aa4\ufe30\u7121\u9023\u7dda\u6216\u6307\u4ee4 -crsreader.datedetected = \u5075\u6e2c\u5230\u65e5\u671f -crsreader.caldetected = \u5075\u6e2c\u5230\u884c\u4e8b\u66c6 +crsreader.connect = (JNDI) \u7121\u6CD5\u9023\u7DDA +crsreader.paramtype = \u7121\u6CD5\u63A8\u65B7\u53C3\u6578\u985E\u578B +crsreader.connecterr = RowSetReader \u4E2D\u51FA\u73FE\u5167\u90E8\u932F\u8AA4: \u7121\u9023\u7DDA\u6216\u547D\u4EE4 +crsreader.datedetected = \u5075\u6E2C\u5230\u65E5\u671F +crsreader.caldetected = \u5075\u6E2C\u5230\u884C\u4E8B\u66C6 #CachedRowSetWriter exceptions -crswriter.connect = \u7121\u6cd5\u5efa\u7acb\u9023\u7dda -crswriter.tname = writeData \u4e0d\u80fd\u6c7a\u5b9a\u8868\u540d\u7a31 -crswriter.params1 = params1 \u7684\u503c\uff1a{0} -crswriter.params2 = params2 \u7684\u503c\uff1a{0} -crswriter.conflictsno = \u540c\u6b65\u5316\u6642\u767c\u751f\u885d\u7a81 +crswriter.connect = \u7121\u6CD5\u53D6\u5F97\u9023\u7DDA +crswriter.tname = writeData \u4E0D\u80FD\u6C7A\u5B9A\u8868\u683C\u540D\u7A31 +crswriter.params1 = params1 \u7684\u503C: {0} +crswriter.params2 = params2 \u7684\u503C: {0} +crswriter.conflictsno = \u540C\u6B65\u5316\u6642\u767C\u751F\u885D\u7A81 #InsertRow exceptions -insertrow.novalue = \u5c1a\u672a\u63d2\u5165\u503c +insertrow.novalue = \u5C1A\u672A\u63D2\u5165\u503C #SyncResolverImpl exceptions -syncrsimpl.indexval = \u7d22\u5f15\u503c\u8d85\u51fa\u7bc4\u570d -syncrsimpl.noconflict = \u6b64\u6b04\u4e0d\u885d\u7a81 -syncrsimpl.syncnotpos = \u4e0d\u53ef\u80fd\u540c\u6b65\u5316 -syncrsimpl.valtores = \u8981\u89e3\u6790\u7684\u503c\u53ef\u4f4d\u65bc\u8cc7\u6599\u5eab\u6216 cachedrowset \u4e2d +syncrsimpl.indexval = \u7D22\u5F15\u503C\u8D85\u51FA\u7BC4\u570D +syncrsimpl.noconflict = \u6B64\u6B04\u4E0D\u885D\u7A81 +syncrsimpl.syncnotpos = \u4E0D\u53EF\u80FD\u540C\u6B65\u5316 +syncrsimpl.valtores = \u8981\u89E3\u6790\u7684\u503C\u53EF\u4F4D\u65BC\u8CC7\u6599\u5EAB\u6216 cachedrowset \u4E2D #WebRowSetXmlReader exception -wrsxmlreader.invalidcp = \u5df2\u5230\u9054 RowSet \u672b\u5c3e\u3002\u6e38\u6a19\u4f4d\u7f6e\u7121\u6548 -wrsxmlreader.readxml = readXML\uff1a{0} -wrsxmlreader.parseerr = ** \u5256\u6790\u932f\u8aa4: {0}\uff0c\u884c: {1}\uff0curi: {2} +wrsxmlreader.invalidcp = \u5DF2\u5230\u9054 RowSet \u7D50\u5C3E\u3002\u6E38\u6A19\u4F4D\u7F6E\u7121\u6548 +wrsxmlreader.readxml = readXML: {0} +wrsxmlreader.parseerr = ** \u5256\u6790\u932F\u8AA4: {0}\uFF0C\u884C: {1}\uFF0Curi: {2} #WebRowSetXmlWriter exceptions -wrsxmlwriter.ioex = IOException\uff1a{0} -wrsxmlwriter.sqlex = SQLException\uff1a{0} -wrsxmlwriter.failedwrite = \u5beb\u5165\u503c\u5931\u6557 -wsrxmlwriter.notproper = \u4e0d\u662f\u6b63\u78ba\u985e\u578b +wrsxmlwriter.ioex = IOException : {0} +wrsxmlwriter.sqlex = SQLException : {0} +wrsxmlwriter.failedwrite = \u5BEB\u5165\u503C\u5931\u6557 +wsrxmlwriter.notproper = \u4E0D\u662F\u6B63\u78BA\u985E\u578B #XmlReaderContentHandler exceptions -xmlrch.errmap = \u8a2d\u5b9a\u5c0d\u6620\u6642\u767c\u751f\u932f\u8aa4\uff1a{0} -xmlrch.errmetadata = \u8a2d\u5b9a\u5143\u8cc7\u6599\u6642\u767c\u751f\u932f\u8aa4\uff1a{0} -xmlrch.errinsertval = \u63d2\u5165\u503c\u6642\u767c\u751f\u932f\u8aa4: {0} -xmlrch.errconstr = \u5efa\u69cb\u5217\u6642\u767c\u751f\u932f\u8aa4\uff1a{0} -xmlrch.errdel = \u522a\u9664\u5217\u6642\u767c\u751f\u932f\u8aa4\uff1a{0} -xmlrch.errinsdel = \u5efa\u69cb insdel \u5217\u6642\u767c\u751f\u932f\u8aa4\uff1a{0} -xmlrch.errupdate = \u5efa\u69cb\u66f4\u65b0\u5217\u6642\u767c\u751f\u932f\u8aa4\uff1a{0} -xmlrch.errupdrow = \u66f4\u65b0\u5217\u6642\u767c\u751f\u932f\u8aa4: {0} -xmlrch.chars = \u5b57\u5143\uff1a -xmlrch.badvalue = \u932f\u8aa4\u7684\u503c\uff1b\u7279\u6027\u4e0d\u80fd\u70ba\u7a7a -xmlrch.badvalue1 = \u932f\u8aa4\u7684\u503c\uff1b\u5143\u8cc7\u6599\u4e0d\u80fd\u70ba\u7a7a -xmlrch.warning = ** \u8b66\u544a: {0}\uff0c\u884c: {1}\uff0curi: {2} +xmlrch.errmap = \u8A2D\u5B9A\u5C0D\u6620\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errmetadata = \u8A2D\u5B9A\u63CF\u8FF0\u8CC7\u6599\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errinsertval = \u63D2\u5165\u503C\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errconstr = \u5EFA\u69CB\u5217\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errdel = \u522A\u9664\u5217\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errinsert = \u5EFA\u69CB\u63D2\u5165\u5217\u6642\u767C\u751F\u932F\u8AA4 : {0} +xmlrch.errinsdel = \u5EFA\u69CB insdel \u5217\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errupdate = \u5EFA\u69CB\u66F4\u65B0\u5217\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.errupdrow = \u66F4\u65B0\u5217\u6642\u767C\u751F\u932F\u8AA4: {0} +xmlrch.chars = \u5B57\u5143: +xmlrch.badvalue = \u932F\u8AA4\u7684\u503C; \u5C6C\u6027\u4E0D\u80FD\u70BA\u7A7A\u503C +xmlrch.badvalue1 = \u932F\u8AA4\u7684\u503C; \u63CF\u8FF0\u8CC7\u6599\u4E0D\u80FD\u70BA\u7A7A\u503C +xmlrch.warning = ** \u8B66\u544A: {0}\uFF0C\u884C: {1}\uFF0Curi: {2} #RIOptimisticProvider Exceptions -riop.locking = \u4e0d\u652f\u63f4\u9396\u5b9a\u5206\u985e +riop.locking = \u4E0D\u652F\u63F4\u9396\u5B9A\u5206\u985E #RIXMLProvider exceptions -rixml.unsupp = RIXMLProvider \u4e0d\u652f\u63f4 +rixml.unsupp = RIXMLProvider \u4E0D\u652F\u63F4 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties index bab2c4296a6..a6975e8b63e 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_de.properties @@ -50,25 +50,25 @@ FileChooser.directoryDescriptionText=Verzeichnis FileChooser.newFolderErrorText=Fehler beim Erstellen eines neuen Ordners FileChooser.newFolderErrorSeparator= : FileChooser.newFolderParentDoesntExistTitleText=Ordner kann nicht erstellt werden -FileChooser.newFolderParentDoesntExistText=Der Ordner kann nicht erstellt werden.\n\nDas System kann den angegebenen Pfad nicht finden. -FileChooser.renameErrorTitleText=Fehler beim Umbenennen der Datei oder des Ordners +FileChooser.newFolderParentDoesntExistText=Ordner kann nicht erstellt werden.\n\nSystem kann den angegebenen Pfad nicht finden. +FileChooser.renameErrorTitleText=Fehler beim Umbenennen von Datei oder Ordner FileChooser.renameErrorText={0} kann nicht umbenannt werden -FileChooser.renameErrorFileExistsText={0} kann nicht umbenannt werden: Es ist bereits eine Datei mit diesem Namen vorhanden. Geben Sie einen anderen Dateinamen an. +FileChooser.renameErrorFileExistsText={0} kann nicht umbenannt werden: Es ist bereits eine Datei mit dem angegebenen Namen vorhanden. Geben Sie einen anderen Dateinamen an. FileChooser.acceptAllFileFilterText=Alle Dateien FileChooser.cancelButtonText=Abbrechen -FileChooser.cancelButtonMnemonic=65 +FileChooser.cancelButtonMnemonic=67 FileChooser.saveButtonText=Speichern FileChooser.saveButtonMnemonic=83 -FileChooser.openButtonText=\u00d6ffnen -FileChooser.openButtonMnemonic=70 +FileChooser.openButtonText=\u00D6ffnen +FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Speichern -FileChooser.openDialogTitleText=\u00d6ffnen +FileChooser.openDialogTitleText=\u00D6ffnen FileChooser.updateButtonText=Aktualisieren -FileChooser.updateButtonMnemonic=75 +FileChooser.updateButtonMnemonic=85 FileChooser.helpButtonText=Hilfe FileChooser.helpButtonMnemonic=72 -FileChooser.directoryOpenButtonText=\u00d6ffnen -FileChooser.directoryOpenButtonMnemonic=69 +FileChooser.directoryOpenButtonText=\u00D6ffnen +FileChooser.directoryOpenButtonMnemonic=79 # File Size Units FileChooser.fileSizeKiloBytes={0} KB @@ -78,28 +78,28 @@ FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. FileChooser.win32.newFolder=Neuer Ordner FileChooser.win32.newFolder.subsequent=Neuer Ordner ({0}) -FileChooser.other.newFolder=Neuer Ordner -FileChooser.other.newFolder.subsequent=Neuer Ordner.{0} +FileChooser.other.newFolder=NewFolder +FileChooser.other.newFolder.subsequent=NewFolder.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=Dialogfeld f\u00fcr Dateiauswahl abbrechen -FileChooser.saveButtonToolTipText=Ausgew\u00e4hlte Datei speichern -FileChooser.openButtonToolTipText=Ausgew\u00e4hlte Datei \u00f6ffnen +FileChooser.cancelButtonToolTipText=Dialogfeld f\u00FCr Dateiauswahl schlie\u00DFen +FileChooser.saveButtonToolTipText=Ausgew\u00E4hlte Datei speichern +FileChooser.openButtonToolTipText=Ausgew\u00E4hlte Datei \u00F6ffnen FileChooser.updateButtonToolTipText=Verzeichnisliste aktualisieren -FileChooser.helpButtonToolTipText=Hilfe f\u00fcr Dateiauswahl -FileChooser.directoryOpenButtonToolTipText=Markiertes Verzeichnis \u00f6ffnen +FileChooser.helpButtonToolTipText=FileChooser-Hilfe +FileChooser.directoryOpenButtonToolTipText=Ausgew\u00E4hltes Verzeichnis \u00F6ffnen ############ COLOR CHOOSER STRINGS ############# ColorChooser.previewText=Vorschau ColorChooser.okText=OK ColorChooser.cancelText=Abbrechen -ColorChooser.resetText=Zur\u00fccksetzen +ColorChooser.resetText=Zur\u00FCcksetzen # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic -ColorChooser.resetMnemonic=90 +ColorChooser.resetMnemonic=82 ColorChooser.sampleText=Beispieltext Beispieltext ColorChooser.swatchesNameText=Muster -ColorChooser.swatchesMnemonic=77 +ColorChooser.swatchesMnemonic=83 ColorChooser.swatchesRecentText=Aktuell: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The @@ -108,20 +108,20 @@ ColorChooser.swatchesRecentText=Aktuell: ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 ColorChooser.hsvHueText=Farbton -ColorChooser.hsvSaturationText=S\u00e4ttigung +ColorChooser.hsvSaturationText=S\u00E4ttigung ColorChooser.hsvValueText=Wert ColorChooser.hsvTransparencyText=Transparenz ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 ColorChooser.hslHueText=Farbton -ColorChooser.hslSaturationText=S\u00e4ttigung +ColorChooser.hslSaturationText=S\u00E4ttigung ColorChooser.hslLightnessText=Helligkeit ColorChooser.hslTransparencyText=Transparenz ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 ColorChooser.rgbRedText=Rot -ColorChooser.rgbRedMnemonic=82 -ColorChooser.rgbGreenText=Gr\u00fcn +ColorChooser.rgbRedMnemonic=68 +ColorChooser.rgbGreenText=Gr\u00FCn ColorChooser.rgbGreenMnemonic=78 ColorChooser.rgbBlueText=Blau ColorChooser.rgbBlueMnemonic=66 @@ -130,7 +130,7 @@ ColorChooser.rgbHexCodeText=Farbcode ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 -ColorChooser.cmykCyanText=Cyan +ColorChooser.cmykCyanText=Zyan ColorChooser.cmykMagentaText=Magenta ColorChooser.cmykYellowText=Gelb ColorChooser.cmykBlackText=Schwarz @@ -141,26 +141,26 @@ ColorChooser.cmykAlphaText=Alpha # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. OptionPane.yesButtonText=Ja -OptionPane.yesButtonMnemonic=74 +OptionPane.yesButtonMnemonic=89 OptionPane.noButtonText=Nein OptionPane.noButtonMnemonic=78 OptionPane.okButtonText=OK -OptionPane.okButtonMnemonic=79 +OptionPane.okButtonMnemonic=0 OptionPane.cancelButtonText=Abbrechen -OptionPane.cancelButtonMnemonic=65 -OptionPane.titleText=W\u00e4hlen Sie eine Option aus +OptionPane.cancelButtonMnemonic=0 +OptionPane.titleText=Option ausw\u00E4hlen # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. OptionPane.inputDialogTitle=Eingabe # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.messageDialogTitle=Nachricht +OptionPane.messageDialogTitle=Meldung ############ Printing Dialog Strings ############ PrintingDialog.titleProgressText=Drucken PrintingDialog.titleAbortingText=Drucken (Abbruch) -PrintingDialog.contentInitialText=Druckvorgang l\u00e4uft... +PrintingDialog.contentInitialText=Druckvorgang l\u00E4uft... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed @@ -169,57 +169,57 @@ PrintingDialog.contentProgressText=Seite {0} wurde gedruckt... PrintingDialog.contentAbortingText=Druckvorgang wird abgebrochen... PrintingDialog.abortButtonText=Abbrechen -PrintingDialog.abortButtonMnemonic=66 -PrintingDialog.abortButtonDisplayedMnemonicIndex=1 +PrintingDialog.abortButtonMnemonic=65 +PrintingDialog.abortButtonDisplayedMnemonicIndex=0 PrintingDialog.abortButtonToolTipText=Druckvorgang abbrechen ############ Internal Frame Strings ############ InternalFrame.iconButtonToolTip=Minimieren InternalFrame.maxButtonToolTip=Maximieren InternalFrame.restoreButtonToolTip=Wiederherstellen -InternalFrame.closeButtonToolTip=Schlie\u00dfen +InternalFrame.closeButtonToolTip=Schlie\u00DFen ############ Internal Frame Title Pane Strings ############ InternalFrameTitlePane.restoreButtonText=Wiederherstellen InternalFrameTitlePane.moveButtonText=Verschieben -InternalFrameTitlePane.sizeButtonText=Gr\u00f6\u00dfe +InternalFrameTitlePane.sizeButtonText=Gr\u00F6\u00DFe InternalFrameTitlePane.minimizeButtonText=Minimieren InternalFrameTitlePane.maximizeButtonText=Maximieren -InternalFrameTitlePane.closeButtonText=Schlie\u00dfen +InternalFrameTitlePane.closeButtonText=Schlie\u00DFen ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Abfrage senden -FormView.resetButtonText=Zur\u00fccksetzen +FormView.submitButtonText=Abfrage weiterleiten +FormView.resetButtonText=Zur\u00FCcksetzen FormView.browseFileButtonText=Durchsuchen... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=Formatvorlagen\u00e4nderung -AbstractDocument.additionText=Hinzuf\u00fcgen -AbstractDocument.deletionText=L\u00f6schen -AbstractDocument.undoText=R\u00fcckg\u00e4ngig +AbstractDocument.styleChangeText=Formatvorlagen\u00E4nderung +AbstractDocument.additionText=Hinzuf\u00FCgen +AbstractDocument.deletionText=L\u00F6schen +AbstractDocument.undoText=R\u00FCckg\u00E4ngig AbstractDocument.redoText=Wiederherstellen ############ Abstract Button Strings ############ AbstractButton.clickText=Klicken ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=R\u00fcckg\u00e4ngig +AbstractUndoableEdit.undoText=R\u00FCckg\u00E4ngig AbstractUndoableEdit.redoText=Wiederherstellen ############ Combo Box Strings ############ -ComboBox.togglePopupText=Popup umschalten +ComboBox.togglePopupText=togglePopup ############ Progress Monitor Strings ############ ProgressMonitor.progressText=Fortschritt... ############ Split Pane Strings ############ -SplitPane.leftButtonText=linke Taste -SplitPane.rightButtonText=rechte Taste +SplitPane.leftButtonText=linke Schaltfl\u00E4che +SplitPane.rightButtonText=rechte Schaltfl\u00E4che # Used for Isindex -IsindexView.prompt=Dieser Index kann durchsucht werden. Geben Sie ein Schlagwort ein: +IsindexView.prompt=Dieser Index kann durchsucht werden. Geben Sie Schl\u00FCsselw\u00F6rter f\u00FCr die Suche ein: ############ InternalFrameTitlePane Strings ############ InternalFrameTitlePane.iconifyButtonAccessibleName=Als Symbol darstellen InternalFrameTitlePane.maximizeButtonAccessibleName=Maximieren -InternalFrameTitlePane.closeButtonAccessibleName=Schlie\u00dfen +InternalFrameTitlePane.closeButtonAccessibleName=Schlie\u00DFen diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties index abc99fadb07..1b96eab4096 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_es.properties @@ -45,30 +45,30 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=Archivo gen\u00e9rico +FileChooser.fileDescriptionText=Archivo Gen\u00E9rico FileChooser.directoryDescriptionText=Directorio FileChooser.newFolderErrorText=Error al crear una nueva carpeta FileChooser.newFolderErrorSeparator= : FileChooser.newFolderParentDoesntExistTitleText=No se ha podido crear la carpeta -FileChooser.newFolderParentDoesntExistText=No se ha podido crear la carpeta.\n\nEl sistema no puede encontrar la ruta especificada. -FileChooser.renameErrorTitleText=Error al cambiar de nombre el archivo o la carpeta -FileChooser.renameErrorText=No se puede cambiar de nombre {0} -FileChooser.renameErrorFileExistsText=No se puede cambiar de nombre {0}: Ya existe un archivo con el nombre que ha especificado. Especifique otro nombre de archivo. -FileChooser.acceptAllFileFilterText=Todos los archivos +FileChooser.newFolderParentDoesntExistText=No se ha podido crear la carpeta.\n\nEl sistema no puede encontrar la ruta de acceso especificada. +FileChooser.renameErrorTitleText=Error al cambiar el nombre del archivo o carpeta +FileChooser.renameErrorText=No se puede cambiar el nombre de {0} +FileChooser.renameErrorFileExistsText=No se puede cambiar el nombre de {0}: ya existe un archivo con el nombre especificado. Especifique otro nombre de archivo. +FileChooser.acceptAllFileFilterText=Todos los Archivos FileChooser.cancelButtonText=Cancelar FileChooser.cancelButtonMnemonic=67 FileChooser.saveButtonText=Guardar -FileChooser.saveButtonMnemonic=71 +FileChooser.saveButtonMnemonic=83 FileChooser.openButtonText=Abrir -FileChooser.openButtonMnemonic=65 +FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Guardar FileChooser.openDialogTitleText=Abrir FileChooser.updateButtonText=Actualizar -FileChooser.updateButtonMnemonic=84 +FileChooser.updateButtonMnemonic=85 FileChooser.helpButtonText=Ayuda -FileChooser.helpButtonMnemonic=89 +FileChooser.helpButtonMnemonic=72 FileChooser.directoryOpenButtonText=Abrir -FileChooser.directoryOpenButtonMnemonic=82 +FileChooser.directoryOpenButtonMnemonic=79 # File Size Units FileChooser.fileSizeKiloBytes={0} KB @@ -76,30 +76,30 @@ FileChooser.fileSizeMegaBytes={0} MB FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. -FileChooser.win32.newFolder=Carpeta nueva -FileChooser.win32.newFolder.subsequent=Carpeta nueva ({0}) -FileChooser.other.newFolder=Carpeta nueva -FileChooser.other.newFolder.subsequent=Carpeta nueva.{0} +FileChooser.win32.newFolder=Nueva Carpeta +FileChooser.win32.newFolder.subsequent=Nueva Carpeta ({0}) +FileChooser.other.newFolder=Nueva Carpeta +FileChooser.other.newFolder.subsequent=Nueva Carpeta.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=Cuadro de di\u00e1logo para cancelar elector de archivo +FileChooser.cancelButtonToolTipText=Cuadro de di\u00E1logo para abortar el selector de archivos FileChooser.saveButtonToolTipText=Guardar archivo seleccionado FileChooser.openButtonToolTipText=Abrir archivo seleccionado FileChooser.updateButtonToolTipText=Actualizar lista de directorios -FileChooser.helpButtonToolTipText=Ayuda elector de archivos +FileChooser.helpButtonToolTipText=Ayuda del Selector de Archivos FileChooser.directoryOpenButtonToolTipText=Abrir directorio seleccionado ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=Vista previa +ColorChooser.previewText=Presentaci\u00F3n Preliminar ColorChooser.okText=Aceptar ColorChooser.cancelText=Cancelar ColorChooser.resetText=Restablecer # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=Texto de ejemplo Texto de ejemplo +ColorChooser.sampleText=Texto de Ejemplo Texto de Ejemplo ColorChooser.swatchesNameText=Muestras -ColorChooser.swatchesMnemonic=77 +ColorChooser.swatchesMnemonic=83 ColorChooser.swatchesRecentText=Reciente: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The @@ -107,26 +107,26 @@ ColorChooser.swatchesRecentText=Reciente: # xxxDisplayedMnemonicIndex. ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 -ColorChooser.hsvHueText=Matriz -ColorChooser.hsvSaturationText=Saturaci\u00f3n +ColorChooser.hsvHueText=Matiz +ColorChooser.hsvSaturationText=Saturaci\u00F3n ColorChooser.hsvValueText=Valor ColorChooser.hsvTransparencyText=Transparencia ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 -ColorChooser.hslHueText=Matriz -ColorChooser.hslSaturationText=Saturaci\u00f3n -ColorChooser.hslLightnessText=Brillo +ColorChooser.hslHueText=Matiz +ColorChooser.hslSaturationText=Saturaci\u00F3n +ColorChooser.hslLightnessText=Iluminaci\u00F3n ColorChooser.hslTransparencyText=Transparencia ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 ColorChooser.rgbRedText=Rojo -ColorChooser.rgbRedMnemonic=74 +ColorChooser.rgbRedMnemonic=68 ColorChooser.rgbGreenText=Verde -ColorChooser.rgbGreenMnemonic=86 +ColorChooser.rgbGreenMnemonic=78 ColorChooser.rgbBlueText=Azul -ColorChooser.rgbBlueMnemonic=76 -ColorChooser.rgbAlphaText=Alpha -ColorChooser.rgbHexCodeText=C\u00f3digo de color +ColorChooser.rgbBlueMnemonic=66 +ColorChooser.rgbAlphaText=Alfa +ColorChooser.rgbHexCodeText=C\u00F3digo de Color ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 @@ -134,21 +134,21 @@ ColorChooser.cmykCyanText=Cian ColorChooser.cmykMagentaText=Magenta ColorChooser.cmykYellowText=Amarillo ColorChooser.cmykBlackText=Negro -ColorChooser.cmykAlphaText=Alpha +ColorChooser.cmykAlphaText=Alfa ############ OPTION PANE STRINGS ############# # Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=S\u00ed -OptionPane.yesButtonMnemonic=83 +OptionPane.yesButtonText=S\u00ED +OptionPane.yesButtonMnemonic=89 OptionPane.noButtonText=No OptionPane.noButtonMnemonic=78 OptionPane.okButtonText=Aceptar OptionPane.okButtonMnemonic=0 OptionPane.cancelButtonText=Cancelar OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=Seleccionar una opci\u00f3n +OptionPane.titleText=Seleccionar una Opci\u00F3n # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. OptionPane.inputDialogTitle=Entrada @@ -157,21 +157,21 @@ OptionPane.inputDialogTitle=Entrada OptionPane.messageDialogTitle=Mensaje ############ Printing Dialog Strings ############ -PrintingDialog.titleProgressText=Impresi\u00f3n -PrintingDialog.titleAbortingText=Impresi\u00f3n (cancelaci\u00f3n) +PrintingDialog.titleProgressText=Impresi\u00F3n +PrintingDialog.titleAbortingText=Impresi\u00F3n (Abortando) -PrintingDialog.contentInitialText=Impresi\u00f3n en curso... +PrintingDialog.contentInitialText=Impresi\u00F3n en curso... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=P\u00e1gina impresa {0}... +PrintingDialog.contentProgressText=P\u00E1gina impresa {0}... -PrintingDialog.contentAbortingText=Cancelando la impresi\u00f3n... +PrintingDialog.contentAbortingText=Abortando la impresi\u00F3n... -PrintingDialog.abortButtonText=Cancelar -PrintingDialog.abortButtonMnemonic=67 +PrintingDialog.abortButtonText=Abortar +PrintingDialog.abortButtonMnemonic=65 PrintingDialog.abortButtonDisplayedMnemonicIndex=0 -PrintingDialog.abortButtonToolTipText=Cancelar la impresi\u00f3n +PrintingDialog.abortButtonToolTipText=Abortar Impresi\u00F3n ############ Internal Frame Strings ############ InternalFrame.iconButtonToolTip=Minimizar @@ -182,21 +182,21 @@ InternalFrame.closeButtonToolTip=Cerrar ############ Internal Frame Title Pane Strings ############ InternalFrameTitlePane.restoreButtonText=Restaurar InternalFrameTitlePane.moveButtonText=Mover -InternalFrameTitlePane.sizeButtonText=Tama\u00f1o +InternalFrameTitlePane.sizeButtonText=Tama\u00F1o InternalFrameTitlePane.minimizeButtonText=Minimizar InternalFrameTitlePane.maximizeButtonText=Maximizar InternalFrameTitlePane.closeButtonText=Cerrar ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Enviar consulta +FormView.submitButtonText=Enviar Consulta FormView.resetButtonText=Restablecer FormView.browseFileButtonText=Examinar... ############ Abstract Document Strings ############ AbstractDocument.styleChangeText=cambio de estilo -AbstractDocument.additionText=adici\u00f3n -AbstractDocument.deletionText=supresi\u00f3n +AbstractDocument.additionText=agregaci\u00F3n +AbstractDocument.deletionText=supresi\u00F3n AbstractDocument.undoText=Deshacer AbstractDocument.redoText=Rehacer @@ -214,12 +214,12 @@ ComboBox.togglePopupText=togglePopup ProgressMonitor.progressText=Progreso... ############ Split Pane Strings ############ -SplitPane.leftButtonText=bot\u00f3n izquierdo -SplitPane.rightButtonText=bot\u00f3n derecho +SplitPane.leftButtonText=bot\u00F3n izquierdo +SplitPane.rightButtonText=bot\u00F3n derecho # Used for Isindex -IsindexView.prompt=En este \u00edndice se pueden efectuar b\u00fasquedas. Escriba las palabras clave de b\u00fasqueda: +IsindexView.prompt=En este \u00EDndice se pueden efectuar b\u00FAsquedas. Escriba las palabras clave de b\u00FAsqueda: ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=Convertir en icono +InternalFrameTitlePane.iconifyButtonAccessibleName=Convertir en Icono InternalFrameTitlePane.maximizeButtonAccessibleName=Maximizar InternalFrameTitlePane.closeButtonAccessibleName=Cerrar diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties index e2085390876..3f8dc5b7bf0 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_fr.properties @@ -45,90 +45,90 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=Fichier g\u00e9n\u00e9rique -FileChooser.directoryDescriptionText=R\u00e9pertoire -FileChooser.newFolderErrorText=Erreur lors de la cr\u00e9ation du nouveau dossier +FileChooser.fileDescriptionText=Fichier g\u00E9n\u00E9rique +FileChooser.directoryDescriptionText=R\u00E9pertoire +FileChooser.newFolderErrorText=Erreur lors de la cr\u00E9ation du dossier FileChooser.newFolderErrorSeparator= : -FileChooser.newFolderParentDoesntExistTitleText=Impossible de cr\u00e9er le dossier -FileChooser.newFolderParentDoesntExistText=Impossible de cr\u00e9er le dossier.\n\nLe syst\u00e8me ne trouve pas le chemin sp\u00e9cifi\u00e9. -FileChooser.renameErrorTitleText=Erreur lors de la modification du nom du fichier ou du dossier +FileChooser.newFolderParentDoesntExistTitleText=Impossible de cr\u00E9er le dossier +FileChooser.newFolderParentDoesntExistText=Impossible de cr\u00E9er le dossier.\n\nLe syst\u00E8me ne parvient pas \u00E0 trouver le chemin indiqu\u00E9. +FileChooser.renameErrorTitleText=Erreur lors du changement de nom du fichier ou du dossier FileChooser.renameErrorText=Impossible de renommer {0} -FileChooser.renameErrorFileExistsText=Impossible de renommer {0}\u00a0: un fichier portant ce nom existe d\u00e9j\u00e0. Choisissez un nom diff\u00e9rent. +FileChooser.renameErrorFileExistsText=Impossible de renommer {0} : il existe d\u00E9j\u00E0 un fichier portant le nom indiqu\u00E9. Indiquez-en un autre. FileChooser.acceptAllFileFilterText=Tous les fichiers FileChooser.cancelButtonText=Annuler -FileChooser.cancelButtonMnemonic=65 +FileChooser.cancelButtonMnemonic=67 FileChooser.saveButtonText=Enregistrer -FileChooser.saveButtonMnemonic=69 +FileChooser.saveButtonMnemonic=83 FileChooser.openButtonText=Ouvrir FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Enregistrer FileChooser.openDialogTitleText=Ouvrir -FileChooser.updateButtonText=Mise \u00e0 jour -FileChooser.updateButtonMnemonic=77 +FileChooser.updateButtonText=Mettre \u00E0 jour +FileChooser.updateButtonMnemonic=85 FileChooser.helpButtonText=Aide -FileChooser.helpButtonMnemonic=68 +FileChooser.helpButtonMnemonic=72 FileChooser.directoryOpenButtonText=Ouvrir FileChooser.directoryOpenButtonMnemonic=79 # File Size Units -FileChooser.fileSizeKiloBytes={0} Ko -FileChooser.fileSizeMegaBytes={0} Mo -FileChooser.fileSizeGigaBytes={0} Go +FileChooser.fileSizeKiloBytes={0} KB +FileChooser.fileSizeMegaBytes={0} MB +FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. FileChooser.win32.newFolder=Nouveau dossier FileChooser.win32.newFolder.subsequent=Nouveau dossier ({0}) -FileChooser.other.newFolder=Nouveau dossier -FileChooser.other.newFolder.subsequent=Nouveau dossier.{0} +FileChooser.other.newFolder=NewFolder +FileChooser.other.newFolder.subsequent=NewFolder.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=Ferme la bo\u00eete de dialogue du s\u00e9lecteur de fichiers -FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00e9lectionn\u00e9 -FileChooser.openButtonToolTipText=Ouvre le fichier s\u00e9lectionn\u00e9 -FileChooser.updateButtonToolTipText=Met \u00e0 jour la liste des r\u00e9pertoires -FileChooser.helpButtonToolTipText=Aide sur le s\u00e9lecteur de fichiers -FileChooser.directoryOpenButtonToolTipText=Ouvrir le r\u00e9pertoire s\u00e9lectionn\u00e9 +FileChooser.cancelButtonToolTipText=Ferme la bo\u00EEte de dialogue du s\u00E9lecteur de fichiers +FileChooser.saveButtonToolTipText=Enregistre le fichier s\u00E9lectionn\u00E9 +FileChooser.openButtonToolTipText=Ouvre le fichier s\u00E9lectionn\u00E9 +FileChooser.updateButtonToolTipText=Met \u00E0 jour la liste des r\u00E9pertoires +FileChooser.helpButtonToolTipText=Aide du s\u00E9lecteur de fichiers +FileChooser.directoryOpenButtonToolTipText=Ouvre le r\u00E9pertoire s\u00E9lectionn\u00E9 ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=Aper\u00e7u +ColorChooser.previewText=Aper\u00E7u ColorChooser.okText=OK ColorChooser.cancelText=Annuler -ColorChooser.resetText=Restaurer +ColorChooser.resetText=R\u00E9initialiser # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 ColorChooser.sampleText=Echantillon de texte Echantillon de texte ColorChooser.swatchesNameText=Echantillons -ColorChooser.swatchesMnemonic=69 +ColorChooser.swatchesMnemonic=83 ColorChooser.swatchesRecentText=Dernier : # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. -ColorChooser.hsvNameText=HSV +ColorChooser.hsvNameText=TSV ColorChooser.hsvMnemonic=72 ColorChooser.hsvHueText=Teinte ColorChooser.hsvSaturationText=Saturation ColorChooser.hsvValueText=Valeur ColorChooser.hsvTransparencyText=Transparence -ColorChooser.hslNameText=HSL +ColorChooser.hslNameText=TSL ColorChooser.hslMnemonic=76 ColorChooser.hslHueText=Teinte ColorChooser.hslSaturationText=Saturation -ColorChooser.hslLightnessText=Clart\u00e9 +ColorChooser.hslLightnessText=Lumi\u00E8re ColorChooser.hslTransparencyText=Transparence ColorChooser.rgbNameText=RVB -ColorChooser.rgbMnemonic=86 +ColorChooser.rgbMnemonic=71 ColorChooser.rgbRedText=Rouge -ColorChooser.rgbRedMnemonic=71 +ColorChooser.rgbRedMnemonic=68 ColorChooser.rgbGreenText=Vert -ColorChooser.rgbGreenMnemonic=84 +ColorChooser.rgbGreenMnemonic=78 ColorChooser.rgbBlueText=Bleu ColorChooser.rgbBlueMnemonic=66 ColorChooser.rgbAlphaText=Alpha ColorChooser.rgbHexCodeText=Code couleur ColorChooser.rgbHexCodeMnemonic=67 -ColorChooser.cmykNameText=CMYK +ColorChooser.cmykNameText=CMJN ColorChooser.cmykMnemonic=77 ColorChooser.cmykCyanText=Cyan ColorChooser.cmykMagentaText=Magenta @@ -141,30 +141,30 @@ ColorChooser.cmykAlphaText=Alpha # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. OptionPane.yesButtonText=Oui -OptionPane.yesButtonMnemonic=79 +OptionPane.yesButtonMnemonic=89 OptionPane.noButtonText=Non OptionPane.noButtonMnemonic=78 OptionPane.okButtonText=OK OptionPane.okButtonMnemonic=0 OptionPane.cancelButtonText=Annuler OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=S\u00e9lectionnez une option +OptionPane.titleText=S\u00E9lectionner une option # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.inputDialogTitle=Entr\u00e9e +OptionPane.inputDialogTitle=Entr\u00E9e # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. OptionPane.messageDialogTitle=Message ############ Printing Dialog Strings ############ PrintingDialog.titleProgressText=Impression -PrintingDialog.titleAbortingText=Impression (Abandon) +PrintingDialog.titleAbortingText=Impression (abandon) PrintingDialog.contentInitialText=Impression en cours... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=Page imprim\u00e9e {0}... +PrintingDialog.contentProgressText=Page {0} imprim\u00E9e... PrintingDialog.contentAbortingText=Abandon de l'impression... @@ -174,38 +174,38 @@ PrintingDialog.abortButtonDisplayedMnemonicIndex=0 PrintingDialog.abortButtonToolTipText=Abandonner l'impression ############ Internal Frame Strings ############ -InternalFrame.iconButtonToolTip=R\u00e9duire +InternalFrame.iconButtonToolTip=R\u00E9duire InternalFrame.maxButtonToolTip=Agrandir InternalFrame.restoreButtonToolTip=Restaurer InternalFrame.closeButtonToolTip=Fermer ############ Internal Frame Title Pane Strings ############ InternalFrameTitlePane.restoreButtonText=Restaurer -InternalFrameTitlePane.moveButtonText=D\u00e9placer +InternalFrameTitlePane.moveButtonText=D\u00E9placer InternalFrameTitlePane.sizeButtonText=Taille -InternalFrameTitlePane.minimizeButtonText=R\u00e9duire +InternalFrameTitlePane.minimizeButtonText=R\u00E9duire InternalFrameTitlePane.maximizeButtonText=Agrandir InternalFrameTitlePane.closeButtonText=Fermer ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Soumettre la requ\u00eate -FormView.resetButtonText=Restaurer +FormView.submitButtonText=Soumettre la requ\u00EAte +FormView.resetButtonText=R\u00E9initialiser FormView.browseFileButtonText=Parcourir... ############ Abstract Document Strings ############ AbstractDocument.styleChangeText=modification de style AbstractDocument.additionText=ajout AbstractDocument.deletionText=suppression -AbstractDocument.undoText=D\u00e9faire -AbstractDocument.redoText=Refaire +AbstractDocument.undoText=Annuler +AbstractDocument.redoText=R\u00E9tablir ############ Abstract Button Strings ############ -AbstractButton.clickText=cliquez sur +AbstractButton.clickText=cliquer ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=D\u00e9faire -AbstractUndoableEdit.redoText=Refaire +AbstractUndoableEdit.undoText=Annuler +AbstractUndoableEdit.redoText=R\u00E9tablir ############ Combo Box Strings ############ ComboBox.togglePopupText=togglePopup @@ -217,9 +217,9 @@ ProgressMonitor.progressText=Progression... SplitPane.leftButtonText=bouton gauche SplitPane.rightButtonText=bouton droit # Used for Isindex -IsindexView.prompt=Ceci est un index de recherche. Tapez des mots-cl\u00e9s pour la recherche : +IsindexView.prompt=Ceci est un index de recherche. Tapez des mots-cl\u00E9s pour la recherche : ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=R\u00e9duire +InternalFrameTitlePane.iconifyButtonAccessibleName=R\u00E9duire InternalFrameTitlePane.maximizeButtonAccessibleName=Agrandir InternalFrameTitlePane.closeButtonAccessibleName=Fermer diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties index 92b4e643974..da914cbcffe 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_it.properties @@ -50,25 +50,25 @@ FileChooser.directoryDescriptionText=Directory FileChooser.newFolderErrorText=Errore durante la creazione della nuova cartella FileChooser.newFolderErrorSeparator= : FileChooser.newFolderParentDoesntExistTitleText=Impossibile creare la cartella -FileChooser.newFolderParentDoesntExistText=Impossibile creare la cartella.\n\nPercorso specificato non trovato nel sistema. -FileChooser.renameErrorTitleText=Errore di ridenominazione del file o della cartella +FileChooser.newFolderParentDoesntExistText=Impossibile creare la cartella.\n\nIl sistema non \u00E8 in grado di trovare il percorso specificato. +FileChooser.renameErrorTitleText=Errore durante la ridenominazione del file o della cartella FileChooser.renameErrorText=Impossibile rinominare {0} -FileChooser.renameErrorFileExistsText=Impossibile rinominare {0}: esiste gi\u00e0 un file con il nome specificato. Specificare un nome file alternativo. +FileChooser.renameErrorFileExistsText=Impossibile rinominare {0}: esiste gi\u00E0 un file con il nome specificato. Specificare un altro nome. FileChooser.acceptAllFileFilterText=Tutti i file FileChooser.cancelButtonText=Annulla -FileChooser.cancelButtonMnemonic=65 +FileChooser.cancelButtonMnemonic=67 FileChooser.saveButtonText=Salva FileChooser.saveButtonMnemonic=83 FileChooser.openButtonText=Apri -FileChooser.openButtonMnemonic=80 +FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Salva FileChooser.openDialogTitleText=Apri FileChooser.updateButtonText=Aggiorna -FileChooser.updateButtonMnemonic=71 +FileChooser.updateButtonMnemonic=85 FileChooser.helpButtonText=? -FileChooser.helpButtonMnemonic=63 +FileChooser.helpButtonMnemonic=72 FileChooser.directoryOpenButtonText=Apri -FileChooser.directoryOpenButtonMnemonic=82 +FileChooser.directoryOpenButtonMnemonic=79 # File Size Units FileChooser.fileSizeKiloBytes={0} KB @@ -78,28 +78,28 @@ FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. FileChooser.win32.newFolder=Nuova cartella FileChooser.win32.newFolder.subsequent=Nuova cartella ({0}) -FileChooser.other.newFolder=Nuova cartella -FileChooser.other.newFolder.subsequent=Nuova cartella.{0} +FileChooser.other.newFolder=NewFolder +FileChooser.other.newFolder.subsequent=NewFolder.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=Finestra di dialogo Interrompi selezione file -FileChooser.saveButtonToolTipText=Salva file selezionato -FileChooser.openButtonToolTipText=Apri file selezionato -FileChooser.updateButtonToolTipText=Aggiorna elenco directory -FileChooser.helpButtonToolTipText=Guida di Selezione file -FileChooser.directoryOpenButtonToolTipText=Apri directory selezionata +FileChooser.cancelButtonToolTipText=Chiude la finestra di dialogo di selezione file +FileChooser.saveButtonToolTipText=Salva il file selezionato +FileChooser.openButtonToolTipText=Apre il file selezionato +FileChooser.updateButtonToolTipText=Aggiorna la lista directory +FileChooser.helpButtonToolTipText=Guida FileChooser +FileChooser.directoryOpenButtonToolTipText=Apre la directory selezionata ############ COLOR CHOOSER STRINGS ############# ColorChooser.previewText=Anteprima ColorChooser.okText=OK ColorChooser.cancelText=Annulla -ColorChooser.resetText=Ripristina +ColorChooser.resetText=Reimposta # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 ColorChooser.sampleText=Testo di prova Testo di prova ColorChooser.swatchesNameText=Colori campione -ColorChooser.swatchesMnemonic=67 +ColorChooser.swatchesMnemonic=83 ColorChooser.swatchesRecentText=Recenti: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The @@ -107,26 +107,26 @@ ColorChooser.swatchesRecentText=Recenti: # xxxDisplayedMnemonicIndex. ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 -ColorChooser.hsvHueText=Tonalit\u00e0 +ColorChooser.hsvHueText=Tonalit\u00E0 ColorChooser.hsvSaturationText=Saturazione ColorChooser.hsvValueText=Valore ColorChooser.hsvTransparencyText=Trasparenza ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 -ColorChooser.hslHueText=Tonalit\u00e0 +ColorChooser.hslHueText=Tonalit\u00E0 ColorChooser.hslSaturationText=Saturazione -ColorChooser.hslLightnessText=Luminosit\u00e0 +ColorChooser.hslLightnessText=Luminosit\u00E0 ColorChooser.hslTransparencyText=Trasparenza ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 ColorChooser.rgbRedText=Rosso -ColorChooser.rgbRedMnemonic=79 +ColorChooser.rgbRedMnemonic=68 ColorChooser.rgbGreenText=Verde -ColorChooser.rgbGreenMnemonic=69 +ColorChooser.rgbGreenMnemonic=78 ColorChooser.rgbBlueText=Blu ColorChooser.rgbBlueMnemonic=66 ColorChooser.rgbAlphaText=Alfa -ColorChooser.rgbHexCodeText=Codice colore +ColorChooser.rgbHexCodeText=Codice colori ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 @@ -140,14 +140,14 @@ ColorChooser.cmykAlphaText=Alfa # Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=S\u00ec -OptionPane.yesButtonMnemonic=83 +OptionPane.yesButtonText=S\u00EC +OptionPane.yesButtonMnemonic=89 OptionPane.noButtonText=No OptionPane.noButtonMnemonic=78 OptionPane.okButtonText=OK -OptionPane.okButtonMnemonic=79 +OptionPane.okButtonMnemonic=0 OptionPane.cancelButtonText=Annulla -OptionPane.cancelButtonMnemonic=65 +OptionPane.cancelButtonMnemonic=0 OptionPane.titleText=Selezionare una opzione # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. @@ -169,7 +169,7 @@ PrintingDialog.contentProgressText=Pagina stampata {0}... PrintingDialog.contentAbortingText=Interruzione della stampa... PrintingDialog.abortButtonText=Interrompi -PrintingDialog.abortButtonMnemonic=73 +PrintingDialog.abortButtonMnemonic=65 PrintingDialog.abortButtonDisplayedMnemonicIndex=0 PrintingDialog.abortButtonToolTipText=Interrompi la stampa @@ -189,12 +189,12 @@ InternalFrameTitlePane.closeButtonText=Chiudi ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Invia query -FormView.resetButtonText=Ripristina +FormView.submitButtonText=Sottometti query +FormView.resetButtonText=Reimposta FormView.browseFileButtonText=Sfoglia... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=cambiamento di stile +AbstractDocument.styleChangeText=modifica di stile AbstractDocument.additionText=aggiunta AbstractDocument.deletionText=eliminazione AbstractDocument.undoText=Annulla @@ -217,7 +217,7 @@ ProgressMonitor.progressText=Avanzamento... SplitPane.leftButtonText=tasto sinistro SplitPane.rightButtonText=tasto destro # Used for Isindex -IsindexView.prompt=Questo \u00e8 un indice di ricerca. Immettere le parole chiave: +IsindexView.prompt=Questo \u00E8 un indice di ricerca. Immettere le parole chiave: ############ InternalFrameTitlePane Strings ############ InternalFrameTitlePane.iconifyButtonAccessibleName=Riduci a icona diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties index eda6e94917d..bcd333953d9 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ja.properties @@ -45,181 +45,181 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=\u6c4e\u7528\u30d5\u30a1\u30a4\u30eb -FileChooser.directoryDescriptionText=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea -FileChooser.newFolderErrorText=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0\u306e\u4f5c\u6210\u306b\u5931\u6557 +FileChooser.fileDescriptionText=\u6C4E\u7528\u30D5\u30A1\u30A4\u30EB +FileChooser.directoryDescriptionText=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA +FileChooser.newFolderErrorText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210\u30A8\u30E9\u30FC FileChooser.newFolderErrorSeparator= : -FileChooser.newFolderParentDoesntExistTitleText=\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093 -FileChooser.newFolderParentDoesntExistText=\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3002\n\n\u6307\u5b9a\u3055\u308c\u305f\u30d1\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 -FileChooser.renameErrorTitleText=\u30d5\u30a1\u30a4\u30eb\u307e\u305f\u306f\u30d5\u30a9\u30eb\u30c0\u306e\u540d\u524d\u5909\u66f4\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -FileChooser.renameErrorText={0} \u306e\u540d\u524d\u3092\u5909\u66f4\u3067\u304d\u307e\u305b\u3093\u3002 -FileChooser.renameErrorFileExistsText={0} \u306e\u540d\u524d\u3092\u5909\u66f4\u3067\u304d\u307e\u305b\u3093: \u6307\u5b9a\u3055\u308c\u305f\u540d\u524d\u306e\u30d5\u30a1\u30a4\u30eb\u304c\u3059\u3067\u306b\u5b58\u5728\u3057\u3066\u3044\u307e\u3059\u3002\u5225\u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002 -FileChooser.acceptAllFileFilterText=\u3059\u3079\u3066\u306e\u30d5\u30a1\u30a4\u30eb -FileChooser.cancelButtonText=\u53d6\u6d88\u3057 +FileChooser.newFolderParentDoesntExistTitleText=\u30D5\u30A9\u30EB\u30C0\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093 +FileChooser.newFolderParentDoesntExistText=\u30D5\u30A9\u30EB\u30C0\u3092\u4F5C\u6210\u3067\u304D\u307E\u305B\u3093\u3002\n\n\u6307\u5B9A\u3057\u305F\u30D1\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002 +FileChooser.renameErrorTitleText=\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30D5\u30A9\u30EB\u30C0\u306E\u540D\u524D\u5909\u66F4\u30A8\u30E9\u30FC +FileChooser.renameErrorText={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093 +FileChooser.renameErrorFileExistsText={0}\u306E\u540D\u524D\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093: \u6307\u5B9A\u3057\u305F\u540D\u524D\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u3059\u3067\u306B\u5B58\u5728\u3057\u307E\u3059\u3002\u5225\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044\u3002 +FileChooser.acceptAllFileFilterText=\u3059\u3079\u3066\u306E\u30D5\u30A1\u30A4\u30EB +FileChooser.cancelButtonText=\u53D6\u6D88 FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\u4fdd\u5b58 +FileChooser.saveButtonText=\u4FDD\u5B58 FileChooser.saveButtonMnemonic=83 -FileChooser.openButtonText=\u958b\u304f +FileChooser.openButtonText=\u958B\u304F FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\u4fdd\u5b58 -FileChooser.openDialogTitleText=\u958b\u304f -FileChooser.updateButtonText=\u66f4\u65b0(U) +FileChooser.saveDialogTitleText=\u4FDD\u5B58 +FileChooser.openDialogTitleText=\u958B\u304F +FileChooser.updateButtonText=\u66F4\u65B0 FileChooser.updateButtonMnemonic=85 -FileChooser.helpButtonText=\u30d8\u30eb\u30d7(H) +FileChooser.helpButtonText=\u30D8\u30EB\u30D7 FileChooser.helpButtonMnemonic=72 -FileChooser.directoryOpenButtonText=\u958b\u304f +FileChooser.directoryOpenButtonText=\u958B\u304F FileChooser.directoryOpenButtonMnemonic=79 # File Size Units -FileChooser.fileSizeKiloBytes={0} K \u30d0\u30a4\u30c8 -FileChooser.fileSizeMegaBytes={0} M \u30d0\u30a4\u30c8 -FileChooser.fileSizeGigaBytes={0} G \u30d0\u30a4\u30c8 +FileChooser.fileSizeKiloBytes={0} KB +FileChooser.fileSizeMegaBytes={0} MB +FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. -FileChooser.win32.newFolder=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.win32.newFolder.subsequent=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 ({0}) -FileChooser.other.newFolder=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.other.newFolder.subsequent=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0.{0} +FileChooser.win32.newFolder=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.win32.newFolder.subsequent=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0({0}) +FileChooser.other.newFolder=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.other.newFolder.subsequent=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=\u30d5\u30a1\u30a4\u30eb\u30c1\u30e5\u30fc\u30b6\u30c0\u30a4\u30a2\u30ed\u30b0\u3092\u7d42\u4e86 -FileChooser.saveButtonToolTipText=\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u4fdd\u5b58 -FileChooser.openButtonToolTipText=\u9078\u629e\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u304f -FileChooser.updateButtonToolTipText=\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u4e00\u89a7\u3092\u66f4\u65b0 -FileChooser.helpButtonToolTipText=\u30d5\u30a1\u30a4\u30eb\u30c1\u30e5\u30fc\u30b6\u30d8\u30eb\u30d7 -FileChooser.directoryOpenButtonToolTipText=\u9078\u629e\u3057\u305f\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u958b\u304f +FileChooser.cancelButtonToolTipText=\u30D5\u30A1\u30A4\u30EB\u30FB\u30C1\u30E5\u30FC\u30B6\u30FB\u30C0\u30A4\u30A2\u30ED\u30B0\u3092\u7D42\u4E86\u3057\u307E\u3059 +FileChooser.saveButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u4FDD\u5B58\u3057\u307E\u3059 +FileChooser.openButtonToolTipText=\u9078\u629E\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u958B\u304D\u307E\u3059 +FileChooser.updateButtonToolTipText=\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30EA\u30B9\u30C8\u3092\u66F4\u65B0\u3057\u307E\u3059 +FileChooser.helpButtonToolTipText=FileChooser\u306E\u30D8\u30EB\u30D7\u3067\u3059 +FileChooser.directoryOpenButtonToolTipText=\u9078\u629E\u3057\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u3092\u958B\u304D\u307E\u3059 ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=\u30d7\u30ec\u30d3\u30e5\u30fc -ColorChooser.okText=\u4e86\u89e3 -ColorChooser.cancelText=\u53d6\u6d88\u3057 -ColorChooser.resetText=\u30ea\u30bb\u30c3\u30c8(R) +ColorChooser.previewText=\u30D7\u30EC\u30D3\u30E5\u30FC +ColorChooser.okText=OK +ColorChooser.cancelText=\u53D6\u6D88 +ColorChooser.resetText=\u30EA\u30BB\u30C3\u30C8 # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=\u30b5\u30f3\u30d7\u30eb\u30c6\u30ad\u30b9\u30c8 \u30b5\u30f3\u30d7\u30eb\u30c6\u30ad\u30b9\u30c8 -ColorChooser.swatchesNameText=\u30b5\u30f3\u30d7\u30eb(S) +ColorChooser.sampleText=\u30B5\u30F3\u30D7\u30EB\u30FB\u30C6\u30AD\u30B9\u30C8 \u30B5\u30F3\u30D7\u30EB\u30FB\u30C6\u30AD\u30B9\u30C8 +ColorChooser.swatchesNameText=\u30B5\u30F3\u30D7\u30EB ColorChooser.swatchesMnemonic=83 -ColorChooser.swatchesRecentText=\u6700\u65b0: +ColorChooser.swatchesRecentText=\u6700\u65B0: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 -ColorChooser.hsvHueText=\u8272\u5408\u3044 -ColorChooser.hsvSaturationText=\u5f69\u5ea6 +ColorChooser.hsvHueText=\u8272\u76F8 +ColorChooser.hsvSaturationText=\u5F69\u5EA6 ColorChooser.hsvValueText=\u5024 -ColorChooser.hsvTransparencyText=\u900f\u660e\u5ea6 +ColorChooser.hsvTransparencyText=\u900F\u660E\u5EA6 ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 -ColorChooser.hslHueText=\u8272\u5408\u3044 -ColorChooser.hslSaturationText=\u5f69\u5ea6 -ColorChooser.hslLightnessText=\u660e\u5ea6 -ColorChooser.hslTransparencyText=\u900f\u660e\u5ea6 +ColorChooser.hslHueText=\u8272\u76F8 +ColorChooser.hslSaturationText=\u5F69\u5EA6 +ColorChooser.hslLightnessText=\u660E\u5EA6 +ColorChooser.hslTransparencyText=\u900F\u660E\u5EA6 ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 -ColorChooser.rgbRedText=\u8d64(D) +ColorChooser.rgbRedText=\u8D64 ColorChooser.rgbRedMnemonic=68 -ColorChooser.rgbGreenText=\u7dd1(N) +ColorChooser.rgbGreenText=\u7DD1 ColorChooser.rgbGreenMnemonic=78 -ColorChooser.rgbBlueText=\u9752(B) +ColorChooser.rgbBlueText=\u9752 ColorChooser.rgbBlueMnemonic=66 -ColorChooser.rgbAlphaText=\u30a2\u30eb\u30d5\u30a1 -ColorChooser.rgbHexCodeText=\u8272\u30b3\u30fc\u30c9 +ColorChooser.rgbAlphaText=\u30A2\u30EB\u30D5\u30A1 +ColorChooser.rgbHexCodeText=\u8272\u30B3\u30FC\u30C9 ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 -ColorChooser.cmykCyanText=\u30b7\u30a2\u30f3 -ColorChooser.cmykMagentaText=\u30de\u30bc\u30f3\u30c0 -ColorChooser.cmykYellowText=\u9ec4 -ColorChooser.cmykBlackText=\u9ed2 -ColorChooser.cmykAlphaText=\u30a2\u30eb\u30d5\u30a1 +ColorChooser.cmykCyanText=\u30B7\u30A2\u30F3 +ColorChooser.cmykMagentaText=\u30DE\u30BC\u30F3\u30BF +ColorChooser.cmykYellowText=\u9EC4 +ColorChooser.cmykBlackText=\u9ED2 +ColorChooser.cmykAlphaText=\u30A2\u30EB\u30D5\u30A1 ############ OPTION PANE STRINGS ############# # Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=\u306f\u3044(Y) +OptionPane.yesButtonText=\u306F\u3044 OptionPane.yesButtonMnemonic=89 -OptionPane.noButtonText=\u3044\u3044\u3048(N) +OptionPane.noButtonText=\u3044\u3044\u3048 OptionPane.noButtonMnemonic=78 -OptionPane.okButtonText=\u4e86\u89e3 +OptionPane.okButtonText=OK OptionPane.okButtonMnemonic=0 -OptionPane.cancelButtonText=\u53d6\u6d88\u3057 +OptionPane.cancelButtonText=\u53D6\u6D88 OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u9078\u629e +OptionPane.titleText=\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u9078\u629E # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.inputDialogTitle=\u5165\u529b +OptionPane.inputDialogTitle=\u5165\u529B # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.messageDialogTitle=\u30e1\u30c3\u30bb\u30fc\u30b8 +OptionPane.messageDialogTitle=\u30E1\u30C3\u30BB\u30FC\u30B8 ############ Printing Dialog Strings ############ -PrintingDialog.titleProgressText=\u5370\u5237\u3057\u3066\u3044\u307e\u3059 -PrintingDialog.titleAbortingText=\u5370\u5237\u3092\u4e2d\u6b62\u3057\u3066\u3044\u307e\u3059 +PrintingDialog.titleProgressText=\u5370\u5237\u3057\u3066\u3044\u307E\u3059 +PrintingDialog.titleAbortingText=\u5370\u5237\u3092\u4E2D\u6B62\u3057\u3066\u3044\u307E\u3059 -PrintingDialog.contentInitialText=\u5370\u5237\u4e2d... +PrintingDialog.contentInitialText=\u5370\u5237\u4E2D... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=\u30da\u30fc\u30b8 {0} \u3092\u5370\u5237\u3057\u307e\u3057\u305f... +PrintingDialog.contentProgressText=\u30DA\u30FC\u30B8{0}\u3092\u5370\u5237\u3057\u307E\u3057\u305F... -PrintingDialog.contentAbortingText=\u5370\u5237\u3092\u4e2d\u6b62\u3057\u3066\u3044\u307e\u3059... +PrintingDialog.contentAbortingText=\u5370\u5237\u3092\u4E2D\u6B62\u3057\u3066\u3044\u307E\u3059... -PrintingDialog.abortButtonText=\u4e2d\u6b62(A) +PrintingDialog.abortButtonText=\u4E2D\u6B62 PrintingDialog.abortButtonMnemonic=65 PrintingDialog.abortButtonDisplayedMnemonicIndex=0 -PrintingDialog.abortButtonToolTipText=\u5370\u5237\u306e\u4e2d\u6b62 +PrintingDialog.abortButtonToolTipText=\u5370\u5237\u306E\u4E2D\u6B62 ############ Internal Frame Strings ############ -InternalFrame.iconButtonToolTip=\u30a2\u30a4\u30b3\u30f3\u5316 -InternalFrame.maxButtonToolTip=\u6700\u5927\u8868\u793a -InternalFrame.restoreButtonToolTip=\u5fa9\u5143 -InternalFrame.closeButtonToolTip=\u9589\u3058\u308b +InternalFrame.iconButtonToolTip=\u6700\u5C0F\u5316 +InternalFrame.maxButtonToolTip=\u6700\u5927\u5316 +InternalFrame.restoreButtonToolTip=\u5FA9\u5143 +InternalFrame.closeButtonToolTip=\u9589\u3058\u308B ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButtonText=\u5fa9\u5143 -InternalFrameTitlePane.moveButtonText=\u79fb\u52d5 -InternalFrameTitlePane.sizeButtonText=\u30b5\u30a4\u30ba -InternalFrameTitlePane.minimizeButtonText=\u6700\u5c0f\u5316 +InternalFrameTitlePane.restoreButtonText=\u5FA9\u5143 +InternalFrameTitlePane.moveButtonText=\u79FB\u52D5 +InternalFrameTitlePane.sizeButtonText=\u30B5\u30A4\u30BA +InternalFrameTitlePane.minimizeButtonText=\u6700\u5C0F\u5316 InternalFrameTitlePane.maximizeButtonText=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButtonText=\u9589\u3058\u308b +InternalFrameTitlePane.closeButtonText=\u9589\u3058\u308B ############ Text strings ############# # Used for html forms -FormView.submitButtonText=\u554f\u3044\u5408\u308f\u305b\u306e\u5b9f\u884c -FormView.resetButtonText=\u30ea\u30bb\u30c3\u30c8 -FormView.browseFileButtonText=\u53c2\u7167... +FormView.submitButtonText=\u554F\u5408\u305B\u306E\u5B9F\u884C +FormView.resetButtonText=\u30EA\u30BB\u30C3\u30C8 +FormView.browseFileButtonText=\u53C2\u7167... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=\u30b9\u30bf\u30a4\u30eb\u5909\u66f4 -AbstractDocument.additionText=\u8ffd\u52a0 -AbstractDocument.deletionText=\u524a\u9664 -AbstractDocument.undoText=\u5143\u306b\u623b\u3059 -AbstractDocument.redoText=\u518d\u5b9f\u884c +AbstractDocument.styleChangeText=\u30B9\u30BF\u30A4\u30EB\u5909\u66F4 +AbstractDocument.additionText=\u8FFD\u52A0 +AbstractDocument.deletionText=\u524A\u9664 +AbstractDocument.undoText=\u5143\u306B\u623B\u3059 +AbstractDocument.redoText=\u3084\u308A\u76F4\u3057 ############ Abstract Button Strings ############ -AbstractButton.clickText=\u30af\u30ea\u30c3\u30af +AbstractButton.clickText=\u30AF\u30EA\u30C3\u30AF ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=\u5143\u306b\u623b\u3059 -AbstractUndoableEdit.redoText=\u518d\u5b9f\u884c +AbstractUndoableEdit.undoText=\u5143\u306B\u623B\u3059 +AbstractUndoableEdit.redoText=\u3084\u308A\u76F4\u3057 ############ Combo Box Strings ############ -ComboBox.togglePopupText=\u30c8\u30b0\u30eb\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7 +ComboBox.togglePopupText=\u30C8\u30B0\u30EB\u30FB\u30DD\u30C3\u30D7\u30A2\u30C3\u30D7 ############ Progress Monitor Strings ############ -ProgressMonitor.progressText=\u9032\u884c\u4e2d... +ProgressMonitor.progressText=\u9032\u884C\u4E2D... ############ Split Pane Strings ############ -SplitPane.leftButtonText=\u5de6\u30dc\u30bf\u30f3 -SplitPane.rightButtonText=\u53f3\u30dc\u30bf\u30f3 +SplitPane.leftButtonText=\u5DE6\u30DC\u30BF\u30F3 +SplitPane.rightButtonText=\u53F3\u30DC\u30BF\u30F3 # Used for Isindex -IsindexView.prompt=\u691c\u7d22\u7528\u306e\u7d22\u5f15\u3067\u3059\u3002\u691c\u7d22\u3059\u308b\u30ad\u30fc\u30ef\u30fc\u30c9\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044: +IsindexView.prompt=\u691C\u7D22\u7528\u306E\u7D22\u5F15\u3067\u3059\u3002\u691C\u7D22\u3059\u308B\u30AD\u30FC\u30EF\u30FC\u30C9\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044: ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=\u6700\u5c0f\u5316 +InternalFrameTitlePane.iconifyButtonAccessibleName=\u30A2\u30A4\u30B3\u30F3\u5316 InternalFrameTitlePane.maximizeButtonAccessibleName=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButtonAccessibleName=\u9589\u3058\u308b +InternalFrameTitlePane.closeButtonAccessibleName=\u9589\u3058\u308B diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties index 7df1dbc402d..a377f13d0b9 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_ko.properties @@ -45,181 +45,181 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=\uc77c\ubc18 \ud30c\uc77c -FileChooser.directoryDescriptionText=\ub514\ub809\ud1a0\ub9ac -FileChooser.newFolderErrorText=\uc0c8 \ud3f4\ub354 \uc791\uc131 \uc624\ub958 +FileChooser.fileDescriptionText=\uC77C\uBC18 \uD30C\uC77C +FileChooser.directoryDescriptionText=\uB514\uB809\uD1A0\uB9AC +FileChooser.newFolderErrorText=\uC0C8 \uD3F4\uB354\uB97C \uC0DD\uC131\uD558\uB294 \uC911 \uC624\uB958\uAC00 \uBC1C\uC0DD\uD588\uC2B5\uB2C8\uB2E4. FileChooser.newFolderErrorSeparator= : -FileChooser.newFolderParentDoesntExistTitleText=\ud3f4\ub354\ub97c \ub9cc\ub4e4 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -FileChooser.newFolderParentDoesntExistText=\ud3f4\ub354\ub97c \ub9cc\ub4e4 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4.\n\n\uc2dc\uc2a4\ud15c\uc5d0\uc11c \uc9c0\uc815\ud55c \uacbd\ub85c\ub97c \ucc3e\uc744 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -FileChooser.renameErrorTitleText=\ud30c\uc77c \ub610\ub294 \ud3f4\ub354 \uc774\ub984 \ubc14\uafb8\uae30 \uc624\ub958 -FileChooser.renameErrorText={0}\uc758 \uc774\ub984\uc744 \ubc14\uafc0 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. -FileChooser.renameErrorFileExistsText={0}\uc758 \uc774\ub984\uc744 \ubc14\uafc0 \uc218 \uc5c6\uc2b5\ub2c8\ub2e4. \uc9c0\uc815\ud55c \uc774\ub984\uc758 \ud30c\uc77c\uc774 \uc774\ubbf8 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\ub978 \ud30c\uc77c \uc774\ub984\uc744 \uc9c0\uc815\ud558\uc2ed\uc2dc\uc624. -FileChooser.acceptAllFileFilterText=\ubaa8\ub4e0 \ud30c\uc77c -FileChooser.cancelButtonText=\ucde8\uc18c +FileChooser.newFolderParentDoesntExistTitleText=\uD3F4\uB354\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC74C +FileChooser.newFolderParentDoesntExistText=\uD3F4\uB354\uB97C \uC0DD\uC131\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.\n\n\uC2DC\uC2A4\uD15C\uC5D0\uC11C \uC9C0\uC815\uB41C \uACBD\uB85C\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +FileChooser.renameErrorTitleText=\uD30C\uC77C \uB610\uB294 \uD3F4\uB354 \uC774\uB984 \uBC14\uAFB8\uB294 \uC911 \uC624\uB958 \uBC1C\uC0DD +FileChooser.renameErrorText={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +FileChooser.renameErrorFileExistsText={0}\uC758 \uC774\uB984\uC744 \uBC14\uAFC0 \uC218 \uC5C6\uC74C: \uC9C0\uC815\uD55C \uC774\uB984\uC744 \uC0AC\uC6A9\uD558\uB294 \uD30C\uC77C\uC774 \uC874\uC7AC\uD569\uB2C8\uB2E4. \uB2E4\uB978 \uD30C\uC77C \uC774\uB984\uC744 \uC9C0\uC815\uD558\uC2ED\uC2DC\uC624. +FileChooser.acceptAllFileFilterText=\uBAA8\uB4E0 \uD30C\uC77C +FileChooser.cancelButtonText=\uCDE8\uC18C FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\uc800\uc7a5 +FileChooser.saveButtonText=\uC800\uC7A5 FileChooser.saveButtonMnemonic=83 -FileChooser.openButtonText=\uc5f4\uae30 +FileChooser.openButtonText=\uC5F4\uAE30 FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\uc800\uc7a5 -FileChooser.openDialogTitleText=\uc5f4\uae30 -FileChooser.updateButtonText=\uc5c5\ub370\uc774\ud2b8(U) +FileChooser.saveDialogTitleText=\uC800\uC7A5 +FileChooser.openDialogTitleText=\uC5F4\uAE30 +FileChooser.updateButtonText=\uAC31\uC2E0 FileChooser.updateButtonMnemonic=85 -FileChooser.helpButtonText=\ub3c4\uc6c0\ub9d0(H) +FileChooser.helpButtonText=\uB3C4\uC6C0\uB9D0 FileChooser.helpButtonMnemonic=72 -FileChooser.directoryOpenButtonText=\uc5f4\uae30 +FileChooser.directoryOpenButtonText=\uC5F4\uAE30 FileChooser.directoryOpenButtonMnemonic=79 # File Size Units -FileChooser.fileSizeKiloBytes={0}KB -FileChooser.fileSizeMegaBytes={0}MB -FileChooser.fileSizeGigaBytes={0}GB +FileChooser.fileSizeKiloBytes={0} KB +FileChooser.fileSizeMegaBytes={0} MB +FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. -FileChooser.win32.newFolder=\uc0c8 \ud3f4\ub354 -FileChooser.win32.newFolder.subsequent=\uc0c8 \ud3f4\ub354 ({0}) -FileChooser.other.newFolder=\uc0c8 \ud3f4\ub354 -FileChooser.other.newFolder.subsequent=\uc0c8 \ud3f4\ub354.{0} +FileChooser.win32.newFolder=\uC0C8 \uD3F4\uB354 +FileChooser.win32.newFolder.subsequent=\uC0C8 \uD3F4\uB354({0}) +FileChooser.other.newFolder=NewFolder +FileChooser.other.newFolder.subsequent=NewFolder.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=\ud30c\uc77c \uc120\ud0dd \ub300\ud654 \uc0c1\uc790 \uc911\uc9c0 -FileChooser.saveButtonToolTipText=\uc120\ud0dd\ub41c \ud30c\uc77c \uc800\uc7a5 -FileChooser.openButtonToolTipText=\uc120\ud0dd\ub41c \ud30c\uc77c \uc5f4\uae30 -FileChooser.updateButtonToolTipText=\ub514\ub809\ud1a0\ub9ac \ubaa9\ub85d \uc5c5\ub370\uc774\ud2b8 -FileChooser.helpButtonToolTipText=FileChooser \ub3c4\uc6c0\ub9d0 -FileChooser.directoryOpenButtonToolTipText=\uc120\ud0dd\ub41c \ub514\ub809\ud1a0\ub9ac \uc5f4\uae30 +FileChooser.cancelButtonToolTipText=\uD30C\uC77C \uC120\uD0DD\uAE30 \uB300\uD654\uC0C1\uC790 \uC911\uB2E8 +FileChooser.saveButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C \uC800\uC7A5 +FileChooser.openButtonToolTipText=\uC120\uD0DD\uB41C \uD30C\uC77C \uC5F4\uAE30 +FileChooser.updateButtonToolTipText=\uB514\uB809\uD1A0\uB9AC \uBAA9\uB85D \uAC31\uC2E0 +FileChooser.helpButtonToolTipText=FileChooser \uB3C4\uC6C0\uB9D0 +FileChooser.directoryOpenButtonToolTipText=\uC120\uD0DD\uB41C \uB514\uB809\uD1A0\uB9AC \uC5F4\uAE30 ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=\ubbf8\ub9ac\ubcf4\uae30 -ColorChooser.okText=\ud655\uc778 -ColorChooser.cancelText=\ucde8\uc18c -ColorChooser.resetText=\uc7ac\uc124\uc815(R) +ColorChooser.previewText=\uBBF8\uB9AC\uBCF4\uAE30 +ColorChooser.okText=\uD655\uC778 +ColorChooser.cancelText=\uCDE8\uC18C +ColorChooser.resetText=\uC7AC\uC124\uC815 # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=\uc0d8\ud50c \ud14d\uc2a4\ud2b8 \uc0d8\ud50c \ud14d\uc2a4\ud2b8 -ColorChooser.swatchesNameText=\uacac\ubcf8(S) +ColorChooser.sampleText=\uC0D8\uD50C \uD14D\uC2A4\uD2B8 \uC0D8\uD50C \uD14D\uC2A4\uD2B8 +ColorChooser.swatchesNameText=\uACAC\uBCF8 ColorChooser.swatchesMnemonic=83 -ColorChooser.swatchesRecentText=\ucd5c\uadfc \ubaa9\ub85d: +ColorChooser.swatchesRecentText=\uCD5C\uADFC \uBAA9\uB85D: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 -ColorChooser.hsvHueText=\uc0c9\uc0c1 -ColorChooser.hsvSaturationText=\ucc44\ub3c4 -ColorChooser.hsvValueText=\uac12 -ColorChooser.hsvTransparencyText=\ud22c\uba85\ub3c4 +ColorChooser.hsvHueText=\uC0C9\uC870 +ColorChooser.hsvSaturationText=\uCC44\uB3C4 +ColorChooser.hsvValueText=\uAC12 +ColorChooser.hsvTransparencyText=\uD22C\uBA85 ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 -ColorChooser.hslHueText=\uc0c9\uc0c1 -ColorChooser.hslSaturationText=\ucc44\ub3c4 -ColorChooser.hslLightnessText=\ubc1d\uae30 -ColorChooser.hslTransparencyText=\ud22c\uba85\ub3c4 +ColorChooser.hslHueText=\uC0C9\uC870 +ColorChooser.hslSaturationText=\uCC44\uB3C4 +ColorChooser.hslLightnessText=\uBC1D\uAE30 +ColorChooser.hslTransparencyText=\uD22C\uBA85 ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 -ColorChooser.rgbRedText=\ube68\uac04\uc0c9(D) +ColorChooser.rgbRedText=\uBE68\uAC04\uC0C9 ColorChooser.rgbRedMnemonic=68 -ColorChooser.rgbGreenText=\ub179\uc0c9(N) +ColorChooser.rgbGreenText=\uB179\uC0C9 ColorChooser.rgbGreenMnemonic=78 -ColorChooser.rgbBlueText=\ud30c\ub780\uc0c9(B) +ColorChooser.rgbBlueText=\uD30C\uB780\uC0C9 ColorChooser.rgbBlueMnemonic=66 -ColorChooser.rgbAlphaText=\uc54c\ud30c -ColorChooser.rgbHexCodeText=\uceec\ub7ec \ucf54\ub4dc +ColorChooser.rgbAlphaText=\uC54C\uD30C +ColorChooser.rgbHexCodeText=\uC0C9\uC0C1 \uCF54\uB4DC ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 -ColorChooser.cmykCyanText=\uccad\ub85d\uc0c9 -ColorChooser.cmykMagentaText=\uc790\ud64d\uc0c9 -ColorChooser.cmykYellowText=\ub178\ub780\uc0c9 -ColorChooser.cmykBlackText=\ud751\uc0c9 -ColorChooser.cmykAlphaText=\uc54c\ud30c +ColorChooser.cmykCyanText=\uCCAD\uB85D\uC0C9 +ColorChooser.cmykMagentaText=\uC9C4\uD64D\uC0C9 +ColorChooser.cmykYellowText=\uB178\uB780\uC0C9 +ColorChooser.cmykBlackText=\uAC80\uC815\uC0C9 +ColorChooser.cmykAlphaText=\uC54C\uD30C ############ OPTION PANE STRINGS ############# # Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=\uc608(Y) +OptionPane.yesButtonText=\uC608 OptionPane.yesButtonMnemonic=89 -OptionPane.noButtonText=\uc544\ub2c8\uc624(N) +OptionPane.noButtonText=\uC544\uB2C8\uC624 OptionPane.noButtonMnemonic=78 -OptionPane.okButtonText=\ud655\uc778 +OptionPane.okButtonText=\uD655\uC778 OptionPane.okButtonMnemonic=0 -OptionPane.cancelButtonText=\ucde8\uc18c +OptionPane.cancelButtonText=\uCDE8\uC18C OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=\uc635\uc158 \uc120\ud0dd +OptionPane.titleText=\uC635\uC158 \uC120\uD0DD # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.inputDialogTitle=\uc785\ub825 +OptionPane.inputDialogTitle=\uC785\uB825 # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.messageDialogTitle=\uba54\uc2dc\uc9c0 +OptionPane.messageDialogTitle=\uBA54\uC2DC\uC9C0 ############ Printing Dialog Strings ############ -PrintingDialog.titleProgressText=\uc778\uc1c4 -PrintingDialog.titleAbortingText=\uc778\uc1c4 (\uc911\uc9c0) +PrintingDialog.titleProgressText=\uC778\uC1C4 +PrintingDialog.titleAbortingText=\uC778\uC1C4(\uC911\uB2E8 \uC911) -PrintingDialog.contentInitialText=\uc778\uc1c4 \uc9c4\ud589 \uc911... +PrintingDialog.contentInitialText=\uC778\uC1C4 \uC9C4\uD589 \uC911... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=\uc778\uc1c4\ub41c \ud398\uc774\uc9c0 {0}... +PrintingDialog.contentProgressText=\uC778\uC1C4\uB41C \uD398\uC774\uC9C0 {0}... -PrintingDialog.contentAbortingText=\uc778\uc1c4 \uc911\uc9c0... +PrintingDialog.contentAbortingText=\uC778\uC1C4 \uC911\uB2E8 \uC911... -PrintingDialog.abortButtonText=\uc911\uc9c0(A) +PrintingDialog.abortButtonText=\uC911\uB2E8 PrintingDialog.abortButtonMnemonic=65 PrintingDialog.abortButtonDisplayedMnemonicIndex=0 -PrintingDialog.abortButtonToolTipText=\uc778\uc1c4 \uc911\uc9c0 +PrintingDialog.abortButtonToolTipText=\uC778\uC1C4 \uC911\uB2E8 ############ Internal Frame Strings ############ -InternalFrame.iconButtonToolTip=\ucd5c\uc18c\ud654 -InternalFrame.maxButtonToolTip=\ucd5c\ub300\ud654 -InternalFrame.restoreButtonToolTip=\ubcf5\uc6d0 -InternalFrame.closeButtonToolTip=\ub2eb\uae30 +InternalFrame.iconButtonToolTip=\uCD5C\uC18C\uD654 +InternalFrame.maxButtonToolTip=\uCD5C\uB300\uD654 +InternalFrame.restoreButtonToolTip=\uBCF5\uC6D0 +InternalFrame.closeButtonToolTip=\uB2EB\uAE30 ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButtonText=\ubcf5\uc6d0 -InternalFrameTitlePane.moveButtonText=\uc774\ub3d9 -InternalFrameTitlePane.sizeButtonText=\ud06c\uae30 -InternalFrameTitlePane.minimizeButtonText=\ucd5c\uc18c\ud654 -InternalFrameTitlePane.maximizeButtonText=\ucd5c\ub300\ud654 -InternalFrameTitlePane.closeButtonText=\ub2eb\uae30 +InternalFrameTitlePane.restoreButtonText=\uBCF5\uC6D0 +InternalFrameTitlePane.moveButtonText=\uC774\uB3D9 +InternalFrameTitlePane.sizeButtonText=\uD06C\uAE30 +InternalFrameTitlePane.minimizeButtonText=\uCD5C\uC18C\uD654 +InternalFrameTitlePane.maximizeButtonText=\uCD5C\uB300\uD654 +InternalFrameTitlePane.closeButtonText=\uB2EB\uAE30 ############ Text strings ############# # Used for html forms -FormView.submitButtonText=\uc9c8\uc758 \uc81c\ucd9c -FormView.resetButtonText=\uc7ac\uc124\uc815 -FormView.browseFileButtonText=\ucc3e\uc544\ubcf4\uae30... +FormView.submitButtonText=\uC9C8\uC758 \uC81C\uCD9C +FormView.resetButtonText=\uC7AC\uC124\uC815 +FormView.browseFileButtonText=\uCC3E\uC544\uBCF4\uAE30... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=\uc2a4\ud0c0\uc77c \ubcc0\uacbd -AbstractDocument.additionText=\ucd94\uac00 -AbstractDocument.deletionText=\uc0ad\uc81c -AbstractDocument.undoText=\uc2e4\ud589 \ucde8\uc18c -AbstractDocument.redoText=\uc7ac\uc2e4\ud589 +AbstractDocument.styleChangeText=\uC2A4\uD0C0\uC77C \uBCC0\uACBD +AbstractDocument.additionText=\uCD94\uAC00 +AbstractDocument.deletionText=\uC0AD\uC81C +AbstractDocument.undoText=\uC2E4\uD589 \uCDE8\uC18C +AbstractDocument.redoText=\uC7AC\uC2E4\uD589 ############ Abstract Button Strings ############ -AbstractButton.clickText=\ub204\ub974\uae30 +AbstractButton.clickText=\uB204\uB974\uAE30 ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=\uc2e4\ud589 \ucde8\uc18c -AbstractUndoableEdit.redoText=\uc7ac\uc2e4\ud589 +AbstractUndoableEdit.undoText=\uC2E4\uD589 \uCDE8\uC18C +AbstractUndoableEdit.redoText=\uC7AC\uC2E4\uD589 ############ Combo Box Strings ############ -ComboBox.togglePopupText=\ud1a0\uae00\ud31d\uc5c5 +ComboBox.togglePopupText=togglePopup ############ Progress Monitor Strings ############ -ProgressMonitor.progressText=\uc9c4\ud589... +ProgressMonitor.progressText=\uC9C4\uD589... ############ Split Pane Strings ############ -SplitPane.leftButtonText=\uc67c\ucabd \ubc84\ud2bc -SplitPane.rightButtonText=\uc624\ub978\ucabd \ubc84\ud2bc +SplitPane.leftButtonText=\uC67C\uCABD \uB2E8\uCD94 +SplitPane.rightButtonText=\uC624\uB978\uCABD \uB2E8\uCD94 # Used for Isindex -IsindexView.prompt=\ub2e4\uc74c\uc740 \uac80\uc0c9 \uac00\ub2a5\ud55c \uc778\ub371\uc2a4\uc785\ub2c8\ub2e4. \uac80\uc0c9 \ud0a4\uc6cc\ub4dc\ub97c \uc785\ub825\ud558\uc2ed\uc2dc\uc624: +IsindexView.prompt=\uB2E4\uC74C\uC740 \uAC80\uC0C9 \uAC00\uB2A5\uD55C \uC778\uB371\uC2A4\uC785\uB2C8\uB2E4. \uAC80\uC0C9 \uD0A4\uC6CC\uB4DC \uC785\uB825: ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=\uc544\uc774\ucf58\ud654 -InternalFrameTitlePane.maximizeButtonAccessibleName=\ucd5c\ub300\ud654 -InternalFrameTitlePane.closeButtonAccessibleName=\ub2eb\uae30 +InternalFrameTitlePane.iconifyButtonAccessibleName=\uC544\uC774\uCF58\uD654 +InternalFrameTitlePane.maximizeButtonAccessibleName=\uCD5C\uB300\uD654 +InternalFrameTitlePane.closeButtonAccessibleName=\uB2EB\uAE30 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties index 26a70452c0a..c03c8d523f3 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_pt_BR.properties @@ -45,11 +45,16 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=Arquivo gen\u00e9rico -FileChooser.directoryDescriptionText=Diret\u00f3rio +FileChooser.fileDescriptionText=Arquivo Gen\u00E9rico +FileChooser.directoryDescriptionText=Diret\u00F3rio FileChooser.newFolderErrorText=Erro ao criar nova pasta FileChooser.newFolderErrorSeparator= : -FileChooser.acceptAllFileFilterText=Todos os arquivos +FileChooser.newFolderParentDoesntExistTitleText=N\u00E3o \u00E9 poss\u00EDvel criar a pasta +FileChooser.newFolderParentDoesntExistText=N\u00E3o \u00E9 poss\u00EDvel criar a pasta.\n\nO sistema n\u00E3o pode localizar o caminho especificado. +FileChooser.renameErrorTitleText=Erro ao Renomear o Arquivo ou a Pasta +FileChooser.renameErrorText=N\u00E3o \u00E9 poss\u00EDvel renomear {0} +FileChooser.renameErrorFileExistsText=N\u00E3o \u00E9 poss\u00EDvel renomear {0}: Um arquivo com o nome especificado j\u00E1 existe. Especifique outro nome de arquivo. +FileChooser.acceptAllFileFilterText=Todos os Arquivos FileChooser.cancelButtonText=Cancelar FileChooser.cancelButtonMnemonic=67 FileChooser.saveButtonText=Salvar @@ -71,19 +76,19 @@ FileChooser.fileSizeMegaBytes={0} MB FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. -FileChooser.win32.newFolder=Nova pasta -FileChooser.win32.newFolder.subsequent=Nova pasta ({0}) +FileChooser.win32.newFolder=Nova Pasta +FileChooser.win32.newFolder.subsequent=Nova Pasta ({0}) FileChooser.other.newFolder=NewFolder FileChooser.other.newFolder.subsequent=NewFolder.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=Anular caixa de di\u00e1logo do seletor de arquivos +FileChooser.cancelButtonToolTipText=Abortar caixa de di\u00E1logo do seletor de arquivos FileChooser.saveButtonToolTipText=Salvar arquivo selecionado FileChooser.openButtonToolTipText=Abrir arquivo selecionado -FileChooser.updateButtonToolTipText=Atualizar lista de diret\u00f3rios +FileChooser.updateButtonToolTipText=Atualizar lista de diret\u00F3rios FileChooser.helpButtonToolTipText=Ajuda do FileChooser -FileChooser.directoryOpenButtonToolTipText=Abrir diret\u00f3rio selecionado +FileChooser.directoryOpenButtonToolTipText=Abrir diret\u00F3rio selecionado ############ COLOR CHOOSER STRINGS ############# ColorChooser.previewText=Visualizar @@ -92,33 +97,44 @@ ColorChooser.cancelText=Cancelar ColorChooser.resetText=Redefinir # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=Texto de amostra Texto de amostra +ColorChooser.sampleText=Texto de Amostra Texto de Amostra ColorChooser.swatchesNameText=Amostras ColorChooser.swatchesMnemonic=83 -ColorChooser.swatchesDisplayedMnemonicIndex=0 ColorChooser.swatchesRecentText=Recente: -ColorChooser.hsbNameText=HSB # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. -ColorChooser.hsbMnemonic=72 -ColorChooser.hsbDisplayedMnemonicIndex=0 -ColorChooser.hsbHueText=H -ColorChooser.hsbSaturationText=S -ColorChooser.hsbBrightnessText=B -ColorChooser.hsbRedText=R -ColorChooser.hsbGreenText=G -ColorChooser.hsbBlueText=B +ColorChooser.hsvNameText=HSV +ColorChooser.hsvMnemonic=72 +ColorChooser.hsvHueText=Matiz +ColorChooser.hsvSaturationText=Satura\u00E7\u00E3o +ColorChooser.hsvValueText=Valor +ColorChooser.hsvTransparencyText=Transpar\u00EAncia +ColorChooser.hslNameText=HSL +ColorChooser.hslMnemonic=76 +ColorChooser.hslHueText=Matiz +ColorChooser.hslSaturationText=Satura\u00E7\u00E3o +ColorChooser.hslLightnessText=Clareza +ColorChooser.hslTransparencyText=Transpar\u00EAncia ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 -ColorChooser.rgbDisplayedMnemonicIndex=1 ColorChooser.rgbRedText=Vermelho ColorChooser.rgbRedMnemonic=68 ColorChooser.rgbGreenText=Verde ColorChooser.rgbGreenMnemonic=78 ColorChooser.rgbBlueText=Azul ColorChooser.rgbBlueMnemonic=66 +ColorChooser.rgbAlphaText=Alfa +ColorChooser.rgbHexCodeText=C\u00F3digo da Cor +ColorChooser.rgbHexCodeMnemonic=67 +ColorChooser.cmykNameText=CMYK +ColorChooser.cmykMnemonic=77 +ColorChooser.cmykCyanText=Ciano +ColorChooser.cmykMagentaText=Magenta +ColorChooser.cmykYellowText=Amarelo +ColorChooser.cmykBlackText=Preto +ColorChooser.cmykAlphaText=Alfa ############ OPTION PANE STRINGS ############# # Mnemonic keys correspond to KeyEvent.VK_XXX constant @@ -126,13 +142,13 @@ ColorChooser.rgbBlueMnemonic=66 # define mnemonics for any of the buttons. OptionPane.yesButtonText=Sim OptionPane.yesButtonMnemonic=89 -OptionPane.noButtonText=N\u00e3o +OptionPane.noButtonText=N\u00E3o OptionPane.noButtonMnemonic=78 OptionPane.okButtonText=OK OptionPane.okButtonMnemonic=0 OptionPane.cancelButtonText=Cancelar OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=Selecionar uma op\u00e7\u00e3o +OptionPane.titleText=Selecionar uma Op\u00E7\u00E3o # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. OptionPane.inputDialogTitle=Entrada @@ -141,21 +157,21 @@ OptionPane.inputDialogTitle=Entrada OptionPane.messageDialogTitle=Mensagem ############ Printing Dialog Strings ############ -PrintingDialog.titleProgressText=Impress\u00e3o -PrintingDialog.titleAbortingText=Impress\u00e3o (Anulando) +PrintingDialog.titleProgressText=Impress\u00E3o +PrintingDialog.titleAbortingText=Impress\u00E3o (Abortando) -PrintingDialog.contentInitialText=Impress\u00e3o em andamento... +PrintingDialog.contentInitialText=Impress\u00E3o em andamento... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=P\u00e1gina imprimida {0}... +PrintingDialog.contentProgressText=P\u00E1gina impressa {0}... -PrintingDialog.contentAbortingText=Anulando impress\u00e3o... +PrintingDialog.contentAbortingText=Abortando impress\u00E3o... -PrintingDialog.abortButtonText=Anular +PrintingDialog.abortButtonText=Abortar PrintingDialog.abortButtonMnemonic=65 PrintingDialog.abortButtonDisplayedMnemonicIndex=0 -PrintingDialog.abortButtonToolTipText=Anular impress\u00e3o +PrintingDialog.abortButtonToolTipText=Abortar Impress\u00E3o ############ Internal Frame Strings ############ InternalFrame.iconButtonToolTip=Minimizar @@ -173,14 +189,14 @@ InternalFrameTitlePane.closeButtonText=Fechar ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Enviar consulta +FormView.submitButtonText=Submeter Consulta FormView.resetButtonText=Redefinir -FormView.browseFileButtonText=Explorar... +FormView.browseFileButtonText=Procurar... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=altera\u00e7\u00e3o de estilo -AbstractDocument.additionText=adi\u00e7\u00e3o -AbstractDocument.deletionText=exclus\u00e3o +AbstractDocument.styleChangeText=altera\u00E7\u00E3o de estilo +AbstractDocument.additionText=adi\u00E7\u00E3o +AbstractDocument.deletionText=dele\u00E7\u00E3o AbstractDocument.undoText=Desfazer AbstractDocument.redoText=Refazer @@ -198,12 +214,12 @@ ComboBox.togglePopupText=togglePopup ProgressMonitor.progressText=Progresso... ############ Split Pane Strings ############ -SplitPane.leftButtonText=bot\u00e3o esquerdo -SplitPane.rightButtonText=bot\u00e3o direito +SplitPane.leftButtonText=bot\u00E3o esquerdo +SplitPane.rightButtonText=bot\u00E3o direito # Used for Isindex -IsindexView.prompt=Trata-se de um \u00edndice pesquis\u00e1vel. Insira as palavras-chave de pesquisa: +IsindexView.prompt=Trata-se de um \u00EDndice pesquis\u00E1vel. Informe as palavras-chave de pesquisa: ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=Iconificar +InternalFrameTitlePane.iconifyButtonAccessibleName=Iconify InternalFrameTitlePane.maximizeButtonAccessibleName=Maximizar InternalFrameTitlePane.closeButtonAccessibleName=Fechar diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties index 01e9b9bc5f8..94cc0e4165b 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_sv.properties @@ -47,28 +47,28 @@ ############ FILE CHOOSER STRINGS ############# FileChooser.fileDescriptionText=Generisk fil FileChooser.directoryDescriptionText=Katalog -FileChooser.newFolderErrorText=Fel d\u00e5 ny mapp skapades +FileChooser.newFolderErrorText=Fel uppstod n\u00E4r ny mapp skapades FileChooser.newFolderErrorSeparator= : -FileChooser.newFolderParentDoesntExistTitleText=Det gick inte att skapa mappen -FileChooser.newFolderParentDoesntExistText=Det gick inte att skapa mappen.\n\nSystemet hittade inte den angivna s\u00f6kv\u00e4gen. -FileChooser.renameErrorTitleText=Det gick inte att byta namn p\u00e5 filen eller mappen -FileChooser.renameErrorText=Det gick inte byta namn p\u00e5 {0} -FileChooser.renameErrorFileExistsText=Det gick inte byta namn p\u00e5 {0}: Det finns redan en fil med det namnet. Ge den ett annat namn. +FileChooser.newFolderParentDoesntExistTitleText=Kan inte skapa mappen +FileChooser.newFolderParentDoesntExistText=Kan inte skapa mappen.\n\nSystemet kan inte hitta angiven s\u00F6kv\u00E4g. +FileChooser.renameErrorTitleText=Ett fel intr\u00E4ffade vid f\u00F6rs\u00F6k att \u00E4ndra namn p\u00E5 fil eller mapp +FileChooser.renameErrorText=Kan inte namn\u00E4ndra {0} +FileChooser.renameErrorFileExistsText=Kan inte namn\u00E4ndra {0}: En fil med angivet namn finns redan. Ange ett annat filnamn. FileChooser.acceptAllFileFilterText=Alla filer FileChooser.cancelButtonText=Avbryt -FileChooser.cancelButtonMnemonic=65 +FileChooser.cancelButtonMnemonic=67 FileChooser.saveButtonText=Spara FileChooser.saveButtonMnemonic=83 -FileChooser.openButtonText=\u00d6ppna -FileChooser.openButtonMnemonic=78 +FileChooser.openButtonText=\u00D6ppna +FileChooser.openButtonMnemonic=79 FileChooser.saveDialogTitleText=Spara -FileChooser.openDialogTitleText=\u00d6ppna +FileChooser.openDialogTitleText=\u00D6ppna FileChooser.updateButtonText=Uppdatera FileChooser.updateButtonMnemonic=85 -FileChooser.helpButtonText=Hj\u00e4lp +FileChooser.helpButtonText=Hj\u00E4lp FileChooser.helpButtonMnemonic=72 -FileChooser.directoryOpenButtonText=\u00d6ppna -FileChooser.directoryOpenButtonMnemonic=80 +FileChooser.directoryOpenButtonText=\u00D6ppna +FileChooser.directoryOpenButtonMnemonic=79 # File Size Units FileChooser.fileSizeKiloBytes={0} KB @@ -84,53 +84,53 @@ FileChooser.other.newFolder.subsequent=Ny mapp.{0} ## file chooser tooltips ### FileChooser.cancelButtonToolTipText=Avbryt filvalsdialogruta -FileChooser.saveButtonToolTipText=Spara markerad fil -FileChooser.openButtonToolTipText=\u00d6ppna markerad fil +FileChooser.saveButtonToolTipText=Spara vald fil +FileChooser.openButtonToolTipText=\u00D6ppna vald fil FileChooser.updateButtonToolTipText=Uppdatera kataloglistan -FileChooser.helpButtonToolTipText=Hj\u00e4lp - Filv\u00e4ljare -FileChooser.directoryOpenButtonToolTipText=\u00d6ppnar den markerade katalogen +FileChooser.helpButtonToolTipText=Hj\u00E4lp - Filv\u00E4ljare +FileChooser.directoryOpenButtonToolTipText=\u00D6ppna vald katalog ############ COLOR CHOOSER STRINGS ############# ColorChooser.previewText=Granska ColorChooser.okText=OK ColorChooser.cancelText=Avbryt -ColorChooser.resetText=\u00c5terst\u00e4ll +ColorChooser.resetText=\u00C5terst\u00E4ll # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic -ColorChooser.resetMnemonic=84 +ColorChooser.resetMnemonic=82 ColorChooser.sampleText=Exempeltext Exempeltext ColorChooser.swatchesNameText=Prov -ColorChooser.swatchesMnemonic=80 -ColorChooser.swatchesRecentText=Tidigare: +ColorChooser.swatchesMnemonic=83 +ColorChooser.swatchesRecentText=Senaste: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. -ColorChooser.hsvNameText=NMI +ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 ColorChooser.hsvHueText=Nyans -ColorChooser.hsvSaturationText=M\u00e4ttnad -ColorChooser.hsvValueText=V\u00e4rde -ColorChooser.hsvTransparencyText=Genomskinlighet +ColorChooser.hsvSaturationText=M\u00E4ttnad +ColorChooser.hsvValueText=V\u00E4rde +ColorChooser.hsvTransparencyText=Transparens ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 ColorChooser.hslHueText=Nyans -ColorChooser.hslSaturationText=M\u00e4ttnad +ColorChooser.hslSaturationText=M\u00E4ttnad ColorChooser.hslLightnessText=Ljusstyrka -ColorChooser.hslTransparencyText=Genomskinlighet +ColorChooser.hslTransparencyText=Transparens ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 -ColorChooser.rgbRedText=R\u00f6d -ColorChooser.rgbRedMnemonic=82 -ColorChooser.rgbGreenText=Gr\u00f6n -ColorChooser.rgbGreenMnemonic=71 -ColorChooser.rgbBlueText=Bl\u00e5 +ColorChooser.rgbRedText=R\u00F6d +ColorChooser.rgbRedMnemonic=68 +ColorChooser.rgbGreenText=Gr\u00F6n +ColorChooser.rgbGreenMnemonic=78 +ColorChooser.rgbBlueText=Bl\u00E5 ColorChooser.rgbBlueMnemonic=66 ColorChooser.rgbAlphaText=Alfa -ColorChooser.rgbHexCodeText=F\u00e4rgkod +ColorChooser.rgbHexCodeText=F\u00E4rgkod ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 -ColorChooser.cmykCyanText=Cyanbl\u00e5 +ColorChooser.cmykCyanText=Cyan ColorChooser.cmykMagentaText=Magenta ColorChooser.cmykYellowText=Gul ColorChooser.cmykBlackText=Svart @@ -141,14 +141,14 @@ ColorChooser.cmykAlphaText=Alfa # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. OptionPane.yesButtonText=Ja -OptionPane.yesButtonMnemonic=74 +OptionPane.yesButtonMnemonic=89 OptionPane.noButtonText=Nej OptionPane.noButtonMnemonic=78 OptionPane.okButtonText=OK OptionPane.okButtonMnemonic=0 OptionPane.cancelButtonText=Avbryt OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=V\u00e4lj ett alternativ +OptionPane.titleText=V\u00E4lj ett alternativ # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. OptionPane.inputDialogTitle=Indata @@ -160,7 +160,7 @@ OptionPane.messageDialogTitle=Meddelande PrintingDialog.titleProgressText=Skriver ut PrintingDialog.titleAbortingText=Skriver ut (avbryter) -PrintingDialog.contentInitialText=Utskrift p\u00e5g\u00e5r... +PrintingDialog.contentInitialText=Utskrift p\u00E5g\u00E5r... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed @@ -176,50 +176,50 @@ PrintingDialog.abortButtonToolTipText=Avbryt utskrift ############ Internal Frame Strings ############ InternalFrame.iconButtonToolTip=Minimera InternalFrame.maxButtonToolTip=Maximera -InternalFrame.restoreButtonToolTip=\u00c5terst\u00e4ll -InternalFrame.closeButtonToolTip=St\u00e4ng +InternalFrame.restoreButtonToolTip=\u00C5terst\u00E4ll +InternalFrame.closeButtonToolTip=St\u00E4ng ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButtonText=\u00c5terst\u00e4ll +InternalFrameTitlePane.restoreButtonText=\u00C5terst\u00E4ll InternalFrameTitlePane.moveButtonText=Flytta InternalFrameTitlePane.sizeButtonText=Storlek InternalFrameTitlePane.minimizeButtonText=Minimera InternalFrameTitlePane.maximizeButtonText=Maximera -InternalFrameTitlePane.closeButtonText=St\u00e4ng +InternalFrameTitlePane.closeButtonText=St\u00E4ng ############ Text strings ############# # Used for html forms -FormView.submitButtonText=Skicka fr\u00e5ga -FormView.resetButtonText=\u00c5terst\u00e4ll -FormView.browseFileButtonText=Bl\u00e4ddra... +FormView.submitButtonText=Skicka fr\u00E5ga +FormView.resetButtonText=\u00C5terst\u00E4ll +FormView.browseFileButtonText=Bl\u00E4ddra... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=snittbyte -AbstractDocument.additionText=till\u00e4gg -AbstractDocument.deletionText=radering -AbstractDocument.undoText=\u00c5ngra -AbstractDocument.redoText=G\u00f6r om +AbstractDocument.styleChangeText=format\u00E4ndring +AbstractDocument.additionText=till\u00E4gg +AbstractDocument.deletionText=borttagning +AbstractDocument.undoText=\u00C5ngra +AbstractDocument.redoText=G\u00F6r om ############ Abstract Button Strings ############ AbstractButton.clickText=klicka ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=\u00c5ngra -AbstractUndoableEdit.redoText=G\u00f6r om +AbstractUndoableEdit.undoText=\u00C5ngra +AbstractUndoableEdit.redoText=G\u00F6r om ############ Combo Box Strings ############ -ComboBox.togglePopupText=v\u00e4xlaPopup +ComboBox.togglePopupText=v\u00E4xlaPopup ############ Progress Monitor Strings ############ -ProgressMonitor.progressText=Status... +ProgressMonitor.progressText=P\u00E5g\u00E5r... ############ Split Pane Strings ############ -SplitPane.leftButtonText=v\u00e4nster knapp -SplitPane.rightButtonText=h\u00f6ger knapp +SplitPane.leftButtonText=v\u00E4nster knapp +SplitPane.rightButtonText=h\u00F6ger knapp # Used for Isindex -IsindexView.prompt=Detta \u00e4r ett s\u00f6kbart index. Ange nyckelord f\u00f6r s\u00f6kningen: +IsindexView.prompt=Detta \u00E4r ett s\u00F6kbart index. Ange s\u00F6kord: ############ InternalFrameTitlePane Strings ############ InternalFrameTitlePane.iconifyButtonAccessibleName=Minimera InternalFrameTitlePane.maximizeButtonAccessibleName=Maximera -InternalFrameTitlePane.closeButtonAccessibleName=St\u00e4ng +InternalFrameTitlePane.closeButtonAccessibleName=St\u00E4ng diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties index b31c33d2cbd..ea84c7e2f7d 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_CN.properties @@ -45,29 +45,29 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=\u666e\u901a\u7684\u6587\u4ef6 -FileChooser.directoryDescriptionText=\u76ee\u5f55 -FileChooser.newFolderErrorText=\u521b\u5efa\u65b0\u7684\u6587\u4ef6\u5939\u65f6\u53d1\u751f\u9519\u8bef +FileChooser.fileDescriptionText=\u666E\u901A\u7684\u6587\u4EF6 +FileChooser.directoryDescriptionText=\u76EE\u5F55 +FileChooser.newFolderErrorText=\u521B\u5EFA\u65B0\u7684\u6587\u4EF6\u5939\u65F6\u51FA\u9519 FileChooser.newFolderErrorSeparator= : -FileChooser.newFolderParentDoesntExistTitleText=\u65e0\u6cd5\u521b\u5efa\u6587\u4ef6\u5939 -FileChooser.newFolderParentDoesntExistText=\u65e0\u6cd5\u521b\u5efa\u6587\u4ef6\u5939\u3002\n\n\u7cfb\u7edf\u65e0\u6cd5\u627e\u5230\u6307\u5b9a\u7684\u8def\u5f84\u3002 -FileChooser.renameErrorTitleText=\u91cd\u547d\u540d\u6587\u4ef6\u6216\u6587\u4ef6\u5939\u65f6\u51fa\u9519 -FileChooser.renameErrorText=\u65e0\u6cd5\u91cd\u547d\u540d {0} -FileChooser.renameErrorFileExistsText=\u65e0\u6cd5\u91cd\u547d\u540d {0}\uff1a\u5df2\u5b58\u5728\u5177\u6709\u6307\u5b9a\u540d\u79f0\u7684\u6587\u4ef6\u3002\u8bf7\u6307\u5b9a\u53e6\u4e00\u6587\u4ef6\u540d\u3002 -FileChooser.acceptAllFileFilterText=\u6240\u6709\u6587\u4ef6 -FileChooser.cancelButtonText=\u53d6\u6d88 +FileChooser.newFolderParentDoesntExistTitleText=\u65E0\u6CD5\u521B\u5EFA\u6587\u4EF6\u5939 +FileChooser.newFolderParentDoesntExistText=\u65E0\u6CD5\u521B\u5EFA\u6587\u4EF6\u5939\u3002\n\n\u7CFB\u7EDF\u627E\u4E0D\u5230\u6307\u5B9A\u7684\u8DEF\u5F84\u3002 +FileChooser.renameErrorTitleText=\u91CD\u547D\u540D\u6587\u4EF6\u6216\u6587\u4EF6\u5939\u65F6\u51FA\u9519 +FileChooser.renameErrorText=\u65E0\u6CD5\u91CD\u547D\u540D{0} +FileChooser.renameErrorFileExistsText=\u65E0\u6CD5\u91CD\u547D\u540D{0}: \u5DF2\u5B58\u5728\u5177\u6709\u6240\u6307\u5B9A\u540D\u79F0\u7684\u6587\u4EF6\u3002\u8BF7\u6307\u5B9A\u5176\u4ED6\u6587\u4EF6\u540D\u3002 +FileChooser.acceptAllFileFilterText=\u6240\u6709\u6587\u4EF6 +FileChooser.cancelButtonText=\u53D6\u6D88 FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\u4fdd\u5b58 +FileChooser.saveButtonText=\u4FDD\u5B58 FileChooser.saveButtonMnemonic=83 -FileChooser.openButtonText=\u6253\u5f00 +FileChooser.openButtonText=\u6253\u5F00 FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\u4fdd\u5b58 -FileChooser.openDialogTitleText=\u6253\u5f00 -FileChooser.updateButtonText=\u66f4\u65b0(U) +FileChooser.saveDialogTitleText=\u4FDD\u5B58 +FileChooser.openDialogTitleText=\u6253\u5F00 +FileChooser.updateButtonText=\u66F4\u65B0 FileChooser.updateButtonMnemonic=85 -FileChooser.helpButtonText=\u5e2e\u52a9(H) +FileChooser.helpButtonText=\u5E2E\u52A9 FileChooser.helpButtonMnemonic=72 -FileChooser.directoryOpenButtonText=\u6253\u5f00 +FileChooser.directoryOpenButtonText=\u6253\u5F00 FileChooser.directoryOpenButtonMnemonic=79 # File Size Units @@ -76,150 +76,150 @@ FileChooser.fileSizeMegaBytes={0} MB FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. -FileChooser.win32.newFolder=\u65b0\u5efa\u6587\u4ef6\u5939 -FileChooser.win32.newFolder.subsequent=\u65b0\u5efa\u6587\u4ef6\u5939 ({0}) -FileChooser.other.newFolder=\u65b0\u5efa\u6587\u4ef6\u5939 -FileChooser.other.newFolder.subsequent=\u65b0\u5efa\u6587\u4ef6\u5939.{0} +FileChooser.win32.newFolder=\u65B0\u5EFA\u6587\u4EF6\u5939 +FileChooser.win32.newFolder.subsequent=\u65B0\u5EFA\u6587\u4EF6\u5939 ({0}) +FileChooser.other.newFolder=NewFolder +FileChooser.other.newFolder.subsequent=NewFolder.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=\u4e2d\u6b62\u6587\u4ef6\u9009\u62e9\u5668\u5bf9\u8bdd\u6846 -FileChooser.saveButtonToolTipText=\u4fdd\u5b58\u9009\u62e9\u7684\u6587\u4ef6 -FileChooser.openButtonToolTipText=\u6253\u5f00\u9009\u62e9\u7684\u6587\u4ef6 -FileChooser.updateButtonToolTipText=\u66f4\u65b0\u76ee\u5f55\u5217\u8868 -FileChooser.helpButtonToolTipText=\u6587\u4ef6\u9009\u62e9\u5668\u5e2e\u52a9 -FileChooser.directoryOpenButtonToolTipText=\u6253\u5f00\u9009\u62e9\u7684\u76ee\u5f55 +FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6587\u4EF6\u9009\u62E9\u5668\u5BF9\u8BDD\u6846 +FileChooser.saveButtonToolTipText=\u4FDD\u5B58\u6240\u9009\u6587\u4EF6 +FileChooser.openButtonToolTipText=\u6253\u5F00\u6240\u9009\u6587\u4EF6 +FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u5F55\u5217\u8868 +FileChooser.helpButtonToolTipText=FileChooser \u5E2E\u52A9 +FileChooser.directoryOpenButtonToolTipText=\u6253\u5F00\u9009\u62E9\u7684\u76EE\u5F55 ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=\u9884\u89c8 -ColorChooser.okText=\u786e\u5b9a -ColorChooser.cancelText=\u53d6\u6d88 -ColorChooser.resetText=\u91cd\u8bbe(R) +ColorChooser.previewText=\u9884\u89C8 +ColorChooser.okText=\u786E\u5B9A +ColorChooser.cancelText=\u53D6\u6D88 +ColorChooser.resetText=\u91CD\u8BBE # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=\u6837\u54c1\u6587\u672c \u6837\u54c1\u6587\u672c -ColorChooser.swatchesNameText=\u6837\u54c1(S) +ColorChooser.sampleText=\u793A\u4F8B\u6587\u672C \u793A\u4F8B\u6587\u672C +ColorChooser.swatchesNameText=\u793A\u4F8B ColorChooser.swatchesMnemonic=83 -ColorChooser.swatchesRecentText=\u6700\u8fd1: +ColorChooser.swatchesRecentText=\u6700\u8FD1: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 -ColorChooser.hsvHueText=\u8272\u8c03 -ColorChooser.hsvSaturationText=\u9971\u548c -ColorChooser.hsvValueText=\u503c -ColorChooser.hsvTransparencyText=\u900f\u660e +ColorChooser.hsvHueText=\u8272\u8C03 +ColorChooser.hsvSaturationText=\u9971\u548C\u5EA6 +ColorChooser.hsvValueText=\u503C +ColorChooser.hsvTransparencyText=\u900F\u660E\u5EA6 ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 -ColorChooser.hslHueText=\u8272\u8c03 -ColorChooser.hslSaturationText=\u9971\u548c -ColorChooser.hslLightnessText=\u4eae\u5ea6 -ColorChooser.hslTransparencyText=\u900f\u660e +ColorChooser.hslHueText=\u8272\u8C03 +ColorChooser.hslSaturationText=\u9971\u548C\u5EA6 +ColorChooser.hslLightnessText=\u4EAE\u5EA6 +ColorChooser.hslTransparencyText=\u900F\u660E\u5EA6 ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 -ColorChooser.rgbRedText=\u7ea2 +ColorChooser.rgbRedText=\u7EA2 ColorChooser.rgbRedMnemonic=68 -ColorChooser.rgbGreenText=\u7eff +ColorChooser.rgbGreenText=\u7EFF ColorChooser.rgbGreenMnemonic=78 -ColorChooser.rgbBlueText=\u84dd +ColorChooser.rgbBlueText=\u84DD ColorChooser.rgbBlueMnemonic=66 ColorChooser.rgbAlphaText=Alpha -ColorChooser.rgbHexCodeText=\u989c\u8272\u4ee3\u7801 +ColorChooser.rgbHexCodeText=\u989C\u8272\u4EE3\u7801 ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 ColorChooser.cmykCyanText=\u9752\u8272 -ColorChooser.cmykMagentaText=\u54c1\u7ea2\u8272 -ColorChooser.cmykYellowText=\u9ec4\u8272 -ColorChooser.cmykBlackText=\u9ed1\u8272 +ColorChooser.cmykMagentaText=\u7D2B\u7EA2\u8272 +ColorChooser.cmykYellowText=\u9EC4\u8272 +ColorChooser.cmykBlackText=\u9ED1\u8272 ColorChooser.cmykAlphaText=Alpha ############ OPTION PANE STRINGS ############# # Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=\u662f(Y) +OptionPane.yesButtonText=\u662F OptionPane.yesButtonMnemonic=89 -OptionPane.noButtonText=\u5426(N) +OptionPane.noButtonText=\u5426 OptionPane.noButtonMnemonic=78 -OptionPane.okButtonText=\u786e\u5b9a +OptionPane.okButtonText=\u786E\u5B9A OptionPane.okButtonMnemonic=0 -OptionPane.cancelButtonText=\u53d6\u6d88 +OptionPane.cancelButtonText=\u53D6\u6D88 OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=\u9009\u62e9\u4e00\u4e2a\u9009\u9879 +OptionPane.titleText=\u9009\u62E9\u4E00\u4E2A\u9009\u9879 # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.inputDialogTitle=\u8f93\u5165 +OptionPane.inputDialogTitle=\u8F93\u5165 # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.messageDialogTitle=\u6d88\u606f +OptionPane.messageDialogTitle=\u6D88\u606F ############ Printing Dialog Strings ############ PrintingDialog.titleProgressText=\u6253\u5370 -PrintingDialog.titleAbortingText=\u6253\u5370 (\u6b63\u5728\u7ec8\u6b62) +PrintingDialog.titleAbortingText=\u6253\u5370 (\u6B63\u5728\u4E2D\u6B62) -PrintingDialog.contentInitialText=\u6b63\u5728\u8fdb\u884c\u6253\u5370... +PrintingDialog.contentInitialText=\u6B63\u5728\u8FDB\u884C\u6253\u5370... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=\u5df2\u6253\u5370\u9875 {0}... +PrintingDialog.contentProgressText=\u5DF2\u6253\u5370\u9875 {0}... -PrintingDialog.contentAbortingText=\u6b63\u5728\u7ec8\u6b62\u6253\u5370... +PrintingDialog.contentAbortingText=\u6B63\u5728\u4E2D\u6B62\u6253\u5370... -PrintingDialog.abortButtonText=\u7ec8\u6b62(A) +PrintingDialog.abortButtonText=\u4E2D\u6B62 PrintingDialog.abortButtonMnemonic=65 -PrintingDialog.abortButtonDisplayedMnemonicIndex=3 -PrintingDialog.abortButtonToolTipText=\u7ec8\u6b62\u6253\u5370 +PrintingDialog.abortButtonDisplayedMnemonicIndex=0 +PrintingDialog.abortButtonToolTipText=\u4E2D\u6B62\u6253\u5370 ############ Internal Frame Strings ############ -InternalFrame.iconButtonToolTip=\u6700\u5c0f\u5316 +InternalFrame.iconButtonToolTip=\u6700\u5C0F\u5316 InternalFrame.maxButtonToolTip=\u6700\u5927\u5316 -InternalFrame.restoreButtonToolTip=\u6062\u590d -InternalFrame.closeButtonToolTip=\u5173\u95ed +InternalFrame.restoreButtonToolTip=\u8FD8\u539F +InternalFrame.closeButtonToolTip=\u5173\u95ED ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButtonText=\u6062\u590d -InternalFrameTitlePane.moveButtonText=\u79fb\u52a8 -InternalFrameTitlePane.sizeButtonText=\u5927\u5c0f -InternalFrameTitlePane.minimizeButtonText=\u6700\u5c0f\u5316 +InternalFrameTitlePane.restoreButtonText=\u8FD8\u539F +InternalFrameTitlePane.moveButtonText=\u79FB\u52A8 +InternalFrameTitlePane.sizeButtonText=\u5927\u5C0F +InternalFrameTitlePane.minimizeButtonText=\u6700\u5C0F\u5316 InternalFrameTitlePane.maximizeButtonText=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButtonText=\u5173\u95ed +InternalFrameTitlePane.closeButtonText=\u5173\u95ED ############ Text strings ############# # Used for html forms -FormView.submitButtonText=\u63d0\u4ea4\u67e5\u8be2 -FormView.resetButtonText=\u91cd\u8bbe -FormView.browseFileButtonText=\u6d4f\u89c8... +FormView.submitButtonText=\u63D0\u4EA4\u67E5\u8BE2 +FormView.resetButtonText=\u91CD\u8BBE +FormView.browseFileButtonText=\u6D4F\u89C8... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=\u98ce\u683c\u53d8\u5316 -AbstractDocument.additionText=\u589e\u52a0 +AbstractDocument.styleChangeText=\u6837\u5F0F\u66F4\u6539 +AbstractDocument.additionText=\u6DFB\u52A0 AbstractDocument.deletionText=\u5220\u9664 -AbstractDocument.undoText=\u64a4\u6d88 -AbstractDocument.redoText=\u91cd\u505a +AbstractDocument.undoText=\u64A4\u6D88 +AbstractDocument.redoText=\u91CD\u505A ############ Abstract Button Strings ############ -AbstractButton.clickText=\u5355\u51fb +AbstractButton.clickText=\u5355\u51FB ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=\u64a4\u6d88 -AbstractUndoableEdit.redoText=\u91cd\u505a +AbstractUndoableEdit.undoText=\u64A4\u6D88 +AbstractUndoableEdit.redoText=\u91CD\u505A ############ Combo Box Strings ############ -ComboBox.togglePopupText=\u5207\u6362\u952e\u5f39\u51fa +ComboBox.togglePopupText=togglePopup ############ Progress Monitor Strings ############ -ProgressMonitor.progressText=\u8fdb\u5ea6... +ProgressMonitor.progressText=\u8FDB\u5EA6... ############ Split Pane Strings ############ -SplitPane.leftButtonText=\u5de6\u952e -SplitPane.rightButtonText=\u53f3\u952e +SplitPane.leftButtonText=\u5DE6\u952E +SplitPane.rightButtonText=\u53F3\u952E # Used for Isindex -IsindexView.prompt=\u8fd9\u662f\u53ef\u641c\u7d22\u7d22\u5f15\u3002\u8bf7\u952e\u5165\u5173\u952e\u8bcd\uff1a +IsindexView.prompt=\u8FD9\u662F\u53EF\u641C\u7D22\u7D22\u5F15\u3002\u8BF7\u8F93\u5165\u641C\u7D22\u5173\u952E\u5B57: ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=\u56fe\u6807\u5316 +InternalFrameTitlePane.iconifyButtonAccessibleName=\u56FE\u6807\u5316 InternalFrameTitlePane.maximizeButtonAccessibleName=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButtonAccessibleName=\u5173\u95ed +InternalFrameTitlePane.closeButtonAccessibleName=\u5173\u95ED diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties index 68b14ad1f78..d0647586b98 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/basic/resources/basic_zh_TW.properties @@ -45,29 +45,29 @@ # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.fileDescriptionText=\u4e00\u822c\u6a94\u6848 -FileChooser.directoryDescriptionText=\u76ee\u9304 -FileChooser.newFolderErrorText=\u5efa\u7acb\u65b0\u6a94\u6848\u593e\u6642\u767c\u751f\u932f\u8aa4 +FileChooser.fileDescriptionText=\u4E00\u822C\u6A94\u6848 +FileChooser.directoryDescriptionText=\u76EE\u9304 +FileChooser.newFolderErrorText=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E\u6642\u767C\u751F\u932F\u8AA4 FileChooser.newFolderErrorSeparator= : -FileChooser.newFolderParentDoesntExistTitleText=\u7121\u6cd5\u5efa\u7acb\u8cc7\u6599\u593e -FileChooser.newFolderParentDoesntExistText=\u7121\u6cd5\u5efa\u7acb\u8cc7\u6599\u593e\u3002\n\n\u7cfb\u7d71\u627e\u4e0d\u5230\u6240\u6307\u5b9a\u7684\u8def\u5f91\u3002 -FileChooser.renameErrorTitleText=\u91cd\u65b0\u547d\u540d\u6a94\u6848\u6216\u8cc7\u6599\u593e\u6642\u767c\u751f\u932f\u8aa4 -FileChooser.renameErrorText=\u7121\u6cd5\u91cd\u65b0\u547d\u540d {0} -FileChooser.renameErrorFileExistsText=\u7121\u6cd5\u91cd\u65b0\u547d\u540d {0}\uff1a\u60a8\u6307\u5b9a\u4e4b\u540d\u7a31\u7684\u6a94\u6848\u5df2\u5b58\u5728\u3002\u6307\u5b9a\u4e0d\u540c\u7684\u6a94\u6848\u540d\u7a31\u3002 -FileChooser.acceptAllFileFilterText=\u6240\u6709\u6a94\u6848 -FileChooser.cancelButtonText=\u53d6\u6d88 +FileChooser.newFolderParentDoesntExistTitleText=\u7121\u6CD5\u5EFA\u7ACB\u8CC7\u6599\u593E +FileChooser.newFolderParentDoesntExistText=\u7121\u6CD5\u5EFA\u7ACB\u8CC7\u6599\u593E\u3002\n\n\u7CFB\u7D71\u627E\u4E0D\u5230\u6307\u5B9A\u7684\u8DEF\u5F91\u3002 +FileChooser.renameErrorTitleText=\u91CD\u65B0\u547D\u540D\u6A94\u6848\u6216\u8CC7\u6599\u593E\u6642\u767C\u751F\u932F\u8AA4\u3002 +FileChooser.renameErrorText=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0} +FileChooser.renameErrorFileExistsText=\u7121\u6CD5\u91CD\u65B0\u547D\u540D {0}: \u5DF2\u7D93\u5B58\u5728\u60A8\u6240\u6307\u5B9A\u540D\u7A31\u7684\u6A94\u6848\u3002\u8ACB\u6307\u5B9A\u4E0D\u540C\u7684\u540D\u7A31\u3002 +FileChooser.acceptAllFileFilterText=\u6240\u6709\u6A94\u6848 +FileChooser.cancelButtonText=\u53D6\u6D88 FileChooser.cancelButtonMnemonic=67 -FileChooser.saveButtonText=\u5132\u5b58 +FileChooser.saveButtonText=\u5132\u5B58 FileChooser.saveButtonMnemonic=83 -FileChooser.openButtonText=\u958b\u555f +FileChooser.openButtonText=\u958B\u555F FileChooser.openButtonMnemonic=79 -FileChooser.saveDialogTitleText=\u5132\u5b58 -FileChooser.openDialogTitleText=\u958b\u555f -FileChooser.updateButtonText=\u66f4\u65b0(U) +FileChooser.saveDialogTitleText=\u5132\u5B58 +FileChooser.openDialogTitleText=\u958B\u555F +FileChooser.updateButtonText=\u66F4\u65B0 FileChooser.updateButtonMnemonic=85 -FileChooser.helpButtonText=\u8aaa\u660e(H) +FileChooser.helpButtonText=\u8AAA\u660E FileChooser.helpButtonMnemonic=72 -FileChooser.directoryOpenButtonText=\u958b\u555f +FileChooser.directoryOpenButtonText=\u958B\u555F FileChooser.directoryOpenButtonMnemonic=79 # File Size Units @@ -76,150 +76,150 @@ FileChooser.fileSizeMegaBytes={0} MB FileChooser.fileSizeGigaBytes={0} GB # These strings are platform dependent not look and feel dependent. -FileChooser.win32.newFolder=\u65b0\u8cc7\u6599\u593e -FileChooser.win32.newFolder.subsequent=\u65b0\u8cc7\u6599\u593e ({0}) -FileChooser.other.newFolder=\u65b0\u8cc7\u6599\u593e -FileChooser.other.newFolder.subsequent=\u65b0\u8cc7\u6599\u593e.{0} +FileChooser.win32.newFolder=\u65B0\u8CC7\u6599\u593E +FileChooser.win32.newFolder.subsequent=\u65B0\u8CC7\u6599\u593E ({0}) +FileChooser.other.newFolder=\u65B0\u8CC7\u6599\u593E +FileChooser.other.newFolder.subsequent=\u65B0\u8CC7\u6599\u593E.{0} ## file chooser tooltips ### -FileChooser.cancelButtonToolTipText=\u4e2d\u65b7\u300c\u6a94\u6848\u9078\u64c7\u5668\u300d\u5c0d\u8a71\u65b9\u584a -FileChooser.saveButtonToolTipText=\u5132\u5b58\u9078\u53d6\u7684\u6a94\u6848 -FileChooser.openButtonToolTipText=\u958b\u555f\u9078\u53d6\u7684\u6a94\u6848 -FileChooser.updateButtonToolTipText=\u66f4\u65b0\u76ee\u9304\u6e05\u55ae -FileChooser.helpButtonToolTipText=\u300c\u6a94\u6848\u9078\u64c7\u5668\u300d\u8aaa\u660e -FileChooser.directoryOpenButtonToolTipText=\u958b\u555f\u9078\u53d6\u7684\u76ee\u9304 +FileChooser.cancelButtonToolTipText=\u4E2D\u6B62\u6A94\u6848\u9078\u64C7\u5668\u5C0D\u8A71\u65B9\u584A +FileChooser.saveButtonToolTipText=\u5132\u5B58\u9078\u53D6\u7684\u6A94\u6848 +FileChooser.openButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u6A94\u6848 +FileChooser.updateButtonToolTipText=\u66F4\u65B0\u76EE\u9304\u6E05\u55AE +FileChooser.helpButtonToolTipText=\u300C\u6A94\u6848\u9078\u64C7\u5668\u300D\u8AAA\u660E +FileChooser.directoryOpenButtonToolTipText=\u958B\u555F\u9078\u53D6\u7684\u76EE\u9304 ############ COLOR CHOOSER STRINGS ############# -ColorChooser.previewText=\u9810\u89bd -ColorChooser.okText=\u78ba\u5b9a -ColorChooser.cancelText=\u53d6\u6d88 -ColorChooser.resetText=\u91cd\u8a2d(R) +ColorChooser.previewText=\u9810\u89BD +ColorChooser.okText=\u78BA\u5B9A +ColorChooser.cancelText=\u53D6\u6D88 +ColorChooser.resetText=\u91CD\u8A2D # VK_XXX constant for 'ColorChooser.resetText' button to make mnemonic ColorChooser.resetMnemonic=82 -ColorChooser.sampleText=\u7bc4\u4f8b\u6587\u5b57 \u7bc4\u4f8b\u6587\u5b57 -ColorChooser.swatchesNameText=\u8abf\u8272\u677f(S) +ColorChooser.sampleText=\u7BC4\u4F8B\u6587\u5B57 \u7BC4\u4F8B\u6587\u5B57 +ColorChooser.swatchesNameText=\u8ABF\u8272\u677F ColorChooser.swatchesMnemonic=83 -ColorChooser.swatchesRecentText=\u6700\u65b0\u9078\u64c7: +ColorChooser.swatchesRecentText=\u6700\u65B0\u9078\u64C7: # Each of the ColorChooser types can define a mnemonic, as a KeyEvent.VK_XXX # constant, and an index into the text to render the mnemonic as. The # mnemonic is xxxMnemonic and the index of the character to underline is # xxxDisplayedMnemonicIndex. ColorChooser.hsvNameText=HSV ColorChooser.hsvMnemonic=72 -ColorChooser.hsvHueText=\u8272\u8abf -ColorChooser.hsvSaturationText=\u98fd\u548c\u5ea6 -ColorChooser.hsvValueText=\u503c -ColorChooser.hsvTransparencyText=\u900f\u660e\u5ea6 +ColorChooser.hsvHueText=\u8272\u8ABF +ColorChooser.hsvSaturationText=\u5F69\u5EA6 +ColorChooser.hsvValueText=\u6578\u503C +ColorChooser.hsvTransparencyText=\u900F\u660E\u5EA6 ColorChooser.hslNameText=HSL ColorChooser.hslMnemonic=76 -ColorChooser.hslHueText=\u8272\u8abf -ColorChooser.hslSaturationText=\u98fd\u548c\u5ea6 -ColorChooser.hslLightnessText=\u4eae\u5ea6 -ColorChooser.hslTransparencyText=\u900f\u660e\u5ea6 +ColorChooser.hslHueText=\u8272\u8ABF +ColorChooser.hslSaturationText=\u5F69\u5EA6 +ColorChooser.hslLightnessText=\u4EAE\u5EA6 +ColorChooser.hslTransparencyText=\u900F\u660E\u5EA6 ColorChooser.rgbNameText=RGB ColorChooser.rgbMnemonic=71 -ColorChooser.rgbRedText=\u7d05\u8272(D) +ColorChooser.rgbRedText=\u7D05\u8272 ColorChooser.rgbRedMnemonic=68 -ColorChooser.rgbGreenText=\u7da0\u8272(N) +ColorChooser.rgbGreenText=\u7DA0\u8272 ColorChooser.rgbGreenMnemonic=78 -ColorChooser.rgbBlueText=\u85cd\u8272(B) +ColorChooser.rgbBlueText=\u85CD\u8272 ColorChooser.rgbBlueMnemonic=66 ColorChooser.rgbAlphaText=Alpha -ColorChooser.rgbHexCodeText=\u8272\u78bc +ColorChooser.rgbHexCodeText=\u984F\u8272\u4EE3\u78BC ColorChooser.rgbHexCodeMnemonic=67 ColorChooser.cmykNameText=CMYK ColorChooser.cmykMnemonic=77 -ColorChooser.cmykCyanText=\u85cd\u7da0\u8272 -ColorChooser.cmykMagentaText=\u7d2b\u7d05\u8272 -ColorChooser.cmykYellowText=\u9ec3\u8272 -ColorChooser.cmykBlackText=\u9ed1\u8272 +ColorChooser.cmykCyanText=\u85CD\u7DA0\u8272 +ColorChooser.cmykMagentaText=\u7D2B\u7D05\u8272 +ColorChooser.cmykYellowText=\u9EC3\u8272 +ColorChooser.cmykBlackText=\u9ED1\u8272 ColorChooser.cmykAlphaText=Alpha ############ OPTION PANE STRINGS ############# # Mnemonic keys correspond to KeyEvent.VK_XXX constant # We only define mnemonics for YES/NO, but for completeness you can # define mnemonics for any of the buttons. -OptionPane.yesButtonText=\u662f(Y) +OptionPane.yesButtonText=\u662F OptionPane.yesButtonMnemonic=89 -OptionPane.noButtonText=\u5426(N) +OptionPane.noButtonText=\u5426 OptionPane.noButtonMnemonic=78 -OptionPane.okButtonText=\u78ba\u5b9a +OptionPane.okButtonText=\u78BA\u5B9A OptionPane.okButtonMnemonic=0 -OptionPane.cancelButtonText=\u53d6\u6d88 +OptionPane.cancelButtonText=\u53D6\u6D88 OptionPane.cancelButtonMnemonic=0 -OptionPane.titleText=\u9078\u53d6\u4e00\u500b\u9078\u9805 +OptionPane.titleText=\u9078\u53D6\u4E00\u500B\u9078\u9805 # Title for the dialog for the showInputDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.inputDialogTitle=\u8f38\u5165 +OptionPane.inputDialogTitle=\u8F38\u5165 # Title for the dialog for the showMessageDialog methods. Only used if # the developer uses one of the variants that doesn't take a title. -OptionPane.messageDialogTitle=\u8a0a\u606f +OptionPane.messageDialogTitle=\u8A0A\u606F ############ Printing Dialog Strings ############ PrintingDialog.titleProgressText=\u5217\u5370 -PrintingDialog.titleAbortingText=\u5217\u5370 (\u4e2d\u65b7) +PrintingDialog.titleAbortingText=\u5217\u5370 (\u4E2D\u6B62) -PrintingDialog.contentInitialText=\u6b63\u5728\u5217\u5370... +PrintingDialog.contentInitialText=\u6B63\u5728\u5217\u5370... # The following string will be formatted by a MessageFormat # and {0} will be replaced by page number being printed -PrintingDialog.contentProgressText=\u5df2\u5217\u5370\u7684\u9801\u9762 {0}... +PrintingDialog.contentProgressText=\u5DF2\u5217\u5370\u7684\u9801\u9762 {0}... -PrintingDialog.contentAbortingText=\u6b63\u5728\u4e2d\u65b7\u5217\u5370... +PrintingDialog.contentAbortingText=\u6B63\u5728\u4E2D\u6B62\u5217\u5370... -PrintingDialog.abortButtonText=\u4e2d\u65b7(A) +PrintingDialog.abortButtonText=\u4E2D\u6B62 PrintingDialog.abortButtonMnemonic=65 PrintingDialog.abortButtonDisplayedMnemonicIndex=0 -PrintingDialog.abortButtonToolTipText=\u4e2d\u65b7\u5217\u5370 +PrintingDialog.abortButtonToolTipText=\u4E2D\u6B62\u5217\u5370 ############ Internal Frame Strings ############ -InternalFrame.iconButtonToolTip=\u6700\u5c0f\u5316 +InternalFrame.iconButtonToolTip=\u6700\u5C0F\u5316 InternalFrame.maxButtonToolTip=\u6700\u5927\u5316 -InternalFrame.restoreButtonToolTip=\u5fa9\u539f -InternalFrame.closeButtonToolTip=\u95dc\u9589 +InternalFrame.restoreButtonToolTip=\u5FA9\u539F +InternalFrame.closeButtonToolTip=\u95DC\u9589 ############ Internal Frame Title Pane Strings ############ -InternalFrameTitlePane.restoreButtonText=\u5fa9\u539f -InternalFrameTitlePane.moveButtonText=\u79fb\u52d5 -InternalFrameTitlePane.sizeButtonText=\u5927\u5c0f -InternalFrameTitlePane.minimizeButtonText=\u6700\u5c0f\u5316 +InternalFrameTitlePane.restoreButtonText=\u5FA9\u539F +InternalFrameTitlePane.moveButtonText=\u79FB\u52D5 +InternalFrameTitlePane.sizeButtonText=\u5927\u5C0F +InternalFrameTitlePane.minimizeButtonText=\u6700\u5C0F\u5316 InternalFrameTitlePane.maximizeButtonText=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButtonText=\u95dc\u9589 +InternalFrameTitlePane.closeButtonText=\u95DC\u9589 ############ Text strings ############# # Used for html forms -FormView.submitButtonText=\u63d0\u51fa\u67e5\u8a62 -FormView.resetButtonText=\u91cd\u8a2d -FormView.browseFileButtonText=\u700f\u89bd... +FormView.submitButtonText=\u9001\u51FA\u67E5\u8A62 +FormView.resetButtonText=\u91CD\u8A2D +FormView.browseFileButtonText=\u700F\u89BD... ############ Abstract Document Strings ############ -AbstractDocument.styleChangeText=\u6a23\u5f0f\u8b8a\u66f4 -AbstractDocument.additionText=\u9644\u52a0 -AbstractDocument.deletionText=\u522a\u9664 -AbstractDocument.undoText=\u9084\u539f -AbstractDocument.redoText=\u91cd\u505a +AbstractDocument.styleChangeText=\u6A23\u5F0F\u8B8A\u66F4 +AbstractDocument.additionText=\u9644\u52A0 +AbstractDocument.deletionText=\u522A\u9664 +AbstractDocument.undoText=\u9084\u539F +AbstractDocument.redoText=\u91CD\u505A ############ Abstract Button Strings ############ -AbstractButton.clickText=\u6309\u4e00\u4e0b +AbstractButton.clickText=\u6309\u4E00\u4E0B ############ Abstract Undoable Edit Strings ############ -AbstractUndoableEdit.undoText=\u9084\u539f -AbstractUndoableEdit.redoText=\u91cd\u505a +AbstractUndoableEdit.undoText=\u9084\u539F +AbstractUndoableEdit.redoText=\u91CD\u505A ############ Combo Box Strings ############ -ComboBox.togglePopupText=\u5207\u63db\u5373\u73fe +ComboBox.togglePopupText=\u5207\u63DB\u5373\u73FE\u5F0F\u8996\u7A97 ############ Progress Monitor Strings ############ -ProgressMonitor.progressText=\u9032\u5ea6... +ProgressMonitor.progressText=\u9032\u5EA6... ############ Split Pane Strings ############ -SplitPane.leftButtonText=\u5de6\u6309\u9215 -SplitPane.rightButtonText=\u53f3\u6309\u9215 +SplitPane.leftButtonText=\u5DE6\u6309\u9215 +SplitPane.rightButtonText=\u53F3\u6309\u9215 # Used for Isindex -IsindexView.prompt=\u9019\u662f\u4e00\u500b\u53ef\u641c\u5c0b\u7684\u7d22\u5f15\u3002\u8f38\u5165\u641c\u5c0b\u95dc\u9375\u5b57\uff1a +IsindexView.prompt=\u9019\u662F\u4E00\u500B\u53EF\u641C\u5C0B\u7684\u7D22\u5F15\u3002\u8F38\u5165\u641C\u5C0B\u95DC\u9375\u5B57: ############ InternalFrameTitlePane Strings ############ -InternalFrameTitlePane.iconifyButtonAccessibleName=\u5716\u793a\u5316 +InternalFrameTitlePane.iconifyButtonAccessibleName=\u5716\u793A\u5316 InternalFrameTitlePane.maximizeButtonAccessibleName=\u6700\u5927\u5316 -InternalFrameTitlePane.closeButtonAccessibleName=\u95dc\u9589 +InternalFrameTitlePane.closeButtonAccessibleName=\u95DC\u9589 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties index 1262ee30ff4..1b3214fc72d 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_de.properties @@ -21,10 +21,10 @@ FileChooser.lookInLabelText=Suchen in: FileChooser.saveInLabelText=Speichern in: FileChooser.fileNameLabelText=Dateiname: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Ordnername: FileChooser.filesOfTypeLabelText=Dateityp: -FileChooser.upFolderToolTipText=Eine Ebene h\u00f6her -FileChooser.upFolderAccessibleName=H\u00f6her +FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her +FileChooser.upFolderAccessibleName=Nach oben FileChooser.homeFolderToolTipText=Home FileChooser.homeFolderAccessibleName=Home FileChooser.newFolderToolTipText=Neuen Ordner erstellen @@ -38,19 +38,19 @@ FileChooser.detailsViewButtonAccessibleName=Details FileChooser.detailsViewActionLabelText=Details FileChooser.refreshActionLabelText=Aktualisieren FileChooser.viewMenuLabelText=Ansicht -FileChooser.fileNameHeaderText=Dateiname -FileChooser.fileSizeHeaderText=Gr\u00f6\u00dfe +FileChooser.fileNameHeaderText=Name +FileChooser.fileSizeHeaderText=Gr\u00F6\u00DFe FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=Ge\u00e4ndert -FileChooser.fileAttrHeaderText=Attribut +FileChooser.fileDateHeaderText=Ge\u00E4ndert +FileChooser.fileAttrHeaderText=Attribute ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers MetalTitlePane.restoreTitle=Wiederherstellen -MetalTitlePane.restoreMnemonic=87 +MetalTitlePane.restoreMnemonic=82 MetalTitlePane.iconifyTitle=Minimieren -MetalTitlePane.iconifyMnemonic=77 +MetalTitlePane.iconifyMnemonic=69 MetalTitlePane.maximizeTitle=Maximieren MetalTitlePane.maximizeMnemonic=88 -MetalTitlePane.closeTitle=Schlie\u00dfen -MetalTitlePane.closeMnemonic=83 +MetalTitlePane.closeTitle=Schlie\u00DFen +MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties index 29f9a51d566..09afa0a86e7 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_es.properties @@ -20,26 +20,26 @@ FileChooser.lookInLabelText=Buscar en: FileChooser.saveInLabelText=Guardar en: -FileChooser.fileNameLabelText=Nombre de archivo: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=Archivos de tipo: -FileChooser.upFolderToolTipText=Subir un nivel +FileChooser.fileNameLabelText=Nombre de Archivo: +FileChooser.folderNameLabelText=Nombre de la Carpeta: +FileChooser.filesOfTypeLabelText=Archivos de Tipo: +FileChooser.upFolderToolTipText=Subir un Nivel FileChooser.upFolderAccessibleName=Arriba -FileChooser.homeFolderToolTipText=Principal -FileChooser.homeFolderAccessibleName=Principal -FileChooser.newFolderToolTipText=Crear carpeta nueva -FileChooser.newFolderAccessibleName=Carpeta nueva -FileChooser.newFolderActionLabelText=Carpeta nueva +FileChooser.homeFolderToolTipText=Inicio +FileChooser.homeFolderAccessibleName=Inicio +FileChooser.newFolderToolTipText=Crear Nueva Carpeta +FileChooser.newFolderAccessibleName=Nueva Carpeta +FileChooser.newFolderActionLabelText=Nueva Carpeta FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Detalles FileChooser.detailsViewButtonAccessibleName=Detalles FileChooser.detailsViewActionLabelText=Detalles -FileChooser.refreshActionLabelText=Renovar +FileChooser.refreshActionLabelText=Refrescar FileChooser.viewMenuLabelText=Ver FileChooser.fileNameHeaderText=Nombre -FileChooser.fileSizeHeaderText=Tama\u00f1o +FileChooser.fileSizeHeaderText=Tama\u00F1o FileChooser.fileTypeHeaderText=Tipo FileChooser.fileDateHeaderText=Modificado FileChooser.fileAttrHeaderText=Atributos @@ -49,7 +49,7 @@ FileChooser.fileAttrHeaderText=Atributos MetalTitlePane.restoreTitle=Restaurar MetalTitlePane.restoreMnemonic=82 MetalTitlePane.iconifyTitle=Minimizar -MetalTitlePane.iconifyMnemonic=77 +MetalTitlePane.iconifyMnemonic=69 MetalTitlePane.maximizeTitle=Maximizar MetalTitlePane.maximizeMnemonic=88 MetalTitlePane.closeTitle=Cerrar diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties index 8f7a7c5d2a7..6c158902326 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_fr.properties @@ -20,37 +20,37 @@ FileChooser.lookInLabelText=Rechercher dans : FileChooser.saveInLabelText=Enregistrer dans : -FileChooser.fileNameLabelText=Nom de fichier : -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=Fichiers du type : +FileChooser.fileNameLabelText=Nom du fichier : +FileChooser.folderNameLabelText=Nom du dossier : +FileChooser.filesOfTypeLabelText=Fichiers de type : FileChooser.upFolderToolTipText=Remonte d'un niveau. -FileChooser.upFolderAccessibleName=Vers le haut -FileChooser.homeFolderToolTipText=R\u00e9pertoire d'accueil -FileChooser.homeFolderAccessibleName=Accueil -FileChooser.newFolderToolTipText=Cr\u00e9e un nouveau dossier. +FileChooser.upFolderAccessibleName=Monter +FileChooser.homeFolderToolTipText=R\u00E9pertoire d'origine +FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine +FileChooser.newFolderToolTipText=Cr\u00E9e un dossier. FileChooser.newFolderAccessibleName=Nouveau dossier FileChooser.newFolderActionLabelText=Nouveau dossier FileChooser.listViewButtonToolTipText=Liste FileChooser.listViewButtonAccessibleName=Liste FileChooser.listViewActionLabelText=Liste -FileChooser.detailsViewButtonToolTipText=D\u00e9tails -FileChooser.detailsViewButtonAccessibleName=D\u00e9tails -FileChooser.detailsViewActionLabelText=D\u00e9tails +FileChooser.detailsViewButtonToolTipText=D\u00E9tails +FileChooser.detailsViewButtonAccessibleName=D\u00E9tails +FileChooser.detailsViewActionLabelText=D\u00E9tails FileChooser.refreshActionLabelText=Actualiser FileChooser.viewMenuLabelText=Affichage FileChooser.fileNameHeaderText=Nom FileChooser.fileSizeHeaderText=Taille FileChooser.fileTypeHeaderText=Type -FileChooser.fileDateHeaderText=Modifi\u00e9 +FileChooser.fileDateHeaderText=Modifi\u00E9 FileChooser.fileAttrHeaderText=Attributs ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers MetalTitlePane.restoreTitle=Restaurer MetalTitlePane.restoreMnemonic=82 -MetalTitlePane.iconifyTitle=R\u00e9duire -MetalTitlePane.iconifyMnemonic=68 +MetalTitlePane.iconifyTitle=R\u00E9duire +MetalTitlePane.iconifyMnemonic=69 MetalTitlePane.maximizeTitle=Agrandir -MetalTitlePane.maximizeMnemonic=65 +MetalTitlePane.maximizeMnemonic=88 MetalTitlePane.closeTitle=Fermer -MetalTitlePane.closeMnemonic=70 +MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties index 2b3b1c0f95b..1a5deb02e37 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_it.properties @@ -21,18 +21,18 @@ FileChooser.lookInLabelText=Cerca in: FileChooser.saveInLabelText=Salva in: FileChooser.fileNameLabelText=Nome file: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Nome della cartella: FileChooser.filesOfTypeLabelText=Tipo file: FileChooser.upFolderToolTipText=Cartella superiore FileChooser.upFolderAccessibleName=Superiore -FileChooser.homeFolderToolTipText=Principale -FileChooser.homeFolderAccessibleName=Principale +FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderAccessibleName=Home FileChooser.newFolderToolTipText=Crea nuova cartella FileChooser.newFolderAccessibleName=Nuova cartella FileChooser.newFolderActionLabelText=Nuova cartella -FileChooser.listViewButtonToolTipText=Elenco -FileChooser.listViewButtonAccessibleName=Elenco -FileChooser.listViewActionLabelText=Elenco +FileChooser.listViewButtonToolTipText=Lista +FileChooser.listViewButtonAccessibleName=Lista +FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Dettagli FileChooser.detailsViewButtonAccessibleName=Dettagli FileChooser.detailsViewActionLabelText=Dettagli @@ -49,8 +49,8 @@ FileChooser.fileAttrHeaderText=Attributi MetalTitlePane.restoreTitle=Ripristina MetalTitlePane.restoreMnemonic=82 MetalTitlePane.iconifyTitle=Riduci a icona -MetalTitlePane.iconifyMnemonic=68 +MetalTitlePane.iconifyMnemonic=69 MetalTitlePane.maximizeTitle=Ingrandisci -MetalTitlePane.maximizeMnemonic=73 +MetalTitlePane.maximizeMnemonic=88 MetalTitlePane.closeTitle=Chiudi MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties index 94a1ad236bc..f5a4bc9cca3 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ja.properties @@ -18,39 +18,39 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u53c2\u7167: -FileChooser.saveInLabelText=\u4fdd\u5b58: -FileChooser.fileNameLabelText=\u30d5\u30a1\u30a4\u30eb\u540d: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7: -FileChooser.upFolderToolTipText=1 \u30ec\u30d9\u30eb\u4e0a\u3078 -FileChooser.upFolderAccessibleName=\u4e0a\u3078 -FileChooser.homeFolderToolTipText=\u30db\u30fc\u30e0 -FileChooser.homeFolderAccessibleName=\u30db\u30fc\u30e0 -FileChooser.newFolderToolTipText=\u30d5\u30a9\u30eb\u30c0\u306e\u65b0\u898f\u4f5c\u6210 -FileChooser.newFolderAccessibleName=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.newFolderActionLabelText=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.listViewButtonToolTipText=\u30ea\u30b9\u30c8 -FileChooser.listViewButtonAccessibleName=\u30ea\u30b9\u30c8 -FileChooser.listViewActionLabelText=\u30ea\u30b9\u30c8 -FileChooser.detailsViewButtonToolTipText=\u8a73\u7d30 -FileChooser.detailsViewButtonAccessibleName=\u8a73\u7d30 -FileChooser.detailsViewActionLabelText=\u8a73\u7d30 -FileChooser.refreshActionLabelText=\u66f4\u65b0 -FileChooser.viewMenuLabelText=\u8868\u793a -FileChooser.fileNameHeaderText=\u540d\u524d -FileChooser.fileSizeHeaderText=\u30b5\u30a4\u30ba -FileChooser.fileTypeHeaderText=\u578b -FileChooser.fileDateHeaderText=\u4fee\u6b63\u65e5 -FileChooser.fileAttrHeaderText=\u5c5e\u6027 +FileChooser.lookInLabelText=\u53C2\u7167: +FileChooser.saveInLabelText=\u4FDD\u5B58: +FileChooser.fileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D: +FileChooser.folderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D: +FileChooser.filesOfTypeLabelText=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7: +FileChooser.upFolderToolTipText=1\u30EC\u30D9\u30EB\u4E0A\u3078 +FileChooser.upFolderAccessibleName=\u4E0A\u3078 +FileChooser.homeFolderToolTipText=\u30DB\u30FC\u30E0 +FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0 +FileChooser.newFolderToolTipText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210 +FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.newFolderActionLabelText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.listViewButtonToolTipText=\u30EA\u30B9\u30C8 +FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8 +FileChooser.listViewActionLabelText=\u30EA\u30B9\u30C8 +FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30 +FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30 +FileChooser.detailsViewActionLabelText=\u8A73\u7D30 +FileChooser.refreshActionLabelText=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5 +FileChooser.viewMenuLabelText=\u8868\u793A +FileChooser.fileNameHeaderText=\u540D\u524D +FileChooser.fileSizeHeaderText=\u30B5\u30A4\u30BA +FileChooser.fileTypeHeaderText=\u30BF\u30A4\u30D7 +FileChooser.fileDateHeaderText=\u4FEE\u6B63\u65E5 +FileChooser.fileAttrHeaderText=\u5C5E\u6027 ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers -MetalTitlePane.restoreTitle=\u5fa9\u5143(R) +MetalTitlePane.restoreTitle=\u5FA9\u5143 MetalTitlePane.restoreMnemonic=82 -MetalTitlePane.iconifyTitle=\u6700\u5c0f\u5316(E) +MetalTitlePane.iconifyTitle=\u6700\u5C0F\u5316 MetalTitlePane.iconifyMnemonic=69 -MetalTitlePane.maximizeTitle=\u6700\u5927\u5316(X) +MetalTitlePane.maximizeTitle=\u6700\u5927\u5316 MetalTitlePane.maximizeMnemonic=88 -MetalTitlePane.closeTitle=\u9589\u3058\u308b(C) +MetalTitlePane.closeTitle=\u9589\u3058\u308B MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties index 1bb569128f9..fae574fcc5a 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_ko.properties @@ -18,39 +18,39 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\uac80\uc0c9 \uc704\uce58: -FileChooser.saveInLabelText=\uc800\uc7a5 \uc704\uce58 -FileChooser.fileNameLabelText=\ud30c\uc77c \uc774\ub984: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\ud30c\uc77c \uc885\ub958: -FileChooser.upFolderToolTipText=\ud55c \ub2e8\uacc4 \uc704\ub85c -FileChooser.upFolderAccessibleName=\uc704 -FileChooser.homeFolderToolTipText=\ud648 -FileChooser.homeFolderAccessibleName=\ud648 -FileChooser.newFolderToolTipText=\uc0c8 \ud3f4\ub354 \uc791\uc131 -FileChooser.newFolderAccessibleName=\uc0c8 \ud3f4\ub354 -FileChooser.newFolderActionLabelText=\uc0c8 \ud3f4\ub354 -FileChooser.listViewButtonToolTipText=\ubaa9\ub85d -FileChooser.listViewButtonAccessibleName=\ubaa9\ub85d -FileChooser.listViewActionLabelText=\ubaa9\ub85d -FileChooser.detailsViewButtonToolTipText=\uc790\uc138\ud788 -FileChooser.detailsViewButtonAccessibleName=\uc790\uc138\ud788 -FileChooser.detailsViewActionLabelText=\uc790\uc138\ud788 -FileChooser.refreshActionLabelText=\uac31\uc2e0 -FileChooser.viewMenuLabelText=\ubcf4\uae30 -FileChooser.fileNameHeaderText=\uc774\ub984 -FileChooser.fileSizeHeaderText=\ud06c\uae30 -FileChooser.fileTypeHeaderText=\uc885\ub958 -FileChooser.fileDateHeaderText=\uc218\uc815 -FileChooser.fileAttrHeaderText=\uc18d\uc131 +FileChooser.lookInLabelText=\uAC80\uC0C9 \uC704\uCE58: +FileChooser.saveInLabelText=\uC800\uC7A5 \uC704\uCE58: +FileChooser.fileNameLabelText=\uD30C\uC77C \uC774\uB984: +FileChooser.folderNameLabelText=\uD3F4\uB354 \uC774\uB984: +FileChooser.filesOfTypeLabelText=\uD30C\uC77C \uC720\uD615: +FileChooser.upFolderToolTipText=\uD55C \uB808\uBCA8 \uC704\uB85C +FileChooser.upFolderAccessibleName=\uC704\uB85C +FileChooser.homeFolderToolTipText=\uD648 +FileChooser.homeFolderAccessibleName=\uD648 +FileChooser.newFolderToolTipText=\uC0C8 \uD3F4\uB354 \uC0DD\uC131 +FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354 +FileChooser.newFolderActionLabelText=\uC0C8 \uD3F4\uB354 +FileChooser.listViewButtonToolTipText=\uBAA9\uB85D +FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D +FileChooser.listViewActionLabelText=\uBAA9\uB85D +FileChooser.detailsViewButtonToolTipText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewActionLabelText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.refreshActionLabelText=\uC0C8\uB85C \uACE0\uCE68 +FileChooser.viewMenuLabelText=\uBCF4\uAE30 +FileChooser.fileNameHeaderText=\uC774\uB984 +FileChooser.fileSizeHeaderText=\uD06C\uAE30 +FileChooser.fileTypeHeaderText=\uC720\uD615 +FileChooser.fileDateHeaderText=\uC218\uC815 \uB0A0\uC9DC +FileChooser.fileAttrHeaderText=\uC18D\uC131 ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers -MetalTitlePane.restoreTitle=\ubcf5\uc6d0(R) +MetalTitlePane.restoreTitle=\uBCF5\uC6D0 MetalTitlePane.restoreMnemonic=82 -MetalTitlePane.iconifyTitle=\ucd5c\uc18c\ud654(E) +MetalTitlePane.iconifyTitle=\uCD5C\uC18C\uD654 MetalTitlePane.iconifyMnemonic=69 -MetalTitlePane.maximizeTitle=\ucd5c\ub300\ud654(X) +MetalTitlePane.maximizeTitle=\uCD5C\uB300\uD654 MetalTitlePane.maximizeMnemonic=88 -MetalTitlePane.closeTitle=\ub2eb\uae30(C) +MetalTitlePane.closeTitle=\uB2EB\uAE30 MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties index 6a397b35545..7f7cd1c8f44 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_pt_BR.properties @@ -18,17 +18,18 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Consultar em: -FileChooser.saveInLabelText=Salvar em: -FileChooser.fileNameLabelText=Nome de arquivo: -FileChooser.filesOfTypeLabelText=Arquivos de tipo: -FileChooser.upFolderToolTipText=Um n\u00edvel acima +FileChooser.lookInLabelText=Consultar Em: +FileChooser.saveInLabelText=Salvar Em: +FileChooser.fileNameLabelText=Nome do Arquivo: +FileChooser.folderNameLabelText=Nome da pasta: +FileChooser.filesOfTypeLabelText=Arquivos do Tipo: +FileChooser.upFolderToolTipText=Um N\u00EDvel Acima FileChooser.upFolderAccessibleName=Acima -FileChooser.homeFolderToolTipText=In\u00edcio -FileChooser.homeFolderAccessibleName=In\u00edcio -FileChooser.newFolderToolTipText=Criar nova pasta -FileChooser.newFolderAccessibleName=Nova pasta -FileChooser.newFolderActionLabelText=Nova pasta +FileChooser.homeFolderToolTipText=In\u00EDcio +FileChooser.homeFolderAccessibleName=In\u00EDcio +FileChooser.newFolderToolTipText=Criar Nova Pasta +FileChooser.newFolderAccessibleName=Nova Pasta +FileChooser.newFolderActionLabelText=Nova Pasta FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties index 03085c022e8..75176928601 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_sv.properties @@ -18,12 +18,12 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=S\u00f6k i: +FileChooser.lookInLabelText=Leta i: FileChooser.saveInLabelText=Spara i: FileChooser.fileNameLabelText=Filnamn: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Mapp: FileChooser.filesOfTypeLabelText=Filformat: -FileChooser.upFolderToolTipText=Upp en niv\u00e5 +FileChooser.upFolderToolTipText=Upp en niv\u00E5 FileChooser.upFolderAccessibleName=Upp FileChooser.homeFolderToolTipText=Hem FileChooser.homeFolderAccessibleName=Hem @@ -33,24 +33,24 @@ FileChooser.newFolderActionLabelText=Ny mapp FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista -FileChooser.detailsViewButtonToolTipText=Detaljerad lista -FileChooser.detailsViewButtonAccessibleName=Detaljerad lista -FileChooser.detailsViewActionLabelText=Detaljerad lista -FileChooser.refreshActionLabelText=Uppdatera +FileChooser.detailsViewButtonToolTipText=Detaljer +FileChooser.detailsViewButtonAccessibleName=Detaljer +FileChooser.detailsViewActionLabelText=Detaljer +FileChooser.refreshActionLabelText=F\u00F6rnya FileChooser.viewMenuLabelText=Vy FileChooser.fileNameHeaderText=Namn FileChooser.fileSizeHeaderText=Storlek FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=\u00c4ndrad +FileChooser.fileDateHeaderText=\u00C4ndrad FileChooser.fileAttrHeaderText=Attribut ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers -MetalTitlePane.restoreTitle=\u00c5terst\u00e4ll -MetalTitlePane.restoreMnemonic=84 +MetalTitlePane.restoreTitle=\u00C5terst\u00E4ll +MetalTitlePane.restoreMnemonic=82 MetalTitlePane.iconifyTitle=Minimera -MetalTitlePane.iconifyMnemonic=77 +MetalTitlePane.iconifyMnemonic=69 MetalTitlePane.maximizeTitle=Maximera MetalTitlePane.maximizeMnemonic=88 -MetalTitlePane.closeTitle=St\u00e4ng -MetalTitlePane.closeMnemonic=83 +MetalTitlePane.closeTitle=St\u00E4ng +MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties index 9e2b454a7ec..7292eebe8c2 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_CN.properties @@ -18,39 +18,39 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67e5\u770b\uff1a -FileChooser.saveInLabelText=\u4fdd\u5b58\uff1a -FileChooser.fileNameLabelText=\u6587\u4ef6\u540d\uff1a -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u6587\u4ef6\u7c7b\u578b\uff1a -FileChooser.upFolderToolTipText=\u5411\u4e0a\u4e00\u5c42 -FileChooser.upFolderAccessibleName=\u5411\u4e0a -FileChooser.homeFolderToolTipText=\u8d77\u59cb\u76ee\u5f55 -FileChooser.homeFolderAccessibleName=\u8d77\u59cb\u76ee\u5f55 -FileChooser.newFolderToolTipText=\u521b\u5efa\u65b0\u7684\u6587\u4ef6\u5939 -FileChooser.newFolderAccessibleName=\u65b0\u5efa\u6587\u4ef6\u5939 -FileChooser.newFolderActionLabelText=\u65b0\u5efa\u6587\u4ef6\u5939 +FileChooser.lookInLabelText=\u67E5\u770B: +FileChooser.saveInLabelText=\u4FDD\u5B58: +FileChooser.fileNameLabelText=\u6587\u4EF6\u540D: +FileChooser.folderNameLabelText=\u6587\u4EF6\u5939\u540D: +FileChooser.filesOfTypeLabelText=\u6587\u4EF6\u7C7B\u578B: +FileChooser.upFolderToolTipText=\u5411\u4E0A\u4E00\u7EA7 +FileChooser.upFolderAccessibleName=\u5411\u4E0A +FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u5F55 +FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55 +FileChooser.newFolderToolTipText=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939 +FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939 +FileChooser.newFolderActionLabelText=\u65B0\u5EFA\u6587\u4EF6\u5939 FileChooser.listViewButtonToolTipText=\u5217\u8868 FileChooser.listViewButtonAccessibleName=\u5217\u8868 FileChooser.listViewActionLabelText=\u5217\u8868 -FileChooser.detailsViewButtonToolTipText=\u8be6\u7ec6\u4fe1\u606f -FileChooser.detailsViewButtonAccessibleName=\u8be6\u7ec6\u4fe1\u606f -FileChooser.detailsViewActionLabelText=\u8be6\u7ec6\u4fe1\u606f -FileChooser.refreshActionLabelText=\u5237\u65b0 -FileChooser.viewMenuLabelText=\u89c6\u56fe -FileChooser.fileNameHeaderText=\u540d\u79f0 -FileChooser.fileSizeHeaderText=\u5927\u5c0f -FileChooser.fileTypeHeaderText=\u7c7b\u578b -FileChooser.fileDateHeaderText=\u4fee\u6b63\u7248 -FileChooser.fileAttrHeaderText=\u5c5e\u6027 +FileChooser.detailsViewButtonToolTipText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.detailsViewActionLabelText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.refreshActionLabelText=\u5237\u65B0 +FileChooser.viewMenuLabelText=\u89C6\u56FE +FileChooser.fileNameHeaderText=\u540D\u79F0 +FileChooser.fileSizeHeaderText=\u5927\u5C0F +FileChooser.fileTypeHeaderText=\u7C7B\u578B +FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeaderText=\u5C5E\u6027 ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers -MetalTitlePane.restoreTitle=\u6062\u590d (R) +MetalTitlePane.restoreTitle=\u8FD8\u539F MetalTitlePane.restoreMnemonic=82 -MetalTitlePane.iconifyTitle=\u6700\u5c0f\u5316 (E) +MetalTitlePane.iconifyTitle=\u6700\u5C0F\u5316 MetalTitlePane.iconifyMnemonic=69 -MetalTitlePane.maximizeTitle=\u6700\u5927\u5316 (X) +MetalTitlePane.maximizeTitle=\u6700\u5927\u5316 MetalTitlePane.maximizeMnemonic=88 -MetalTitlePane.closeTitle=\u5173\u95ed (C) +MetalTitlePane.closeTitle=\u5173\u95ED MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties index 3bc9d125fb2..c62c888cadf 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/metal/resources/metal_zh_TW.properties @@ -18,39 +18,39 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67e5\u770b\ufe55 -FileChooser.saveInLabelText=\u5132\u5b58\u65bc\uff1a -FileChooser.fileNameLabelText=\u6a94\u6848\u540d\u7a31\ufe55 -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u6a94\u6848\u985e\u578b\ufe55 -FileChooser.upFolderToolTipText=\u5f80\u4e0a\u4e00\u5c64 -FileChooser.upFolderAccessibleName=\u5f80\u4e0a -FileChooser.homeFolderToolTipText=\u4e3b\u76ee\u9304 -FileChooser.homeFolderAccessibleName=\u4e3b\u76ee\u9304 -FileChooser.newFolderToolTipText=\u5efa\u7acb\u65b0\u8cc7\u6599\u593e -FileChooser.newFolderAccessibleName=\u65b0\u8cc7\u6599\u593e -FileChooser.newFolderActionLabelText=\u65b0\u8cc7\u6599\u593e -FileChooser.listViewButtonToolTipText=\u6e05\u55ae -FileChooser.listViewButtonAccessibleName=\u6e05\u55ae -FileChooser.listViewActionLabelText=\u6e05\u55ae -FileChooser.detailsViewButtonToolTipText=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.detailsViewButtonAccessibleName=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.detailsViewActionLabelText=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.refreshActionLabelText=\u66f4\u65b0 -FileChooser.viewMenuLabelText=\u6aa2\u8996 -FileChooser.fileNameHeaderText=\u540d\u7a31 -FileChooser.fileSizeHeaderText=\u5927\u5c0f -FileChooser.fileTypeHeaderText=\u985e\u578b -FileChooser.fileDateHeaderText=\u5df2\u4fee\u6539 -FileChooser.fileAttrHeaderText=\u5c6c\u6027 +FileChooser.lookInLabelText=\u67E5\u8A62: +FileChooser.saveInLabelText=\u5132\u5B58\u65BC: +FileChooser.fileNameLabelText=\u6A94\u6848\u540D\u7A31: +FileChooser.folderNameLabelText=\u8CC7\u6599\u593E\u540D\u7A31: +FileChooser.filesOfTypeLabelText=\u6A94\u6848\u985E\u578B: +FileChooser.upFolderToolTipText=\u5F80\u4E0A\u4E00\u5C64 +FileChooser.upFolderAccessibleName=\u5F80\u4E0A +FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u9304 +FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304 +FileChooser.newFolderToolTipText=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderActionLabelText=\u65B0\u8CC7\u6599\u593E +FileChooser.listViewButtonToolTipText=\u6E05\u55AE +FileChooser.listViewButtonAccessibleName=\u6E05\u55AE +FileChooser.listViewActionLabelText=\u6E05\u55AE +FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.detailsViewActionLabelText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.refreshActionLabelText=\u91CD\u65B0\u6574\u7406 +FileChooser.viewMenuLabelText=\u6AA2\u8996 +FileChooser.fileNameHeaderText=\u540D\u7A31 +FileChooser.fileSizeHeaderText=\u5927\u5C0F +FileChooser.fileTypeHeaderText=\u985E\u578B +FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeaderText=\u5C6C\u6027 ############ Used by MetalTitlePane if rendering window decorations############ # All mnemonics are KeyEvent.VK_XXX as integers -MetalTitlePane.restoreTitle=\u5fa9\u539f(R) +MetalTitlePane.restoreTitle=\u5FA9\u539F MetalTitlePane.restoreMnemonic=82 -MetalTitlePane.iconifyTitle=\u6700\u5c0f\u5316(E) +MetalTitlePane.iconifyTitle=\u6700\u5C0F\u5316 MetalTitlePane.iconifyMnemonic=69 -MetalTitlePane.maximizeTitle=\u6700\u5927\u5316(X) +MetalTitlePane.maximizeTitle=\u6700\u5927\u5316 MetalTitlePane.maximizeMnemonic=88 -MetalTitlePane.closeTitle=\u95dc\u9589(C) +MetalTitlePane.closeTitle=\u95DC\u9589 MetalTitlePane.closeMnemonic=67 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties index 67192ebc71d..990f34464c2 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_de.properties @@ -10,6 +10,9 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson @@ -18,20 +21,25 @@ FileChooser.lookInLabelText=Suchen in: FileChooser.saveInLabelText=Speichern in: FileChooser.fileNameLabelText=Dateiname: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Ordnername: FileChooser.filesOfTypeLabelText=Dateityp: -FileChooser.upFolderToolTipText=Eine Ebene h\u00f6her -FileChooser.upFolderAccessibleName=H\u00f6her +FileChooser.upFolderToolTipText=Eine Ebene h\u00F6her +FileChooser.upFolderAccessibleName=Nach oben FileChooser.homeFolderToolTipText=Home FileChooser.homeFolderAccessibleName=Home FileChooser.newFolderToolTipText=Neuen Ordner erstellen FileChooser.newFolderAccessibleName=Neuer Ordner +FileChooser.newFolderActionLabelText=Neuer Ordner FileChooser.listViewButtonToolTipText=Liste FileChooser.listViewButtonAccessibleName=Liste +FileChooser.listViewActionLabelText=Liste FileChooser.detailsViewButtonToolTipText=Details FileChooser.detailsViewButtonAccessibleName=Details -FileChooser.fileNameHeaderText=Dateiname -FileChooser.fileSizeHeaderText=Gr\u00f6\u00dfe +FileChooser.detailsViewActionLabelText=Details +FileChooser.refreshActionLabelText=Aktualisieren +FileChooser.viewMenuLabelText=Ansicht +FileChooser.fileNameHeaderText=Name +FileChooser.fileSizeHeaderText=Gr\u00F6\u00DFe FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=Ge\u00e4ndert -FileChooser.fileAttrHeaderText=Attribut +FileChooser.fileDateHeaderText=Ge\u00E4ndert +FileChooser.fileAttrHeaderText=Attribute diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties index 6645bb24d3b..03d21660371 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_es.properties @@ -10,6 +10,9 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson @@ -17,21 +20,26 @@ FileChooser.lookInLabelText=Buscar en: FileChooser.saveInLabelText=Guardar en: -FileChooser.fileNameLabelText=Nombre de archivo: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=Archivos de tipo: -FileChooser.upFolderToolTipText=Subir un nivel +FileChooser.fileNameLabelText=Nombre de Archivo: +FileChooser.folderNameLabelText=Nombre de la Carpeta: +FileChooser.filesOfTypeLabelText=Archivos de Tipo: +FileChooser.upFolderToolTipText=Subir un Nivel FileChooser.upFolderAccessibleName=Arriba -FileChooser.homeFolderToolTipText=Principal -FileChooser.homeFolderAccessibleName=Principal -FileChooser.newFolderToolTipText=Crear carpeta nueva -FileChooser.newFolderAccessibleName=Carpeta nueva +FileChooser.homeFolderToolTipText=Inicio +FileChooser.homeFolderAccessibleName=Inicio +FileChooser.newFolderToolTipText=Crear Nueva Carpeta +FileChooser.newFolderAccessibleName=Nueva Carpeta +FileChooser.newFolderActionLabelText=Nueva Carpeta FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista +FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Detalles FileChooser.detailsViewButtonAccessibleName=Detalles +FileChooser.detailsViewActionLabelText=Detalles +FileChooser.refreshActionLabelText=Refrescar +FileChooser.viewMenuLabelText=Ver FileChooser.fileNameHeaderText=Nombre -FileChooser.fileSizeHeaderText=Tama\u00f1o +FileChooser.fileSizeHeaderText=Tama\u00F1o FileChooser.fileTypeHeaderText=Tipo FileChooser.fileDateHeaderText=Modificado FileChooser.fileAttrHeaderText=Atributos diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties index 24afdce6063..273351d689d 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_fr.properties @@ -10,6 +10,9 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson @@ -17,21 +20,26 @@ FileChooser.lookInLabelText=Rechercher dans : FileChooser.saveInLabelText=Enregistrer dans : -FileChooser.fileNameLabelText=Nom de fichier : -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=Fichiers du type : +FileChooser.fileNameLabelText=Nom du fichier : +FileChooser.folderNameLabelText=Nom du dossier : +FileChooser.filesOfTypeLabelText=Fichiers de type : FileChooser.upFolderToolTipText=Remonte d'un niveau. -FileChooser.upFolderAccessibleName=Vers le haut -FileChooser.homeFolderToolTipText= R\u00e9pertoire d'accueil -FileChooser.homeFolderAccessibleName=Accueil -FileChooser.newFolderToolTipText=Cr\u00e9e un nouveau dossier. +FileChooser.upFolderAccessibleName=Monter +FileChooser.homeFolderToolTipText=R\u00E9pertoire d'origine +FileChooser.homeFolderAccessibleName=R\u00E9pertoire d'origine +FileChooser.newFolderToolTipText=Cr\u00E9e un dossier. FileChooser.newFolderAccessibleName=Nouveau dossier +FileChooser.newFolderActionLabelText=Nouveau dossier FileChooser.listViewButtonToolTipText=Liste FileChooser.listViewButtonAccessibleName=Liste -FileChooser.detailsViewButtonToolTipText=D\u00e9tails -FileChooser.detailsViewButtonAccessibleName=D\u00e9tails +FileChooser.listViewActionLabelText=Liste +FileChooser.detailsViewButtonToolTipText=D\u00E9tails +FileChooser.detailsViewButtonAccessibleName=D\u00E9tails +FileChooser.detailsViewActionLabelText=D\u00E9tails +FileChooser.refreshActionLabelText=Actualiser +FileChooser.viewMenuLabelText=Affichage FileChooser.fileNameHeaderText=Nom FileChooser.fileSizeHeaderText=Taille FileChooser.fileTypeHeaderText=Type -FileChooser.fileDateHeaderText=Modifi\u00e9 +FileChooser.fileDateHeaderText=Modifi\u00E9 FileChooser.fileAttrHeaderText=Attributs diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties index c1eecd62742..da2e2c7bac8 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_it.properties @@ -10,6 +10,9 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson @@ -18,21 +21,25 @@ FileChooser.lookInLabelText=Cerca in: FileChooser.saveInLabelText=Salva in: FileChooser.fileNameLabelText=Nome file: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Nome della cartella: FileChooser.filesOfTypeLabelText=Tipo file: FileChooser.upFolderToolTipText=Cartella superiore FileChooser.upFolderAccessibleName=Superiore -FileChooser.homeFolderToolTipText=Principale -FileChooser.homeFolderAccessibleName=Principale +FileChooser.homeFolderToolTipText=Home +FileChooser.homeFolderAccessibleName=Home FileChooser.newFolderToolTipText=Crea nuova cartella FileChooser.newFolderAccessibleName=Nuova cartella -FileChooser.listViewButtonToolTipText=Elenco -FileChooser.listViewButtonAccessibleName=Elenco +FileChooser.newFolderActionLabelText=Nuova cartella +FileChooser.listViewButtonToolTipText=Lista +FileChooser.listViewButtonAccessibleName=Lista +FileChooser.listViewActionLabelText=Lista FileChooser.detailsViewButtonToolTipText=Dettagli FileChooser.detailsViewButtonAccessibleName=Dettagli +FileChooser.detailsViewActionLabelText=Dettagli +FileChooser.refreshActionLabelText=Aggiorna +FileChooser.viewMenuLabelText=Visualizza FileChooser.fileNameHeaderText=Nome FileChooser.fileSizeHeaderText=Dimensioni FileChooser.fileTypeHeaderText=Tipo FileChooser.fileDateHeaderText=Modificato FileChooser.fileAttrHeaderText=Attributi - diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties index d8c68ddb7e1..382fcf8b9e6 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ja.properties @@ -18,28 +18,28 @@ ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u53c2\u7167: -FileChooser.saveInLabelText=\u4fdd\u5b58: -FileChooser.fileNameLabelText=\u30d5\u30a1\u30a4\u30eb\u540d: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7: -FileChooser.upFolderToolTipText=1 \u30ec\u30d9\u30eb\u4e0a\u3078 -FileChooser.upFolderAccessibleName=\u4e0a\u3078 -FileChooser.homeFolderToolTipText=\u30db\u30fc\u30e0 -FileChooser.homeFolderAccessibleName=\u30db\u30fc\u30e0 -FileChooser.newFolderToolTipText=\u30d5\u30a9\u30eb\u30c0\u306e\u65b0\u898f\u4f5c\u6210 -FileChooser.newFolderAccessibleName=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.newFolderActionLabelText=\u65b0\u898f\u30d5\u30a9\u30eb\u30c0 -FileChooser.listViewButtonToolTipText=\u30ea\u30b9\u30c8 -FileChooser.listViewButtonAccessibleName=\u30ea\u30b9\u30c8 -FileChooser.listViewActionLabelText=\u30ea\u30b9\u30c8 -FileChooser.detailsViewButtonToolTipText=\u8a73\u7d30 -FileChooser.detailsViewButtonAccessibleName=\u8a73\u7d30 -FileChooser.detailsViewActionLabelText=\u8a73\u7d30 -FileChooser.refreshActionLabelText=\u66f4\u65b0 -FileChooser.viewMenuLabelText=\u8868\u793a -FileChooser.fileNameHeaderText=\u540d\u524d -FileChooser.fileSizeHeaderText=\u30b5\u30a4\u30ba -FileChooser.fileTypeHeaderText=\u578b -FileChooser.fileDateHeaderText=\u4fee\u6b63\u65e5 -FileChooser.fileAttrHeaderText=\u5c5e\u6027 +FileChooser.lookInLabelText=\u53C2\u7167: +FileChooser.saveInLabelText=\u4FDD\u5B58: +FileChooser.fileNameLabelText=\u30D5\u30A1\u30A4\u30EB\u540D: +FileChooser.folderNameLabelText=\u30D5\u30A9\u30EB\u30C0\u540D: +FileChooser.filesOfTypeLabelText=\u30D5\u30A1\u30A4\u30EB\u306E\u30BF\u30A4\u30D7: +FileChooser.upFolderToolTipText=1\u30EC\u30D9\u30EB\u4E0A\u3078 +FileChooser.upFolderAccessibleName=\u4E0A\u3078 +FileChooser.homeFolderToolTipText=\u30DB\u30FC\u30E0 +FileChooser.homeFolderAccessibleName=\u30DB\u30FC\u30E0 +FileChooser.newFolderToolTipText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0\u306E\u4F5C\u6210 +FileChooser.newFolderAccessibleName=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.newFolderActionLabelText=\u65B0\u898F\u30D5\u30A9\u30EB\u30C0 +FileChooser.listViewButtonToolTipText=\u30EA\u30B9\u30C8 +FileChooser.listViewButtonAccessibleName=\u30EA\u30B9\u30C8 +FileChooser.listViewActionLabelText=\u30EA\u30B9\u30C8 +FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30 +FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30 +FileChooser.detailsViewActionLabelText=\u8A73\u7D30 +FileChooser.refreshActionLabelText=\u30EA\u30D5\u30EC\u30C3\u30B7\u30E5 +FileChooser.viewMenuLabelText=\u8868\u793A +FileChooser.fileNameHeaderText=\u540D\u524D +FileChooser.fileSizeHeaderText=\u30B5\u30A4\u30BA +FileChooser.fileTypeHeaderText=\u30BF\u30A4\u30D7 +FileChooser.fileDateHeaderText=\u4FEE\u6B63\u65E5 +FileChooser.fileAttrHeaderText=\u5C5E\u6027 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties index e3b817e9e0b..adc9b1d5990 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_ko.properties @@ -10,34 +10,36 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\uac80\uc0c9 \uc704\uce58: -FileChooser.saveInLabelText=\uc800\uc7a5 \uc704\uce58 -FileChooser.fileNameLabelText=\ud30c\uc77c \uc774\ub984: -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\ud30c\uc77c \uc885\ub958: -FileChooser.upFolderToolTipText=\ud55c \ub2e8\uacc4 \uc704\ub85c -FileChooser.upFolderAccessibleName=\uc704 -FileChooser.homeFolderToolTipText=\ud648 -FileChooser.homeFolderAccessibleName=\ud648 -FileChooser.newFolderToolTipText=\uc0c8 \ud3f4\ub354 \uc791\uc131 -FileChooser.newFolderAccessibleName=\uc0c8 \ud3f4\ub354 -FileChooser.newFolderActionLabelText=\uc0c8 \ud3f4\ub354 -FileChooser.listViewButtonToolTipText=\ubaa9\ub85d -FileChooser.listViewButtonAccessibleName=\ubaa9\ub85d -FileChooser.listViewActionLabelText=\ubaa9\ub85d -FileChooser.detailsViewButtonToolTipText=\uc790\uc138\ud788 -FileChooser.detailsViewButtonAccessibleName=\uc790\uc138\ud788 -FileChooser.detailsViewActionLabelText=\uc790\uc138\ud788 -FileChooser.refreshActionLabelText=\uac31\uc2e0 -FileChooser.viewMenuLabelText=\ubcf4\uae30 -FileChooser.fileNameHeaderText=\uc774\ub984 -FileChooser.fileSizeHeaderText=\ud06c\uae30 -FileChooser.fileTypeHeaderText=\uc885\ub958 -FileChooser.fileDateHeaderText=\uc218\uc815 -FileChooser.fileAttrHeaderText=\uc18d\uc131 - +FileChooser.lookInLabelText=\uAC80\uC0C9 \uC704\uCE58: +FileChooser.saveInLabelText=\uC800\uC7A5 \uC704\uCE58: +FileChooser.fileNameLabelText=\uD30C\uC77C \uC774\uB984: +FileChooser.folderNameLabelText=\uD3F4\uB354 \uC774\uB984: +FileChooser.filesOfTypeLabelText=\uD30C\uC77C \uC720\uD615: +FileChooser.upFolderToolTipText=\uD55C \uB808\uBCA8 \uC704\uB85C +FileChooser.upFolderAccessibleName=\uC704\uB85C +FileChooser.homeFolderToolTipText=\uD648 +FileChooser.homeFolderAccessibleName=\uD648 +FileChooser.newFolderToolTipText=\uC0C8 \uD3F4\uB354 \uC0DD\uC131 +FileChooser.newFolderAccessibleName=\uC0C8 \uD3F4\uB354 +FileChooser.newFolderActionLabelText=\uC0C8 \uD3F4\uB354 +FileChooser.listViewButtonToolTipText=\uBAA9\uB85D +FileChooser.listViewButtonAccessibleName=\uBAA9\uB85D +FileChooser.listViewActionLabelText=\uBAA9\uB85D +FileChooser.detailsViewButtonToolTipText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewButtonAccessibleName=\uC138\uBD80 \uC815\uBCF4 +FileChooser.detailsViewActionLabelText=\uC138\uBD80 \uC815\uBCF4 +FileChooser.refreshActionLabelText=\uC0C8\uB85C \uACE0\uCE68 +FileChooser.viewMenuLabelText=\uBCF4\uAE30 +FileChooser.fileNameHeaderText=\uC774\uB984 +FileChooser.fileSizeHeaderText=\uD06C\uAE30 +FileChooser.fileTypeHeaderText=\uC720\uD615 +FileChooser.fileDateHeaderText=\uC218\uC815 \uB0A0\uC9DC +FileChooser.fileAttrHeaderText=\uC18D\uC131 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties index 395bd612741..b14a61f5b5d 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_pt_BR.properties @@ -10,22 +10,26 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=Consultar em: -FileChooser.saveInLabelText=Salvar em: -FileChooser.fileNameLabelText=Nome de arquivo: -FileChooser.filesOfTypeLabelText=Arquivos de tipo: -FileChooser.upFolderToolTipText=Um n\u00edvel acima +FileChooser.lookInLabelText=Consultar Em: +FileChooser.saveInLabelText=Salvar Em: +FileChooser.fileNameLabelText=Nome do Arquivo: +FileChooser.folderNameLabelText=Nome da pasta: +FileChooser.filesOfTypeLabelText=Arquivos do Tipo: +FileChooser.upFolderToolTipText=Um N\u00EDvel Acima FileChooser.upFolderAccessibleName=Acima -FileChooser.homeFolderToolTipText=In\u00edcio -FileChooser.homeFolderAccessibleName=In\u00edcio -FileChooser.newFolderToolTipText=Criar nova pasta -FileChooser.newFolderAccessibleName=Nova pasta -FileChooser.newFolderActionLabelText=Nova pasta +FileChooser.homeFolderToolTipText=In\u00EDcio +FileChooser.homeFolderAccessibleName=In\u00EDcio +FileChooser.newFolderToolTipText=Criar Nova Pasta +FileChooser.newFolderAccessibleName=Nova Pasta +FileChooser.newFolderActionLabelText=Nova Pasta FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista FileChooser.listViewActionLabelText=Lista diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties index eadf8335e96..9167b72f17b 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_sv.properties @@ -10,28 +10,36 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=S\u00f6k i: +FileChooser.lookInLabelText=Leta i: FileChooser.saveInLabelText=Spara i: FileChooser.fileNameLabelText=Filnamn: -FileChooser.folderNameLabelText=Folder name: +FileChooser.folderNameLabelText=Mapp: FileChooser.filesOfTypeLabelText=Filformat: -FileChooser.upFolderToolTipText=Upp en niv\u00e5 +FileChooser.upFolderToolTipText=Upp en niv\u00E5 FileChooser.upFolderAccessibleName=Upp FileChooser.homeFolderToolTipText=Hem FileChooser.homeFolderAccessibleName=Hem FileChooser.newFolderToolTipText=Skapa ny mapp FileChooser.newFolderAccessibleName=Ny mapp +FileChooser.newFolderActionLabelText=Ny mapp FileChooser.listViewButtonToolTipText=Lista FileChooser.listViewButtonAccessibleName=Lista -FileChooser.detailsViewButtonToolTipText=Detaljerad lista -FileChooser.detailsViewButtonAccessibleName=Detaljerad lista +FileChooser.listViewActionLabelText=Lista +FileChooser.detailsViewButtonToolTipText=Detaljer +FileChooser.detailsViewButtonAccessibleName=Detaljer +FileChooser.detailsViewActionLabelText=Detaljer +FileChooser.refreshActionLabelText=F\u00F6rnya +FileChooser.viewMenuLabelText=Vy FileChooser.fileNameHeaderText=Namn FileChooser.fileSizeHeaderText=Storlek FileChooser.fileTypeHeaderText=Typ -FileChooser.fileDateHeaderText=\u00c4ndrad +FileChooser.fileDateHeaderText=\u00C4ndrad FileChooser.fileAttrHeaderText=Attribut diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties index 2ca34e130ae..547fd155f8c 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_CN.properties @@ -10,28 +10,36 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67e5\u770b\uff1a -FileChooser.saveInLabelText=\u4fdd\u5b58\uff1a -FileChooser.fileNameLabelText=\u6587\u4ef6\u540d\uff1a -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u6587\u4ef6\u7c7b\u578b\uff1a -FileChooser.upFolderToolTipText=\u5411\u4e0a\u4e00\u5c42 -FileChooser.upFolderAccessibleName=\u5411\u4e0a -FileChooser.homeFolderToolTipText=\u8d77\u59cb\u76ee\u5f55 -FileChooser.homeFolderAccessibleName=\u8d77\u59cb\u76ee\u5f55 -FileChooser.newFolderToolTipText=\u521b\u5efa\u65b0\u7684\u6587\u4ef6\u5939 -FileChooser.newFolderAccessibleName=\u65b0\u5efa\u6587\u4ef6\u5939 +FileChooser.lookInLabelText=\u67E5\u770B: +FileChooser.saveInLabelText=\u4FDD\u5B58: +FileChooser.fileNameLabelText=\u6587\u4EF6\u540D: +FileChooser.folderNameLabelText=\u6587\u4EF6\u5939\u540D: +FileChooser.filesOfTypeLabelText=\u6587\u4EF6\u7C7B\u578B: +FileChooser.upFolderToolTipText=\u5411\u4E0A\u4E00\u7EA7 +FileChooser.upFolderAccessibleName=\u5411\u4E0A +FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u5F55 +FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u5F55 +FileChooser.newFolderToolTipText=\u521B\u5EFA\u65B0\u6587\u4EF6\u5939 +FileChooser.newFolderAccessibleName=\u65B0\u5EFA\u6587\u4EF6\u5939 +FileChooser.newFolderActionLabelText=\u65B0\u5EFA\u6587\u4EF6\u5939 FileChooser.listViewButtonToolTipText=\u5217\u8868 FileChooser.listViewButtonAccessibleName=\u5217\u8868 -FileChooser.detailsViewButtonToolTipText=\u8be6\u7ec6\u4fe1\u606f -FileChooser.detailsViewButtonAccessibleName=\u8be6\u7ec6\u4fe1\u606f -FileChooser.fileNameHeaderText=\u540d\u79f0 -FileChooser.fileSizeHeaderText=\u5927\u5c0f -FileChooser.fileTypeHeaderText=\u7c7b\u578b -FileChooser.fileDateHeaderText=\u4fee\u6b63\u7248 -FileChooser.fileAttrHeaderText=\u5c5e\u6027 +FileChooser.listViewActionLabelText=\u5217\u8868 +FileChooser.detailsViewButtonToolTipText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.detailsViewButtonAccessibleName=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.detailsViewActionLabelText=\u8BE6\u7EC6\u8D44\u6599 +FileChooser.refreshActionLabelText=\u5237\u65B0 +FileChooser.viewMenuLabelText=\u89C6\u56FE +FileChooser.fileNameHeaderText=\u540D\u79F0 +FileChooser.fileSizeHeaderText=\u5927\u5C0F +FileChooser.fileTypeHeaderText=\u7C7B\u578B +FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeaderText=\u5C5E\u6027 diff --git a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties index 42493313a9c..1144f6173dd 100644 --- a/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties +++ b/jdk/src/share/classes/com/sun/swing/internal/plaf/synth/resources/synth_zh_TW.properties @@ -10,28 +10,36 @@ # This may change in future versions of Swing as we improve localization # support. # +# Refer to the note in basic.properties for a description as to what +# the mnemonics correspond to and how to calculate them. +# # @author Steve Wilson ############ FILE CHOOSER STRINGS ############# -FileChooser.lookInLabelText=\u67e5\u770b\ufe55 -FileChooser.saveInLabelText=\u5132\u5b58\u65bc\uff1a -FileChooser.fileNameLabelText=\u6a94\u6848\u540d\u7a31\ufe55 -FileChooser.folderNameLabelText=Folder name: -FileChooser.filesOfTypeLabelText=\u6a94\u6848\u985e\u578b\ufe55 -FileChooser.upFolderToolTipText=\u5f80\u4e0a\u4e00\u5c64 -FileChooser.upFolderAccessibleName=\u5f80\u4e0a -FileChooser.homeFolderToolTipText=\u4e3b\u76ee\u9304 -FileChooser.homeFolderAccessibleName=\u4e3b\u76ee\u9304 -FileChooser.newFolderToolTipText=\u5efa\u7acb\u65b0\u8cc7\u6599\u593e -FileChooser.newFolderAccessibleName=\u65b0\u8cc7\u6599\u593e -FileChooser.listViewButtonToolTipText=\u6e05\u55ae -FileChooser.listViewButtonAccessibleName=\u6e05\u55ae -FileChooser.detailsViewButtonToolTipText=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.detailsViewButtonAccessibleName=\u8a73\u7d30\u8cc7\u8a0a -FileChooser.fileNameHeaderText=\u540d\u7a31 -FileChooser.fileSizeHeaderText=\u5927\u5c0f -FileChooser.fileTypeHeaderText=\u985e\u578b -FileChooser.fileDateHeaderText=\u5df2\u4fee\u6539 -FileChooser.fileAttrHeaderText=\u5c6c\u6027 +FileChooser.lookInLabelText=\u67E5\u8A62: +FileChooser.saveInLabelText=\u5132\u5B58\u65BC: +FileChooser.fileNameLabelText=\u6A94\u6848\u540D\u7A31: +FileChooser.folderNameLabelText=\u8CC7\u6599\u593E\u540D\u7A31: +FileChooser.filesOfTypeLabelText=\u6A94\u6848\u985E\u578B: +FileChooser.upFolderToolTipText=\u5F80\u4E0A\u4E00\u5C64 +FileChooser.upFolderAccessibleName=\u5F80\u4E0A +FileChooser.homeFolderToolTipText=\u4E3B\u76EE\u9304 +FileChooser.homeFolderAccessibleName=\u4E3B\u76EE\u9304 +FileChooser.newFolderToolTipText=\u5EFA\u7ACB\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderAccessibleName=\u65B0\u8CC7\u6599\u593E +FileChooser.newFolderActionLabelText=\u65B0\u8CC7\u6599\u593E +FileChooser.listViewButtonToolTipText=\u6E05\u55AE +FileChooser.listViewButtonAccessibleName=\u6E05\u55AE +FileChooser.listViewActionLabelText=\u6E05\u55AE +FileChooser.detailsViewButtonToolTipText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.detailsViewButtonAccessibleName=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.detailsViewActionLabelText=\u8A73\u7D30\u8CC7\u8A0A +FileChooser.refreshActionLabelText=\u91CD\u65B0\u6574\u7406 +FileChooser.viewMenuLabelText=\u6AA2\u8996 +FileChooser.fileNameHeaderText=\u540D\u7A31 +FileChooser.fileSizeHeaderText=\u5927\u5C0F +FileChooser.fileTypeHeaderText=\u985E\u578B +FileChooser.fileDateHeaderText=\u4FEE\u6539\u65E5\u671F +FileChooser.fileAttrHeaderText=\u5C6C\u6027 diff --git a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java index 6e61b51a217..14b3073f689 100644 --- a/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java +++ b/jdk/src/share/classes/com/sun/tools/example/debug/tty/TTYResources_ja.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,403 +45,282 @@ public class TTYResources_ja extends java.util.ListResourceBundle { * @return the contents of this ResourceBundle. */ public Object[][] getContents() { - return new Object[][] { + Object[][] temp = new Object[][] { // NOTE: The value strings in this file containing "{0}" are // processed by the java.text.MessageFormat class. Any // single quotes appearing in these strings need to be // doubled up. // // LOCALIZE THIS - {"** classes list **", "** \u30af\u30e9\u30b9\u30ea\u30b9\u30c8 **\n{0}"}, - {"** fields list **", "** \u30d5\u30a3\u30fc\u30eb\u30c9\u30ea\u30b9\u30c8 **\n{0}"}, - {"** methods list **", "** \u30e1\u30bd\u30c3\u30c9\u30ea\u30b9\u30c8 **\n{0}"}, - {"*** Reading commands from", "*** {0} \u304b\u3089\u30b3\u30de\u30f3\u30c9\u3092\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059"}, - {"All threads resumed.", "\u3059\u3079\u3066\u306e\u30b9\u30ec\u30c3\u30c9\u304c\u518d\u958b\u3055\u308c\u307e\u3057\u305f\u3002"}, - {"All threads suspended.", "\u3059\u3079\u3066\u306e\u30b9\u30ec\u30c3\u30c9\u304c\u4e2d\u65ad\u3055\u308c\u307e\u3057\u305f\u3002"}, - {"Argument is not defined for connector:", "\u30b3\u30cd\u30af\u30bf {1} \u3067\u5f15\u6570 {0} \u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"Arguments match no method", "\u5f15\u6570\u3068\u4e00\u81f4\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"Array:", "\u914d\u5217: {0}"}, - {"Array element is not a method", "\u914d\u5217\u8981\u7d20\u306f\u3001\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3042\u308a\u307e\u305b\u3093"}, - {"Array index must be a integer type", "\u914d\u5217\u306e\u6dfb\u3048\u5b57\u306f\u6574\u6570\u578b\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059"}, - {"base directory:", "\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea: {0}"}, - {"bootclasspath:", "\u30d6\u30fc\u30c8\u30af\u30e9\u30b9\u30d1\u30b9: {0}"}, - {"Breakpoint hit:", "\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u30d2\u30c3\u30c8: "}, - {"breakpoint", "\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8 {0}"}, - {"Breakpoints set:", "\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u30bb\u30c3\u30c8:"}, - {"Breakpoints can be located only in classes.", "\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u306f\u3001\u30af\u30e9\u30b9\u306b\u306e\u307f\u5272\u308a\u5f53\u3066\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002{0} \u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u307e\u305f\u306f\u914d\u5217\u3067\u3059\u3002"}, - {"Can only trace", "'methods'\u3001'method exit' \u307e\u305f\u306f 'method exits' \u306e\u307f\u3092\u30c8\u30ec\u30fc\u30b9\u3067\u304d\u307e\u3059"}, - {"cannot redefine existing connection", "{0} \u306f\u3001\u65e2\u5b58\u306e\u63a5\u7d9a\u3092\u518d\u5b9a\u7fa9\u3067\u304d\u307e\u305b\u3093"}, - {"Cannot assign to a method invocation", "\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306b\u306f\u5272\u308a\u5f53\u3066\u3089\u308c\u307e\u305b\u3093"}, - {"Cannot specify command line with connector:", "\u30b3\u30cd\u30af\u30bf\uff5b0} \u3067\u306f\u30b3\u30de\u30f3\u30c9\u884c\u3092\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093"}, - {"Cannot specify target vm arguments with connector:", "\u30b3\u30cd\u30af\u30bf {0}\u3067\u306f\u3001\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u5f15\u6570\u3092\u6307\u5b9a\u3067\u304d\u307e\u305b\u3093"}, - {"Class containing field must be specified.", "\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u542b\u3080\u30af\u30e9\u30b9\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002"}, - {"Class:", "\u30af\u30e9\u30b9: {0}"}, - {"Classic VM no longer supported.", "Classic VM \u306f\u3082\u3046\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"classpath:", "\u30af\u30e9\u30b9\u30d1\u30b9: {0}"}, + {"** classes list **", "** \u30AF\u30E9\u30B9\u30FB\u30EA\u30B9\u30C8 **\n{0}"}, + {"** fields list **", "** \u30D5\u30A3\u30FC\u30EB\u30C9\u30FB\u30EA\u30B9\u30C8 **\n{0}"}, + {"** methods list **", "** \u30E1\u30BD\u30C3\u30C9\u30FB\u30EA\u30B9\u30C8 **\n{0}"}, + {"*** Reading commands from", "*** {0}\u304B\u3089\u306E\u30B3\u30DE\u30F3\u30C9\u306E\u8AAD\u53D6\u308A"}, + {"All threads resumed.", "\u3059\u3079\u3066\u306E\u30B9\u30EC\u30C3\u30C9\u304C\u518D\u958B\u3055\u308C\u307E\u3057\u305F\u3002"}, + {"All threads suspended.", "\u3059\u3079\u3066\u306E\u30B9\u30EC\u30C3\u30C9\u304C\u4E2D\u65AD\u3055\u308C\u307E\u3057\u305F\u3002"}, + {"Argument is not defined for connector:", "\u5F15\u6570{0}\u306F\u30B3\u30CD\u30AF\u30BF\u306B\u5BFE\u3057\u3066\u5B9A\u7FA9\u3055\u308C\u3066\u3044\u307E\u305B\u3093: {1}"}, + {"Arguments match no method", "\u5F15\u6570\u304C\u9069\u5408\u3059\u308B\u30E1\u30BD\u30C3\u30C9\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"Array:", "\u914D\u5217: {0}"}, + {"Array element is not a method", "\u914D\u5217\u8981\u7D20\u306F\u30E1\u30BD\u30C3\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"}, + {"Array index must be a integer type", "\u914D\u5217\u306E\u6DFB\u3048\u5B57\u306F\u6574\u6570\u578B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"}, + {"base directory:", "\u30D9\u30FC\u30B9\u30FB\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA: {0}"}, + {"bootclasspath:", "\u30D6\u30FC\u30C8\u30FB\u30AF\u30E9\u30B9\u30D1\u30B9: {0}"}, + {"Breakpoint hit:", "\u30D2\u30C3\u30C8\u3057\u305F\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8: "}, + {"breakpoint", "\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8{0}"}, + {"Breakpoints set:", "\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u308B\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8:"}, + {"Breakpoints can be located only in classes.", "\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u306F\u30AF\u30E9\u30B9\u5185\u306B\u306E\u307F\u914D\u7F6E\u3067\u304D\u307E\u3059\u3002{0}\u306F\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9\u307E\u305F\u306F\u914D\u5217\u3067\u3059\u3002"}, + {"Can only trace", "'methods'\u3001'method exit'\u307E\u305F\u306F'method exits'\u306E\u307F\u30C8\u30EC\u30FC\u30B9\u3067\u304D\u307E\u3059"}, + {"cannot redefine existing connection", "{0}\u306F\u65E2\u5B58\u306E\u63A5\u7D9A\u3092\u518D\u5B9A\u7FA9\u3067\u304D\u307E\u305B\u3093"}, + {"Cannot assign to a method invocation", "\u30E1\u30BD\u30C3\u30C9\u547C\u51FA\u3057\u306B\u5272\u5F53\u3066\u3067\u304D\u307E\u305B\u3093"}, + {"Cannot specify command line with connector:", "\u30B3\u30CD\u30AF\u30BF\u3067\u30B3\u30DE\u30F3\u30C9\u30E9\u30A4\u30F3\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093: {0}"}, + {"Cannot specify target vm arguments with connector:", "\u30B3\u30CD\u30AF\u30BF\u3067\u30BF\u30FC\u30B2\u30C3\u30C8VM\u5F15\u6570\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093: {0}"}, + {"Class containing field must be specified.", "\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u542B\u3080\u30AF\u30E9\u30B9\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059\u3002"}, + {"Class:", "\u30AF\u30E9\u30B9: {0}"}, + {"Classic VM no longer supported.", "Classic VM\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"classpath:", "\u30AF\u30E9\u30B9\u30D1\u30B9: {0}"}, {"colon mark", ":"}, {"colon space", ": "}, - {"Command is not supported on the target VM", "\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u3067\u306f\u3001\u30b3\u30de\u30f3\u30c9 ''{0}'' \u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"Command is not supported on a read-only VM connection", "\u8aad\u307f\u53d6\u308a\u5c02\u7528 VM \u63a5\u7d9a\u3067\u306f\u3001\u30b3\u30de\u30f3\u30c9 ''{0}'' \u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"Command not valid until the VM is started with the run command", "\u30b3\u30de\u30f3\u30c9 ''{0}'' \u306f\u3001''run'' \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u3063\u3066 VM \u3092\u8d77\u52d5\u3059\u308b\u307e\u3067\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093"}, - {"Condition must be boolean", "\u6761\u4ef6\u306f boolean \u578b\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059"}, - {"Connector and Transport name", " \u30b3\u30cd\u30af\u30bf: {0} \u30c8\u30e9\u30f3\u30b9\u30dd\u30fc\u30c8: {1}"}, - {"Connector argument nodefault", " \u5f15\u6570: {0} (\u30c7\u30d5\u30a9\u30eb\u30c8\u306a\u3057)"}, - {"Connector argument default", " \u5f15\u6570: {0} \u30c7\u30d5\u30a9\u30eb\u30c8\u5024: {1}"}, - {"Connector description", " \u8aac\u660e: {0}"}, - {"Connector required argument nodefault", " \u5fc5\u9808\u5f15\u6570: {0} (\u30c7\u30d5\u30a9\u30eb\u30c8\u306a\u3057)"}, - {"Connector required argument default", " \u5fc5\u9808\u5f15\u6570: {0} \u30c7\u30d5\u30a9\u30eb\u30c8\u5024: {1}"}, - {"Connectors available", "\u5229\u7528\u53ef\u80fd\u306a\u30b3\u30cd\u30af\u30bf:"}, - {"Constant is not a method", "\u5b9a\u6570\u306f\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3042\u308a\u307e\u305b\u3093"}, - {"Could not open:", "{0} \u3092\u958b\u3051\u307e\u305b\u3093"}, - {"Current method is native", "\u73fe\u884c\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u30cd\u30a4\u30c6\u30a3\u30d6\u3067\u3059"}, - {"Current thread died. Execution continuing...", "\u73fe\u5728\u306e\u30b9\u30ec\u30c3\u30c9 {0} \u304c\u4e2d\u65ad\u3055\u308c\u307e\u3057\u305f\u3002\u51e6\u7406\u3092\u7d9a\u884c\u3057\u3066\u3044\u307e\u3059..."}, - {"Current thread isnt suspended.", "\u73fe\u5728\u306e\u30b9\u30ec\u30c3\u30c9\u306f\u505c\u6b62\u3057\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"Current thread not set.", "\u73fe\u5728\u306e\u30b9\u30ec\u30c3\u30c9\u306f\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"dbgtrace flag value must be an integer:", "dbgtrace \u30d5\u30e9\u30b0\u5024\u306f\u3001\u6574\u6570\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059: {0}"}, - {"Deferring.", "{0} \u3092\u4fdd\u7559\u3057\u3066\u3044\u307e\u3059\u3002\n\u30af\u30e9\u30b9\u304c\u30ed\u30fc\u30c9\u3055\u308c\u305f\u5f8c\u306b\u8a2d\u5b9a\u3055\u308c\u307e\u3059\u3002"}, - {"End of stack.", "\u30b9\u30bf\u30c3\u30af\u306e\u7d42\u308f\u308a\u3002"}, - {"Error popping frame", "\u30d5\u30ec\u30fc\u30e0\u306e\u30dd\u30c3\u30d7\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f - {0}"}, - {"Error reading file", "''{0}'' \u306e \u8aad\u307f\u8fbc\u307f\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f - {1}"}, - {"Error redefining class to file", "{0} \u306e {1} \u3078\u306e\u518d\u5b9a\u7fa9\u4e2d\u306b\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3057\u305f - {2}"}, - {"exceptionSpec all", "all {0}"}, - {"exceptionSpec caught", "caught {0}"}, - {"exceptionSpec uncaught", "uncaught {0}"}, - {"Exception in expression:", "\u5f0f\u3067\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {0}"}, - {"Exception occurred caught", "\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {0} ({1}\u3067\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u307e\u3057\u305f)"}, - {"Exception occurred uncaught", "\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {0} (\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u3066\u3044\u307e\u305b\u3093)"}, - {"Exceptions caught:", "\u4ee5\u4e0b\u306e\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u6642\u306b\u505c\u6b62\u3057\u307e\u3059:"}, + {"Command is not supported on the target VM", "\u30B3\u30DE\u30F3\u30C9''{0}''\u306F\u30BF\u30FC\u30B2\u30C3\u30C8VM\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"}, + {"Command is not supported on a read-only VM connection", "\u30B3\u30DE\u30F3\u30C9''{0}''\u306F\u8AAD\u53D6\u308A\u5C02\u7528VM\u63A5\u7D9A\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"}, + {"Command not valid until the VM is started with the run command", "\u30B3\u30DE\u30F3\u30C9''{0}''\u306F\u3001VM\u304C''run''\u30B3\u30DE\u30F3\u30C9\u3067\u958B\u59CB\u3055\u308C\u308B\u307E\u3067\u7121\u52B9\u3067\u3059"}, + {"Condition must be boolean", "\u6761\u4EF6\u306Fboolean\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"}, + {"Connector and Transport name", " \u30B3\u30CD\u30AF\u30BF: {0} \u30C8\u30E9\u30F3\u30B9\u30DD\u30FC\u30C8: {1}"}, + {"Connector argument nodefault", " \u5F15\u6570: {0} (\u30C7\u30D5\u30A9\u30EB\u30C8\u306A\u3057)"}, + {"Connector argument default", " \u5F15\u6570: {0} \u30C7\u30D5\u30A9\u30EB\u30C8\u5024: {1}"}, + {"Connector description", " \u8AAC\u660E: {0}"}, + {"Connector required argument nodefault", " \u5FC5\u9808\u5F15\u6570: {0} (\u30C7\u30D5\u30A9\u30EB\u30C8\u306A\u3057)"}, + {"Connector required argument default", " \u5FC5\u9808\u5F15\u6570: {0} \u30C7\u30D5\u30A9\u30EB\u30C8\u5024: {1}"}, + {"Connectors available", "\u5229\u7528\u53EF\u80FD\u306A\u30B3\u30CD\u30AF\u30BF:"}, + {"Constant is not a method", "\u5B9A\u6570\u306F\u30E1\u30BD\u30C3\u30C9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"}, + {"Could not open:", "\u958B\u3051\u307E\u305B\u3093\u3067\u3057\u305F: {0}"}, + {"Current method is native", "\u73FE\u5728\u306E\u30E1\u30BD\u30C3\u30C9\u306Fnative\u3067\u3059"}, + {"Current thread died. Execution continuing...", "\u73FE\u5728\u306E\u30B9\u30EC\u30C3\u30C9{0}\u304C\u7D42\u4E86\u3057\u307E\u3057\u305F\u3002\u5B9F\u884C\u304C\u7D9A\u884C\u4E2D..."}, + {"Current thread isnt suspended.", "\u73FE\u5728\u306E\u30B9\u30EC\u30C3\u30C9\u306F\u4E2D\u65AD\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"Current thread not set.", "\u73FE\u5728\u306E\u30B9\u30EC\u30C3\u30C9\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"dbgtrace flag value must be an integer:", "dbgtrace\u30D5\u30E9\u30B0\u5024\u306F\u6574\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059: {0}"}, + {"Deferring.", "\u9045\u5EF6\u3057\u305F{0}\u3002\n\u30AF\u30E9\u30B9\u304C\u30ED\u30FC\u30C9\u3055\u308C\u305F\u5F8C\u306B\u8A2D\u5B9A\u3055\u308C\u307E\u3059\u3002"}, + {"End of stack.", "\u30B9\u30BF\u30C3\u30AF\u306E\u7D42\u308F\u308A\u3002"}, + {"Error popping frame", "\u30D5\u30EC\u30FC\u30E0\u306E\u30DD\u30C3\u30D7\u4E2D\u306E\u30A8\u30E9\u30FC - {0}"}, + {"Error reading file", "''{0}''\u306E\u8AAD\u53D6\u308A\u30A8\u30E9\u30FC - {1}"}, + {"Error redefining class to file", "{0}\u3092{1}\u306B\u518D\u5B9A\u7FA9\u4E2D\u306E\u30A8\u30E9\u30FC - {2}"}, + {"exceptionSpec all", "\u3059\u3079\u3066\u306E{0}"}, + {"exceptionSpec caught", "\u6355\u6349\u3057\u305F{0}"}, + {"exceptionSpec uncaught", "\u6355\u6349\u3055\u308C\u306A\u3044{0}"}, + {"Exception in expression:", "\u5F0F\u306E\u4F8B\u5916: {0}"}, + {"Exception occurred caught", "\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0} (\u6355\u6349\u3055\u308C\u308B\u5834\u6240: {1})"}, + {"Exception occurred uncaught", "\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0} (\u6355\u6349\u3055\u308C\u306A\u3044)"}, + {"Exceptions caught:", "\u6B21\u306E\u4F8B\u5916\u304C\u767A\u751F\u3057\u305F\u3068\u304D\u306B\u30D6\u30EC\u30FC\u30AF:"}, {"expr is null", "{0} = null"}, {"expr is value", "{0} = {1}"}, - {"expr is value ", " {0} = {1} <\u53ce\u96c6\u3055\u308c\u307e\u3057\u305f>"}, - {"Expression cannot be void", "\u5f0f\u3092 void \u578b\u306b\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093"}, - {"Expression must evaluate to an object", "\u5f0f\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8a55\u4fa1\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059"}, - {"extends:", "\u62e1\u5f35: {0}"}, - {"Failed reading output", "\u5b50 java \u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u306e\u51fa\u529b\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002"}, - {"Fatal error", "\u81f4\u547d\u7684\u30a8\u30e9\u30fc:"}, - {"Field access encountered before after", "{1} \u306e\u30d5\u30a3\u30fc\u30eb\u30c9 ({0}) \u306f {2} \u306b\u306a\u308a\u307e\u3059: "}, - {"Field access encountered", "\u30d5\u30a3\u30fc\u30eb\u30c9 ({0}) \u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f: "}, - {"Field to unwatch not specified", "\u76e3\u8996\u3057\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"Field to watch not specified", "\u76e3\u8996\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"GC Disabled for", "{0} \u3067\u306f GC \u304c\u7121\u52b9\u3067\u3059:"}, - {"GC Enabled for", "{0} \u3067\u306f GC \u304c\u6709\u52b9\u3067\u3059:"}, + {"expr is value ", " {0} = {1} "}, + {"Expression cannot be void", "\u5F0F\u306Fvoid\u578B\u306B\u3067\u304D\u307E\u305B\u3093"}, + {"Expression must evaluate to an object", "\u5F0F\u306F\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3068\u3057\u3066\u8A55\u4FA1\u3055\u308C\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"}, + {"extends:", "\u62E1\u5F35\u3057\u307E\u3059: {0}"}, + {"Failed reading output", "\u5B50\u306Ejava\u30A4\u30F3\u30BF\u30FC\u30D7\u30EA\u30BF\u306E\u51FA\u529B\u306E\u8AAD\u53D6\u308A\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"}, + {"Fatal error", "\u81F4\u547D\u7684\u30A8\u30E9\u30FC:"}, + {"Field access encountered before after", "\u30D5\u30A3\u30FC\u30EB\u30C9({0})\u306F{1}\u3067\u3001{2}\u306B\u306A\u308A\u307E\u3059: "}, + {"Field access encountered", "\u30D5\u30A3\u30FC\u30EB\u30C9({0})\u306E\u30A2\u30AF\u30BB\u30B9\u304C\u691C\u51FA\u3055\u308C\u307E\u3057\u305F: "}, + {"Field to unwatch not specified", "\u76E3\u8996\u3057\u306A\u3044\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"Field to watch not specified", "\u76E3\u8996\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"GC Disabled for", "{0}\u306EGC\u304C\u7121\u52B9\u3067\u3059:"}, + {"GC Enabled for", "{0}\u306EGC\u304C\u6709\u52B9\u3067\u3059:"}, {"grouping begin character", "{"}, {"grouping end character", "}"}, - {"Illegal Argument Exception", "\u4e0d\u6b63\u306a\u5f15\u6570\u4f8b\u5916\u3067\u3059"}, - {"Illegal connector argument", "\u4e0d\u6b63\u306a\u30b3\u30cd\u30af\u30bf\u5f15\u6570: {0}"}, - {"implementor:", "\u5b9f\u88c5\u8005: {0}"}, - {"implements:", "\u5b9f\u88c5\u3057\u307e\u3059: {0}"}, - {"Initializing progname", "{0} \u306e\u521d\u671f\u5316\u4e2d\u3067\u3059..."}, - {"Input stream closed.", "\u5165\u529b\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u7d42\u4e86\u3057\u307e\u3057\u305f\u3002"}, - {"Interface:", "\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9: {0}"}, - {"Internal debugger error.", "\u5185\u90e8\u30c7\u30d0\u30c3\u30ac\u30a8\u30e9\u30fc"}, - {"Internal error: null ThreadInfo created", "\u5185\u90e8\u30a8\u30e9\u30fc: null ThreadInfo \u304c\u4f5c\u6210\u3055\u308c\u307e\u3057\u305f"}, - {"Internal error; unable to set", "\u5185\u90e8\u30a8\u30e9\u30fc; {0} \u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093"}, - {"Internal exception during operation:", "\u51e6\u7406\u4e2d\u306b\u5185\u90e8\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f:\n {0}"}, - {"Internal exception:", "\u5185\u90e8\u4f8b\u5916:"}, - {"Invalid argument type name", "\u5f15\u6570\u306e\u578b\u540d\u304c\u7121\u52b9\u3067\u3059"}, - {"Invalid assignment syntax", "\u4ee3\u5165\u69cb\u6587\u304c\u7121\u52b9\u3067\u3059"}, - {"Invalid command syntax", "\u30b3\u30de\u30f3\u30c9\u69cb\u6587\u304c\u7121\u52b9\u3067\u3059"}, - {"Invalid connect type", "\u63a5\u7d9a\u306e\u7a2e\u985e\u304c\u7121\u52b9\u3067\u3059"}, - {"Invalid consecutive invocations", "\u9023\u7d9a\u547c\u3073\u51fa\u3057\u304c\u7121\u52b9\u3067\u3059"}, - {"Invalid exception object", "\u4f8b\u5916\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u7121\u52b9\u3067\u3059"}, - {"Invalid method specification:", "\u7121\u52b9\u306a\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3057\u307e\u3057\u305f: {0}"}, - {"Invalid option on class command", "\u30af\u30e9\u30b9\u30b3\u30de\u30f3\u30c9\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u7121\u52b9\u3067\u3059"}, - {"invalid option", "\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u7121\u52b9\u3067\u3059: {0}"}, - {"Invalid thread status.", "\u30b9\u30ec\u30c3\u30c9\u30b9\u30c6\u30fc\u30bf\u30b9\u304c\u7121\u52b9\u3067\u3059\u3002"}, - {"Invalid transport name:", "\u30c8\u30e9\u30f3\u30b9\u30dd\u30fc\u30c8\u540d\u304c\u7121\u52b9\u3067\u3059: {0}"}, - {"I/O exception occurred:", "\u5165\u51fa\u529b\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f: {0}"}, - {"is an ambiguous method name in", "\"{0}\" \u306f\u3001\"{1}\" \u3067\u306f\u3042\u3044\u307e\u3044\u306a\u30e1\u30bd\u30c3\u30c9\u540d\u3067\u3059"}, - {"is an invalid line number for", "{0,number,integer} \u306f\u3001{1} \u306e\u7121\u52b9\u306a\u884c\u756a\u53f7\u3067\u3059"}, - {"is not a valid class name", "\"{0}\" \u306f\u3001\u6709\u52b9\u306a\u30af\u30e9\u30b9\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"is not a valid field name", "\"{0}\" \u306f\u3001\u6709\u52b9\u306a\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"is not a valid id or class name", "\"{0}\" \u306f\u3001\u6709\u52b9\u306a ID \u307e\u305f\u306f\u30af\u30e9\u30b9\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"is not a valid line number or method name for", "\"{0}\" \u306f\u3001\u30af\u30e9\u30b9 \"{1}\" \u306e\u6709\u52b9\u306a\u884c\u756a\u53f7\u307e\u305f\u306f\u30e1\u30bd\u30c3\u30c9\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093"}, - {"is not a valid method name", "\"{0}\" \u306f\u3001\u6709\u52b9\u306a\u30e1\u30bd\u30c3\u30c9\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"is not a valid thread id", "\"{0}\" \u306f\u3001\u6709\u52b9\u306a\u30b9\u30ec\u30c3\u30c9 ID \u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"is not a valid threadgroup name", "\"{0}\" \u306f\u3001\u6709\u52b9\u306a\u30b9\u30ec\u30c3\u30c9\u30b0\u30eb\u30fc\u30d7\u540d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"}, + {"Illegal Argument Exception", "\u4E0D\u6B63\u306A\u5F15\u6570\u306E\u4F8B\u5916\u3067\u3059"}, + {"Illegal connector argument", "\u4E0D\u6B63\u306A\u30B3\u30CD\u30AF\u30BF\u5F15\u6570\u3067\u3059: {0}"}, + {"implementor:", "\u30A4\u30F3\u30D7\u30EA\u30E1\u30F3\u30BF: {0}"}, + {"implements:", "\u5B9F\u88C5\u3057\u307E\u3059: {0}"}, + {"Initializing progname", "{0}\u306E\u521D\u671F\u5316\u4E2D..."}, + {"Input stream closed.", "\u5165\u529B\u30B9\u30C8\u30EA\u30FC\u30E0\u304C\u9589\u3058\u3089\u308C\u307E\u3057\u305F\u3002"}, + {"Interface:", "\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: {0}"}, + {"Internal debugger error.", "\u30C7\u30D0\u30C3\u30AC\u306E\u5185\u90E8\u30A8\u30E9\u30FC\u3067\u3059\u3002"}, + {"Internal error: null ThreadInfo created", "\u5185\u90E8\u30A8\u30E9\u30FC: null\u306EThreadInfo\u304C\u4F5C\u6210\u3055\u308C\u307E\u3057\u305F"}, + {"Internal error; unable to set", "\u5185\u90E8\u30A8\u30E9\u30FC\u3002{0}\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093"}, + {"Internal exception during operation:", "\u64CD\u4F5C\u4E2D\u306E\u5185\u90E8\u4F8B\u5916:\n {0}"}, + {"Internal exception:", "\u5185\u90E8\u4F8B\u5916:"}, + {"Invalid argument type name", "\u5F15\u6570\u578B\u306E\u540D\u524D\u304C\u7121\u52B9\u3067\u3059"}, + {"Invalid assignment syntax", "\u5272\u5F53\u3066\u69CB\u6587\u304C\u7121\u52B9\u3067\u3059"}, + {"Invalid command syntax", "\u30B3\u30DE\u30F3\u30C9\u69CB\u6587\u304C\u7121\u52B9\u3067\u3059"}, + {"Invalid connect type", "\u63A5\u7D9A\u578B\u304C\u7121\u52B9\u3067\u3059"}, + {"Invalid consecutive invocations", "\u9023\u7D9A\u547C\u51FA\u3057\u304C\u7121\u52B9\u3067\u3059"}, + {"Invalid exception object", "\u4F8B\u5916\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u7121\u52B9\u3067\u3059"}, + {"Invalid method specification:", "\u7121\u52B9\u306A\u30E1\u30BD\u30C3\u30C9\u6307\u5B9A: {0}"}, + {"Invalid option on class command", "class\u30B3\u30DE\u30F3\u30C9\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u304C\u7121\u52B9\u3067\u3059"}, + {"invalid option", "\u7121\u52B9\u306A\u30AA\u30D7\u30B7\u30E7\u30F3: {0}"}, + {"Invalid thread status.", "\u30B9\u30EC\u30C3\u30C9\u72B6\u614B\u304C\u7121\u52B9\u3067\u3059\u3002"}, + {"Invalid transport name:", "\u30C8\u30E9\u30F3\u30B9\u30DD\u30FC\u30C8\u540D\u304C\u7121\u52B9\u3067\u3059: {0}"}, + {"I/O exception occurred:", "\u5165\u51FA\u529B\u4F8B\u5916\u304C\u767A\u751F\u3057\u307E\u3057\u305F: {0}"}, + {"is an ambiguous method name in", "\"{0}\"\u306F\"{1}\"\u306E\u3042\u3044\u307E\u3044\u306A\u30E1\u30BD\u30C3\u30C9\u540D\u3067\u3059"}, + {"is an invalid line number for", "{0,number,integer}\u306F{1}\u306E\u7121\u52B9\u306A\u884C\u756A\u53F7\u3067\u3059"}, + {"is not a valid class name", "\"{0}\"\u306F\u4E0D\u6B63\u306A\u30AF\u30E9\u30B9\u540D\u3067\u3059\u3002"}, + {"is not a valid field name", "\"{0}\"\u306F\u4E0D\u6B63\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u540D\u3067\u3059\u3002"}, + {"is not a valid id or class name", "\"{0}\"\u306F\u4E0D\u6B63\u306AID\u307E\u305F\u306F\u30AF\u30E9\u30B9\u540D\u3067\u3059\u3002"}, + {"is not a valid line number or method name for", "\"{0}\"\u306F\u30AF\u30E9\u30B9\"{1}\"\u306E\u4E0D\u6B63\u306A\u884C\u756A\u53F7\u307E\u305F\u306F\u30E1\u30BD\u30C3\u30C9\u540D\u3067\u3059"}, + {"is not a valid method name", "\"{0}\"\u306F\u4E0D\u6B63\u306A\u30E1\u30BD\u30C3\u30C9\u540D\u3067\u3059\u3002"}, + {"is not a valid thread id", "\"{0}\"\u306F\u4E0D\u6B63\u306A\u30B9\u30EC\u30C3\u30C9ID\u3067\u3059\u3002"}, + {"is not a valid threadgroup name", "\"{0}\"\u306F\u4E0D\u6B63\u306A\u30B9\u30EC\u30C3\u30C9\u30FB\u30B0\u30EB\u30FC\u30D7\u540D\u3067\u3059\u3002"}, {"jdb prompt with no current thread", "> "}, {"jdb prompt thread name and current stack frame", "{0}[{1,number,integer}] "}, - {"killed", "{0} \u304c\u7d42\u4e86\u3057\u307e\u3057\u305f"}, - {"killing thread:", "\u6b21\u306e\u30b9\u30ec\u30c3\u30c9\u3092\u7d42\u4e86\u3057\u3066\u3044\u307e\u3059: {0}"}, - {"Line number information not available for", "\u30bd\u30fc\u30b9\u306e\u884c\u756a\u53f7\u306f\u3001\u3053\u3053\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002"}, + {"killed", "{0}\u304C\u5F37\u5236\u7D42\u4E86\u3055\u308C\u307E\u3057\u305F"}, + {"killing thread:", "\u5F37\u5236\u7D42\u4E86\u3059\u308B\u30B9\u30EC\u30C3\u30C9: {0}"}, + {"Line number information not available for", "\u30BD\u30FC\u30B9\u884C\u756A\u53F7\u306F\u3053\u306E\u5834\u6240\u3067\u306F\u4F7F\u7528\u3067\u304D\u307E\u305B\u3093\u3002"}, {"line number", ":{0,number,integer}"}, {"list field typename and name", "{0} {1}\n"}, - {"list field typename and name inherited", "{0} {1} ({2} \u304b\u3089\u7d99\u627f)\n"}, - {"list field typename and name hidden", "{0} {1} (\u975e\u8868\u793a)\n"}, - {"Listening at address:", "\u30a2\u30c9\u30ec\u30b9\u3067\u5f85\u6a5f: {0}"}, - {"Local variable information not available.", "\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u60c5\u5831\u304c\u5229\u7528\u3067\u304d\u307e\u305b\u3093\u3002-g \u3092\u4f7f\u3063\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3001\u5909\u6570\u60c5\u5831\u3092\u751f\u6210\u3057\u3066\u304f\u3060\u3055\u3044"}, - {"Local variables:", "\u30ed\u30fc\u30ab\u30eb\u5909\u6570:"}, - {"", "<\u4f4d\u7f6e\u9078\u629e\u4e0d\u53ef>"}, - {"location", "\"\u30b9\u30ec\u30c3\u30c9={0}\", {1}"}, - {"locationString", "{0}.{1}(), line={2,number,integer} bci={3,number,integer}"}, - {"Main class and arguments must be specified", "\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u3068\u5f15\u6570\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059"}, - {"Method arguments:", "\u30e1\u30bd\u30c3\u30c9\u5f15\u6570:"}, - {"Method entered:", "\u30e1\u30bd\u30c3\u30c9\u958b\u59cb: "}, - {"Method exited:", "\u30e1\u30bd\u30c3\u30c9\u7d42\u4e86"}, - {"Method exitedValue:", "\u30e1\u30bd\u30c3\u30c9\u7d42\u4e86: \u623b\u308a\u5024 = {0}, "}, - {"Method is overloaded; specify arguments", "\u30e1\u30bd\u30c3\u30c9 {0} \u304c\u30aa\u30fc\u30d0\u30fc\u30ed\u30fc\u30c9\u3057\u3066\u3044\u307e\u3059\u3002\u5f15\u6570\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044"}, - {"minus version", "\u3053\u308c\u306f {0} \u30d0\u30fc\u30b8\u30e7\u30f3 {1,number,integer}.{2,number,integer} (J2SE \u30d0\u30fc\u30b8\u30e7\u30f3 {3}) \u3067\u3059"}, - {"Monitor information for thread", "\u30b9\u30ec\u30c3\u30c9 {0} \u306e\u30e2\u30cb\u30bf\u60c5\u5831:"}, - {"Monitor information for expr", "{0} ({1}) \u306e\u30e2\u30cb\u30bf\u60c5\u5831:"}, - {"More than one class named", "\u8907\u6570\u306e\u30af\u30e9\u30b9\u306b\u6b21\u306e\u540d\u524d\u304c\u4ed8\u3044\u3066\u3044\u307e\u3059: ''{0}''"}, - {"native method", "\u30cd\u30a4\u30c6\u30a3\u30d6 \u30e1\u30bd\u30c3\u30c9"}, - {"nested:", "\u5165\u308c\u5b50: {0}"}, - {"No attach address specified.", "\u63a5\u7d9a\u5148\u306e\u30a2\u30c9\u30ec\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No breakpoints set.", "\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u304c\u8a2d\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No class named", "''{0}'' \u3068\u3044\u3046\u540d\u524d\u306e\u30af\u30e9\u30b9\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No class specified.", "\u30af\u30e9\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No classpath specified.", "\u30af\u30e9\u30b9\u30d1\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No code at line", "{1} \u306e\u884c {0,number,integer} \u306b\u30b3\u30fc\u30c9\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No connect specification.", "\u63a5\u7d9a\u4ed5\u69d8\u304c\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"No connector named:", "\u6b21\u306e\u540d\u524d\u306e\u30b3\u30cd\u30af\u30bf\u304c\u3042\u308a\u307e\u305b\u3093: {0}"}, - {"No current thread", "\u73fe\u884c\u30b9\u30ec\u30c3\u30c9\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No default thread specified:", "\u30c7\u30d5\u30a9\u30eb\u30c8\u30b9\u30ec\u30c3\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u6700\u521d\u306b \"thread\" \u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002"}, - {"No exception object specified.", "\u4f8b\u5916\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No exceptions caught.", "\u4f8b\u5916\u306f\u30ad\u30e3\u30c3\u30c1\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No expression specified.", "\u5f0f\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No field in", "{1} \u306b\u30d5\u30a3\u30fc\u30eb\u30c9 {0} \u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No frames on the current call stack", "\u73fe\u884c\u306e\u547c\u3073\u51fa\u3057\u30b9\u30bf\u30c3\u30af\u306b\u306f\u30d5\u30ec\u30fc\u30e0\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No linenumber information for", "{0} \u306e\u884c\u756a\u53f7\u60c5\u5831\u304c\u3042\u308a\u307e\u305b\u3093\u3002\u30c7\u30d0\u30c3\u30b0\u6a5f\u80fd\u3092\u30aa\u30f3\u306b\u3057\u3066\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002"}, - {"No local variables", "\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No method in", "{1} \u306b\u30e1\u30bd\u30c3\u30c9 {0} \u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No method specified.", "\u30e1\u30bd\u30c3\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No monitor numbered:", "\u6b21\u306e\u756a\u53f7\u306e\u30e2\u30cb\u30bf\u304c\u3042\u308a\u307e\u305b\u3093: {0}"}, - {"No monitors owned", " \u6240\u6709\u3059\u308b\u30e2\u30cb\u30bf\u304c\u3042\u308a\u307e\u305b\u3093"}, - {"No object specified.", "\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No objects specified.", "\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No save index specified.", "\u4fdd\u5b58\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No saved values", "\u4fdd\u5b58\u3055\u308c\u305f\u5024\u304c\u3042\u308a\u307e\u305b\u3093\u3002"}, - {"No source information available for:", "{0} \u306e\u30bd\u30fc\u30b9\u60c5\u5831\u304c\u5229\u7528\u3067\u304d\u307e\u305b\u3093"}, - {"No sourcedebugextension specified", "SourceDebugExtension \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No sourcepath specified.", "sourcepath \u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No thread specified.", "\u30b9\u30ec\u30c3\u30c9\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"No VM connected", "VM \u304c\u63a5\u7d9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"No waiters", " \u5f85\u6a5f\u8005\u306f\u3044\u307e\u305b\u3093"}, - {"not a class", "{0} \u306f\u30af\u30e9\u30b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093"}, - {"Not a monitor number:", "\u30e2\u30cb\u30bf\u756a\u53f7\u3067\u306f\u3042\u308a\u307e\u305b\u3093: ''{0}''"}, - {"not found (try the full name)", "{0} \u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093 (\u30d5\u30eb\u30cd\u30fc\u30e0\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044)"}, - {"Not found:", "\u898b\u3064\u304b\u308a\u307e\u305b\u3093: {0}"}, - {"not found", "{0} \u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093"}, - {"Not owned", " \u6240\u6709\u3057\u3066\u3044\u307e\u305b\u3093"}, - {"Not waiting for a monitor", " \u30e2\u30cb\u30bf\u3092\u5f85\u6a5f\u3057\u3066\u3044\u307e\u305b\u3093"}, - {"Nothing suspended.", "\u4f55\u3082\u4e2d\u65ad\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, + {"list field typename and name inherited", "{0} {1} ({2}\u304B\u3089\u7D99\u627F)\n"}, + {"list field typename and name hidden", "{0} {1} (\u975E\u8868\u793A)\n"}, + {"Listening at address:", "\u6B21\u306E\u30A2\u30C9\u30EC\u30B9\u3067\u30EA\u30B9\u30CB\u30F3\u30B0: {0}"}, + {"Local variable information not available.", "\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u5909\u6570\u60C5\u5831\u3092\u751F\u6210\u3059\u308B\u306B\u306F-g\u3092\u6307\u5B9A\u3057\u3066\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044"}, + {"Local variables:", "\u30ED\u30FC\u30AB\u30EB\u5909\u6570:"}, + {"", ""}, + {"location", "\"\u30B9\u30EC\u30C3\u30C9={0}\", {1}"}, + {"locationString", "{0}.{1}()\u3001\u884C={2,number,integer} bci={3,number,integer}"}, + {"Main class and arguments must be specified", "\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3068\u5F15\u6570\u3092\u6307\u5B9A\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"}, + {"Method arguments:", "\u30E1\u30BD\u30C3\u30C9\u5F15\u6570:"}, + {"Method entered:", "\u5165\u529B\u3055\u308C\u305F\u30E1\u30BD\u30C3\u30C9: "}, + {"Method exited:", "\u7D42\u4E86\u3057\u305F\u30E1\u30BD\u30C3\u30C9"}, + {"Method exitedValue:", "\u30E1\u30BD\u30C3\u30C9\u304C\u7D42\u4E86\u3057\u307E\u3057\u305F: \u623B\u308A\u5024= {0}, "}, + {"Method is overloaded; specify arguments", "\u30E1\u30BD\u30C3\u30C9{0}\u304C\u30AA\u30FC\u30D0\u30FC\u30ED\u30FC\u30C9\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u5F15\u6570\u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044"}, + {"minus version", "\u3053\u308C\u306F{0}\u30D0\u30FC\u30B8\u30E7\u30F3{1,number,integer}.{2,number,integer} (Java SE\u30D0\u30FC\u30B8\u30E7\u30F3{3})\u3067\u3059"}, + {"Monitor information for thread", "\u30B9\u30EC\u30C3\u30C9{0}\u306E\u60C5\u5831\u306E\u30E2\u30CB\u30BF\u30FC:"}, + {"Monitor information for expr", "{0} ({1})\u306E\u60C5\u5831\u306E\u30E2\u30CB\u30BF\u30FC:"}, + {"More than one class named", "\u540D\u524D''{0}''\u306E\u30AF\u30E9\u30B9\u304C\u8907\u6570\u3042\u308A\u307E\u3059"}, + {"native method", "native\u30E1\u30BD\u30C3\u30C9"}, + {"nested:", "\u5165\u308C\u5B50\u306B\u306A\u3063\u3066\u3044\u307E\u3059: {0}"}, + {"No attach address specified.", "\u63A5\u7D9A\u30A2\u30C9\u30EC\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No breakpoints set.", "\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u304C\u8A2D\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No class named", "\u540D\u524D''{0}''\u306E\u30AF\u30E9\u30B9\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No class specified.", "\u30AF\u30E9\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No classpath specified.", "\u30AF\u30E9\u30B9\u30D1\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No code at line", "{1}\u306E\u884C{0,number,integer}\u306B\u30B3\u30FC\u30C9\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No connect specification.", "\u63A5\u7D9A\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No connector named:", "\u540D\u524D{0}\u306E\u30B3\u30CD\u30AF\u30BF\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No current thread", "\u73FE\u5728\u306E\u30B9\u30EC\u30C3\u30C9\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No default thread specified:", "\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30B9\u30EC\u30C3\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u6700\u521D\u306B\"thread\"\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, + {"No exception object specified.", "\u4F8B\u5916\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No exceptions caught.", "\u4F8B\u5916\u304C\u6355\u6349\u3055\u308C\u307E\u305B\u3093\u3067\u3057\u305F\u3002"}, + {"No expression specified.", "\u5F0F\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No field in", "{1}\u306B\u30D5\u30A3\u30FC\u30EB\u30C9{0}\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No frames on the current call stack", "\u73FE\u5728\u306E\u30B3\u30FC\u30EB\u30FB\u30B9\u30BF\u30C3\u30AF\u306B\u30D5\u30EC\u30FC\u30E0\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No linenumber information for", "{0}\u306E\u884C\u756A\u53F7\u60C5\u5831\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30C7\u30D0\u30C3\u30B0\u3092\u30AA\u30F3\u306B\u3057\u3066\u30B3\u30F3\u30D1\u30A4\u30EB\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, + {"No local variables", "\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No method in", "{1}\u306B\u30E1\u30BD\u30C3\u30C9{0}\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No method specified.", "\u30E1\u30BD\u30C3\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No monitor numbered:", "\u756A\u53F7\u4ED8\u3051\u3055\u308C\u3066\u3044\u308B\u30E2\u30CB\u30BF\u30FC\u304C\u3042\u308A\u307E\u305B\u3093: {0}"}, + {"No monitors owned", " \u6240\u6709\u3055\u308C\u3066\u3044\u308B\u30E2\u30CB\u30BF\u30FC\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No object specified.", "\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No objects specified.", "\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No save index specified.", "\u4FDD\u5B58\u30A4\u30F3\u30C7\u30C3\u30AF\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No saved values", "\u4FDD\u5B58\u3055\u308C\u305F\u5024\u304C\u3042\u308A\u307E\u305B\u3093"}, + {"No source information available for:", "{0}\u306E\u30BD\u30FC\u30B9\u60C5\u5831\u304C\u5229\u7528\u3067\u304D\u307E\u305B\u3093"}, + {"No sourcedebugextension specified", "SourceDebugExtension\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"}, + {"No sourcepath specified.", "\u30BD\u30FC\u30B9\u30FB\u30D1\u30B9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No thread specified.", "\u30B9\u30EC\u30C3\u30C9\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"No VM connected", "VM\u304C\u63A5\u7D9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093"}, + {"No waiters", " \u5F85\u6A5F\u306F\u3042\u308A\u307E\u305B\u3093"}, + {"not a class", "{0}\u306F\u30AF\u30E9\u30B9\u3067\u306F\u3042\u308A\u307E\u305B\u3093"}, + {"Not a monitor number:", "\u30E2\u30CB\u30BF\u30FC\u756A\u53F7\u3067\u306F\u3042\u308A\u307E\u305B\u3093: ''{0}''"}, + {"not found (try the full name)", "{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093(\u30D5\u30EB\u30CD\u30FC\u30E0\u3092\u8A66\u3057\u3066\u304F\u3060\u3055\u3044)"}, + {"Not found:", "\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"}, + {"not found", "{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"}, + {"Not owned", " \u6240\u6709\u3055\u308C\u3066\u3044\u307E\u305B\u3093"}, + {"Not waiting for a monitor", " \u30E2\u30CB\u30BF\u30FC\u3092\u5F85\u6A5F\u3057\u3066\u3044\u307E\u305B\u3093"}, + {"Nothing suspended.", "\u4F55\u3082\u4E2D\u65AD\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, {"object description and hex id", "({0}){1}"}, - {"Operation is not supported on the target VM", "\u3053\u306e\u64cd\u4f5c\u306f\u3001\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u3067\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"operation not yet supported", "\u3053\u306e\u64cd\u4f5c\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"Owned by:", " \u6240\u6709\u8005: {0}\u3001\u30a8\u30f3\u30c8\u30ea\u30ab\u30a6\u30f3\u30c8: {1,number,integer}"}, - {"Owned monitor:", " \u6240\u6709\u30e2\u30cb\u30bf: {0}"}, - {"Parse exception:", "\u69cb\u6587\u89e3\u6790\u4f8b\u5916: {0}"}, - {"printbreakpointcommandusage", "\u4f7f\u7528\u6cd5: {0} : \u307e\u305f\u306f\n {1} .[(argument_type,...)]"}, - {"Removed:", "\u524a\u9664\u6e08\u307f: {0}"}, - {"Requested stack frame is no longer active:", "\u8981\u6c42\u3055\u308c\u305f\u30b9\u30bf\u30c3\u30af\u30d5\u30ec\u30fc\u30e0\u306f\u30a2\u30af\u30c6\u30a3\u30d6\u3067\u306f\u3042\u308a\u307e\u305b\u3093: {0,number,integer}"}, - {"run command is valid only with launched VMs", "'run ' \u30b3\u30de\u30f3\u30c9\u306f\u3001VM \u306e\u8d77\u52d5\u6642\u306b\u306e\u307f\u6709\u52b9\u3067\u3059\u3002"}, - {"run", "{0} \u3092\u5b9f\u884c\u3057\u307e\u3059"}, - {"saved", "{0} \u3092\u4fdd\u5b58\u3057\u307e\u3057\u305f"}, - {"Set deferred", "\u4fdd\u7559\u3057\u305f {0} \u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f"}, - {"Set", "{0} \u3092\u8a2d\u5b9a\u3057\u307e\u3057\u305f"}, - {"Source file not found:", "\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: {0}"}, + {"Operation is not supported on the target VM", "\u64CD\u4F5C\u306F\u30BF\u30FC\u30B2\u30C3\u30C8VM\u3067\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093"}, + {"operation not yet supported", "\u307E\u3060\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u306A\u3044\u64CD\u4F5C"}, + {"Owned by:", " \u6240\u6709\u8005: {0}\u3001\u30A8\u30F3\u30C8\u30EA\u6570: {1,number,integer}"}, + {"Owned monitor:", " \u6240\u6709\u3055\u308C\u3066\u3044\u308B\u30E2\u30CB\u30BF\u30FC: {0}"}, + {"Parse exception:", "\u4F8B\u5916\u306E\u89E3\u6790: {0}"}, + {"printbreakpointcommandusage", "\u4F7F\u7528\u65B9\u6CD5: {0} :\u307E\u305F\u306F\n {1} .[(argument_type,...)]"}, + {"Removed:", "{0}\u306F\u524A\u9664\u3055\u308C\u307E\u3057\u305F"}, + {"Requested stack frame is no longer active:", "\u30EA\u30AF\u30A8\u30B9\u30C8\u3055\u308C\u305F\u30B9\u30BF\u30C3\u30AF\u30FB\u30D5\u30EC\u30FC\u30E0\u306F\u73FE\u5728\u30A2\u30AF\u30C6\u30A3\u30D6\u3067\u306F\u3042\u308A\u307E\u305B\u3093: {0,number,integer}"}, + {"run command is valid only with launched VMs", "'run '\u30B3\u30DE\u30F3\u30C9\u306F\u8D77\u52D5\u6E08\u306EVM\u3067\u306E\u307F\u6709\u52B9\u3067\u3059"}, + {"run", "{0}\u306E\u5B9F\u884C"}, + {"saved", "{0}\u304C\u4FDD\u5B58\u3055\u308C\u307E\u3057\u305F"}, + {"Set deferred", "\u9045\u5EF6\u3057\u305F{0}\u306E\u8A2D\u5B9A"}, + {"Set", "{0}\u306E\u8A2D\u5B9A"}, + {"Source file not found:", "\u30BD\u30FC\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: {0}"}, {"source line number and line", "{0,number,integer} {1}"}, {"source line number current line and line", "{0,number,integer} => {1}"}, {"sourcedebugextension", "SourceDebugExtension -- {0}"}, - {"Specify class and method", "\u30af\u30e9\u30b9\u304a\u3088\u3073\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044"}, - {"Specify classes to redefine", "\u518d\u5b9a\u7fa9\u3059\u308b\u30af\u30e9\u30b9\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044"}, - {"Specify file name for class", "\u30af\u30e9\u30b9 {0} \u306e\u30d5\u30a1\u30a4\u30eb\u540d\u3092\u6307\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044"}, + {"Specify class and method", "\u30AF\u30E9\u30B9\u3068\u30E1\u30BD\u30C3\u30C9\u306E\u6307\u5B9A"}, + {"Specify classes to redefine", "\u518D\u5B9A\u7FA9\u3059\u308B\u30AF\u30E9\u30B9\u306E\u6307\u5B9A"}, + {"Specify file name for class", "\u30AF\u30E9\u30B9{0}\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u306E\u6307\u5B9A"}, {"stack frame dump with pc", " [{0,number,integer}] {1}.{2} ({3})\u3001pc = {4}"}, {"stack frame dump", " [{0,number,integer}] {1}.{2} ({3})"}, - {"Step completed:", "\u30b9\u30c6\u30c3\u30d7\u5b8c\u4e86: "}, - {"Stopping due to deferred breakpoint errors.", "\u4fdd\u7559\u3057\u305f\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u306e\u30a8\u30e9\u30fc\u304c\u539f\u56e0\u3067\u505c\u6b62\u3057\u307e\u3057\u305f\u3002\n"}, - {"subclass:", "\u30b5\u30d6\u30af\u30e9\u30b9: {0}"}, - {"subinterface:", "\u30b5\u30d6\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9: {0}"}, + {"Step completed:", "\u30B9\u30C6\u30C3\u30D7\u304C\u5B8C\u4E86\u3057\u307E\u3057\u305F: "}, + {"Stopping due to deferred breakpoint errors.", "\u9045\u5EF6\u3057\u305F\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u30FB\u30A8\u30E9\u30FC\u304C\u539F\u56E0\u3067\u505C\u6B62\u3057\u3066\u3044\u307E\u3059\u3002\n"}, + {"subclass:", "\u30B5\u30D6\u30AF\u30E9\u30B9: {0}"}, + {"subinterface:", "\u30B5\u30D6\u30A4\u30F3\u30BF\u30D5\u30A7\u30FC\u30B9: {0}"}, {"tab", "\t{0}"}, - {"Target VM failed to initialize.", "\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u306e\u521d\u671f\u5316\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002"}, - {"The application exited", "\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u7d42\u4e86\u3057\u307e\u3057\u305f"}, - {"The application has been disconnected", "\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306f\u5207\u65ad\u3055\u308c\u3066\u3044\u307e\u3059"}, - {"The gc command is no longer necessary.", "'gc' \u30b3\u30de\u30f3\u30c9\u306f\u73fe\u5728\u306f\u5fc5\u8981\u3042\u308a\u307e\u305b\u3093\u3002\n" + - "\u901a\u5e38\u3069\u304a\u308a\u3001\u3059\u3079\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30c8\u3055\u308c\u3066\u3044\u307e\u3059\u3002'enablegc' \u304a\u3088\u3073 'disablegc'\n" + - "\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3054\u3068\u306b\u5236\u5fa1\u3057\u3066\u304f\u3060\u3055\u3044\u3002"}, - {"The load command is no longer supported.", "'load' \u30b3\u30de\u30f3\u30c9\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"The memory command is no longer supported.", "'memory' \u30b3\u30de\u30f3\u30c9\u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"The VM does not use paths", "VM \u3067\u306f\u30d1\u30b9\u3092\u4f7f\u7528\u3057\u307e\u305b\u3093"}, - {"Thread is not running (no stack).", "\u30b9\u30ec\u30c3\u30c9\u306f\u5b9f\u884c\u3055\u308c\u3066\u3044\u307e\u305b\u3093 (\u30b9\u30bf\u30c3\u30af\u306a\u3057)\u3002"}, - {"Thread number not specified.", "\u30b9\u30ec\u30c3\u30c9\u756a\u53f7\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, + {"Target VM failed to initialize.", "\u30BF\u30FC\u30B2\u30C3\u30C8VM\u304C\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002"}, + {"The application exited", "\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u7D42\u4E86\u3057\u307E\u3057\u305F"}, + {"The application has been disconnected", "\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u304C\u5207\u65AD\u3055\u308C\u307E\u3057\u305F"}, + {"The gc command is no longer necessary.", "'gc'\u30B3\u30DE\u30F3\u30C9\u306F\u4E0D\u8981\u306B\u306A\u308A\u307E\u3057\u305F\u3002\n\u3059\u3079\u3066\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306F\u901A\u5E38\u3069\u304A\u308A\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3055\u308C\u307E\u3059\u3002\u500B\u3005\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\n\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u5236\u5FA1\u3059\u308B\u306B\u306F'enablegc'\u304A\u3088\u3073'disablegc'\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, + {"The load command is no longer supported.", "'load'\u30B3\u30DE\u30F3\u30C9\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"The memory command is no longer supported.", "'memory'\u30B3\u30DE\u30F3\u30C9\u306F\u73FE\u5728\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"The VM does not use paths", "VM\u306F\u30D1\u30B9\u3092\u4F7F\u7528\u3057\u307E\u305B\u3093"}, + {"Thread is not running (no stack).", "\u30B9\u30EC\u30C3\u30C9\u306F\u5B9F\u884C\u4E2D\u3067\u306F\u3042\u308A\u307E\u305B\u3093(\u30B9\u30BF\u30C3\u30AF\u306A\u3057)\u3002"}, + {"Thread number not specified.", "\u30B9\u30EC\u30C3\u30C9\u756A\u53F7\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, {"Thread:", "{0}:"}, - {"Thread Group:", "\u30b0\u30eb\u30fc\u30d7 {0}:"}, - {"Thread description name unknownStatus BP", " {0} {1} \u4e0d\u660e (\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8)"}, - {"Thread description name unknownStatus", " {0} {1} \u4e0d\u660e"}, - {"Thread description name zombieStatus BP", " {0} {1} \u30be\u30f3\u30d3 (\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8)"}, - {"Thread description name zombieStatus", " {0} {1} \u30be\u30f3\u30d3"}, - {"Thread description name runningStatus BP", " {0} {1} \u5b9f\u884c\u4e2d (\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8)"}, - {"Thread description name runningStatus", " {0} {1} \u5b9f\u884c\u4e2d"}, - {"Thread description name sleepingStatus BP", " {0} {1} \u4f11\u6b62\u4e2d (\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8)"}, - {"Thread description name sleepingStatus", " {0} {1} \u4f11\u6b62\u4e2d"}, - {"Thread description name waitingStatus BP", " {0} {1} \u30e2\u30cb\u30bf\u3067\u5f85\u6a5f\u4e2d (\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8)"}, - {"Thread description name waitingStatus", " {0} {1} \u30e2\u30cb\u30bf\u3067\u5f85\u6a5f\u4e2d"}, - {"Thread description name condWaitstatus BP", " {0} {1} \u72b6\u6cc1\u5f85\u6a5f\u4e2d (\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8)"}, - {"Thread description name condWaitstatus", " {0} {1} \u72b6\u6cc1\u5f85\u6a5f\u4e2d"}, - {"Thread has been resumed", "\u30b9\u30ec\u30c3\u30c9\u304c\u518d\u958b\u3055\u308c\u307e\u3057\u305f"}, - {"Thread not suspended", "\u30b9\u30ec\u30c3\u30c9\u306f\u4e2d\u65ad\u3055\u308c\u3066\u3044\u307e\u305b\u3093"}, - {"thread group number description name", "{0,number,integer}\u3002 {1} {2}"}, - {"Threadgroup name not specified.", "Threadgroup \u540d\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"Threads must be suspended", "\u30b9\u30ec\u30c3\u30c9\u3092\u4e2d\u65ad\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059"}, - {"trace method exit in effect for", "{0} \u306b\u5bfe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u7d42\u4e86\u306e\u30c8\u30ec\u30fc\u30b9\u6709\u52b9"}, - {"trace method exits in effect", "\u30e1\u30bd\u30c3\u30c9\u7d42\u4e86\u306e\u30c8\u30ec\u30fc\u30b9\u6709\u52b9"}, - {"trace methods in effect", "\u30e1\u30bd\u30c3\u30c9\u306e\u30c8\u30ec\u30fc\u30b9\u6709\u52b9"}, - {"trace go method exit in effect for", "{0} \u306b\u5bfe\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u7d42\u4e86\u306e\u30c8\u30ec\u30fc\u30b9 (go \u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d) \u6709\u52b9"}, - {"trace go method exits in effect", "\u30e1\u30bd\u30c3\u30c9\u7d42\u4e86\u306e\u30c8\u30ec\u30fc\u30b9 (go \u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d) \u6709\u52b9"}, - {"trace go methods in effect", "\u30e1\u30bd\u30c3\u30c9\u306e\u30c8\u30ec\u30fc\u30b9 (go \u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u304d) \u6709\u52b9"}, - {"trace not in effect", "\u30c8\u30ec\u30fc\u30b9\u304c\u6709\u52b9\u3067\u306f\u3042\u308a\u307e\u305b\u3093"}, - {"Unable to attach to target VM.", "\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u306b\u63a5\u7d9a\u3067\u304d\u307e\u305b\u3093"}, - {"Unable to display process output:", "\u30d7\u30ed\u30bb\u30b9\u51fa\u529b\u3092\u8868\u793a\u3067\u304d\u307e\u305b\u3093: {0}"}, - {"Unable to launch target VM.", "\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u3092\u8d77\u52d5\u3067\u304d\u307e\u305b\u3093"}, - {"Unable to set deferred", "\u4fdd\u7559\u3057\u305f {0} \u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093: {1}"}, - {"Unable to set main class and arguments", "\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u304a\u3088\u3073\u5f15\u6570\u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093"}, - {"Unable to set", "{0} \u3092\u8a2d\u5b9a\u3067\u304d\u307e\u305b\u3093: {1}"}, - {"Unexpected event type", "\u4e88\u671f\u3057\u306a\u3044\u7a2e\u985e\u306e\u30a4\u30d9\u30f3\u30c8: {0}"}, - {"unknown", "\u4e0d\u660e"}, - {"Unmonitoring", "{0} \u306f\u76e3\u8996\u3057\u3066\u3044\u307e\u305b\u3093\u3002"}, - {"Unrecognized command. Try help...", "\u8a8d\u8b58\u3067\u304d\u306a\u3044\u30b3\u30de\u30f3\u30c9: ''{0}''\u3002\u30d8\u30eb\u30d7\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044..."}, - {"Usage: catch exception", "\u4f7f\u7528\u6cd5: catch [uncaught|caught|all] |"}, - {"Usage: ignore exception", "\u4f7f\u7528\u6cd5: ignore [uncaught|caught|all] |"}, - {"Usage: down [n frames]", "\u4f7f\u7528\u6cd5: down [\u30d5\u30ec\u30fc\u30e0\u6570 n]"}, - {"Usage: kill ", "\u4f7f\u7528\u6cd5: kill "}, - {"Usage: read ", "\u4f7f\u7528\u6cd5: read "}, - {"Usage: unmonitor ", "\u4f7f\u7528\u6cd5: unmonitor "}, - {"Usage: up [n frames]", "\u4f7f\u7528\u6cd5: up [\u30d5\u30ec\u30fc\u30e0\u6570 n]"}, - {"Use java minus X to see", "'java -X' \u3092\u4f7f\u7528\u3057\u3066\u3001\u4f7f\u7528\u53ef\u80fd\u306a\u6a19\u6e96\u4ee5\u5916\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u8868\u793a\u3057\u3066\u304f\u3060\u3055\u3044\u3002"}, - {"Use stop at to set a breakpoint at a line number", "'stop at' \u3092\u4f7f\u7528\u3057\u3066\u3001\u884c\u756a\u53f7\u306b\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u5b9a\u3057\u3066\u304f\u3060\u3055\u3044\u3002"}, - {"VM already running. use cont to continue after events.", "VM \u306f\u65e2\u306b\u5b9f\u884c\u4e2d\u3067\u3059\u3002'cont' \u3092\u4f7f\u7528\u3057\u3066\u30a4\u30d9\u30f3\u30c8\u306e\u5f8c\u3082\u7d9a\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002"}, - {"VM Started:", "VM \u304c\u8d77\u52d5\u3057\u307e\u3057\u305f: "}, - {"vmstartexception", "VM \u8d77\u52d5\u4f8b\u5916: {0}"}, - {"Waiting for monitor:", " \u30e2\u30cb\u30bf\u5f85\u6a5f\u4e2d: {0}"}, - {"Waiting thread:", " \u30b9\u30ec\u30c3\u30c9\u5f85\u6a5f\u4e2d: {0}"}, - {"watch accesses of", "{0}.{1} \u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u76e3\u8996\u3057\u307e\u3059\u3002"}, - {"watch modification of", "{0}.{1} \u3078\u306e\u5909\u66f4\u3092\u76e3\u8996\u3057\u307e\u3059\u3002"}, + {"Thread Group:", "\u30B0\u30EB\u30FC\u30D7{0}:"}, + {"Thread description name unknownStatus BP", " {0} {1}\u306F\u4E0D\u660E\u3067\u3059(\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8)"}, + {"Thread description name unknownStatus", " {0} {1}\u306F\u4E0D\u660E\u3067\u3059"}, + {"Thread description name zombieStatus BP", " {0} {1}\u306F\u30BE\u30F3\u30D3\u3067\u3059(\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u5730\u70B9)"}, + {"Thread description name zombieStatus", " {0} {1}\u306F\u30BE\u30F3\u30D3\u3067\u3059"}, + {"Thread description name runningStatus BP", " {0} {1}\u306F\u5B9F\u884C\u4E2D\u3067\u3059(\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8)"}, + {"Thread description name runningStatus", " {0} {1}\u306F\u5B9F\u884C\u4E2D\u3067\u3059"}, + {"Thread description name sleepingStatus BP", " {0} {1}\u306F\u30B9\u30EA\u30FC\u30D7\u4E2D\u3067\u3059(\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8)"}, + {"Thread description name sleepingStatus", " {0} {1}\u306F\u30B9\u30EA\u30FC\u30D7\u4E2D\u3067\u3059"}, + {"Thread description name waitingStatus BP", " {0} {1}\u306F\u30E2\u30CB\u30BF\u30FC\u5185\u3067\u5F85\u6A5F\u4E2D\u3067\u3059(\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8)"}, + {"Thread description name waitingStatus", " {0} {1}\u306F\u30E2\u30CB\u30BF\u30FC\u5185\u3067\u5F85\u6A5F\u4E2D\u3067\u3059"}, + {"Thread description name condWaitstatus BP", " {0} {1}\u306F\u6761\u4EF6\u3092\u5F85\u6A5F\u4E2D\u3067\u3059(\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8)"}, + {"Thread description name condWaitstatus", " {0} {1}\u306F\u6761\u4EF6\u3092\u5F85\u6A5F\u4E2D\u3067\u3059"}, + {"Thread has been resumed", "\u30B9\u30EC\u30C3\u30C9\u304C\u518D\u958B\u3057\u307E\u3057\u305F"}, + {"Thread not suspended", "\u30B9\u30EC\u30C3\u30C9\u306F\u4E2D\u65AD\u3057\u3066\u3044\u307E\u305B\u3093"}, + {"thread group number description name", "{0,number,integer}. {1} {2}"}, + {"Threadgroup name not specified.", "\u30B9\u30EC\u30C3\u30C9\u30B0\u30EB\u30FC\u30D7\u540D\u304C\u6307\u5B9A\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002"}, + {"Threads must be suspended", "\u30B9\u30EC\u30C3\u30C9\u3092\u4E2D\u65AD\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059"}, + {"trace method exit in effect for", "{0}\u306B\u5BFE\u3057\u3066\u6709\u52B9\u306A\u30E1\u30BD\u30C3\u30C9\u7D42\u4E86\u306E\u30C8\u30EC\u30FC\u30B9"}, + {"trace method exits in effect", "\u6709\u52B9\u306A\u30E1\u30BD\u30C3\u30C9\u7D42\u4E86\u306E\u30C8\u30EC\u30FC\u30B9"}, + {"trace methods in effect", "\u30E1\u30BD\u30C3\u30C9\u306E\u30C8\u30EC\u30FC\u30B9\u306E\u6709\u52B9\u5316"}, + {"trace go method exit in effect for", "{0}\u306B\u6709\u52B9\u306Ago\u30E1\u30BD\u30C3\u30C9\u7D42\u4E86\u306E\u30C8\u30EC\u30FC\u30B9"}, + {"trace go method exits in effect", "\u6709\u52B9\u306Ago\u30E1\u30BD\u30C3\u30C9\u7D42\u4E86\u306E\u30C8\u30EC\u30FC\u30B9"}, + {"trace go methods in effect", "go\u30E1\u30BD\u30C3\u30C9\u306E\u30C8\u30EC\u30FC\u30B9\u306E\u6709\u52B9\u5316"}, + {"trace not in effect", "\u30C8\u30EC\u30FC\u30B9\u306E\u7121\u52B9\u5316"}, + {"Unable to attach to target VM.", "\u30BF\u30FC\u30B2\u30C3\u30C8VM\u306B\u63A5\u7D9A\u3067\u304D\u307E\u305B\u3093\u3002"}, + {"Unable to display process output:", "\u30D7\u30ED\u30BB\u30B9\u51FA\u529B\u3092\u8868\u793A\u3067\u304D\u307E\u305B\u3093: {0}"}, + {"Unable to launch target VM.", "\u30BF\u30FC\u30B2\u30C3\u30C8VM\u3092\u8D77\u52D5\u3067\u304D\u307E\u305B\u3093\u3002"}, + {"Unable to set deferred", "\u9045\u5EF6\u3057\u305F{0}\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093: {1}"}, + {"Unable to set main class and arguments", "\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u3068\u5F15\u6570\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093"}, + {"Unable to set", "{0}\u3092\u8A2D\u5B9A\u3067\u304D\u307E\u305B\u3093: {1}"}, + {"Unexpected event type", "\u4E88\u671F\u3057\u306A\u3044\u30A4\u30D9\u30F3\u30C8\u30FB\u30BF\u30A4\u30D7: {0}"}, + {"unknown", "\u4E0D\u660E"}, + {"Unmonitoring", "{0}\u306E\u30E2\u30CB\u30BF\u30EA\u30F3\u30B0\u89E3\u9664 "}, + {"Unrecognized command. Try help...", "''{0}''\u306F\u8A8D\u8B58\u3055\u308C\u306A\u3044\u30B3\u30DE\u30F3\u30C9\u3067\u3059\u3002help\u3067\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044..."}, + {"Usage: catch exception", "\u4F7F\u7528\u65B9\u6CD5: catch [uncaught|caught|all] |"}, + {"Usage: ignore exception", "\u4F7F\u7528\u65B9\u6CD5: ignore [uncaught|caught|all] |"}, + {"Usage: down [n frames]", "\u4F7F\u7528\u65B9\u6CD5: down [n frames]"}, + {"Usage: kill ", "\u4F7F\u7528\u65B9\u6CD5: kill "}, + {"Usage: read ", "\u4F7F\u7528\u65B9\u6CD5: read "}, + {"Usage: unmonitor ", "\u4F7F\u7528\u65B9\u6CD5: unmonitor "}, + {"Usage: up [n frames]", "\u4F7F\u7528\u65B9\u6CD5: up [n frames]"}, + {"Use java minus X to see", "\u4F7F\u7528\u53EF\u80FD\u306A\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u8868\u793A\u3059\u308B\u306B\u306F'java -X'\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"}, + {"Use stop at to set a breakpoint at a line number", "\u884C\u756A\u53F7\u306B\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u3092\u8A2D\u5B9A\u3059\u308B\u306B\u306F'stop at'\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044"}, + {"VM already running. use cont to continue after events.", "VM\u306F\u3059\u3067\u306B\u5B9F\u884C\u4E2D\u3067\u3059\u3002\u30A4\u30D9\u30F3\u30C8\u5F8C\u306B\u7D9A\u884C\u3059\u308B\u306B\u306F'cont'\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002"}, + {"VM Started:", "VM\u304C\u958B\u59CB\u3055\u308C\u307E\u3057\u305F: "}, + {"vmstartexception", "VM\u304C\u4F8B\u5916\u3092\u958B\u59CB\u3057\u307E\u3057\u305F: {0}"}, + {"Waiting for monitor:", " \u30E2\u30CB\u30BF\u30FC\u306E\u5F85\u6A5F\u4E2D: {0}"}, + {"Waiting thread:", " \u30B9\u30EC\u30C3\u30C9\u3092\u5F85\u6A5F\u4E2D: {0}"}, + {"watch accesses of", "{0}.{1}\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u76E3\u8996"}, + {"watch modification of", "{0}.{1}\u306E\u5909\u66F4\u306E\u76E3\u8996"}, {"zz help text", - "** command list **\n" + - "connectors -- \u3053\u306e VM \u5185\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30b3\u30cd\u30af\u30bf\u3068\u30c8\u30e9\u30f3\u30b9\u30dd\u30fc\u30c8\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3057\u307e\u3059\n" + - "\n" + - "run [class [args]] -- \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u306e\u5b9f\u884c\u3092\u958b\u59cb\u3057\u307e\u3059\u3002\n" + - "\n" + - "threads [threadgroup] -- \u30b9\u30ec\u30c3\u30c9\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "thread -- \u30c7\u30d5\u30a9\u30eb\u30c8\u30b9\u30ec\u30c3\u30c9\u3092\u8a2d\u5b9a\u3057\u307e\u3059\n" + - "suspend [thread id(s)] -- \u30b9\u30ec\u30c3\u30c9\u3092\u4e2d\u65ad\u3057\u307e\u3059 (\u30c7\u30d5\u30a9\u30eb\u30c8: \u3059\u3079\u3066)\n" + - "resume [thread id(s)] -- \u30b9\u30ec\u30c3\u30c9\u3092\u518d\u958b\u3057\u307e\u3059 (\u30c7\u30d5\u30a9\u30eb\u30c8: \u3059\u3079\u3066)\n" + - "where [ | all] -- \u30b9\u30ec\u30c3\u30c9\u306e\u30b9\u30bf\u30c3\u30af\u3092\u30c0\u30f3\u30d7\u3057\u307e\u3059\n" + - "wherei [ | all] -- \u30b9\u30ec\u30c3\u30c9\u306e\u30b9\u30bf\u30c3\u30af\u3092 PC \u60c5\u5831\u3068\u3044\u3063\u3057\u3087\u306b\u30c0\u30f3\u30d7\u3057\u307e\u3059\n" + - "up [n frames] -- \u30b9\u30ec\u30c3\u30c9\u306e\u30b9\u30bf\u30c3\u30af\u3092\u4e0a\u3078\u79fb\u52d5\u3057\u307e\u3059\n" + - "down [n frames] -- \u30b9\u30ec\u30c3\u30c9\u306e\u30b9\u30bf\u30c3\u30af\u3092\u4e0b\u3078\u79fb\u52d5\u3057\u307e\u3059\n" + - "kill -- \u6307\u5b9a\u3055\u308c\u305f\u4f8b\u5916\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u30b9\u30ec\u30c3\u30c9\u3092\u7d42\u4e86\u3057\u307e\u3059\n" + - "interrupt -- \u30b9\u30ec\u30c3\u30c9\u306b\u5272\u308a\u8fbc\u307f\u307e\u3059\n" + - "\n" + - "print -- \u5f0f\u306e\u5024\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "dump -- \u3059\u3079\u3066\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u60c5\u5831\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "eval -- \u5f0f\u3092\u8a55\u4fa1\u3057\u307e\u3059 (print \u3068\u540c\u3058)\n" + - "set = -- \u30d5\u30a3\u30fc\u30eb\u30c9/\u5909\u6570/\u914d\u5217\u8981\u7d20\u306b\u65b0\u3057\u3044\u5024\u3092\u5272\u308a\u5f53\u3066\u307e\u3059\n" + - "locals -- \u73fe\u884c\u306e\u30b9\u30bf\u30c3\u30af\u30d5\u30ec\u30fc\u30e0\u306e\u3059\u3079\u3066\u306e\u30ed\u30fc\u30ab\u30eb\u5909\u6570\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "\n" + - "classes -- \u73fe\u6642\u70b9\u3067\u65e2\u77e5\u306e\u30af\u30e9\u30b9\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "class -- \u540d\u524d\u4ed8\u304d\u30af\u30e9\u30b9\u306e\u8a73\u7d30\u3092\u8868\u793a\u3057\u307e\u3059\n" + - "methods -- \u30af\u30e9\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "fields -- \u30af\u30e9\u30b9\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "\n" + - "threadgroups -- \u30b9\u30ec\u30c3\u30c9\u30b0\u30eb\u30fc\u30d7\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "threadgroup -- \u73fe\u5728\u306e\u30b9\u30ec\u30c3\u30c9\u30b0\u30eb\u30fc\u30d7\u3092\u8a2d\u5b9a\u3057\u307e\u3059\n" + - "\n" + - "stop in .[(argument_type,...)]\n" + - " -- \u30e1\u30bd\u30c3\u30c9\u306b\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\n" + - "stop at : -- \u884c\u306b\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u8a2d\u5b9a\u3057\u307e\u3059\n" + - "clear .[(argument_type,...)]\n" + - " -- \u30e1\u30bd\u30c3\u30c9\u306e\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u89e3\u9664\u3057\u307e\u3059\n" + - "clear : -- \u884c\u306e\u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u89e3\u9664\u3057\u307e\u3059\n" + - "clear -- \u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "catch [uncaught|caught|all] |\n" + - " -- \u6307\u5b9a\u3055\u308c\u305f\u4f8b\u5916\u304c\u767a\u751f\u3057\u305f\u3089\u505c\u6b62\u3057\u307e\u3059\n" + - "ignore [uncaught|caught|all] |\n" + - " -- \u6307\u5b9a\u3055\u308c\u305f\u4f8b\u5916\u306e 'catch' \u3092\u53d6\u308a\u6d88\u3057\u307e\u3059\n" + - "watch [access|all] .\n" + - " -- \u30d5\u30a3\u30fc\u30eb\u30c9\u3078\u306e\u30a2\u30af\u30bb\u30b9/\u4fee\u6b63\u3092\u76e3\u8996\u3057\u307e\u3059\n" + - "unwatch [access|all] .\n" + - " -- \u30d5\u30a3\u30fc\u30eb\u30c9\u3078\u306e\u30a2\u30af\u30bb\u30b9/\u4fee\u6b63\u306e\u76e3\u8996\u3092\u4e2d\u6b62\u3057\u307e\u3059\n" + - "trace methods [thread] -- \u30e1\u30bd\u30c3\u30c9\u306e\u958b\u59cb/\u7d42\u4e86\u3092\u8ffd\u8de1\u3057\u307e\u3059\n" + - "untrace methods [thread] -- \u30e1\u30bd\u30c3\u30c9\u306e\u958b\u59cb/\u7d42\u4e86\u306e\u8ffd\u8de1\u3092\u4e2d\u6b62\u3057\u307e\u3059\n" + - "step -- \u73fe\u5728\u306e\u884c\u3092\u5b9f\u884c\u3057\u307e\u3059\n" + - "step up -- \u73fe\u5728\u306e\u30e1\u30bd\u30c3\u30c9\u304c\u547c\u3073\u51fa\u3057\u5074\u306b\u623b\u308b\u307e\u3067\u5b9f\u884c\u3057\u307e\u3059\n" + - "stepi -- \u73fe\u5728\u306e\u547d\u4ee4\u3092\u5b9f\u884c\u3057\u307e\u3059\n" + - "next -- 1 \u884c\u30b9\u30c6\u30c3\u30d7\u5b9f\u884c\u3057\u307e\u3059 (\u547c\u3073\u51fa\u3057\u3092\u30b9\u30c6\u30c3\u30d7\u30aa\u30fc\u30d0\u30fc\u3057\u307e\u3059)\n" + - "cont -- \u30d6\u30ec\u30fc\u30af\u30dd\u30a4\u30f3\u30c8\u304b\u3089\u7d99\u7d9a\u3057\u3066\u5b9f\u884c\u3057\u307e\u3059\n" + - "\n" + - "list [line number|method] -- \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "use (or sourcepath) [source file path]\n" + - " -- \u30bd\u30fc\u30b9\u30d1\u30b9\u3092\u8868\u793a\u307e\u305f\u306f\u5909\u66f4\u3057\u307e\u3059\n" + - "exclude [, ... | \"none\"]\n" + - " -- \u6307\u5b9a\u3057\u305f\u30af\u30e9\u30b9\u306e\u30b9\u30c6\u30c3\u30d7\u307e\u305f\u306f\u30e1\u30bd\u30c3\u30c9\u30a4\u30d9\u30f3\u30c8\u3092\u5831\u544a\u3057\u307e\u305b\u3093\n" + - "classpath -- \u30bf\u30fc\u30b2\u30c3\u30c8 VM \u306e\u30af\u30e9\u30b9\u30d1\u30b9\u60c5\u5831\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "\n" + - "monitor -- \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u505c\u6b62\u6642\u306b\u6bce\u56de\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\n" + - "monitor -- \u30e2\u30cb\u30bf\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "unmonitor -- \u30e2\u30cb\u30bf\u3092\u524a\u9664\u3057\u307e\u3059\n" + - "read -- \u30b3\u30de\u30f3\u30c9\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u307f\u3001\u5b9f\u884c\u3057\u307e\u3059\n" + - "\n" + - "lock -- \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ed\u30c3\u30af\u60c5\u5831\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "threadlocks [thread id] -- \u30b9\u30ec\u30c3\u30c9\u306e\u30ed\u30c3\u30af\u60c5\u5831\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "\n" + - "pop -- \u73fe\u5728\u306e\u30d5\u30ec\u30fc\u30e0\u3092\u542b\u3080\u3059\u3079\u3066\u306e\u30b9\u30bf\u30c3\u30af\u3092\u30dd\u30c3\u30d7\u3057\u307e\u3059\n" + - "reenter -- \u30dd\u30c3\u30d7\u3068\u540c\u3058\u3067\u3059\u304c\u3001\u73fe\u5728\u306e\u30d5\u30ec\u30fc\u30e0\u304c\u518d\u5165\u529b\u3055\u308c\u307e\u3059\n" + - "redefine \n" + - " -- \u30af\u30e9\u30b9\u306e\u30b3\u30fc\u30c9\u3092\u518d\u5b9a\u7fa9\u3057\u307e\u3059\n" + - "\n" + - "disablegc -- \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u6291\u6b62\u3057\u307e\u3059\n" + - "enablegc -- \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30ac\u30d9\u30fc\u30b8\u30b3\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u8a31\u53ef\u3057\u307e\u3059\n" + - "\n" + - "!! -- \u6700\u5f8c\u306e\u30b3\u30de\u30f3\u30c9\u3092\u7e70\u308a\u8fd4\u3057\u307e\u3059\n" + - " -- \u30b3\u30de\u30f3\u30c9\u3092 n \u56de\u7e70\u308a\u8fd4\u3057\u307e\u3059\n" + - "help (or ?) -- \u30b3\u30de\u30f3\u30c9\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\n" + - "version -- \u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3057\u307e\u3059\n" + - "exit (or quit) -- \u30c7\u30d0\u30c3\u30ac\u3092\u7d42\u4e86\u3057\u307e\u3059\n" + - "\n" + - ": \u30d1\u30c3\u30b1\u30fc\u30b8\u4fee\u98fe\u5b50\u3092\u542b\u3080\u5b8c\u5168\u306a\u30af\u30e9\u30b9\u540d\n" + - ": \u5148\u982d\u304b\u672b\u5c3e\u306b\u30ef\u30a4\u30eb\u30c9\u30ab\u30fc\u30c9 ('*') \u306e\u4ed8\u3044\u305f\u30af\u30e9\u30b9\u540d\n" + - ": 'threads' \u30b3\u30de\u30f3\u30c9\u3067\u5831\u544a\u3055\u308c\u308b\u30b9\u30ec\u30c3\u30c9\u756a\u53f7\n" + - ": Java(tm) \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u5f0f\n" + - "\u3082\u3063\u3068\u3082\u4e00\u822c\u7684\u306a\u69cb\u6587\u304c\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3059\u3002\n" + - "\n" + - "user.home \u307e\u305f\u306f user.dir \u4e0b\u306e \"jdb.ini\" \u304b \".jdbrc\" \u306e\n" + - "\u3044\u305a\u308c\u304b\u306b\u8d77\u52d5\u30b3\u30de\u30f3\u30c9\u3092\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002"}, + "** \u30B3\u30DE\u30F3\u30C9\u30FB\u30EA\u30B9\u30C8 **\nconnectors -- \u3053\u306EVM\u5185\u306E\u4F7F\u7528\u53EF\u80FD\u306A\u30B3\u30CD\u30AF\u30BF\u3068\u30C8\u30E9\u30F3\u30B9\u30DD\u30FC\u30C8\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\n\nrun [class [args]] -- \u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u306E\u30E1\u30A4\u30F3\u30FB\u30AF\u30E9\u30B9\u306E\u5B9F\u884C\u3092\u958B\u59CB\u3057\u307E\u3059\n\nthreads [threadgroup] -- \u30B9\u30EC\u30C3\u30C9\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\nthread -- \u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u30B9\u30EC\u30C3\u30C9\u3092\u8A2D\u5B9A\u3057\u307E\u3059\nsuspend [thread id(s)] -- \u30B9\u30EC\u30C3\u30C9\u3092\u4E2D\u65AD\u3057\u307E\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8: \u3059\u3079\u3066)\nresume [thread id(s)] -- \u30B9\u30EC\u30C3\u30C9\u3092\u518D\u958B\u3057\u307E\u3059(\u30C7\u30D5\u30A9\u30EB\u30C8: \u3059\u3079\u3066)\nwhere [ | all] -- \u30B9\u30EC\u30C3\u30C9\u306E\u30B9\u30BF\u30C3\u30AF\u3092\u30C0\u30F3\u30D7\u3057\u307E\u3059\nwherei [ | all]-- \u30B9\u30EC\u30C3\u30C9\u306E\u30B9\u30BF\u30C3\u30AF\u3092pc\u60C5\u5831\u3068\u3068\u3082\u306B\u30C0\u30F3\u30D7\u3057\u307E\u3059\nup [n frames] -- \u30B9\u30EC\u30C3\u30C9\u306E\u30B9\u30BF\u30C3\u30AF\u3092\u4E0A\u306B\u79FB\u52D5\u3057\u307E\u3059\ndown [n frames] -- \u30B9\u30EC\u30C3\u30C9\u306E\u30B9\u30BF\u30C3\u30AF\u3092\u4E0B\u306B\u79FB\u52D5\u3057\u307E\u3059\nkill -- \u6307\u5B9A\u3055\u308C\u305F\u4F8B\u5916\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u3067\u30B9\u30EC\u30C3\u30C9\u3092\u5F37\u5236\u7D42\u4E86\u3057\u307E\u3059\ninterrupt -- \u30B9\u30EC\u30C3\u30C9\u3092\u4E2D\u65AD\u3057\u307E\u3059\n\nprint -- \u5F0F\u306E\u5024\u3092\u51FA\u529B\u3057\u307E\u3059\ndump -- \u3059\u3079\u3066\u306E\u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u60C5\u5831\u3092\u51FA\u529B\u3057\u307E\u3059\neval -- \u5F0F\u3092\u8A55\u4FA1\u3057\u307E\u3059(print\u3068\u540C\u3058)\nset = -- \u65B0\u3057\u3044\u5024\u3092\u30D5\u30A3\u30FC\u30EB\u30C9/\u5909\u6570/\u914D\u5217\u8981\u7D20\u306B\u4EE3\u5165\u3057\u307E\u3059\nlocals -- \u73FE\u5728\u306E\u30B9\u30BF\u30C3\u30AF\u30FB\u30D5\u30EC\u30FC\u30E0\u5185\u306E\u3059\u3079\u3066\u306E\u30ED\u30FC\u30AB\u30EB\u5909\u6570\u3092\u51FA\u529B\u3057\u307E\u3059\n\nclasses -- \u73FE\u5728\u65E2\u77E5\u306E\u30AF\u30E9\u30B9\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\nclass -- \u6307\u5B9A\u3057\u305F\u30AF\u30E9\u30B9\u306E\u8A73\u7D30\u3092\u8868\u793A\u3057\u307E\u3059\nmethods -- \u30AF\u30E9\u30B9\u306E\u30E1\u30BD\u30C3\u30C9\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\nfields -- \u30AF\u30E9\u30B9\u306E\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\n\nthreadgroups -- \u30B9\u30EC\u30C3\u30C9\u30B0\u30EB\u30FC\u30D7\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\nthreadgroup -- \u73FE\u5728\u306E\u30B9\u30EC\u30C3\u30C9\u30B0\u30EB\u30FC\u30D7\u3092\u8A2D\u5B9A\u3057\u307E\u3059\n\nstop in .[(argument_type,...)]\n -- \u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u3092\u30E1\u30BD\u30C3\u30C9\u5185\u306B\u8A2D\u5B9A\u3057\u307E\u3059\nstop at : -- \u884C\u306B\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u3092\u8A2D\u5B9A\u3057\u307E\u3059\nclear .[(argument_type,...)]\n -- \u30E1\u30BD\u30C3\u30C9\u5185\u306E\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u3092\u30AF\u30EA\u30A2\u3057\u307E\u3059\nclear : -- \u884C\u306E\u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u3092\u30AF\u30EA\u30A2\u3057\u307E\u3059\nclear -- \u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\ncatch [uncaught|caught|all] |\n -- \u6307\u5B9A\u3055\u308C\u305F\u4F8B\u5916\u304C\u767A\u751F\u3057\u305F\u3068\u304D\u306B\u30D6\u30EC\u30FC\u30AF\u3057\u307E\u3059\nignore [uncaught|caught|all] |\n -- \u6307\u5B9A\u3055\u308C\u305F\u4F8B\u5916\u306E'catch'\u3092\u53D6\u308A\u6D88\u3057\u307E\u3059\nwatch [access|all] .\n -- \u30D5\u30A3\u30FC\u30EB\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u307E\u305F\u306F\u5909\u66F4\u3092\u76E3\u8996\u3057\u307E\u3059\nunwatch [access|all] .\n -- \u30D5\u30A3\u30FC\u30EB\u30C9\u3078\u306E\u30A2\u30AF\u30BB\u30B9\u307E\u305F\u306F\u5909\u66F4\u306E\u76E3\u8996\u3092\u4E2D\u6B62\u3057\u307E\u3059\ntrace [go] methods [thread]\n -- \u30E1\u30BD\u30C3\u30C9\u306E\u5165\u308A\u53E3\u3068\u51FA\u53E3\u3092\u30C8\u30EC\u30FC\u30B9\u3057\u307E\u3059\u3002\n -- 'go'\u304C\u6307\u5B9A\u3055\u308C\u308B\u307E\u3067\u3059\u3079\u3066\u306E\u30B9\u30EC\u30C3\u30C9\u306F\u4E2D\u65AD\u3057\u307E\u3059\ntrace [go] method exit | exits [thread]\n -- \u73FE\u5728\u306E\u30E1\u30BD\u30C3\u30C9\u306E\u51FA\u53E3\u307E\u305F\u306F\u3059\u3079\u3066\u306E\u30E1\u30BD\u30C3\u30C9\u306E\u51FA\u53E3\u3092\u30C8\u30EC\u30FC\u30B9\u3057\u307E\u3059\n -- 'go'\u304C\u6307\u5B9A\u3055\u308C\u308B\u307E\u3067\u3059\u3079\u3066\u306E\u30B9\u30EC\u30C3\u30C9\u306F\u4E2D\u65AD\u3057\u307E\u3059\nuntrace [methods] -- \u30E1\u30BD\u30C3\u30C9\u306E\u958B\u59CB\u307E\u305F\u306F\u7D42\u4E86\u306E\u30C8\u30EC\u30FC\u30B9\u3092\u505C\u6B62\u3057\u307E\u3059\nstep -- \u73FE\u5728\u306E\u884C\u3092\u5B9F\u884C\u3057\u307E\u3059\nstep up -- \u73FE\u5728\u306E\u30E1\u30BD\u30C3\u30C9\u304C\u30E1\u30BD\u30C3\u30C9\u306E\u547C\u51FA\u3057\u5143\u306B\u623B\u308B\u307E\u3067\u5B9F\u884C\u3057\u307E\u3059\nstepi -- \u73FE\u5728\u306E\u547D\u4EE4\u3092\u5B9F\u884C\u3057\u307E\u3059\nnext -- 1\u884C\u3092\u30B9\u30C6\u30C3\u30D7\u5B9F\u884C\u3057\u307E\u3059(\u547C\u51FA\u3057\u3092\u30B9\u30C6\u30C3\u30D7\u30AA\u30FC\u30D0\u30FC)\ncont -- \u30D6\u30EC\u30FC\u30AF\u30DD\u30A4\u30F3\u30C8\u304B\u3089\u5B9F\u884C\u3092\u7D9A\u884C\u3057\u307E\u3059\n\nlist [line number|method] -- \u30BD\u30FC\u30B9\u30FB\u30B3\u30FC\u30C9\u3092\u51FA\u529B\u3057\u307E\u3059\nuse (or sourcepath) [source file path]\n -- \u30BD\u30FC\u30B9\u30FB\u30D1\u30B9\u3092\u8868\u793A\u307E\u305F\u306F\u5909\u66F4\u3057\u307E\u3059\nexclude [, ... | \"none\"]\n -- \u6307\u5B9A\u3057\u305F\u30AF\u30E9\u30B9\u306E\u30B9\u30C6\u30C3\u30D7\u3084\u30E1\u30BD\u30C3\u30C9\u30FB\u30A4\u30D9\u30F3\u30C8\u3092\u5831\u544A\u3057\u307E\u305B\u3093\nclasspath -- \u30BF\u30FC\u30B2\u30C3\u30C8VM\u304B\u3089\u30AF\u30E9\u30B9\u30D1\u30B9\u60C5\u5831\u3092\u51FA\u529B\u3057\u307E\u3059\n\nmonitor -- \u30D7\u30ED\u30B0\u30E9\u30E0\u304C\u505C\u6B62\u3059\u308B\u305F\u3073\u306B\u30B3\u30DE\u30F3\u30C9\u3092\u5B9F\u884C\u3057\u307E\u3059\nmonitor -- \u30E2\u30CB\u30BF\u30FC\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\nunmonitor -- \u30E2\u30CB\u30BF\u30FC\u3092\u524A\u9664\u3057\u307E\u3059\nread -- \u30B3\u30DE\u30F3\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u8AAD\u307F\u53D6\u3063\u3066\u5B9F\u884C\u3057\u307E\u3059\n\nlock -- \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30ED\u30C3\u30AF\u60C5\u5831\u3092\u51FA\u529B\u3057\u307E\u3059\nthreadlocks [thread id] -- \u30B9\u30EC\u30C3\u30C9\u306E\u30ED\u30C3\u30AF\u60C5\u5831\u3092\u51FA\u529B\u3057\u307E\u3059\n\npop -- \u73FE\u5728\u306E\u30D5\u30EC\u30FC\u30E0\u307E\u3067\u306E\u3059\u3079\u3066\u306E\u30B9\u30BF\u30C3\u30AF\u3092\u30DD\u30C3\u30D7\u3057\u307E\u3059\nreenter -- pop\u3068\u540C\u3058\u3067\u3059\u304C\u3001\u73FE\u5728\u306E\u30D5\u30EC\u30FC\u30E0\u304C\u518D\u5165\u529B\u3055\u308C\u307E\u3059\nredefine \n -- \u30AF\u30E9\u30B9\u306E\u30B3\u30FC\u30C9\u3092\u518D\u5B9A\u7FA9\u3057\u307E\u3059\n\ndisablegc -- \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u6291\u5236\u3057\u307E\u3059\nenablegc -- \u30AA\u30D6\u30B8\u30A7\u30AF\u30C8\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u8A31\u53EF\u3057\u307E\u3059\n\n!! -- \u6700\u5F8C\u306E\u30B3\u30DE\u30F3\u30C9\u3092\u7E70\u308A\u8FD4\u3057\u307E\u3059\n -- \u30B3\u30DE\u30F3\u30C9\u3092n\u56DE\u7E70\u308A\u8FD4\u3057\u307E\u3059\n# -- \u7834\u68C4\u3057\u307E\u3059(\u64CD\u4F5C\u306A\u3057)\nhelp (\u307E\u305F\u306F?) -- \u30B3\u30DE\u30F3\u30C9\u3092\u30EA\u30B9\u30C8\u3057\u307E\u3059\nversion -- \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u51FA\u529B\u3057\u307E\u3059\nexit (\u307E\u305F\u306Fquit) -- \u30C7\u30D0\u30C3\u30AC\u3092\u7D42\u4E86\u3057\u307E\u3059\n\n: \u30D1\u30C3\u30B1\u30FC\u30B8\u4FEE\u98FE\u5B50\u3092\u542B\u3080\u5B8C\u5168\u30AF\u30E9\u30B9\u540D\n: \u5148\u982D\u307E\u305F\u306F\u672B\u5C3E\u306E\u30EF\u30A4\u30EB\u30C9\u30AB\u30FC\u30C9('*')\u3092\u542B\u3080\u30AF\u30E9\u30B9\u540D\n: 'threads'\u30B3\u30DE\u30F3\u30C9\u3067\u5831\u544A\u3055\u308C\u308B\u30B9\u30EC\u30C3\u30C9\u756A\u53F7\n: Java(TM)\u30D7\u30ED\u30B0\u30E9\u30DF\u30F3\u30B0\u8A00\u8A9E\u306E\u5F0F\u3002\n\u307B\u3068\u3093\u3069\u306E\u4E00\u822C\u7684\u306A\u69CB\u6587\u304C\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u3059\u3002\n\n\u8D77\u52D5\u30B3\u30DE\u30F3\u30C9\u306F\u3001\"jdb.ini\"\u307E\u305F\u306F\".jdbrc\"\u306B\u914D\u7F6E\u3067\u304D\u307E\u3059\n(user.home\u307E\u305F\u306Fuser.dir\u5185)"}, {"zz usage text", - "\u4f7f\u7528\u6cd5: {0} \n" + -"\n" + - "\u3053\u3053\u3067 options \u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002\n" + - " -help \u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u51fa\u529b\u3057\u3066\u7d42\u4e86\u3057\u307e\u3059\n" + - " -sourcepath <\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f \"{1}\" \u3067\u533a\u5207\u308a\u307e\u3059>\n" + - " \u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3067\u3059\n" + - " -attach

\n" + - " \u6a19\u6e96\u7684\u306a\u30b3\u30cd\u30af\u30bf\u3092\u4f7f\u3063\u3066\u3001\u6307\u5b9a\u3057\u305f\u30a2\u30c9\u30ec\u30b9\u3067\u5b9f\u884c\u4e2d\u306e VM \u306b\u63a5\u7d9a\u3057\u307e\u3059\n" + - " -listen
\n" + - " \u6a19\u6e96\u7684\u306a\u30b3\u30cd\u30af\u30bf\u3092\u4f7f\u3063\u3066\u3001\u6307\u5b9a\u3057\u305f\u30a2\u30c9\u30ec\u30b9\u3067\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u5b9f\u884c\u4e2d\u306e VM \u3092\u5f85\u6a5f\u3057\u307e\u3059\n" + - " -listenany\n" + - " \u6a19\u6e96\u7684\u306a\u30b3\u30cd\u30af\u30bf\u3092\u4f7f\u3063\u3066\u3001\u4f7f\u7528\u53ef\u80fd\u306a\u4efb\u610f\u306e\u30a2\u30c9\u30ec\u30b9\u3067\u63a5\u7d9a\u3059\u308b\u305f\u3081\u306b\u5b9f\u884c\u4e2d\u306e VM \u3092\u5f85\u6a5f\u3057\u307e\u3059\n" + - " -launch\n" + - " ''run'' \u30b3\u30de\u30f3\u30c9\u3092\u5f85\u305f\u305a\u306b VM \u3092\u305f\u3060\u3061\u306b\u8d77\u52d5\u3057\u307e\u3059\n" + - " -listconnectors \u3053\u306e VM \u5185\u3067\u4f7f\u7528\u53ef\u80fd\u306a\u30b3\u30cd\u30af\u30bf\u3092\u30ea\u30b9\u30c8\u8868\u793a\u3057\u307e\u3059\n" + - " -connect :=,...\n" + - " \u540d\u524d\u4ed8\u304d\u30b3\u30cd\u30af\u30bf\u3068\u4e00\u89a7\u8868\u793a\u3055\u308c\u305f\u5f15\u6570\u5024\u3092\u4f7f\u7528\u3057\u3066\u30bf\u30fc\u30b2\u30c3\u30c8 VM \u306b\u63a5\u7d9a\u3057\u307e\u3059\n" + - " -dbgtrace [flags] {0} \u3092\u30c7\u30d0\u30c3\u30b0\u3059\u308b\u305f\u3081\u306e\u51fa\u529b\u60c5\u5831\n" + - " -tclient Hotspot(tm) Performance Engine (\u30af\u30e9\u30a4\u30a2\u30f3\u30c8) \u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\n" + - " -tserver Hotspot(tm) Performance Engine (\u30b5\u30fc\u30d0) \u3067\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\n" + - "\n" + - "\u30c7\u30d0\u30c3\u30b0\u30d7\u30ed\u30bb\u30b9\u306b\u8ee2\u9001\u3055\u308c\u305f\u30aa\u30d7\u30b7\u30e7\u30f3:\n" + - " -v -verbose[:class|gc|jni]\n" + - " \u5197\u9577\u30e2\u30fc\u30c9\u3092\u30aa\u30f3\u306b\u3057\u307e\u3059\u3002\n" + - " -D= \u30b7\u30b9\u30c6\u30e0\u30d7\u30ed\u30d1\u30c6\u30a3\u3092\u8a2d\u5b9a\u3057\u307e\u3059\n" + - " -classpath <\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f \"{1}\" \u3067\u533a\u5207\u308a\u307e\u3059>\n" + - " \u30af\u30e9\u30b9\u306e\u691c\u7d22\u5148\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4e00\u89a7\u8868\u793a\u3057\u307e\u3059\u3002\n" + - " -X

Summary of Rounding Operations Under Different Rounding Modes

Summary of Rounding Operations Under Different Rounding Modes
Result of rounding input to one digit with the given * rounding mode
The character with hexadecimal value 0xhh
\uhhhhThe character with hexadecimal value 0xhhhh
\x{h...h}The character with hexadecimal value 0xh...h + * ({@link java.lang.Character#MIN_CODE_POINT Character.MIN_CODE_POINT} + *  <= 0xh...h <=  + * {@link java.lang.Character#MAX_CODE_POINT Character.MAX_CODE_POINT})
\tThe tab character ('\u0009')
\n