summaryrefslogtreecommitdiff
path: root/java
Commit message (Collapse)AuthorAgeFilesLines
* Revert undocumented changes accidentally included with last commit.Andrew John Hughes2016-02-161-11/+2
|
* Mention PR66376.Andrew John Hughes2015-06-191-2/+11
| | | | | | 2015-06-19 Andrew John Hughes <gnu_andrew@member.fsf.org> * NEWS: Mention PR66376.
* Cleanup the majority of the warnings in the gnu.java.security, ↵Andrew John Hughes2015-03-1163-371/+334
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | java.security, javax.security and gnu.javax.security classes. 2015-03-11 Andrew John Hughes <gnu_andrew@member.fsf.org> * configure.ac: (ECJ_WARNINGS): Turn off parameter assignment, autoboxing and overridding without a super method call warnings for now. * gnu/java/security/OID.java: (OID(int[],boolean)): Remove unnecessary cast on clone() call. (getIDs()): Likewise. (getDER()): Likewise. (clone()): Add @Override. (toString()): Add @Override. Remove unncessary else clause. (hashCode()): Add @Override. (equals(Object)): Likewise. (compareTo(OID)): Likewise. * gnu/java/security/PolicyFile.java: (getPermissions(CodeSource)): Add @Override. (refresh()): Likewise and on anonymous inner class run() method. (toString()): Add @Override. (parse(URL)): Throw exception if p is null, and suppress associated warning, as exception is thrown via error method. Add default empty case to switch method. Call error method with the exception, not the result of its toString() method. Remove unneeded else block. (expand(String)): Avoid shadowing the prop variable. (error(URL,StreamTokenizer,Throwable)): Add new variant that allows the cause to be included. * gnu/java/security/Properties.java: (init()): Avoid unnecessary casts. (handleBooleanProperty(String)): Make static. * gnu/java/security/action/GetPropertyAction.java: (run()): Add @Override. * gnu/java/security/action/GetSecurityPropertyAction.java: (run()): Add @Override. * gnu/java/security/ber/BERReader.java: (read()): Add @Override. Remove unnecessary else clause. * gnu/java/security/ber/BERValue.java: (getLength()): Add @Override. * gnu/java/security/der/BitString.java: (toByteArray()): Remove unnecessary cast on clone() call. (getShiftedByteArray()): Likewise. (toBooleanArray()): Likewise. (clone(): Add @Override. (hashCode()): Likewise. (equals(Object)): Likewise. (toString()): Likewise. * gnu/java/security/der/DERReader.java: (makeTime(int,byte[])): Make static. Mark fall-through cases in switch statement. Add default case which throws an exception. * gnu/java/security/der/DERValue.java: (DERValue(int,int,Object,byte[])): Remove unnecessary cast on clone() call. (getValueAs(int)): Avoid shadowing of encoded variable. (getEncoded()): Remove unnecessary cast on clone() call. (toString()): Add @Override. * gnu/java/security/hash/BaseHash.java: (name()): Add @Override. (hashSize()): Likewise. (blockSize()): Likewise. (update(byte)): Likewise. (update(byte[])): Likewise. (update(byte[],int,int)): Likewise. (digest()): Likewise. (reset()): Likewise. (clone()): Likewise. (selfTest()): Likewise. * gnu/java/security/hash/Haval.java: (Haval(Haval)): Remove unnecessary cast on clone() call. (clone()): Add @Override. (transform(byte[],int)): Likewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest()): Likewise. (tailorDigestBits()): Add empty default case to switch statement. (FF5(int,int,int,int,int,int,int,int,int,int)): Make static. (f1(int,int,int,int,int,int,int)): Likewise. (f2(int,int,int,int,int,int,int)): Likewise. (f3(int,int,int,int,int,int,int)): Likewise. (f4(int,int,int,int,int,int,int)): Likewise. (f5(int,int,int,int,int,int,int)): Likewise. * gnu/java/security/hash/MD2.java: (MD2(MD2)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. (padBuffer()): Likewise. (transform(byte[],int)): LIkewise. * gnu/java/security/hash/MD4.java: (MD4(MD4)): Remove unncessary casts on clone() call. (clone()): Add @Override. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. Avoid shadowing d variable. (padBuffer()): Likewise. (transform(byte[],int)): LIkewise. * gnu/java/security/hash/MD5.java: (MD5(MD5)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/RipeMD128.java: (RipeMD128(RipeMD128)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/RipeMD160.java: (RipeMD160(RipeMD160)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/Sha160.java: (Sha160(Sha160)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/Sha256.java: (Sha256(Sha256)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/Sha384.java: (Sha384(Sha384)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/Sha512.java: (Sha512(Sha512)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/hash/Tiger.java: (Tiger(Tiger)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (selfTest())): Likewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (transform(byte[],int)): LIkewise. * gnu/java/security/hash/Whirlpool.java, (Whirlpool(Whirlpool)): Remove unnecessary casts on clone() call. (clone()): Add @Override. (transform(byte[],int)): LIkewise. (padBuffer()): Likewise. (getResult()): Likewise. (resetContext()): Likewise. (selfTest())): Likewise. * gnu/java/security/jce/hash/MessageDigestAdapter.java: (clone()): Add @Override. (engineGetDigestLength()): Likewise. (engineUpdate(byte)): Likewise. (engineUpdate(byte[],int,int)): Likewise. (engineDigest()): Likewise. (engineDigest(byte[],int,int)): Likewise. (engineReset()): Likewise. * gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.java: (initialize(int,SecureRandom)): Add @Override. (initialize(AlgorithmParameterSpec,SecureRandom)): Likewise. * gnu/java/security/jce/sig/DSSParametersGenerator.java: (engineInit(int,SecureRandom)): Add @Override. (engineInit(AlgorithmParameterSpec,SecureRandom)): Likewise. (engineGenerateParameters()): Likewise. * gnu/java/security/jce/sig/EncodedKeyFactory.java: (decodeDSSPublicKey(DSAPublicKeySpec)): Make static. (decodeRSAPublicKey(RSAPublicKeySpec)): Likewise. (decodeDHPublicKey(DHPublicKeySpec)): Likewise. (decodeDHPublicKey(byte[]]): Likewise. (decodeDSSPrivateKey(DSAPrivateKeySpec)): Likewise. (decodeRSAPrivateKey(RSAPrivateCrtKeySpec)): Likewise. (decodeDHPrivateKey(DHPrivateKeySpec)): Likewise. (decodeDHPrivateKey(byte[])): Likewise. * gnu/java/security/jce/sig/KeyPairGeneratorAdapter.java: (initialize(int,SecureRandom)): Add Override. (initialize(AlgorithmParameterSpec,SecureRandom)): Likewise. (generateKeyPair()): Likewise. (localiseName(String)): Uncomment conversion. * gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java: (initialize(int,SecureRandom)): Add Override. (initialize(AlgorithmParameterSpec,SecureRandom)): Likewise. * gnu/java/security/jce/sig/SignatureAdapter.java: Drop unneeded import of BaseSignature. (clone()): Add @Override. (engineInitVerify(PublicKey)): Reference VERIFIER_KEY via interface ISignature where it is defined. (engineInitSign(PrivateKey)): Likewise for SIGNER_KEY. (engineInitSign(PrivateKey,SecureRandom)): Likewise for SIGNER_KEY and SOURCE_OF_RANDOMNESS. * gnu/java/security/key/KeyPairCodecFactory.java: (getInstance(String,int)): Add default case which returns null. (getInstance(Key)): Likewise and fix typo in documentation. * gnu/java/security/key/dss/DSSKey.java: (getParams()): Add @Override. (getAlgorithm()): Likewise. (getEncoded()): Likewise. (getFormat()): LIkewise. (equals(Object)): Likewise. (hashCode()): Add implementation using java.util.Objects.hash (toString()): Remove unneeded cast. * gnu/java/security/key/dss/DSSKeyPairGenerator.java: (setup(MAp)): Remove unnecessary else clause. (generate()): Remove left-over debug statement. * gnu/java/security/key/dss/DSSKeyPairRawCodec.java: (getFormatID()): Add @Override. (encodePublicKey(PublicKey)): Likewise. (decodePublicKey(byte[])): Likewise. (encodePrivateKey(PrivateKey)): Likewise. (decodePrivateKey(byte[])): Likewise. * gnu/java/security/key/dss/DSSKeyPairX509Codec.java: (getFormatID()): Add @Override. (encodePublicKey(PublicKey)): Likewise. (encodePrivateKey(PrivateKey)): Likewise. (decodePublicKey(byte[])): Likewise. (decodePrivateKey(byte[])): Likewise. * gnu/java/security/key/dss/DSSPrivateKey.java: Drop unneeded reference to PrivateKey. (getX()): Add @Override. (getEncoded(int)): Likewise. (equals(Object)): Likewise. (hashCode()): Implemented. (toString()): Add @Override and remove unneeded cast. * gnu/java/security/key/dss/DSSPublicKey.java: Drop unneeded reference to PublicKey. (getY()): Add @Override. (getEncoded(int)): Likewise. (equals(Object)): Likewise. (hashCode()): Implemented. (toString()): Add @Override and remove unneeded cast. * gnu/java/security/key/rsa/GnuRSAKey.java: (getModulus()): Add @Override. (getAlgorithm()): Likewise. (getEncoded()): Likewise. (getFormat()): Likewise. (equals(Object)): Likewise. (hashCode()): Implemented using java.util.Objects.hash (toString()): Add @Override and remove unneeded cast. * gnu/java/security/key/rsa/GnuRSAPrivateKey.java: Drop unneeded reference to PrivateKey. (getPrimeP()): Add @Override. (getPrimeQ()): Likewise. (getPrimeExponentP()): Likewise. (getPrimeExponentQ()): Likewise. (getCrtCoefficient()): Likewise. (getPrivateExponent()): Likewise. (getEncoded(int)): Likewise. (equals(Object)): Likewise. (hashCode()): Implemented using java.util.Objects.hash. (toString()): Add @Override and remove unneeded cast. * gnu/java/security/key/rsa/GnuRSAPublicKey.java: Drop unneeded reference to PublicKey. (getEncoded()): Add @Override. (equals(Object)): Likewise. (hashCode()): Implemented. (toString()): Add @Override and remove unneeded cast. * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java: (getFormatID()): Add @Override. (encodePublicKey(PublicKey)): Likewise. (encodePrivateKey(PrivateKey)): Likewise. (decodePublicKey(byte[])): Likewise. (decodePrivateKey(byte[])): Likewise. * gnu/java/security/key/rsa/RSAKeyPairRawCodec.java: (getFormatID()): Add @Override. (encodePublicKey(PublicKey)): Likewise. (decodePublicKey(byte[])): Likewise. (encodePrivateKey(PrivateKey)): Likewise. (decodePrivateKey(byte[])): Likewise. * gnu/java/security/pkcs/PKCS7SignedData.java: (PKCS7SignedData(BERReader)): Refer to constants by the interface where they are defined. Rename crls to avoid shadowing the class variable. * gnu/java/security/pkcs/SignerInfo.java: (SignerInfo(BERReader)): Refer to constants by the interface where they are defined. * gnu/java/security/prng/BasePRNG.java: (addRandomBytes(byte[])): Add @Override. (addRandomBytes(byte[],int,int)): Likewise. Rename buffer to buf to avoid shadowing. (clone()): Remove unnecessary cast and this references. * gnu/java/security/prng/MDGenerator.java: Remove unneeded reference to Cloneable. * gnu/java/security/prng/RandomEvent.java: (RandomEvent(Object,byte,byte,byte[])): Remove unnecessary cast. * gnu/java/security/provider/DefaultPolicy.java: (getPermissions(CodeSource)): Add @Override. (refresh()): Likewise. * gnu/java/security/provider/Gnu.java: (Gnu()): Add @Override to run implementation in anonymous inner class. * gnu/java/security/provider/PKIXCertPathValidatorImpl.java: (engineValidate(CertPath,CertPathParameters)): Add @Override. Remove unneeded cast and else clause. (checkExplicitPolicy(int,List)): Make static. * gnu/java/security/provider/X509CertificateFactory.java: (generateCert(InputStream)): Make static. Remove unnecessary else clause. (generateCRL(InputStream)): Likewise. * gnu/java/security/sig/SignatureCodecFactory.java: (getInstance(String,int)): Add default case to switch statement. * gnu/java/security/sig/dss/DSSSignature.java: (encodeSignature(BigInteger,BigInteger)): Make static. (decodeSignature(Object)): Likewise. * gnu/java/security/sig/dss/DSSSignatureRawCodec.java: (getFormatID()): Add @Override. (encodeSignature(Object)): Likewise. (decodeSignature(byte[])): Likewise. * gnu/java/security/sig/dss/DSSSignatureX509Codec.java: (getFormatID()): Add @Override. (encodeSignature(Object)): Likewise. (decodeSignature(byte[])): Likewise. * gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.java: (clone()): Add @Override. * gnu/java/security/sig/rsa/EMSA_PSS.java: (clone()): Add @Override. * gnu/java/security/sig/rsa/RSA.java: (RSADP(RSAPrivateKey, BigInteger)): Suppress null warning as r is always non-null if rsaBlinding is true. * gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.java: (clone()): Add @Override. (setupForVerification(PublicKey)): Likewise. (setupForSigning(PrivateKey)): Likewise. (generateSignature()): Likewise. (verifySignature(Object)): Likewise. * gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureRawCodec.java: (getFormatID()): Add @Override. (encodeSignature(Object)): Likewise. (decodeSignature(byte[])): Likewise. * gnu/java/security/sig/rsa/RSAPKCS1V1_5SignatureX509Codec.java: (getFormatID()): Add @Override. (encodeSignature(Object)): Likewise. (decodeSignature(byte[])): Likewise. * gnu/java/security/sig/rsa/RSAPSSSignature.java: (clone()): Add @Override. (setupForVerification(PublicKey)): Likewise. Remove unnecessary cast. (setupForSigning(PrivateKey)): Likewise. (generateSignature()): Add @Override. (verifySignature(Object)): Likewise. * gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.java: (getFormatID()): Add @Override. (encodeSignature(Object)): Likewise. (decodeSignature(byte[])): Likewise. * gnu/java/security/util/ByteArray.java: (toString()): Add @Override. * gnu/java/security/util/ByteBufferOutputStream.java: (toString()): Add @Override. * gnu/java/security/util/ExpirableObject.java: (destroy()): Add @Override. (Destroyer.run()): Likewise. * gnu/java/security/util/FormatUtil.java: (getEncodingName(int)): Add default case for switch statement. (getEncodingShortName(int)): Likewise. * gnu/java/security/util/Sequence.java: (size()): Add @Override. (toArray()): Likewise. Remove unnecessary cast. * gnu/java/security/util/SimpleList.java: (size()): Add @Override. (get(int)): Likewise. (toString()): Likewise. * gnu/java/security/util/Util.java: (toBase64(byte[])): Add default case to switch statement which does nothing. Remove unnecessary else clause. * gnu/java/security/x509/PolicyNodeImpl.java: (addExpectedPolicy(String)): Rename variable to expectedPolicy to avoid shadowing policy variable. (addAllPolicyQualifiers(Collection)): Rename variable to policyQualifiers to avoid shadowing qualifiers variable. Rewrite collection check to catch ClassCastException as, if it.next() returns normally, it will always be an instance of PolicyQualifierInfo. (toString()): Add @Override. * gnu/java/security/x509/X500DistinguishedName.java: (X500DistinguishedName(String)): Throw IOException rather than catching it as calling methods in X509CRLSelector implementations, addIssuerName(String), expect an IOException to be thrown if there is a parsing error. (getName()): Add @Override. (hashCode()): Likewise. (equals(Object)): Likewise. (toString()): Likewise. (getDer()): Remove unnecessary casts. (readAttributeType(Reader)): Make static. * gnu/java/security/x509/X509CRL.java: (equals(Object)): Add @Override. (hashCode()): Likewise. (getEncoded()): Remove unnecessary cast. (getIssuerX500Principal()): Add @Override. (getTBSCertList()): Remove unnecessary cast. (getSignature()): Likewise. (getSigAlgParams()): Likewise. (hasUnsupportedCriticalExtension()): Add @Override. (getCriticialExtensionOIDs()): Likewise. (getNonCriticalExtensionOIDs()): Likewise. (getExtensionValue(String)): Likewise. (isRevoked(Certificate)): Likewise. Remove unnecessary cast. (parse(InputStream)): Remove unnecessary cast. * gnu/java/security/x509/X509CRLEntry.java: (getEncoded()): Remove unncessary cast. (hasUnsupportedCriticalExtension()): Add @Override. (getCriticialExtensionOIDs()): Likewise. (getNonCriticalExtensionOIDs()): Likewise. (getExtensionValue(String)): Likewise. * gnu/java/security/x509/X509CRLSelectorImpl.java: (addIssuerName(String)): Throw IOException as specified. * gnu/java/security/x509/X509CertPath.java: (getCertificates()): Add @Override. (getEncoded()): Likewise. Remove unnecessary casts. (getEncodings()): Add @Override. (parse(InputStream, String)): Rename path to parsedPath to avoid shadowing. * gnu/java/security/x509/X509CertSelectorImpl.java: (addIssuerName(String)): Throw IOException as specified. * gnu/java/security/x509/X509Certificate.java: Remove unneeded Serializable reference. (checkValidity()): Add @Override. (checkValidity(Date)): Likewise. (getVersion()): Likewise. (getSerialNumber()): Likewise. (getIssuerDN()): Likewise. (getIssuerX500Principal()): Likewise. (getSubjectDN()): Likewise. (getSubjectX500Principal()): Likewise. (getNotBefore()): Likewise. (getNotAfter()): Likewise. (getTBSCertificate()): Likewise. Remove unnecessary cast. (getSignature()): Likewise. (getSigAlgName()): Add @Override. (getSigAlgOID()): Likewise. (getSigAlgParams()): Likewise. Remove unnecessary cast. (getIssuerUniqueID()): Add @Override. (getSubjectUniqueID()): Likewise. (getKeyUsage()): Likewise. (getExtendedKeyUsage()): Likewise. (getBasicConstraints()): Likewise. (getSubjectAlternativeNames()): Likewise. Make conversion from int to Integer explicit. (getIssuerAlternativeNames()): Likewise. (hasUnsupportedCriticalExtension()): Add @Override. (getCriticialExtensionOIDs()): Likewise. (getNonCriticalExtensionOIDs()): Likewise. (getExtensionValue(String)): Likewise. (getEncoded()): Likewise. Remove unnecessary cast. (verify(PublicKey)): Add @Override. (verify(PublicKey, String)): Likewise. (toString()): Likewise. (getPublicKey()): Likewise. (parse(InputStream)): Rename encoded to enc to avoid shadowing. Avoid unnecessary cast. * gnu/java/security/x509/ext/AuthorityKeyIdentifier.java: (toString()): Add @Override. * gnu/java/security/x509/ext/BasicConstraints.java: (getEncoded()): Add @Override. Remove unncessary casts. (toString()): Add @Override. * gnu/java/security/x509/ext/CRLNumber.java: (getEncoded()): Add @Override. Remove unncessary casts. (toString()): Add @Override. * gnu/java/security/x509/ext/CertificatePolicies.java: (CertificatePolicies(List,Map)): Swap empty for-loop for a while loop. (getEncoded()): Add @Override. Remove unnecessary cast. (toString()): Add @Override. * gnu/java/security/x509/ext/ExtendedKeyUsage.java: (toString()): Add @Override. * gnu/java/security/x509/ext/Extension.java: (Extension(byte[])): Remove unnecessary cast. (getEncoded()): Likewise. (toString()): Add @Override. (Value.Value(byte[])): Remove unnecessary cast. (Value.getEncoded()): Likewise. (hashCode()): Add @Override. (equals(Object)): Likewise. (toString()): Likewise. * gnu/java/security/x509/ext/GeneralName.java: (Kind.forTag(int)): Add default case. (Kind): Remove unnecessary ; on closing brace. (GeneralName(Kind,byte[])): Remove unnecessary cast. (name()): Likewise. (encoded()): Check for null rather than catching exception. Remove unnecessary cast. (equals(Object)): Add @Override. Avoid unnecessary method call. (hashCode()): Implemented using java.util.Objects.hash. (toString()): Add @Override. * gnu/java/security/x509/ext/GeneralNames.java: (toString()): Add @Override. * gnu/java/security/x509/ext/GeneralSubtree.java: (toString()): Add @Override. * gnu/java/security/x509/ext/IssuerAlternativeNames.java: (toString()): Add @Override. * gnu/java/security/x509/ext/KeyUsage.java: (toString()): Add @Override. * gnu/java/security/x509/ext/NameConstraints.java: (toString()): Add @Override. * gnu/java/security/x509/ext/PolicyConstraint.java: (toString()): Add @Override. * gnu/java/security/x509/ext/PolicyMappings.java: (toString()): Add @Override. * gnu/java/security/x509/ext/PrivateKeyUsagePeriod.java: (toString()): Add @Override. * gnu/java/security/x509/ext/ReasonCode.java: (toString()): Add @Override. * gnu/java/security/x509/ext/SubjectAlternativeNames.java: (toString()): Add @Override. * gnu/java/security/x509/ext/SubjectKeyIdentifier.java: (getKeyIdentifier()): Remove unnecessary cast. (toString()): Add @Override. * gnu/javax/security/auth/Password.java: (doDestroy): Add @Override. Remove unneeded else block. (isDestroyed): Add @Override. * gnu/javax/security/auth/callback/AWTCallbackHandler.java: (handleChoice(ChoiceCallback)): Add @Override. (handleConfirmation(ConfirmationCallback)): Likewise. (handleLanguage(LanguageCallback)): Likewise. (handleName(NameCallback)): Likewise. (handlePassword(PasswordCallback)): Likewise. (handleTextInput(TextInputCallback)): Likewise. (handleTextOutput(TextOutputCallback)): Likewise. (actionPerformed(ActionEvent)): Likewise. (windowClosing(WindowEvent)): Likewise. (windowOpened(WindowEvent)): Likewise. (windowClosed(WindowEvent)): Likewise. (windowIconified(WindowEvent)): Likewise. (windowDeiconified(WindowEvent)): Likewise. (windowActivated(WindowEvent)): Likewise. (windowDeactivated(WindowEvent)): Likewise. * gnu/javax/security/auth/callback/AbstractCallbackHandler.java: (AbstractCallbackHandler(String)): Reference getBundle by class where it is implemented (ResourceBundle). (handle(Callback[])): Add @Override. (handleChoice(ChoiceCallback)): Allow and document an UnsupportedCallbackException being thrown. (handleConfirmation(ConfirmationCallback)): Likewise. (handleLanguage(LanguageCallback)): Likewise. (handleName(NameCallback)): Likewise. (handlePassword(PasswordCallback)): Likewise. (handleTextInput(TextInputCallback)): Likewise. (handleTextOutput(TextOutputCallback)): Likewise. (handleOther(Callback)): Suppress warnings resulting from unused variables, unthrown exceptions and lack of IOException being thrown. They are necessary for subclasses. * gnu/javax/security/auth/callback/ConsoleCallbackHandler.java: (handleChoice(ChoiceCallback)): Add @Override. Drop unnecessary cast. (handleConfirmation(ConfirmationCallback)): Add @Override. (handleLanguage(LanguageCallback)): Likewise. (handleName(NameCallback)): Likewise. (handlePassword(PasswordCallback)): Likewise. (handleTextInput(TextInputCallback)): Likewise. (handleTextOutput(TextOutputCallback)): Likewise. * gnu/javax/security/auth/callback/DefaultCallbackHandler.java: (handleChoice(ChoiceCallback)): Add @Override. (handleConfirmation(ConfirmationCallback)): Likewise. (handleLanguage(LanguageCallback)): Likewise. (handleName(NameCallback)): Likewise. (handlePassword(PasswordCallback)): Likewise. (handleTextInput(TextInputCallback)): Likewise. (handleTextOutput(TextOutputCallback)): Likewise. * gnu/javax/security/auth/callback/GnuCallbacks.java: (GnuCallbacks()): Add @Override to run() implementation in anonymous inner class. * gnu/javax/security/auth/callback/SwingCallbackHandler.java: (handleChoice(ChoiceCallback)): Add @Override to method and methods of anonymous inner classes. Refer to constants using interface where they appear. (handleConfirmation(ConfirmationCallback)): Add @Override to method and methods of anonymous inner class. Declare UnsupportedCallbackException as thrown and add default cases and fall-through markers to switch statements. (handleLanguage(LanguageCallback)): Add @Override. Remove unused variable defaultIndex. (handleName(NameCallback)): Add @Override to method and method of anonymous inner class. (handlePassword(PasswordCallback)): Likewise. (handleTextInput(TextInputCallback)): Likewise. Refer to constants using interface where they appear. (handleTextOutput(TextOutputCallback)): Likewise. Declare UnsupportedCallbackException as thrown and add default case to switch statement. (waitForInput(JDialog, Callback)): Make static. * gnu/javax/security/auth/login/ConfigFileParser.java: (initParser(Reader)): Don't declare IOException as thrown as one is never thrown. (expandParamValue(String)): Make static. * gnu/javax/security/auth/login/GnuConfiguration.java: (getAppConfigurationEntry(String)): Add @Override. (refresh()): Likewise. (getInputStreamFromURL(String)): Make static. (parseConfig(InputStream)): Remove unneeded variable. (getUserName()): Make static. (getConfigFromUserName(File,String)): Likewise. * java/security/AccessControlContext.java: (equals(Object)): Add @Override. (hashCode()): Likewise. * java/security/AlgorithmParameters.java: (toString()): Add @Override. * java/security/AllPermission.java: (AllPermission(String,String)): Suppress warning about actions variable being unused. (implies(Permission)): Add @Override. (equals(Object)): Likewise. (hashCode()): Likewise. (getActions()): Likewise. (newPermissionCollection()): Likewise. (AllPermissionCollection()): Add public constructor to avoid generating a synthetic accessor method. * java/security/BasicPermission.java: Remove unneeded Serializable reference. (BasicPermission(String,String)): Suppress warnings about actions variable being unused. (getActions()): Add @Override. (newPermissionCollection()): Likewise. * java/security/Certificate.java: Mark with @Deprecated. Fix typo in documentation. * java/security/DigestInputStream.java: (read()): Add @Override. (read(byte[],int,int)): Likewise. (toString()): Likewise. * java/security/DigestOutputStream.java: (write(int)): Add @Override. (write(byte[],int,int)): Likewise. (toString()): Likewise. * java/security/DummyKeyPairGenerator.java: (clone()): Add @Override. (initialize(int,SecureRandom)): Likewise. (initialize(AlgorithmParameterSpec,SecureRandom)): Likewise. (generateKeyPair()): Likewise. * java/security/DummyMessageDigest.java: (clone()): Add @Override. (engineDigest()): Likewise. (engineDigest(byte[],int,int)): Likewise. (engineGetDigestLength()): Likewise. (engineReset()): Likewise. (engineUpdate(byte)): Likewise. (engineUpdate(byte[],int,int)): Likewise. * java/security/Identity.java: Mark as @Deprecated. Fix typo in documentation. (getName()): Add @Override. (equals(Object)): Likewise. (toString()): Likewise. (toString(boolean)): Remove unnecessary else clause. (hashCode()): Add @Override. * java/security/IdentityScope.java: Mark as @Deprecated. (toString()): Add @Override. * java/security/IntersectingDomainCombiner.java: (combine(ProtectionDomain[],ProtectionDomain[])): Add @Override. * java/security/KeyPairGenerator.java: (generateKeyPair()): Add @Override. * java/security/KeyPairGeneratorSpi.java: (initialize(AlgorithmParameterSpec,SecureRandom)): Suppress warning about making this method static. Intended to be overridden by subclasses. (clone()): Add @Override. * java/security/KeyStore.java: (getInstance(String,Provider)): Fix typo in documentation. (getDefaultType()): Add @Override to run() in anonymous inner class. * java/security/MessageDigest.java: (toString()): Add @Override. (clone()): Likewise. * java/security/MessageDigestSpi.java: (engineGetDigestLength()): Suppress warning about making this method static. Intended to be overridden by subclasses. (clone()): Add @Override. * java/security/Permission.java: (checkGuard(Object)): Add @Override. (equals(Object)): Likewise. (hashCode()): Likewise. (newPermissionCollection()): Likewise. (toString()): Likewise. * java/security/PermissionCollection.java: (toString()): Add @Override. * java/security/Permissions.java: Remove unneeded Serializable reference. (elements()): Add @Override to hasMoreElements and nextElement methods in anonymous inner class. (PermissionsHash.PermissionsHash()): Add explicit constructor to avoid a synthetic accessor method. (add(Permission)): Mark synchronized. (implies(Permission)): Likewise. * java/security/Policy.java: (implies(ProtectionDomain,Permission)): Remove unnecessary cast. * java/security/Principal.java: (equals(Object)): Add @Override. (toString()): Likewise. (hashCode()): Likewise. * java/security/PrivilegedActionException.java: (getCause()): Add @Override. (toString()): Removed; pointless as it just calls superclass version. * java/security/ProtectionDomain.java: (ProtectionDomain(CodeSource,PermissionCollection, ClassLoader,Principal[],boolean)): Remove unnecessary cast. (getPrincipals()): Add @Override. (toString()): Likewise. * java/security/Provider.java: Remove unneeded Serializable reference. (put(Object,Object)): Add @Override. Suppress warnings about overridding a synchronized method as all collection modifications are made in synchronized superclass method. (get(Object)): Likewise. (remove(Object)): Likewise. (clear()): Likewise. (toString()): Add @Override. Suppress warning about overridding a synchronized method as the collection isn't used. (toCanonicalKey(Object)): Make static. * java/security/SecureClassLoader.java: (getPermissions(CodeSource)): Suppress warning about making this method static; may potentially be overridden by subclasses. Avoid unnecessary variable policy. * java/security/SecureRandom.java: (setSeed(byte[])): Make synchronized to prevent concurrent access to secureRandomSpi. (setSeed(long)): Add @Override and make synchronized. (nextBytes(byte[])): Likewise. (next(int)): Likewise. (generateSeed(byte[])): Make synchronized. * java/security/Security.java: (getAlgorithmProperty(String,String)): Add @Deprecated. (getProvider(String)): Remove unnecessary else clause. (getAlgorithm(String)): Use provs instead of providers to avoid shadowing class variable. (provides(Provider,String,String,String,String)): Set serviceDotAlgorithm to the empty string to avoid null pointer issues. * java/security/SecurityPermission.java: (SecurityPermission(String,String)): Suppress warning due to nothing being done with actions. * java/security/Signature.java: (sign()): Remove unnecessary else clause. (sign(byte[],int,int)): Likewise. (verify(byte[])): Likewise. (toString()): Mark @Override. (setParameter(String,Object)): Add @Deprecated. (getParameter(String)): Likewise. (clone()): Add @Override. * java/security/SignatureSpi.java: (engineSetParameter(String,Object)): Add @Deprecated. (engineSetParameter(AlgorithmParameterSpec)): Suppress warnings about unused variables, unthrown exceptions and ability to be a static method. Subclasses override this. (engineGetParameters()): Suppress warnings about making this method static. (engineGetParameter(String)): Add @Deprecated. * java/security/SignedObject.java: (getSignature()): Remove unnecessary cast. (readObject(ObjectInputStream)): Likewise x 2. * java/security/Signer.java: Mark as @Deprecated. (toString()): Add @Override. * java/security/UnresolvedPermission.java: (getUnresolvedCerts()): Remove unnecessaary cast. (UnresolvedPermissionCollection.elements()): Add @Override to hasMoreElements and nextElement. * java/security/acl/Acl.java: (toString()): Add @Override. * java/security/acl/AclEntry.java: (setPrincipal(Principal)): Fix formatting of documentation. (addPermission(Permission)): Likewise. (removePermission(Permission)): Likewise. (checkPermission(Permission)): Likewise. (toString()): Add @Override. * java/security/acl/Permission.java: (equals(Object)): Add @Override. (toString()): Likewise. * java/security/cert/CRL.java: (toString()): Add @Override. * java/security/cert/CertPath.java: (equals(Object)): Add @Override. (hashCode()): Likewise. (toString()): Likewise. * java/security/cert/CertPathBuilderException.java: (CertPathBuilderException(Throwable)): Just call superclass constructor. (CertPathBuilderException(String,Throwable)): Likewise. (getMessage()): Removed; provided by superclass. (getCause()): Likewise. (toString()): Likewise. (printStackTrace()): Likewise. (printStackTrace(PrintStream)): Likewise. (printStackTrace(PrintWriter)): Likewise. * java/security/cert/CertPathValidatorException.java: (CertPathValidatorException(String,Throwable)): Just call superclass with both arguments, rather than initCause. (getMessage()): Removed; provided by superclass. (getCause()): Likewise. (toString()): Likewise. (printStackTrace()): Likewise. (printStackTrace(PrintStream)): Likewise. (printStackTrace(PrintWriter)): Likewise. * java/security/cert/CertStoreException.java: (CertStoreException(Throwable)): Just call superclass constructor. (CertStoreException(String,Throwable)): Likewise. (getMessage()): Removed; provided by superclass. (getCause()): Likewise. (toString()): Likewise. (printStackTrace()): Likewise. (printStackTrace(PrintStream)): Likewise. (printStackTrace(PrintWriter)): Likewise. * java/security/cert/CertStoreSpi.java: (CertStoreSpi(CertStoreParameters)): Suppress warnings about exception not being thrown. Present for subclasses. * java/security/cert/Certificate.java: (equals(Object)): Add @Override. (hashCode()): Likewise. (toString()): Likewise. * java/security/cert/CertificateFactorySpi.java: (engineGenerateCertPath(InputStream)): Suppress warnings about unused arguments, exceptions not being thrown and method can be static. Provided for subclass implementations. (engineGenerateCertPath(InputStream,String)): Likewise. (engineGenerateCertPath(List)): Likewise. (engineGetCertPathEncodings()): Likewise. * java/security/cert/CollectionCertStoreParameters.java: (toString()): Add @Override. * java/security/cert/LDAPCertStoreParameters.java: (clone()): Add @Override. (toString()): Likewise. * java/security/cert/PKIXBuilderParameters.java: (toString()): Likewise. * java/security/cert/PKIXCertPathBuilderResult.java: (getCertPath()): Add @Override. (toString()): Likewise. * java/security/cert/PKIXCertPathChecker.java: (clone()): Add @Override. * java/security/cert/PKIXCertPathValidatorResult.java: (clone()): Add @Override. (toString()): Likewise. * java/security/cert/PKIXParameters.java: (clone()): Add @Overrride. (toString()): Likewise. * java/security/cert/PolicyQualifierInfo.java: (PolicyQualifierInfo(byte[])): Remove unnecessary cast. (getEncoded()): Likewise. (toString()): Add @Override. * java/security/cert/TrustAnchor.java: (TrustAnchor(X509Certificate,byte[])): Remove unnecessary cast. (TrustAnchor(String,PublicKey,byte[])): Document exceptions. Catch IOException and throw as IllegalArgumentException. Remove unnecessary casts. (toString()): Add @Override. * java/security/cert/X509CRL.java: (equals(Object)): Add @Override. (hashCode()): Likewise. (getIssuerX500Principal()): Suppress warning about making this static. Should be overridden by subclasses. * java/security/cert/X509CRLEntry.java: (equals(Object):: Add @Override. (hashCode()): Likewise. (toString()): Likewise. * java/security/cert/X509CRLSelector.java: Remove unneeded Cloneable reference. (getIssuerNames()): Remove unneeded else block. (toString()): Add @Override. (match(CRL)): Likewise. (clone()): LIkewise. * java/security/cert/X509CertSelector.java: Remove unneeded Cloneable reference. (makeName(int,String)): Re-use earlier result of Kind.forTag(id). Add default case. (clone()): Add @Override. (getAuthorityKeyIdentifier()): Remove unneeded else block and cast. (getCertificateValid()): Remove unneeded else block. (getExtendedKeyUsage()): Likewise. (getIssuerAsBytes()): Likewise. (getIssuerAsString()): Likewise. (getKeyUsage()): Likewise and remove unneeded cast. (getNameConstraints()): Likewise. (getPathToNames()): Explicitly convert int to Integer. (getPrivateKeyValid()): Suppress static method warning. Method is deliberately useless. (getSubjectAlternativeNames()): Explicitly convert int to Integer. (getSubjectAsBytes()): Remove unneeded else block. (getSubjectAsString()): Likewise. (getSubjectKeyIdentifier()): Likewise and remove unneeded cast. (match(Certificate)): Add @Override. Rename cert to other to avoid shadowing. (setNameConstraints(byte[])): Remove unnecessary cast. Suppress warnings about NameConstraints instance being unused. (setPrivateKeyValid()): Suppress unused variable warning. Method is deliberately useless. (setSubjectPublicKey(PublicKey)): Remove unneeded cast. (toString()): Add @Override. * java/security/cert/X509Certificate.java: (getExtendedKeyUsage()): Suppress unthrown exception warning and static method suggestion. Overridden by subclasses. (getSubjectAlternativeNames()): Likewise. (getIssuerAlternativeNames()): Likewise. (getSubjectX500Principal()): Suppress static method suggestion. Overridden by subclasses. (getIssuerX500Principal()): Likewise. * java/security/spec/DSAParameterSpec.java: (getP()): Add @Override. (getQ()): Likewise. (getG()): Likewise. * java/security/spec/PKCS8EncodedKeySpec.java: (getEncoded()): Add @Override. (getFormat()): Likewise. * java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java: (RSAMultiPrimePrivateCrtKeySpec(BigInteger,BigInteger,BigInteger, BigInteger,BigInteger,BigInteger,BigInteger,BigInteger, RSAOtherPrimeInfo[])): Remove unneeded else block. * java/security/spec/X509EncodedKeySpec.java: (getEncoded()): Add @Override. (getFormat()): Likewise. * javax/security/auth/Policy.java: Add @Deprecated. * javax/security/auth/PrivateCredentialPermission.java: Remove unneeded Serializable reference. (equals(Object)): Add @Override. Rename principals to thisPrincipals to avoid shadowing. (getActions()): Add @Override. (hashCode()): Likewise. (implies(Permission)): Likewise. Rename principals to thisPrincipals to avoid shadowing. (newPermissionCollection()): Add @Override to method and anonymous inner class implementations of equals(Object) & hashCode(). * javax/security/auth/SubjectDomainCombiner.java: (combine(ProtectionDomain[],ProtectionDomain[])): Add @Override. * javax/security/auth/callback/ConfirmationCallback.java: (setOptions(String[],int)): Move reference to options.length to after options null check. * javax/security/auth/kerberos/KerberosKey.java: Remove unneeded Serializable reference. (getAlgorithm()): Add @Override. (getFormat()): Likewise. (getEncoded()): Likewise and remove unnecessary cast. (destroy()): Add @Override. (isDestroyed()): Likewise. (toString()): Likewise. * javax/security/auth/kerberos/KerberosPrincipal.java: (getName()): Add @Override. (hashCode()): Likewise. (equals(Object)): Likewise. (toString()): Likewise. * javax/security/auth/kerberos/KerberosTicket.java: (asn1Encoding): Remove @SuppressWarnings. (KerberosTicket(byte[],KerberosPrincipal,KerberosPrincipal, byte[],int,boolean[],Date,Date,Date,Date,InetAddress[])): Remove unnecessary cast. Remove duplicate assignment to flags. (destroy()): Add @Override. (isDestroyed()): Likewise. (isCurrent()): Likewise. (refresh()): Likewise. (getFlags()): Remove unnecessary cast. (getEncoded()): Likewise. (toString()): Add @Override. * javax/security/auth/kerberos/KeyImpl.java: Remove unneeded Serializable reference. (KeyImpl(byte[],int)): Remove unnecessary cast. (getAlgorithm()): Add @Override. (getEncoded()): Likewise. (getFormat()): Likewise. (toString()): Likewise. * javax/security/auth/login/AppConfigurationEntry.java: (toString()): Add @Override. (LoginModuleControlFlag.toString()): Likewise. * javax/security/auth/login/Configuration.java: (getConfig()): Use GetSecurityPropertyAction rather than a bespoke PrivilegedAction implementation. * javax/security/auth/login/LoginContext.java: (LoginContext(String,Subject,CallbackHandler,Configuration)): Rename entries to appEntries to avoid shadowing. (lookupModule(AppConfigurationEntry,Subject,Map)): Rename subject to subj to avoid shadowing. Check module is null rather than cause is non-null. * javax/security/auth/login/NullConfiguration.java: (getAppConfigurationEntry(String)): Add @Override. (refresh()): Likewise. * javax/security/auth/x500/X500Principal.java: (hashCode()): Add @Override. (equals(Object)): Likewise. (getEncoded()): Remove unnecessary cast. (getName()): Add @Override. (toString()): Likewise. (readAttributeType(Reader)): Make static. (parseDer(InputStream)): Rename encoded to encodedStream to avoid shadowing. * javax/security/auth/x500/X500PrivateCredential.java: (destroy()): Add @Override. (isDestroyed()): Likewise. * javax/security/cert/Certificate.java: (equals(Object)): Add @Override. (hashCode()): Likewise. (toString()): Likewise. * javax/security/cert/X509CertBridge.java: (getEncoded()): Add @Override. (verify(PublicKey)): Likewise. (verify(PublicKey,String)): Likewise. (toString()): Likewise. (getPublicKey()): Likewise. (checkValidity()): Likewise. (checkValidity(Date)): Likewise. (getVersion()): Likewise. (getSerialNumber()): Likewise. (getIssuerDN()): Likewise. (getSubjectDN()): Likewise. (getNotBefore()): Likewise. (getNotAfter()): Likewise. (getSigAlgName()): Likewise. (getSigAlgOID()): Likewise. (getSigAlgParams()): Likewise. * javax/security/sasl/Sasl.java: (createSaslClient(String[],String,String,String,Map,CallbackHandler)): Remove unnecessary else clause and pointless result assignment. (createSaslServer(String,String,String,Map,CallbackHandler)): Likewise. * javax/security/sasl/SaslException.java: Remove unneeded Serializable reference. (SaslException(String,Throwable)): Add cause to superclass call. (getCause()): Add @Override. (printStackTrace()): Removed; provided by superclass. (printStackTrace(PrintStream)): Likewise. (printStackTrace(PrintWriter)): Likewise. (initCause(Throwable)): Call superclass version, then sync the local copy. (toString()): Add @Override.
* PR64881: KeyPairGenerator.genKeyPair() ends up calling the default ↵Andrew John Hughes2015-02-021-18/+47
| | | | | | | | | | | | | | | | | generateKeyPair method which returns a DSA generator 2015-01-30 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/64881 * NEWS: Updated. * java/security/KeyPairGenerator.java: (genKeyPair()): Document properly. Call original method, generateKeyPair(). (generateKeyPair()): Document properly. Use provider and algorithm values if set rather than just defaulting to GNU and DSA. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Implement java.util.Objects.Andrew John Hughes2015-01-071-0/+296
| | | | | | | | | | | | | | | | | | 2015-01-06 Andrew John Hughes <gnu_andrew@member.fsf.org> * NEWS: Updated. * java/util/Objects.java: New class. (compareTo(T,T,Comparator)): Implemented. (deepEquals(Object,Object)): Likewise. (equals(Object,Object)): Likewise. (hash(Object...)): Likewise. (hashCode(Object)): Likewise. (requireNonNull(T)): Likewise. (requireNonNull(T,String)): Likewise. (toString(Object)): Likewise. (toString(Object,String)): Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* PR64176: Week of year field during end of year transition is incorrectAndrew John Hughes2014-12-221-11/+79
| | | | | | | | | | | | | | | | 2014-12-15 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/64176 * NEWS: Updated. * java/util/GregorianCalendar.java: (computeFields()): Handle the week that runs over the end of the year and the beginning of the next one, so that it is numbered the same in both years. (getBaseWeekOfYear(int,int,int)): Broken out of computeFields to avoid code duplication. (getRelativeWeekday(int)): Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Fix majority of warnings in gnu.java.security.* and java.security.*.Andrew John Hughes2014-10-1322-216/+266
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also fixes PR58688 as a consequence. 2014-10-09 Andrew John Hughes <gnu_andrew@member.fsf.org> * NEWS: Updated. * gnu/java/security/util/IntegerUtil.java: Removed. Methods are available in java.lang.Integer. * gnu/java/security/Engine.java: Add missing type parameters to Class, Constructor and Enumeration. * gnu/java/security/OID.java: Add type parameter to Comparable implementation. (compareTo(OID)): Changed from compareTo(Object). Remove now redundant cast. * gnu/java/security/Properties.java: Add type parameters to HashMap. (getProperty(String)): Remove redundant cast. (init()): Use generic implementation of PrivilegedAction. Add properties in a for-each loop to get correct types. * gnu/java/security/action/SetAccessibleAction.java: Use generic implementation of PrivilegedAction. * gnu/java/security/ber/BEREncodingException.java: Add explicit serialVersionUID. * gnu/java/security/der/BitString.java: Add type parameter to Comparable implementation. (compareTo(BitString)): Changed from compareTo(Object). Remove now redundant cast. * gnu/java/security/der/DEREncodingException.java: Add explicit serialVersionUID. * gnu/java/security/der/DERWriter.java: (write(OutputStream,DERValue)): Cast List and Set to correct generic versions. (writeSequence(OutputStream,List)): Add type parameters. Drop now redundant cast. (writeSet(OutputStream,Set)): Likewise. * gnu/java/security/hash/HashFactory.java: (getNames()): Add type parameters. * gnu/java/security/hash/Whirlpool.java: Drop unused byte array. * gnu/java/security/jce/prng/HavalRandomSpi.java: Add explicit serialVersionUID. * gnu/java/security/jce/prng/MD2RandomSpi.java: Likewise. * gnu/java/security/jce/prng/MD4RandomSpi.java: Likewise. * gnu/java/security/jce/prng/MD5RandomSpi.java: Likewise. * gnu/java/security/jce/prng/RipeMD128RandomSpi.java: Likewise. * gnu/java/security/jce/prng/RipeMD160RandomSpi.java: Likewise. * gnu/java/security/jce/prng/SecureRandomAdapter.java: Likewise. Drop unused mdName variable. Remove redundant casts. Add Override annotation to interface implementation. * gnu/java/security/jce/prng/Sha160RandomSpi.java: Add explicit serialVersionUID. * gnu/java/security/jce/prng/Sha256RandomSpi.java: Likewise. * gnu/java/security/jce/prng/Sha384RandomSpi.java: Likewise. * gnu/java/security/jce/prng/Sha512RandomSpi.java: Likewise. * gnu/java/security/jce/prng/TigerRandomSpi.java: Likewise. * gnu/java/security/jce/prng/WhirlpoolRandomSpi.java: Likewise. * gnu/java/security/jce/sig/DSSKeyFactory.java: Add Override annotation to interface implementation. (engineGetKeySpec(Key,Class)): Update return type. Use keySpec.cast to cast newly created instances to the correct type. * gnu/java/security/jce/sig/DSSKeyPairGeneratorSpi.java: Add missing type parameters and Override annotations. * gnu/java/security/jce/sig/DSSParameters.java: Add Override annotation to interface implementation. (engineGetParameterSpec(Class)): Update return type. Use paramSpec.cast to cast new instances to correct type. (engineGetEncoded()): Add missing type parameter to list. * gnu/java/security/jce/sig/EncodedKeyFactory.java: Add type parameters and Override annotations. (engineGetKeySpec(Key,Class)): Update return type. Use keySpec.cast to cast new instances to correct type. * gnu/java/security/jce/sig/RSAKeyFactory.java: Add @Override annotation. Drop unused variables. (engineGetKeySpec(Key,Class)): Update return type. Use keySpec.cast to cast new instances to correct type. * gnu/java/security/jce/sig/RSAKeyPairGeneratorSpi.java: Add type parameters. * gnu/java/security/jce/sig/SignatureAdapter.java: Add type parameters and Override annotation. * gnu/java/security/key/IKeyPairGenerator.java: (setup(Map)): Add type parameters. * gnu/java/security/key/KeyPairCodecFactory.java: Add type parameters. * gnu/java/security/key/KeyPairGeneratorFactory.java: Likewise. * gnu/java/security/key/dss/DSSKey.java: Add explicit serialVersionUID. * gnu/java/security/key/dss/DSSKeyPairGenerator.java: Add type parameters and Override annotations. * gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java: Likewise. * gnu/java/security/key/dss/DSSKeyPairX509Codec.java: Add type parameters. * gnu/java/security/key/dss/DSSPrivateKey.java: Add explicit serialVersionUID. * gnu/java/security/key/dss/DSSPublicKey.java: Likewise. * gnu/java/security/key/rsa/GnuRSAKey.java: Likewise. * gnu/java/security/key/rsa/GnuRSAPrivateKey.java: Likewise. * gnu/java/security/key/rsa/GnuRSAPublicKey.java: Likewise. * gnu/java/security/key/rsa/RSAKeyPairGenerator.java: Add Override annotations and type parameters. * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java: Add missing type parameters on ArrayList instances. * gnu/java/security/key/rsa/RSAKeyPairX509Codec.java: Add Override annotations and type parameters. * gnu/java/security/pkcs/PKCS7SignedData.java: (PKCS7SignedData(BERReader)): Add a type parameter to the algId list and ensure all additions are homogenous. Add other missing type parameters. (PKCS7SignedData(Set,PKCS7Data,Certificate[],X509CRL[],Set)): Add missing type parameters. (getDigestAlgorithms()): Do a deep copy of the set. (getSignerInfos()): Add type parameters. (encode(OutputStream)): Likewise. * gnu/java/security/pkcs/SignerInfo.java: Drop unused variable, count. Add type parameters. (encode(OutputStream)): Include derAuthenticatedAttributes and derUnauthenticatedAttributes in signerInfo. * gnu/java/security/prng/BasePRNG.java: Add type parameters and Override annotations. * gnu/java/security/prng/IRandom.java: Add type parameters. * gnu/java/security/prng/LimitReachedException.java: Add explicit serialVersionUID. * gnu/java/security/prng/MDGenerator.java: Add type parameters and Override annotations. * gnu/java/security/prng/PRNGFactory.java: Add missing type parameters. * gnu/java/security/prng/RandomEvent.java: Add explicit serialVersionUID. * gnu/java/security/provider/CollectionCertStoreImpl.java: Add Override annotation and missing type parameters. * gnu/java/security/provider/Gnu.java: Add explicit serialVersionUID. Parameterise implementation of PrivilegedAction. * gnu/java/security/provider/PKIXCertPathValidatorImpl.java: Add missing type parameters. Remove unused qualifierInfos variable. * gnu/java/security/provider/X509CertificateFactory.java: Add Override annotations and type parameters. * gnu/java/security/sig/BaseSignature.java: Likewise. * gnu/java/security/sig/ISignature.java: Add type parameters. * gnu/java/security/sig/SignatureCodecFactory.java: Likewise. * gnu/java/security/sig/SignatureFactory.java: Likewise. * gnu/java/security/sig/dss/DSSSignature.java: Add Override annotations and type parameters. * gnu/java/security/sig/dss/DSSSignatureX509Codec.java: Add type parameter to ArrayList instance. * gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.java: Remove unused hLen variable. * gnu/java/security/sig/rsa/RSASignatureFactory.java: Add type parameters. * gnu/java/security/util/PRNG.java: (getInstance()): Move initialisation code to shared method, initialiseDelegate. (nextBytes(byte[],int,int)): Call out to initialiseDelegate to re-initialise. (initialiseDelegate(IRandom)): New common method for shared code. * gnu/java/security/util/Sequence.java: Add Override annotation and type parameters. * gnu/java/security/util/SimpleList.java: Add type parameters. * gnu/java/security/x509/GnuPKIExtension.java: Likewise. * gnu/java/security/x509/PolicyNodeImpl.java: Add type parameters and Override annotations. (addAllPolicyQualifiers(Collection)): Qualify reference to addAll. * gnu/java/security/x509/X500DistinguishedName.java: Add type parameters. * gnu/java/security/x509/X509CRL.java: Remove unused variable algParams. Add type parameters and Override annotations. * gnu/java/security/x509/X509CRLEntry.java: Add type parameters and Override annotations. * gnu/java/security/x509/X509CRLSelectorImpl.java: Likewise. * gnu/java/security/x509/X509CertPath.java: Add type parameters. (pkcsEncoded): Renamed from pkcs_encoded. (pkiEncoded): Renamed from pki_encoded. * gnu/java/security/x509/X509CertSelectorImpl.java: Add type parameters and Override annotations. * gnu/java/security/x509/X509Certificate.java: Likewise. * gnu/java/security/x509/ext/BasicConstraints.java: Add type parameters. * gnu/java/security/x509/ext/CertificatePolicies.java: Likewise. * gnu/java/security/x509/ext/PolicyMappings.java: Likewise. * gnu/javax/crypto/cipher/IBlockCipher.java: Add type parameters. * gnu/javax/crypto/jce/prng/FortunaImpl.java: (engineSetSeed(byte[])): Add cast for singletonMap invocation. * gnu/javax/crypto/key/dh/DHKeyPairPKCS8Codec.java: Add type parameters. * gnu/javax/crypto/key/dh/DHKeyPairX509Codec.java: Likewise. * gnu/javax/crypto/mac/IMac.java: Likewise. * gnu/javax/crypto/mode/BaseMode.java: Add Override annotations and type parameters. * gnu/javax/crypto/mode/EAX.java: Add Override annotations, type parameters and casts for singletonMap invocations. * gnu/javax/crypto/prng/Fortuna.java: Likewise. * gnu/javax/net/ssl/Session.java: Add Override annotations and type parameters. * gnu/javax/net/ssl/provider/AbstractHandshake.java: Fix type parameters. * gnu/javax/net/ssl/provider/SSLRandom.java: Add Override annotations and type parameters. * gnu/javax/net/ssl/provider/TLSRandom.java: Likewise. (hmacSHA): Renamed from hmac_sha. (hmacMD5): Renamed from hmac_md5. * gnu/javax/net/ssl/provider/Util.java: (transform(Object,Class,String,Object[])): Use a type parameter T rather than Object. * gnu/javax/net/ssl/provider/X509KeyManagerFactory.java: Add type parameters. * gnu/javax/net/ssl/provider/X509TrustManagerFactory.java: Likewise. * gnu/javax/security/auth/callback/AWTCallbackHandler.java: Replace calls to deprecated show() with setVisible(true). (ACTION_NO): Remove unused variable. (ACTION_YES): Likewise. * gnu/javax/security/auth/callback/ConsoleCallbackHandler.java: Add type parameters. * gnu/javax/security/auth/callback/GnuCallbacks.java: Add explicit serialVersionUID. Convert PrivilegedAction implementation to parameterised version. * gnu/javax/security/auth/login/ConfigFileParser.java: Add type parameters. * gnu/javax/security/auth/login/GnuConfiguration.java: Likewise. Fix typo. * java/security/AccessControlContext.java: Add type parameters. * java/security/AllPermission.java: Add Override annotations. (AllPermissionCollection.elements()): Add type parameter to return type and return appropriately typed enumerations. * java/security/BasicPermission.java: Add type parameters and Override annotations. * java/security/CodeSource.java: Likewise. * java/security/DummySignature.java: Add Override annotations. * java/security/Identity.java: Add type parameters. * java/security/IntersectingDomainCombiner.java: Likewise. * java/security/KeyPairGenerator.java: Add Override annotations. * java/security/Permissions.java: Add type parameters and Override annotations. (elements()): Rename main_enum and sub_enum to mainEnum and subEnum respectively. * java/security/Policy.java: Add type parameters. * java/security/SecureRandom.java: Add missing type parameter. Remove unused imports. * java/security/Security.java: Add type parameters. Fix mis-spelling of 'query'. * java/security/SignatureSpi.java: Add Override annotation. * java/security/UnresolvedPermission.java: Add Override annotations and type parameters. (elements()): Rename main_enum and sub_enum to mainEnum and subEnum respectively. * java/security/cert/CertPath.java: Add type parameters. * java/security/cert/CertPathValidator.java: (getDefaultType()): Use GetSecurityPropertyAction rather than implementing PrivilegedAction locally. * java/security/cert/CertStore.java: (getDefaultType()): Use GetSecurityPropertyAction rather than implementing PrivilegedAction locally. * java/security/cert/CollectionCertStoreParameters.java: Add type parameters and Override annotations. * java/security/cert/PKIXParameters.java: Add type parameters. * java/security/cert/X509CRLSelector.java: Add type parameters. (getIssuerNames()): Return a deep copy. * java/security/cert/X509CertSelector.java: Add type parameters. * java/util/Properties.java: Add type parameters. (stringPropertyNames()): Implemented. * javax/naming/directory/BasicAttribute.java: Add Override annotations and missing type parameter. * javax/security/auth/AuthPermission.java: Add explicit serialVersionUID. * javax/security/auth/DestroyFailedException.java: Likewise. * javax/security/auth/PrivateCredentialPermission.java: Add type parameters. (equals(Object)): Use thatPrincipals instead of that_principals. (implies(Permission)): Likewise. (CredOwner): Add explicit serialVersionUID. * javax/security/auth/RefreshFailedException.java: Add explicit serialVersionUID. * javax/security/auth/Subject.java: Add type parameters and Override annotations. * javax/security/auth/SubjectDomainCombiner.java: Add type parameters. * javax/security/auth/callback/ChoiceCallback.java: Add explicit serialVersionUID. * javax/security/auth/callback/ConfirmationCallback.java: Likewise. * javax/security/auth/callback/LanguageCallback.java: Likewise. * javax/security/auth/callback/NameCallback.java: Likewise. * javax/security/auth/callback/PasswordCallback.java: Likewise. * javax/security/auth/callback/TextInputCallback.java: Likewise. * javax/security/auth/callback/TextOutputCallback.java: Likewise. * javax/security/auth/callback/UnsupportedCallbackException.java: Likewise. * javax/security/auth/kerberos/DelegationPermission.java: Re-enable explicit serialVersionUID. Add Override annotations and type parameters. * javax/security/auth/kerberos/KerberosPrincipal.java: Re-enable explicit serialVersionUID. * javax/security/auth/kerberos/KerberosTicket.java: Suppress warning about unused asn1Encoding variable. * javax/security/auth/kerberos/KeyImpl.java: Re-enable explicit serialVersionUID. * javax/security/auth/kerberos/ServicePermission.java: Re-enable explicit serialVersionUID. Add Override annotations and type parameters. * javax/security/auth/login/AppConfigurationEntry.java: Add type parameters. * javax/security/auth/login/Configuration.java: Likewise. * javax/security/auth/login/LoginContext.java: Likewise. * javax/security/auth/x500/X500Principal.java: Likewise. (fixed): Remove unused variable. * javax/security/cert/CertificateEncodingException.java: Add explicit serialVersionUID. * javax/security/cert/CertificateException.java: Likewise. * javax/security/cert/CertificateExpiredException.java: Likewise. * javax/security/cert/CertificateNotYetValidException.java: Likewise. * javax/security/cert/CertificateParsingException.java: Likewise. * javax/security/sasl/AuthenticationException.java: Likewise. * javax/security/sasl/RealmCallback.java: Likewise. * javax/security/sasl/RealmChoiceCallback.java: Likewise. * javax/security/sasl/Sasl.java: Add type parameters. * tools/gnu/classpath/tools/jarsigner/SFHelper.java: Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Add missing IOException constructors.Andrew John Hughes2014-05-071-0/+26
| | | | | | | | | | 2014-05-07 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/io/IOException.java: (IOException(String,Throwable)): Add missing constructor. (IOException(Throwable)): Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Fix warnings in TreeMap and TreeSet.Andrew John Hughes2013-05-262-134/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2013-02-17 Andrew John Hughes <gnu_andrew@member.fsf.org> Fix warnings. * java/util/TreeMap.java: (nil): Add type parameters. (root): Likewise. (left): Don't set to nil here. (right): Likewise. (parent): Likewise. (Node(K,V,int)): Set left, right and parent here using correctly typed nil. (TreeMap()): Cast Comparator with type parameters. (TreeMap(Map)): Likewise. (TreeMap(SortedMap)): Remove unused variable. Use for-each loop and typed nil. (clone()): Separate cast and cloning. Add type parameters to node and cnode. (containsKey(Object)): Cast key. (containsvalue()): Add type parameters to node. (get(Object)): Cast key. (headMap(K,boolean)): Likewise. (put(K,V)): Cast nil before assigning to parent. Add type parameters to n. (putAll(Map)): Rewrite using for-each loop. (remove(Object)): Cast key. (tailMap(K,boolean)): Likewise. (values()): Add type parameter to iterator. (compare(K,K)): Suppress warnings. (fabricateTree(int)): Use typed nil. Add type parameters to root, row, parent, last, left, right and next. (firstNode()): Add type parameters to node. (highestLessThan(K,boolean)): Use typed nil. (insertFixup(Node)): Add type parameters to uncle. (lastNode()): Add type parameters to node. (lowestGreaterThan(K,boolean,boolean)): Use typed nil. (predecessor(Node)): Add type parameters to parent. (putFromObjStream(ObjectInputStream,int,V)): Pass value with type rather than using String. Add type parameter to node. (putKeysLinear(Iterator,int,V)): Pass in value rather than using empty string. (readObject(ObjectInputStream)): Call putFromObjStream with null rather than true. (removeNode(Node)): Add type parameters to parent. (rotateLeft(Node)): Add type parameters to child. (rotateRight(Node)): Likewise. (writeObject(ObjectOutputStream)): Add type parameters to node. (TreeIterator): Add type parameter. (TreeIterator.last): Likewise. (TreeIterator.next): Likewise. (TreeIterator.max): Likewise. (TreeIterator.TreeIterator(int)): Cast nil. (TreeIterator.TreeIterator(int,Node,Node)): Add type parameters. (TreeIterator.next()): Suppress warnings and cast to correct type. (descendingMap()): Add type parameters. (clear()): Add type parameters to next, max and current. (SubMap.containsKey(Object)): Fix casting of key. (SubMap.containsValue(Object)): Add type parameters to node and max. (SubMap.get(Object)): Fix casting of key. (SubMap.remove(Object)): Likewise. (SubMap.size()): Add type parameters to node and max. (SubMap.values()): Add type parameter to AbstractCollection, first, max and TreeIterator. (SubMap.KeySet.iterator()): Add type parameters to first and max. (SubMap.KeySet.contains(Object)): Fix casting of key. (SubMap.KeySet.remove(Object)): Likewise. (SubMap.NavigableKeySet.descendingSet()): Add type parameter to DescendingSet. (SubMap.EntrySet.iterator()): Add type parameters to first and max. (SubMap.EntrySet.contains(Object)): Fix casting of entry. (SubMap.EntrySet.remove(Object)): Likewise. (SubMap.NavigableEntrySet.descendingSet()): Add type parameter to DescendingSet. (SubMap.NavigableEntrySet.tailSet(Entry,boolean)): Return entry set, not key set. (DescendingMap.headMap(DK,boolean)): Add type parameters. (DescendingMap.subMap(DK,boolean,DK,boolean)): Likewise. (DescendingMap.tailMap(Dk,boolean)): Likewise. (DescendingMap.values()): Add type parameter to AbstractCollection. (KeySet.iterator()): Add type parameter to TreeIterator. (KeySet.remove(Object)): Fix casting of key. (NavigableKeySet.headSet(D,boolean)): Add type parameter. (NavigableKeySet.subSet(D,boolean,D,boolean)): Likewise. (NavigableKeySet.tailSet(D,boolean)): Likewise. (NavigableKeySet.toArray()): Suppress warnings on cast. (NavigableKeySet.toArray(T[])): Likewise. (EntrySet.iterator()): Add type parameter to TreeIterator. (EntrySet.contains(Object)): Fix casting of entry. (EntrySet.remove(Object)): Likewise. (NavigableEntrySet.descendingSet()): Add type parameter to DescendingSet. (NavigableEntrySet.tailSet(Entry,boolean)): Return entry set, not key set. * java/util/TreeSet.java: (TreeSet(SortedSet)): Explicitly pass empty String to putKeysLinear as it no longer defaults to this. (readObject(ObjectInputStream)): Pass empty String rather than false, which will in turn make "" == null return false in putFromObjStream. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Implement javax.tools.ToolProvider using ecj. Cleanup and make more use of ↵Andrew John Hughes2013-02-261-1/+1
| | | | | | Classpath logging mechanism. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* PR55140: Addition of exception to codePointBefore breaks OpenJDK ↵Andrew John Hughes2012-10-301-2/+2
| | | | | | | | | | | | | GenerateBreakIteratorData tool 2012-10-30 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/55140 * NEWS: List fix. * java/lang/String.java: (codePointBefore(int)): Fix index check to match spec. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Merge remote-tracking branch 'ivan/ivmai4review-v3'Andrew John Hughes2012-10-261-14/+18
|\ | | | | | | | | | | | | Conflicts: ChangeLog Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
| * Optimize emptySet/Map/List() in Collections classIvan Maidanski2012-10-161-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-10-16 Ivan Maidanski <ivmai@mail.ru> * java/util/Collections.java: (emptySet(), EmptySet.iterator(), emptyList(), emptyMap(), EmptyMap.entrySet(), EmptyMap.keySet(), EmptyMap.values()): Suppress "unchecked" warnings. (emptySet(), emptyList(), emptyMap()): Don't create new instance (use the corresponding immutable container instance); remove FIXME. (EmptySet.equals(Object), EmptyList.equals(Object), EmptyMap.entrySet(), EmptyMap.equals(Object), EmptyMap.keySet(), EmptyMap.values()): Add generic typing. (SingletonList.subList(int, int)): Use emptyList() instead of EMPTY_LIST (to eliminate "unchecked" warning). (SynchronizedCollection.toArray(T[])): Rename T type to E (to suppress compiler warning about type hiding).
* | PR44208: Ensure a handle for the enum is registered before its constant.Andrew John Hughes2012-10-261-1/+2
|/ | | | | | | | | | | | 2010-05-20 Paul Viney <paul@diasoft.nl> PR classpath/44208 * java/io/ObjectInputStream.java, (parseContent(byte,boolean)): Ensure a handle for the enum is registered before one for its String constant. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Fix NPE in java/util/Formatter.format() methodPekka Enberg2012-10-151-3/+18
| | | | | | | | | | | | | | This patch fixes NPE for the following Malva test cases: assertEquals("false", String.format("%b", (Object[])null)); assertEquals("null", String.format("%h", (Object[])null)); assertEquals("null", String.format("%s", (Object[])null)); assertEquals("null", String.format("%c", (Object[])null)); assertEquals("null", String.format("%d", (Object[])null)); assertEquals("null", String.format("%o", (Object[])null)); assertEquals("null", String.format("%x", (Object[])null)); Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Fix java/lang/String.codePoint{At|Before} exception typesPekka Enberg2012-10-151-0/+4
| | | | | | OpenJDK throws StringIndexOutOfBoundsException and so should we. Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Replace all .cvsignore files with .gitignoreIvan Maidanski2012-10-151-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-06-10 Ivan Maidanski <ivmai@mail.ru> * compat/.gitignore, * compat/java.net/.gitignore, * doc/.gitignore, * doc/api/.gitignore, * doc/www.gnu.org/.gitignore, * doc/www.gnu.org/announce/.gitignore, * doc/www.gnu.org/cp-tools/.gitignore, * doc/www.gnu.org/docs/.gitignore, * doc/www.gnu.org/downloads/.gitignore, * doc/www.gnu.org/events/.gitignore, * doc/www.gnu.org/faq/.gitignore, * examples/.gitignore, * external/.gitignore, * external/jsr166/.gitignore, * external/relaxngDatatype/.gitignore, * external/sax/.gitignore, * external/w3c_dom/.gitignore, * gnu/classpath/.gitignore, * gnu/java/locale/.gitignore, * gnu/java/security/.gitignore, * gnu/test/.gitignore, * include/.gitignore, * java/util/.gitignore, * lib/.gitignore, * native/.gitignore, * native/fdlibm/.gitignore, * native/jawt/.gitignore, * native/jni/.gitignore, * native/jni/classpath/.gitignore, * native/jni/gconf-peer/.gitignore, * native/jni/gstreamer-peer/.gitignore, * native/jni/gtk-peer/.gitignore, * native/jni/java-io/.gitignore, * native/jni/java-lang/.gitignore, * native/jni/java-math/.gitignore, * native/jni/java-net/.gitignore, * native/jni/java-nio/.gitignore, * native/jni/java-util/.gitignore, * native/jni/midi-alsa/.gitignore, * native/jni/midi-dssi/.gitignore, * native/jni/native-lib/.gitignore, * native/jni/qt-peer/.gitignore, * native/jni/xmlj/.gitignore, * native/plugin/.gitignore, * native/testsuite/.gitignore, * native/vmi/.gitignore, * resource/.gitignore, * resource/META-INF/services/.gitignore, * scripts/.gitignore, * test/.gitignore, * test/gnu.java.lang.reflect/.gitignore, * test/java.io/.gitignore, * test/java.lang.reflect/.gitignore, * test/java.net/.gitignore, * test/java.util/.gitignore, * tools/.gitignore, * tools/gnu/classpath/tools/doclets/.gitignore, * tools/gnu/classpath/tools/doclets/debugdoclet/.gitignore, * tools/gnu/classpath/tools/doclets/htmldoclet/.gitignore, * tools/gnu/classpath/tools/doclets/xmldoclet/.gitignore, * tools/gnu/classpath/tools/doclets/xmldoclet/doctranslet/.gitignore, * tools/gnu/classpath/tools/gjdoc/.gitignore, * tools/gnu/classpath/tools/gjdoc/expr/.gitignore, * tools/gnu/classpath/tools/java2xhtml/.gitignore, * tools/gnu/classpath/tools/taglets/.gitignore, * vm/.gitignore, * vm/reference/.gitignore: Renamed from .cvsignore. Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Fix warnings in java.awt.geom.Area.Andrew John Hughes2012-10-151-120/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-10-10 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/awt/geom/Area.java: (solids): Add type parameter. (holes): Likewise. (ccIntersections): Likewise and rename to meet standards. (Area()): Add type parameters. (Area(Shape)): Likewise and remove redundant casts. (add(Area)): Likewise and remove unused nNodes variable. (subtract(Area)): Likewise. (intersect(Area)): Likewise. (exclusiveOr(Area)): Likewise. (reset()): Add type parameters. (isEmpty()): Remove redundant casts. (isPolygonal()): Likewise. (isRectangular()): Likewise. (getBounds2D()): Likewise. (clone()): Likewise. (equals(Area)): Add type parameters. (transform(AffineTransform)): Remove redundant casts. (contains(double,double)): Likewise. (contains(double,double,double,double)): Likewise. (intersects(double,double,double,double)): Likewise. (AreaIterator.segments): Add type parameter. (AreaIterator(AffineTransform)): Add type parameters. Remove redundant casts. (currentSegment(double[])): Remove redundant casts. (currentSegment(float[])): Likewise. (weilerAtherton(Vector)): Add type parameters and remove redundant casts. (recursiveSubdivide(CubicCurve2D,CubicCurve2D,int,int,double, double,double,double)): Fix use of cc_intersections/ccIntersections. (cubicCubicIntersect(CubicSegment,CubicSegment)): Likewise. (lineQuadIntersect(LineSegment,QuadSegment)): Fix Javadoc typo. (makeSegment(Shape)): Add type parameters. (createNodes(Segment,Segment)): Remove redundant bracketing. (deleteRedundantPaths(Vector)): Likewise. Remove redundant casts. Add type parameters. (setDirection(Vector,boolean)): Add type parameters and remove redundant casts. (cloneSegmentList()): Add type parameter. Remove redundant cast. (createNodes(Segment,Intersection[])): Add type parameter. Remove redundant cast. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* PR42134: NullPointerException in java.text.BidiAndrew John Hughes2012-09-281-8/+8
| | | | | | | | | | | | | 2012-09-26 Andrew John Hughes <gnu_andrew@member.fsf.org> PR classpath/42134 * java/text/Bidi.java: (Bidi(AttributedCharacterIterator)): Remove shadow variable text which hides the instance variable of the same name. Remove unnecessary use of this. * NEWS: Updated. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Fix warnings in java.util.TimeZone.Andrew John Hughes2012-08-091-42/+42
| | | | | | | | | | | | | | | | | 2012-08-09 Andrew John Hughes <gnu_andrew@member.fsf.org> * java/util/TimeZone.java: (defaultZone()): Use parameterized PrivilegedAction. (aliases0): Add type parameters. (timezones0); Likewise. (timezones()): Likewise. (getDateParams(String)): Fix indenting. (getTimeZoneInternal(String)): Remove redundant casts. (getAvailableIDs(int)): Add type parameters. (getAvailableIDs(File,String,ArrayList)): Likewise. (getAvailableIDs()): Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* Fix warnings in java.text.* and gnu.java.text.*Andrew John Hughes2012-07-319-99/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-07-03 Andrew John Hughes <gnu_andrew@member.fsf.org> Update copyright headers throughout. * gnu/java/text/AttributedFormatBuffer.java: (ranges): Add generic type information. (attributes): Likewise. (aRanges): Rename from a_ranges. (aAttributes): Add generic type information and rename from a_attributes. Convert to a list of maps rather than an array for type safety. (defaultAttr): Replace prefix with static import. (AttributedFormatBuffer(CPStringBuilder): Add generic typing. (addAttribute(int,Attribute)): Drop prefix, rename new_range to newRange. Add generic types. Use Integer.valueOf in place of new Integer. (append(String,Attribute)): Drop prefix. (append(String,int[],List)): Replace array with list. Use Integer.valueOf instead of new Integer. (append(char,Attribute)): Drop prefix. (setDefaultAttribute(Attribute)): Likewise. (getDefaultAttribute()): Likewise. (sync()): Rename a_ranges to aRanges. Drop unneeded casts. Replace array with list. (getRanges()): Rename a_ranges to aRanges. (getAttributes()): Replace map with list. Rename a_attributes to aAttributes. * gnu/java/text/FormatBuffer.java: Add static import for Attribute. * gnu/java/text/FormatCharacterIterator.java: (attributes): Replace array with list. (FormatCharacterIterator()): Likewise. (FormatCharacterIterator(String,int,List)): Switch from array to list. Update documentation. (getAllAttributeKeys()): Add generic type. Switch from array to list. (getAttributes()): Likewise. (getAttribute(Attribute)): Likewise. (getRunLimit(Set)): Likewise. (getRunLimit(Attribute)): Likewise. (getRunStart(Set)): Likewise. (getRunStart(Attribute)): Likewise. (mergeAttributes(List,int[])): Likewise. Use List in preference to Vector. Use newRanges & newAttributes rather than new_ranges and new_attributes. (append(AttributedCharacterIterator)): Likewise. (append(String,HashMap)): Likewise. (addAttributes(Map,int,int)): Likewise. (dumpTable()): Use startRange instead of start_range. Add generic types. * gnu/java/text/StringFormatBuffer.java, Add static import for Attribute. * java/text/AttributedString.java: Add static import for Attribute. (attribs): Add generic type. (AttributeRange(Map,int,int)): Likewise. (AttributedString(String,Map)): Likewise. (AttributedString(AttributedCharacterIterator, int, int, Attribute)): Drop prefix, add generic types. (addAttribute(Attribute,Object)): Drop prefix. (addAttribute(Attribute,Object,int,int)): Likewise and add generic types. (addAttributes(Map,int,int)): Add generic types. (getIterator(Attribute)): Drop prefix. (getIterator(Attribute[])): Likewise. * java/text/AttributedStringIterator.java: Add static import for Attribute. (getAllAttributeKeys()): Add generic type. (getRunLimit(Attribute)): Add generic type, drop prefix. (getRunLimit(Set)): Add generic types. (getRunStart(Attribute)): Add generic type, drop prefix. (getRunStart(Set)): Add generic types. (getAttributes()): Likewise. * java/text/Bidi.java: (formatterIndices): Add generic type. (reinsertFormattingCodes()): Drop redundant cast. * java/text/BreakIterator.java: (getInstance(String,Locale)): Add generic type to Class. * java/text/ChoiceFormat.java: (stringVec): Add generic type. (limitVec): Likewise. (applyPattern(String)): Remove redundant cast. * java/text/CollationElementIterator.java: (textDecomposition): Renamed from text_decomposition. (textIndexes): Renamed from text_indexes. (setText(String)): Add generic types. Rename a_element to aElement. Rename a_idx to aIdx. Rename key_old to keyOld. Use Integer.valueOf rather than new Integer. * java/text/DecimalFormat.java: (attributes): Add generic type. (formatToCharacterIterator(Object)): Remove redundant cast. * java/text/MessageFormat.java: (Field()): Remove unneeded warning suppression. * java/text/NumberFormat.java: (Field()): Likewise. Signed-off-by: Andrew John Hughes <gnu_andrew@member.fsf.org>
* PR44052: Cache parsed property data for DateFormatSymbols.Andrew John Hughes2012-07-021-34/+227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2012-07-01 Andrew John Hughes <ahughes@redhat.com> PR classpath/44052 * java/text/DateFormatSymbols.java: (DFSData): Inner immutable class for storing parsed locale data. (DFSData.DFSData(String[],String[],String,String[], String[],String[],String[],String[],String[], String[][])): Constructor to initialise a new instance with property data. (DFSData.getAMPMs()): Return a clone of the ampms array. (DFSData.getEras()): Likewise for eras. (DFSData.getLocalPatternChars()): Return the local pattern characters. (DFSData.getMonths()): Return a clone of the (long) months array. (DFSData.getShortMonths()): Likewise for the short months array. (DFSData.getWeekdays()): Likewise for (long) weekdays. (DFSData.getShortWeekdays()): Likewise for short weekdays. (DFSData.getDateFormats()): Likewise for date formats. (DFSData.getTimeFormats()): Likewise for time formats. (DFSData.getZoneStrings()): Likewise for zone strings. (dataCache): Cache of parsed locale data. (getZoneStrings(List<ResourceBundle>,Locale)): Make static so it can be called by retrieveData. (formatsForKey(List<ResourceBundle>,String)): Likewise. (getString(List<ResourceBundle>, String)): Likewise. (retrieveData(Locale)): Separate out retrieval of locale data from constructor and store it in the cache. (DateFormatSymbols(Locale)): Modify to call retrieveData and set fields from the returned DFSData instance. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* Refactor DateFormatSymbols to use list of ResourceBundle objects for all ↵Andrew John Hughes2012-05-311-16/+41
| | | | | | | | | | | | | | | | | | | | | | lookups. Fix bug whereby we were using the least-specific bundle for time & date formats. 2012-05-30 Andrew John Hughes <ahughes@redhat.com> * java/text/DateFormatSymbols.java: (getZoneStrings(List<ResourceBundle>, Locale)): Refactor to use existing list of resource bundles. (formatsForKey(List<ResourceBundle>, String)): Likewise and use new local getString method. (getString(List<ResourceBundle>, String)): Use first available String from most-specific locale rather than the least-specific. (DateFormatSymbols(Locale)): Use bundles for resolving localPatternChars, dateFormats, timeFormats and runtimeZoneStrings as well. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* PR classpath/53171: Cache the compiled regular expressions for splitting ↵Andrew John Hughes2012-05-021-3/+8
| | | | | | | | | | | | | | | | | | | | | | | locale data fields. 2012-05-01 Andrew John Hughes <ahughes@redhat.com> * java/text/DateFormatSymbols.java: Rename U00AE and U000A9 as the more memorable FIELD_SPLIT and ZONE_SPLIT respectively. * THANKYOU: Add Andreas Sewe. 2012-04-30 Andreas Sewe <sewe@st.informatik.tu-darmstadt.de> * java/text/DateFormatSymbols.java: (U00A9): Pre-compile pattern for zone separation. (U00AE): Likewise for fields. (getStringArray(List,String,int,String)): Use U00AE.split in place of String.split. (getZoneStrings(ResourceBundle,Locale)): Use U00AE.split and U00A9.split in place of String.split. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* Don't check if TimeZone is an instance of SimpleTimeZone.Jakub Jelinek2012-04-031-8/+1
| | | | | | | | | 2007-02-26 Jakub Jelinek <jakub@redhat.com> * java/util/TimeZone.java (getDefaultDisplayName): Don't check if TimeZone is instanceof SimpleTimeZone. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* Decrement index when removing elements from PriorityQueue. Catch capacity < 1.Andrew Haley2012-04-031-0/+3
| | | | | | | | | | 2006-09-13 Andrew Haley <aph@redhat.com> * java/util/PriorityQueue.java: Throw IllegalArgumentException for capacity < 1. (Iterator.remove()): Decrement index after removing element. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* Negate dayOfWeek in java.util.TimeZone.getDateParams.Andrew Haley2012-04-031-6/+18
| | | | | | | | | 2007-02-14 Jakub Jelinek <jakub@redhat.com> Andrew Haley <aph@redhat.com> * java/util/TimeZone.java (getDateParams): Negate dayOfWeek. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* Implement Matcher.usePattern(Pattern).Andrew John Hughes2012-04-031-1/+23
| | | | | | | | | 2012-03-22 Andrew John Hughes <ahughes@redhat.com> * java/util/regex/Matcher.java: (usePattern(Pattern)): Implemented. Signed-off-by: Andrew John Hughes <ahughes@redhat.com>
* Add missing Java 1.7 AutoCloseable interfacePekka Enberg2012-03-1410-3/+63
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Add missing Java 1.7 java/lang/reflect/Modifier methodsPekka Enberg2012-03-141-1/+41
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Add missing Java 1.7 ReflectiveOperationException classPekka Enberg2012-03-147-18/+106
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Add missing Java 1.7 constructors to java/lang classesPekka Enberg2012-03-142-3/+28
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Add missing Java 1.7 compare() API methods to java/lang classesPekka Enberg2012-03-146-0/+100
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Add missing java/lang/System.lineSeparator() methodPekka Enberg2012-03-141-0/+12
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Fix java/lang/reflect/Member.getDeclaringClass() return typePekka Enberg2012-03-141-1/+1
| | | | Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Remove trailing separator from locale data and hack to get around it in ↵Andrew John Hughes2012-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DateFormatSymbols. 2012-02-15 Andrew John Hughes <ahughes@redhat.com> * java/text/DateFormatSymbols.java: (getStringArray(List,String,int,String)): Remove hack which removes last character of the input data; now unnecessary. * resource/gnu/java/locale/LocaleInformation.properties, * resource/gnu/java/locale/LocaleInformation_aa.properties, * resource/gnu/java/locale/LocaleInformation_aa_DJ.properties, * resource/gnu/java/locale/LocaleInformation_aa_ER_SAAHO.properties, * resource/gnu/java/locale/LocaleInformation_af.properties, * resource/gnu/java/locale/LocaleInformation_ak.properties, * resource/gnu/java/locale/LocaleInformation_am.properties, * resource/gnu/java/locale/LocaleInformation_ar.properties, * resource/gnu/java/locale/LocaleInformation_ar_JO.properties, * resource/gnu/java/locale/LocaleInformation_ar_LB.properties, * resource/gnu/java/locale/LocaleInformation_ar_QA.properties, * resource/gnu/java/locale/LocaleInformation_ar_SA.properties, * resource/gnu/java/locale/LocaleInformation_ar_SY.properties, * resource/gnu/java/locale/LocaleInformation_ar_TN.properties, * resource/gnu/java/locale/LocaleInformation_ar_YE.properties, * resource/gnu/java/locale/LocaleInformation_as.properties, * resource/gnu/java/locale/LocaleInformation_az.properties, * resource/gnu/java/locale/LocaleInformation_az_Cyrl.properties, * resource/gnu/java/locale/LocaleInformation_be.properties, * resource/gnu/java/locale/LocaleInformation_bg.properties, * resource/gnu/java/locale/LocaleInformation_bn.properties, * resource/gnu/java/locale/LocaleInformation_bs.properties, * resource/gnu/java/locale/LocaleInformation_byn.properties, * resource/gnu/java/locale/LocaleInformation_ca.properties, * resource/gnu/java/locale/LocaleInformation_cch.properties, * resource/gnu/java/locale/LocaleInformation_cop.properties, * resource/gnu/java/locale/LocaleInformation_cs.properties, * resource/gnu/java/locale/LocaleInformation_cy.properties, * resource/gnu/java/locale/LocaleInformation_da.properties, * resource/gnu/java/locale/LocaleInformation_de.properties, * resource/gnu/java/locale/LocaleInformation_de_AT.properties, * resource/gnu/java/locale/LocaleInformation_de_BE.properties, * resource/gnu/java/locale/LocaleInformation_dv.properties, * resource/gnu/java/locale/LocaleInformation_dz.properties, * resource/gnu/java/locale/LocaleInformation_ee.properties, * resource/gnu/java/locale/LocaleInformation_el.properties, * resource/gnu/java/locale/LocaleInformation_en.properties, * resource/gnu/java/locale/LocaleInformation_en_Dsrt.properties, * resource/gnu/java/locale/LocaleInformation_en_Shaw.properties, * resource/gnu/java/locale/LocaleInformation_eo.properties, * resource/gnu/java/locale/LocaleInformation_es.properties, * resource/gnu/java/locale/LocaleInformation_et.properties, * resource/gnu/java/locale/LocaleInformation_eu.properties, * resource/gnu/java/locale/LocaleInformation_fa.properties, * resource/gnu/java/locale/LocaleInformation_fa_AF.properties, * resource/gnu/java/locale/LocaleInformation_fi.properties, * resource/gnu/java/locale/LocaleInformation_fil.properties, * resource/gnu/java/locale/LocaleInformation_fo.properties, * resource/gnu/java/locale/LocaleInformation_fr.properties, * resource/gnu/java/locale/LocaleInformation_fur.properties, * resource/gnu/java/locale/LocaleInformation_ga.properties, * resource/gnu/java/locale/LocaleInformation_gaa.properties, * resource/gnu/java/locale/LocaleInformation_gez.properties, * resource/gnu/java/locale/LocaleInformation_gl.properties, * resource/gnu/java/locale/LocaleInformation_gu.properties, * resource/gnu/java/locale/LocaleInformation_gv.properties, * resource/gnu/java/locale/LocaleInformation_ha.properties, * resource/gnu/java/locale/LocaleInformation_ha_Arab.properties, * resource/gnu/java/locale/LocaleInformation_haw.properties, * resource/gnu/java/locale/LocaleInformation_he.properties, * resource/gnu/java/locale/LocaleInformation_hi.properties, * resource/gnu/java/locale/LocaleInformation_hr.properties, * resource/gnu/java/locale/LocaleInformation_hu.properties, * resource/gnu/java/locale/LocaleInformation_hy.properties, * resource/gnu/java/locale/LocaleInformation_hy_AM_REVISED.properties, * resource/gnu/java/locale/LocaleInformation_ia.properties, * resource/gnu/java/locale/LocaleInformation_id.properties, * resource/gnu/java/locale/LocaleInformation_ig.properties, * resource/gnu/java/locale/LocaleInformation_ii.properties, * resource/gnu/java/locale/LocaleInformation_is.properties, * resource/gnu/java/locale/LocaleInformation_it.properties, * resource/gnu/java/locale/LocaleInformation_iu.properties, * resource/gnu/java/locale/LocaleInformation_ja.properties, * resource/gnu/java/locale/LocaleInformation_ka.properties, * resource/gnu/java/locale/LocaleInformation_kaj.properties, * resource/gnu/java/locale/LocaleInformation_kam.properties, * resource/gnu/java/locale/LocaleInformation_kcg.properties, * resource/gnu/java/locale/LocaleInformation_kfo.properties, * resource/gnu/java/locale/LocaleInformation_kk.properties, * resource/gnu/java/locale/LocaleInformation_kl.properties, * resource/gnu/java/locale/LocaleInformation_km.properties, * resource/gnu/java/locale/LocaleInformation_kn.properties, * resource/gnu/java/locale/LocaleInformation_ko.properties, * resource/gnu/java/locale/LocaleInformation_kok.properties, * resource/gnu/java/locale/LocaleInformation_kpe.properties, * resource/gnu/java/locale/LocaleInformation_ku_Latn.properties, * resource/gnu/java/locale/LocaleInformation_kw.properties, * resource/gnu/java/locale/LocaleInformation_ky.properties, * resource/gnu/java/locale/LocaleInformation_ln.properties, * resource/gnu/java/locale/LocaleInformation_lo.properties, * resource/gnu/java/locale/LocaleInformation_lt.properties, * resource/gnu/java/locale/LocaleInformation_lv.properties, * resource/gnu/java/locale/LocaleInformation_mk.properties, * resource/gnu/java/locale/LocaleInformation_ml.properties, * resource/gnu/java/locale/LocaleInformation_mn.properties, * resource/gnu/java/locale/LocaleInformation_mr.properties, * resource/gnu/java/locale/LocaleInformation_ms.properties, * resource/gnu/java/locale/LocaleInformation_mt.properties, * resource/gnu/java/locale/LocaleInformation_my.properties, * resource/gnu/java/locale/LocaleInformation_nb.properties, * resource/gnu/java/locale/LocaleInformation_ne.properties, * resource/gnu/java/locale/LocaleInformation_nl.properties, * resource/gnu/java/locale/LocaleInformation_nn.properties, * resource/gnu/java/locale/LocaleInformation_nr.properties, * resource/gnu/java/locale/LocaleInformation_nso.properties, * resource/gnu/java/locale/LocaleInformation_ny.properties, * resource/gnu/java/locale/LocaleInformation_om.properties, * resource/gnu/java/locale/LocaleInformation_or.properties, * resource/gnu/java/locale/LocaleInformation_pa.properties, * resource/gnu/java/locale/LocaleInformation_pa_Arab.properties, * resource/gnu/java/locale/LocaleInformation_pl.properties, * resource/gnu/java/locale/LocaleInformation_ps.properties, * resource/gnu/java/locale/LocaleInformation_pt.properties, * resource/gnu/java/locale/LocaleInformation_pt_PT.properties, * resource/gnu/java/locale/LocaleInformation_ro.properties, * resource/gnu/java/locale/LocaleInformation_ru.properties, * resource/gnu/java/locale/LocaleInformation_rw.properties, * resource/gnu/java/locale/LocaleInformation_sa.properties, * resource/gnu/java/locale/LocaleInformation_se.properties, * resource/gnu/java/locale/LocaleInformation_se_FI.properties, * resource/gnu/java/locale/LocaleInformation_si.properties, * resource/gnu/java/locale/LocaleInformation_sid.properties, * resource/gnu/java/locale/LocaleInformation_sk.properties, * resource/gnu/java/locale/LocaleInformation_sl.properties, * resource/gnu/java/locale/LocaleInformation_so.properties, * resource/gnu/java/locale/LocaleInformation_sq.properties, * resource/gnu/java/locale/LocaleInformation_sr.properties, * resource/gnu/java/locale/LocaleInformation_sr_BA_Cyrl.properties, * resource/gnu/java/locale/LocaleInformation_sr_Latn.properties, * resource/gnu/java/locale/LocaleInformation_ss.properties, * resource/gnu/java/locale/LocaleInformation_st.properties, * resource/gnu/java/locale/LocaleInformation_sv.properties, * resource/gnu/java/locale/LocaleInformation_sw.properties, * resource/gnu/java/locale/LocaleInformation_syr.properties, * resource/gnu/java/locale/LocaleInformation_ta.properties, * resource/gnu/java/locale/LocaleInformation_te.properties, * resource/gnu/java/locale/LocaleInformation_tg.properties, * resource/gnu/java/locale/LocaleInformation_th.properties, * resource/gnu/java/locale/LocaleInformation_ti.properties, * resource/gnu/java/locale/LocaleInformation_ti_ER.properties, * resource/gnu/java/locale/LocaleInformation_tig.properties, * resource/gnu/java/locale/LocaleInformation_tn.properties, * resource/gnu/java/locale/LocaleInformation_to.properties, * resource/gnu/java/locale/LocaleInformation_tr.properties, * resource/gnu/java/locale/LocaleInformation_trv.properties, * resource/gnu/java/locale/LocaleInformation_ts.properties, * resource/gnu/java/locale/LocaleInformation_tt.properties, * resource/gnu/java/locale/LocaleInformation_ug.properties, * resource/gnu/java/locale/LocaleInformation_uk.properties, * resource/gnu/java/locale/LocaleInformation_ur.properties, * resource/gnu/java/locale/LocaleInformation_uz.properties, * resource/gnu/java/locale/LocaleInformation_uz_Arab.properties, * resource/gnu/java/locale/LocaleInformation_uz_Latn.properties, * resource/gnu/java/locale/LocaleInformation_ve.properties, * resource/gnu/java/locale/LocaleInformation_vi.properties, * resource/gnu/java/locale/LocaleInformation_wal.properties, * resource/gnu/java/locale/LocaleInformation_wo.properties, * resource/gnu/java/locale/LocaleInformation_xh.properties, * resource/gnu/java/locale/LocaleInformation_yo.properties, * resource/gnu/java/locale/LocaleInformation_zh.properties, * resource/gnu/java/locale/LocaleInformation_zh_Hant.properties, * resource/gnu/java/locale/LocaleInformation_zu.properties: Update locale data without trailing separator.
* PR classpath/42390: Use AccessController and PrivilegedAction to retrieve ↵Andrew John Hughes2012-02-082-4/+15
| | | | | | | | | | | | | system properties. 2012-02-08 Andrew John Hughes <ahughes@redhat.com> PR classpath/42390 * java/nio/channels/spi/SelectorProvider.java: (provider()): Retrieve property value using PrivilegedAction. * java/security/KeyStore.java: (getDefaultType()): Likewise.
* PR classpath/42390: Add missing security checks in DatagramSocket.connect.Andrew John Hughes2012-02-081-1/+21
| | | | | | | | | | | 2012-02-06 Andrew John Hughes <ahughes@redhat.com> PR classpath/42390 * java/net/DatagramSocket.java: (connect(InetAddress,int)): Add missing security checks which OpenJDK performs and we don't. It's possible to initialise a DatagramSocket with null so we should also ensure we are bound.
* RH712013: pdftk crashes with java.lang.ArrayIndexOutOfBoundsExceptionAndrew John Hughes2012-01-121-11/+70
| | | | | | | | | | | | | | | | | | 2011-12-12 Andrew John Hughes <ahughes@redhat.com> RH712013: pdftk crashes with java.lang.ArrayIndexOutOfBoundsException * java/text/DateFormatSymbols.java: (getStringArray(List<ResourceBundle>, String, int)): Calls getStringArray(list,string,int,null). (getStringArray(List<ResourceBundle>, String, int, String[])): Populate a String array with locale data. The data used is the first non-null non-empty element found as we traverse the locale hierarchy. May be supplemented by fallback data. (DateFormatSymbols(Locale)): Get a list of all bundles up the locale hierarchy, rather than just using the one specific locale. Use the improved getStringArray method to populate the arrays, supplying existing data where "sideways" inheritance takes place.
* Add java/io/Console class and java/lang/System.console() methodPekka Enberg2012-01-082-1/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch implements java/io/Console and adds a console() method to java/lang/System. The implementation is lame but it works reasonably well. 2012-01-07 Pekka Enberg <penberg@kernel.org> * include/Makefile.am: Add java_io_VMConsole.h. * java/io/Console: Add Java 1.6 java/io/Console API. * java/lang/System.java: (console): Add Java 1.6 console() API. * vm/reference/java/io/VMConsole: Add new class. * native/jni/java-io/Makefile.am: Add java_io_VMConsole.c. * native/jni/java-io/java_io_VMConsole.c: Add native helpers for java/io/Console. Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Add java.io.IOError classPekka Enberg2012-01-061-0/+58
| | | | | | | | | | | | This patch adds a missing IOError class to GNU Classpath that was introduced in Java 1.6. 2012-01-05 Pekka Enberg <penberg@kernel.org> * java/io/IOError: Add new class. Signed-off-by: Pekka Enberg <penberg@kernel.org>
* Stefan Ring reports that commit f154af6 ("Fix HashMap.put() to check forPekka Enberg2011-10-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hashCode equality before equals()") breaks running the CACAO test suite. The breakage looks like this: LD_LIBRARY_PATH=../../../src/cacao/.libs ../../../src/cacao/cacao -Xbootclasspath:../../../src/classes/classes:/home/sr/classpathcvs/share/classpath/glibj.zip -classpath /usr/share/java/junit4.jar:. org.junit.runner.JUnitCore All JUnit version 4.5 .E Time: 0.003 There was 1 failure: 1) initializationError(All) java.lang.NullPointerException at java.util.HashMap.put(HashMap.java:348) at java.util.HashSet.add(HashSet.java:151) at org.junit.runners.model.RunnerBuilder.addParent(RunnerBuilder.java:64) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:81) at org.junit.runners.Suite.<init>(Suite.java:88) at org.junit.runners.Suite.<init>(Suite.java:54) at java.lang.reflect.VMConstructor.construct(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:318) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:35) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:93) at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:84) at org.junit.runners.Suite.<init>(Suite.java:66) at org.junit.runner.Request.classes(Request.java:68) at org.junit.runner.JUnitCore.run(JUnitCore.java:107) at org.junit.runner.JUnitCore.runMain(JUnitCore.java:88) at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:54) at org.junit.runner.JUnitCore.main(JUnitCore.java:46) FAILURES!!! Tests run: 1, Failures: 1 Looking at the code, it's obviously broken for HashMap.put() with a null key. 2011-10-24 Pekka Enberg <penberg@kernel.org> * java/util/HashMap.java: (put): Fix NullPointerException for null keys.
* Add Matcher.quoteReplacement API methodPekka Enberg2011-04-251-0/+23
| | | | | | | 2011-04-25 Pekka Enberg <penberg@kernel.org> * java/util/regex/Matcher.java: (quoteReplacement): Implement missing Java 1.5 API method.
* PR42390: Add missing call to SecurityManager.checkConnect in ↵Andrew John Hughes2011-03-151-1/+10
| | | | | | | | | | | connect(SocketAddress, int). 2011-03-14 Andrew John Hughes <ahughes@redhat.com> PR classpath/42390 * java/net/Socket.java: (connect(SocketAddress, int)): Add missing call to SecurityManager.
* Fix for PR 48131.Jeroen Frijters2011-03-151-1/+1
| | | | Handle empty tree.
* PR classpath/42390: Don't include permissions of the Policy in toString() ↵Andrew John Hughes2011-03-061-1/+9
| | | | | | | | | | | | output if reading them is prohibited. 2011-02-22 Andrew John Hughes <ahughes@redhat.com> PR classpath/42390 * java/security/ProtectionDomain.java: (toString()): Don't include permissions from the policy if we don't have permission to read it.
* Fix Matcher.find() infinite loop bugPekka Enberg2011-03-021-0/+6
| | | | | | | | | | | | | | | | | | This patch fixes a problem in Match.find() where the following piece of code would enter an infinite loop: System.out.println("hello, world".split("\uFFFF"); The root cause is that Matcher.find() returns true for the following snippet: Pattern p = Pattern.compile("\uFFFF"); Matcher m = p.matcher("hello, world"); System.out.println(m.find()); 2011-03-02 Pekka Enberg <penberg@kernel.org> * java/util/regex/Matcher: (find): Make sure match is within input data limits.
* Fix HashMap.put() to check for hashCode equality before equals()Pekka Enberg2011-02-221-1/+1
| | | | | | | | | | | | This patch is needed to run Jython 2.5.2 RC 4 under JamVM and GNU Classpath CVS HEAD. It turns out Jythin bootstrap is bit hairy and assumes HashMap.put() checks for hashCode equality before invoking Object.equals(). 2011-02-22 Pekka Enberg <penberg@kernel.org> * java/util/HashMap: (put): Check for key hashCode equality before invoking Object.equals() to fix compatibility issue with Jython.
* Bump up HashMap default initial capacityPekka Enberg2011-02-221-3/+2
| | | | | | | | | | | While debugging Jython bootstrap issues with GNU Classpath, I noticed that HashMap.DEFAULT_CAPACITY is set to 11 although Java 1.4 has it as 16. 2011-02-22 Pekka Enberg <penberg@kernel.org> * java/util/HashMap: (DEFAULT_CAPACITY): Make default initial capacity 16 as it is defined in official Javadocs.
* Fix Formatter.parseInt() wrt. leading zeroesPekka Enberg2011-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following test case: public class StringTest { public static void main(String[] args) { System.out.println(String.format("%08x", 1234)); } } produces the following error: Exception in thread "main" java.lang.NumberFormatException: invalid character at position 2 in 08 at java.lang.Integer.parseInt(Integer.java:837) at java.lang.Integer.decode(Integer.java:568) at java.util.Formatter.parseInt(Formatter.java:1191) at java.util.Formatter.parseArgumentIndex(Formatter.java:1212) at java.util.Formatter.format(Formatter.java:1326) at java.util.Formatter.format(Formatter.java:1442) at java.lang.String.format(String.java:1984) at java.lang.String.format(String.java:1990) at StringTest.main(StringTest.java:3) This patch fixes the issue by switching to Integer.parseInt() in java.util.Formatter.parseInt(). Reviewed-by: Dr Andrew John Hughes <gnu_andrew@member.fsf.org> 2010-02-16 Pekka Enberg <penberg@kernel.org> * java/util/Formatter.java: (parseInt): Use Integer.parseInt() insted of Integer.decode() because the latter doesn't work with leading zeros which are used in String.format() formatting, for example.