summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2010-09-02 16:47:04 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2010-09-02 16:47:04 +0000
commit6605e28839909048684f485fa931cce6fa11535b (patch)
treed1167c1f089f589fd74f3864f40070fb56e07d00
parent930fa220b269a16fb89e549c80ad0f4d491d5ac9 (diff)
downloadclasspath-6605e28839909048684f485fa931cce6fa11535b.tar.gz
Only initialise loggers when Configuration.DEBUG is true.
Avoid floating point arithmetic when computing 1.5 * length. Cast instance generated by reflection to correct type. Remove redundant super() calls and initialisations. Drop unused variable. 2010-05-09 Ivan Maidanski <ivmai@mail.ru> * gnu/java/security/Properties.java: Only initialise log if Configuration.DEBUG is true. * gnu/java/security/der/DERWriter.java: (toUtf8(String)): Calculate 1.5 * len using len + (len >> 1) to avoid multiplication by a floating-point number. * gnu/java/security/hash/Whirlpool.java: Only initialise log if Configuration.DEBUG is true. * gnu/java/security/jce/sig/EncodedKeyFactory.java: Likewise. * gnu/java/security/jce/sig/SignatureAdapter.java: Likewise. * gnu/java/security/key/dss/DSSKeyPairGenerator.java: Likewise. * gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java: Likewise. * gnu/java/security/key/rsa/RSAKeyPairGenerator.java: Likewise. * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java: Likewise. * gnu/java/security/key/rsa/RSAKeyPairX509Codec.java: Likewise. * gnu/java/security/pkcs/PKCS7SignedData.java: Likewise. * gnu/java/security/pkcs/SignerInfo.java: Likewise. (SignerInfo(BERReader)): Only print version if Configuration.DEBUG is true, as with other output. * gnu/java/security/provider/PKIXCertPathValidatorImpl.java: Only initialise log if Configuration.DEBUG is true. * gnu/java/security/sig/rsa/EMSA_PSS.java: Likewise. * gnu/java/security/sig/rsa/RSAPSSSignature.java: Likewise. * gnu/java/security/x509/X509CRL.java: Likewise. * gnu/java/security/x509/X509CRLEntry.java: Likewise. * gnu/java/security/x509/ext/Extension.java: Likewise. * gnu/javax/crypto/cipher/Anubis.java: Likewise. * gnu/javax/crypto/cipher/BaseCipher.java: Likewise. * gnu/javax/crypto/cipher/Khazad.java: Likewise. * gnu/javax/crypto/cipher/Rijndael.java: Likewise. * gnu/javax/crypto/cipher/Twofish.java: Likewise. * gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java: Likewise. * gnu/javax/crypto/jce/keyring/GnuKeyring.java: Likewise. * gnu/javax/crypto/jce/params/BlockCipherParameters.java: Likewise. * gnu/javax/crypto/jce/prng/ICMRandomSpi.java: Likewise. * gnu/javax/crypto/jce/prng/UMacRandomSpi.java: Likewise. * gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java: Likewise. (sha): Drop unused variable. (rnd): Use implicit initialisation to null as with other variables. * gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java: Only initialise log if Configuration.DEBUG is true. * gnu/javax/crypto/keyring/Entry.java: Likewise. * gnu/javax/crypto/keyring/EnvelopeEntry.java: Likewise. * gnu/javax/crypto/keyring/GnuPublicKeyring.java: Likewise. * gnu/javax/crypto/mac/OMAC.java: Likewise. * gnu/javax/crypto/pad/BasePad.java: Likewise. * gnu/javax/crypto/pad/PKCS1_V1_5.java: Likewise. * gnu/javax/crypto/pad/PKCS7.java: Likewise. * gnu/javax/crypto/pad/TBC.java: Likewise. * gnu/javax/crypto/prng/CSPRNG.java: Likewise. (getSystemInstance()): Clarify bracketing of for loop and ignorance of exceptions in the OTHER case. * gnu/javax/crypto/sasl/SaslInputStream.java: Only initialise log if Configuration.DEBUG is true. * gnu/javax/crypto/sasl/SaslOutputStream.java: Likewise. * gnu/javax/crypto/sasl/srp/SRPClient.java: Likewise. * gnu/javax/crypto/sasl/srp/SRPServer.java: Likewise. * gnu/javax/security/auth/login/ConfigFileParser.java: Likewise. (map): Make final. * gnu/javax/security/auth/login/ConfigFileTokenizer.java: Only initialise log if Configuration.DEBUG is true. (br): Make final. (ConfigFileTokenizer(Reader)): Remove explicit initialisation of initialised and call to superclass when superclass is Object. * gnu/javax/security/auth/login/GnuConfiguration.java: Only iniialise log if Configuration.DEBUG is true. * java/math/BigInteger.java: Likewise.
-rw-r--r--ChangeLog70
-rw-r--r--gnu/java/security/Properties.java5
-rw-r--r--gnu/java/security/der/DERWriter.java8
-rw-r--r--gnu/java/security/hash/Whirlpool.java6
-rw-r--r--gnu/java/security/jce/sig/EncodedKeyFactory.java5
-rw-r--r--gnu/java/security/jce/sig/SignatureAdapter.java5
-rw-r--r--gnu/java/security/key/dss/DSSKeyPairGenerator.java5
-rw-r--r--gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java6
-rw-r--r--gnu/java/security/key/rsa/RSAKeyPairGenerator.java5
-rw-r--r--gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java6
-rw-r--r--gnu/java/security/key/rsa/RSAKeyPairX509Codec.java6
-rw-r--r--gnu/java/security/pkcs/PKCS7SignedData.java5
-rw-r--r--gnu/java/security/pkcs/SignerInfo.java8
-rw-r--r--gnu/java/security/provider/PKIXCertPathValidatorImpl.java5
-rw-r--r--gnu/java/security/sig/rsa/EMSA_PSS.java5
-rw-r--r--gnu/java/security/sig/rsa/RSAPSSSignature.java5
-rw-r--r--gnu/java/security/x509/X509CRL.java6
-rw-r--r--gnu/java/security/x509/X509CRLEntry.java6
-rw-r--r--gnu/java/security/x509/ext/Extension.java5
-rw-r--r--gnu/javax/crypto/cipher/Anubis.java5
-rw-r--r--gnu/javax/crypto/cipher/BaseCipher.java5
-rw-r--r--gnu/javax/crypto/cipher/Khazad.java5
-rw-r--r--gnu/javax/crypto/cipher/Rijndael.java5
-rw-r--r--gnu/javax/crypto/cipher/Twofish.java5
-rw-r--r--gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java5
-rw-r--r--gnu/javax/crypto/jce/keyring/GnuKeyring.java5
-rw-r--r--gnu/javax/crypto/jce/params/BlockCipherParameters.java5
-rw-r--r--gnu/javax/crypto/jce/prng/ICMRandomSpi.java5
-rw-r--r--gnu/javax/crypto/jce/prng/UMacRandomSpi.java5
-rw-r--r--gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java11
-rw-r--r--gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java6
-rw-r--r--gnu/javax/crypto/keyring/Entry.java5
-rw-r--r--gnu/javax/crypto/keyring/EnvelopeEntry.java5
-rw-r--r--gnu/javax/crypto/keyring/GnuPublicKeyring.java5
-rw-r--r--gnu/javax/crypto/mac/OMAC.java5
-rw-r--r--gnu/javax/crypto/pad/BasePad.java5
-rw-r--r--gnu/javax/crypto/pad/PKCS1_V1_5.java5
-rw-r--r--gnu/javax/crypto/pad/PKCS7.java5
-rw-r--r--gnu/javax/crypto/pad/TBC.java5
-rw-r--r--gnu/javax/crypto/prng/CSPRNG.java38
-rw-r--r--gnu/javax/crypto/sasl/SaslInputStream.java5
-rw-r--r--gnu/javax/crypto/sasl/SaslOutputStream.java5
-rw-r--r--gnu/javax/crypto/sasl/srp/SRPClient.java5
-rw-r--r--gnu/javax/crypto/sasl/srp/SRPServer.java5
-rw-r--r--gnu/javax/security/auth/login/ConfigFileParser.java8
-rw-r--r--gnu/javax/security/auth/login/ConfigFileTokenizer.java11
-rw-r--r--gnu/javax/security/auth/login/GnuConfiguration.java6
-rw-r--r--java/math/BigInteger.java6
48 files changed, 248 insertions, 120 deletions
diff --git a/ChangeLog b/ChangeLog
index 31a03ca53..37857759c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,73 @@
+2010-05-09 Ivan Maidanski <ivmai@mail.ru>
+
+ * gnu/java/security/Properties.java: Only
+ initialise log if Configuration.DEBUG is true.
+ * gnu/java/security/der/DERWriter.java:
+ (toUtf8(String)): Calculate 1.5 * len using
+ len + (len >> 1) to avoid multiplication by a floating-point
+ number.
+ * gnu/java/security/hash/Whirlpool.java: Only
+ initialise log if Configuration.DEBUG is true.
+ * gnu/java/security/jce/sig/EncodedKeyFactory.java: Likewise.
+ * gnu/java/security/jce/sig/SignatureAdapter.java: Likewise.
+ * gnu/java/security/key/dss/DSSKeyPairGenerator.java: Likewise.
+ * gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java: Likewise.
+ * gnu/java/security/key/rsa/RSAKeyPairGenerator.java: Likewise.
+ * gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java: Likewise.
+ * gnu/java/security/key/rsa/RSAKeyPairX509Codec.java: Likewise.
+ * gnu/java/security/pkcs/PKCS7SignedData.java: Likewise.
+ * gnu/java/security/pkcs/SignerInfo.java: Likewise.
+ (SignerInfo(BERReader)): Only print version if Configuration.DEBUG is
+ true, as with other output.
+ * gnu/java/security/provider/PKIXCertPathValidatorImpl.java:
+ Only initialise log if Configuration.DEBUG is true.
+ * gnu/java/security/sig/rsa/EMSA_PSS.java: Likewise.
+ * gnu/java/security/sig/rsa/RSAPSSSignature.java: Likewise.
+ * gnu/java/security/x509/X509CRL.java: Likewise.
+ * gnu/java/security/x509/X509CRLEntry.java: Likewise.
+ * gnu/java/security/x509/ext/Extension.java: Likewise.
+ * gnu/javax/crypto/cipher/Anubis.java: Likewise.
+ * gnu/javax/crypto/cipher/BaseCipher.java: Likewise.
+ * gnu/javax/crypto/cipher/Khazad.java: Likewise.
+ * gnu/javax/crypto/cipher/Rijndael.java: Likewise.
+ * gnu/javax/crypto/cipher/Twofish.java: Likewise.
+ * gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java: Likewise.
+ * gnu/javax/crypto/jce/keyring/GnuKeyring.java: Likewise.
+ * gnu/javax/crypto/jce/params/BlockCipherParameters.java: Likewise.
+ * gnu/javax/crypto/jce/prng/ICMRandomSpi.java: Likewise.
+ * gnu/javax/crypto/jce/prng/UMacRandomSpi.java: Likewise.
+ * gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java: Likewise.
+ (sha): Drop unused variable.
+ (rnd): Use implicit initialisation to null as with other variables.
+ * gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java:
+ Only initialise log if Configuration.DEBUG is true.
+ * gnu/javax/crypto/keyring/Entry.java: Likewise.
+ * gnu/javax/crypto/keyring/EnvelopeEntry.java: Likewise.
+ * gnu/javax/crypto/keyring/GnuPublicKeyring.java: Likewise.
+ * gnu/javax/crypto/mac/OMAC.java: Likewise.
+ * gnu/javax/crypto/pad/BasePad.java: Likewise.
+ * gnu/javax/crypto/pad/PKCS1_V1_5.java: Likewise.
+ * gnu/javax/crypto/pad/PKCS7.java: Likewise.
+ * gnu/javax/crypto/pad/TBC.java: Likewise.
+ * gnu/javax/crypto/prng/CSPRNG.java: Likewise.
+ (getSystemInstance()): Clarify bracketing of for loop
+ and ignorance of exceptions in the OTHER case.
+ * gnu/javax/crypto/sasl/SaslInputStream.java:
+ Only initialise log if Configuration.DEBUG is true.
+ * gnu/javax/crypto/sasl/SaslOutputStream.java: Likewise.
+ * gnu/javax/crypto/sasl/srp/SRPClient.java: Likewise.
+ * gnu/javax/crypto/sasl/srp/SRPServer.java: Likewise.
+ * gnu/javax/security/auth/login/ConfigFileParser.java: Likewise.
+ (map): Make final.
+ * gnu/javax/security/auth/login/ConfigFileTokenizer.java:
+ Only initialise log if Configuration.DEBUG is true.
+ (br): Make final.
+ (ConfigFileTokenizer(Reader)): Remove explicit initialisation of
+ initialised and call to superclass when superclass is Object.
+ * gnu/javax/security/auth/login/GnuConfiguration.java:
+ Only iniialise log if Configuration.DEBUG is true.
+ * java/math/BigInteger.java: Likewise.
+
2010-04-12 Ivan Maidanski <ivmai@mail.ru>
PR classpath/40889
diff --git a/gnu/java/security/Properties.java b/gnu/java/security/Properties.java
index 2213bde06..1a4bf2276 100644
--- a/gnu/java/security/Properties.java
+++ b/gnu/java/security/Properties.java
@@ -1,5 +1,5 @@
/* Properties.java -- run-time configuration properties.
- Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -54,7 +54,8 @@ import java.util.logging.Logger;
*/
public final class Properties
{
- private static final Logger log = Logger.getLogger(Properties.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Properties.class.getName()) : null;
public static final String VERSION = "gnu.crypto.version";
diff --git a/gnu/java/security/der/DERWriter.java b/gnu/java/security/der/DERWriter.java
index 0c2633605..cea3fa31d 100644
--- a/gnu/java/security/der/DERWriter.java
+++ b/gnu/java/security/der/DERWriter.java
@@ -1,5 +1,5 @@
/* DERWriter.java -- write Java types in DER format.
- Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2005, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -281,9 +281,9 @@ public class DERWriter implements DER
private static byte[] toUtf8(String string)
{
- ByteArrayOutputStream buf =
- new ByteArrayOutputStream((int)(string.length() * 1.5));
- for (int i = 0; i < string.length(); i++)
+ int len = string.length();
+ ByteArrayOutputStream buf = new ByteArrayOutputStream(len + (len >> 1));
+ for (int i = 0; i < len; i++)
{
char c = string.charAt(i);
if (c < 0x0080)
diff --git a/gnu/java/security/hash/Whirlpool.java b/gnu/java/security/hash/Whirlpool.java
index 574104074..29eed59ba 100644
--- a/gnu/java/security/hash/Whirlpool.java
+++ b/gnu/java/security/hash/Whirlpool.java
@@ -1,5 +1,5 @@
/* Whirlpool.java --
- Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -67,7 +67,9 @@ import java.util.logging.Logger;
public final class Whirlpool
extends BaseHash
{
- private static final Logger log = Logger.getLogger(Whirlpool.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Whirlpool.class.getName()) : null;
+
private static final int BLOCK_SIZE = 64; // inner block size in bytes
/** The digest of the 0-bit long message. */
diff --git a/gnu/java/security/jce/sig/EncodedKeyFactory.java b/gnu/java/security/jce/sig/EncodedKeyFactory.java
index 19ec088c5..ec7420138 100644
--- a/gnu/java/security/jce/sig/EncodedKeyFactory.java
+++ b/gnu/java/security/jce/sig/EncodedKeyFactory.java
@@ -1,5 +1,5 @@
/* EncodedKeyFactory.java -- JCE Encoded key factory Adapter
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,7 +78,8 @@ import javax.crypto.spec.DHPublicKeySpec;
public class EncodedKeyFactory
extends KeyFactorySpi
{
- private static final Logger log = Logger.getLogger(EncodedKeyFactory.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(EncodedKeyFactory.class.getName()) : null;
private static Object invokeConstructor(String className, Object[] params)
throws InvalidKeySpecException
diff --git a/gnu/java/security/jce/sig/SignatureAdapter.java b/gnu/java/security/jce/sig/SignatureAdapter.java
index 0ed1e2f41..efe3681ca 100644
--- a/gnu/java/security/jce/sig/SignatureAdapter.java
+++ b/gnu/java/security/jce/sig/SignatureAdapter.java
@@ -1,5 +1,5 @@
/* SignatureAdapter.java --
- Copyright 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -75,7 +75,8 @@ class SignatureAdapter
extends SignatureSpi
implements Cloneable
{
- private static final Logger log = Logger.getLogger(SignatureAdapter.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SignatureAdapter.class.getName()) : null;
/** Our underlying signature instance. */
private ISignature adaptee;
diff --git a/gnu/java/security/key/dss/DSSKeyPairGenerator.java b/gnu/java/security/key/dss/DSSKeyPairGenerator.java
index 6bda4e88e..70df734a9 100644
--- a/gnu/java/security/key/dss/DSSKeyPairGenerator.java
+++ b/gnu/java/security/key/dss/DSSKeyPairGenerator.java
@@ -1,5 +1,5 @@
/* DSSKeyPairGenerator.java --
- Copyright 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -66,7 +66,8 @@ import java.util.logging.Logger;
public class DSSKeyPairGenerator
implements IKeyPairGenerator
{
- private static final Logger log = Logger.getLogger(DSSKeyPairGenerator.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(DSSKeyPairGenerator.class.getName()) : null;
/** The BigInteger constant 2. */
private static final BigInteger TWO = BigInteger.valueOf(2L);
diff --git a/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java b/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java
index a59ca3cee..1806ecf58 100644
--- a/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java
+++ b/gnu/java/security/key/dss/DSSKeyPairPKCS8Codec.java
@@ -1,5 +1,5 @@
/* DSSKeyPairPKCS8Codec.java -- PKCS#8 Encoding/Decoding handler
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -67,7 +67,9 @@ import java.util.logging.Logger;
public class DSSKeyPairPKCS8Codec
implements IKeyPairCodec
{
- private static final Logger log = Logger.getLogger(DSSKeyPairPKCS8Codec.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(DSSKeyPairPKCS8Codec.class.getName()) : null;
+
private static final OID DSA_ALG_OID = new OID(Registry.DSA_OID_STRING);
// implicit 0-arguments constructor
diff --git a/gnu/java/security/key/rsa/RSAKeyPairGenerator.java b/gnu/java/security/key/rsa/RSAKeyPairGenerator.java
index bec60d350..99c313944 100644
--- a/gnu/java/security/key/rsa/RSAKeyPairGenerator.java
+++ b/gnu/java/security/key/rsa/RSAKeyPairGenerator.java
@@ -1,5 +1,5 @@
/* RSAKeyPairGenerator.java --
- Copyright 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -70,7 +70,8 @@ import java.util.logging.Logger;
public class RSAKeyPairGenerator
implements IKeyPairGenerator
{
- private static final Logger log = Logger.getLogger(RSAKeyPairGenerator.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(RSAKeyPairGenerator.class.getName()) : null;
/** The BigInteger constant 1. */
private static final BigInteger ONE = BigInteger.ONE;
diff --git a/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java b/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java
index 2785f02c8..b07ed667c 100644
--- a/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java
+++ b/gnu/java/security/key/rsa/RSAKeyPairPKCS8Codec.java
@@ -1,5 +1,5 @@
/* RSAKeyPairPKCS8Codec.java -- PKCS#8 Encoding/Decoding handler
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -64,7 +64,9 @@ import java.util.logging.Logger;
public class RSAKeyPairPKCS8Codec
implements IKeyPairCodec
{
- private static final Logger log = Logger.getLogger(RSAKeyPairPKCS8Codec.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(RSAKeyPairPKCS8Codec.class.getName()) : null;
+
private static final OID RSA_ALG_OID = new OID(Registry.RSA_OID_STRING);
// implicit 0-arguments constructor
diff --git a/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java b/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java
index 9ad6ae029..36fd75c98 100644
--- a/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java
+++ b/gnu/java/security/key/rsa/RSAKeyPairX509Codec.java
@@ -1,5 +1,5 @@
/* RSAKeyPairX509Codec.java -- X.509 Encoding/Decoding handler
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -65,7 +65,9 @@ import java.util.logging.Logger;
public class RSAKeyPairX509Codec
implements IKeyPairCodec
{
- private static final Logger log = Logger.getLogger(RSAKeyPairX509Codec.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(RSAKeyPairX509Codec.class.getName()) : null;
+
private static final OID RSA_ALG_OID = new OID(Registry.RSA_OID_STRING);
// implicit 0-arguments constructor
diff --git a/gnu/java/security/pkcs/PKCS7SignedData.java b/gnu/java/security/pkcs/PKCS7SignedData.java
index adb00a3be..e479d2e8c 100644
--- a/gnu/java/security/pkcs/PKCS7SignedData.java
+++ b/gnu/java/security/pkcs/PKCS7SignedData.java
@@ -1,5 +1,5 @@
/* PKCS7SignedData.java -- reader/writer for PKCS#7 signedData objects
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,7 +78,8 @@ import java.util.logging.Logger;
*/
public class PKCS7SignedData
{
- private static final Logger log = Logger.getLogger(PKCS7SignedData.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(PKCS7SignedData.class.getName()) : null;
public static final OID PKCS7_SIGNED_DATA = new OID("1.2.840.113549.1.7.2");
diff --git a/gnu/java/security/pkcs/SignerInfo.java b/gnu/java/security/pkcs/SignerInfo.java
index 645ed67bb..07ce4d71b 100644
--- a/gnu/java/security/pkcs/SignerInfo.java
+++ b/gnu/java/security/pkcs/SignerInfo.java
@@ -1,5 +1,5 @@
/* SignerInfo.java -- a SignerInfo object, from PKCS #7
- Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -59,7 +59,8 @@ import javax.security.auth.x500.X500Principal;
public class SignerInfo
{
- private static final Logger log = Logger.getLogger(SignerInfo.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SignerInfo.class.getName()) : null;
private final BigInteger version;
private final BigInteger serialNumber;
@@ -111,7 +112,8 @@ public class SignerInfo
throw new BEREncodingException("malformed Version");
version = (BigInteger) val.getValue();
- log.fine(" Version: " + version);
+ if (Configuration.DEBUG)
+ log.fine(" Version: " + version);
val = ber.read();
if (!val.isConstructed())
diff --git a/gnu/java/security/provider/PKIXCertPathValidatorImpl.java b/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
index d4ce4aeb4..e0d318777 100644
--- a/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
+++ b/gnu/java/security/provider/PKIXCertPathValidatorImpl.java
@@ -1,5 +1,5 @@
/* PKIXCertPathValidatorImpl.java -- PKIX certificate path validator.
- Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2005, 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -97,7 +97,8 @@ import java.util.logging.Logger;
public class PKIXCertPathValidatorImpl
extends CertPathValidatorSpi
{
- private static final Logger log = Logger.getLogger(PKIXCertPathValidatorImpl.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(PKIXCertPathValidatorImpl.class.getName()) : null;
public static final String ANY_POLICY = "2.5.29.32.0";
diff --git a/gnu/java/security/sig/rsa/EMSA_PSS.java b/gnu/java/security/sig/rsa/EMSA_PSS.java
index 917d96323..7a8e591a3 100644
--- a/gnu/java/security/sig/rsa/EMSA_PSS.java
+++ b/gnu/java/security/sig/rsa/EMSA_PSS.java
@@ -1,5 +1,5 @@
/* EMSA_PSS.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -73,7 +73,8 @@ import java.util.logging.Logger;
public class EMSA_PSS
implements Cloneable
{
- private static final Logger log = Logger.getLogger(EMSA_PSS.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(EMSA_PSS.class.getName()) : null;
/** The underlying hash function to use with this instance. */
private IMessageDigest hash;
diff --git a/gnu/java/security/sig/rsa/RSAPSSSignature.java b/gnu/java/security/sig/rsa/RSAPSSSignature.java
index d8f8327f1..7b042f77f 100644
--- a/gnu/java/security/sig/rsa/RSAPSSSignature.java
+++ b/gnu/java/security/sig/rsa/RSAPSSSignature.java
@@ -1,5 +1,5 @@
/* RSAPSSSignature.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -75,7 +75,8 @@ import java.util.logging.Logger;
public class RSAPSSSignature
extends BaseSignature
{
- private static final Logger log = Logger.getLogger(RSAPSSSignature.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(RSAPSSSignature.class.getName()) : null;
/** The underlying EMSA-PSS instance for this object. */
private EMSA_PSS pss;
diff --git a/gnu/java/security/x509/X509CRL.java b/gnu/java/security/x509/X509CRL.java
index 7c471c972..518edaa24 100644
--- a/gnu/java/security/x509/X509CRL.java
+++ b/gnu/java/security/x509/X509CRL.java
@@ -1,5 +1,5 @@
/* X509CRL.java -- X.509 certificate revocation list.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -77,7 +77,9 @@ import javax.security.auth.x500.X500Principal;
public class X509CRL extends java.security.cert.X509CRL
implements GnuPKIExtension
{
- private static final Logger log = Logger.getLogger(X509CRL.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(X509CRL.class.getName()) : null;
+
private static final OID ID_DSA = new OID("1.2.840.10040.4.1");
private static final OID ID_DSA_WITH_SHA1 = new OID("1.2.840.10040.4.3");
private static final OID ID_RSA = new OID("1.2.840.113549.1.1.1");
diff --git a/gnu/java/security/x509/X509CRLEntry.java b/gnu/java/security/x509/X509CRLEntry.java
index 26b40363c..64adf7f69 100644
--- a/gnu/java/security/x509/X509CRLEntry.java
+++ b/gnu/java/security/x509/X509CRLEntry.java
@@ -1,5 +1,5 @@
/* X509CRLEntry.java -- an entry in a X.509 CRL.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -65,7 +65,9 @@ import java.util.logging.Logger;
class X509CRLEntry extends java.security.cert.X509CRLEntry
implements GnuPKIExtension
{
- private static final Logger log = Logger.getLogger(X509CRLEntry.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(X509CRLEntry.class.getName()) : null;
+
/** The DER encoded form of this CRL entry. */
private byte[] encoded;
diff --git a/gnu/java/security/x509/ext/Extension.java b/gnu/java/security/x509/ext/Extension.java
index 2b7e96d5a..b740c8ac4 100644
--- a/gnu/java/security/x509/ext/Extension.java
+++ b/gnu/java/security/x509/ext/Extension.java
@@ -1,5 +1,5 @@
/* Extension.java -- an X.509 certificate or CRL extension.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -53,7 +53,8 @@ import java.util.logging.Logger;
public class Extension
{
- private static final Logger log = Logger.getLogger(Extension.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Extension.class.getName()) : null;
/**
* This extension's object identifier.
*/
diff --git a/gnu/javax/crypto/cipher/Anubis.java b/gnu/javax/crypto/cipher/Anubis.java
index 3526ad612..c2a7cce93 100644
--- a/gnu/javax/crypto/cipher/Anubis.java
+++ b/gnu/javax/crypto/cipher/Anubis.java
@@ -1,5 +1,5 @@
/* Anubis.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -67,7 +67,8 @@ import java.util.logging.Logger;
public final class Anubis
extends BaseCipher
{
- private static final Logger log = Logger.getLogger(Anubis.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Anubis.class.getName()) : null;
private static final int DEFAULT_BLOCK_SIZE = 16; // in bytes
private static final int DEFAULT_KEY_SIZE = 16; // in bytes
private static final String Sd = // p. 25 [ANUBIS]
diff --git a/gnu/javax/crypto/cipher/BaseCipher.java b/gnu/javax/crypto/cipher/BaseCipher.java
index 45aa2d6fd..8dfd47e1e 100644
--- a/gnu/javax/crypto/cipher/BaseCipher.java
+++ b/gnu/javax/crypto/cipher/BaseCipher.java
@@ -1,5 +1,5 @@
/* BaseCipher.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -56,7 +56,8 @@ import java.util.logging.Logger;
public abstract class BaseCipher
implements IBlockCipher, IBlockCipherSpi
{
- private static final Logger log = Logger.getLogger(BaseCipher.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(BaseCipher.class.getName()) : null;
/** The canonical name prefix of the cipher. */
protected String name;
/** The default block size, in bytes. */
diff --git a/gnu/javax/crypto/cipher/Khazad.java b/gnu/javax/crypto/cipher/Khazad.java
index 55e42628b..1c3b778a2 100644
--- a/gnu/javax/crypto/cipher/Khazad.java
+++ b/gnu/javax/crypto/cipher/Khazad.java
@@ -1,5 +1,5 @@
/* Khazad.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -67,7 +67,8 @@ import java.util.logging.Logger;
public final class Khazad
extends BaseCipher
{
- private static final Logger log = Logger.getLogger(Khazad.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Khazad.class.getName()) : null;
private static final int DEFAULT_BLOCK_SIZE = 8; // in bytes
private static final int DEFAULT_KEY_SIZE = 16; // in bytes
private static final int R = 8; // standard number of rounds; para. 3.7
diff --git a/gnu/javax/crypto/cipher/Rijndael.java b/gnu/javax/crypto/cipher/Rijndael.java
index 0463fe51d..6ce394360 100644
--- a/gnu/javax/crypto/cipher/Rijndael.java
+++ b/gnu/javax/crypto/cipher/Rijndael.java
@@ -1,5 +1,5 @@
/* Rijndael.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -64,7 +64,8 @@ import java.util.logging.Logger;
public final class Rijndael
extends BaseCipher
{
- private static final Logger log = Logger.getLogger(Rijndael.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Rijndael.class.getName()) : null;
private static final int DEFAULT_BLOCK_SIZE = 16; // in bytes
private static final int DEFAULT_KEY_SIZE = 16; // in bytes
private static final String SS =
diff --git a/gnu/javax/crypto/cipher/Twofish.java b/gnu/javax/crypto/cipher/Twofish.java
index c9789a699..7f3a34132 100644
--- a/gnu/javax/crypto/cipher/Twofish.java
+++ b/gnu/javax/crypto/cipher/Twofish.java
@@ -1,5 +1,5 @@
/* Twofish.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -69,7 +69,8 @@ import java.util.logging.Logger;
public final class Twofish
extends BaseCipher
{
- private static final Logger log = Logger.getLogger(Twofish.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Twofish.class.getName()) : null;
private static final int DEFAULT_BLOCK_SIZE = 16; // in bytes
private static final int DEFAULT_KEY_SIZE = 16; // in bytes
private static final int MAX_ROUNDS = 16; // max # rounds (for allocating subkeys)
diff --git a/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java b/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java
index 97fdd5331..b9ce37894 100644
--- a/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java
+++ b/gnu/javax/crypto/jce/cipher/KeyWrappingAlgorithmAdapter.java
@@ -1,5 +1,5 @@
/* KeyWrappingAlgorithmAdapter.java -- Base Adapter for Key Wrapping algorithms
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -76,7 +76,8 @@ import javax.crypto.spec.SecretKeySpec;
abstract class KeyWrappingAlgorithmAdapter
extends CipherSpi
{
- private static final Logger log = Logger.getLogger(KeyWrappingAlgorithmAdapter.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(KeyWrappingAlgorithmAdapter.class.getName()) : null;
/** JCE canonical name of a null-padder. */
private static final String NO_PADDING = "nopadding";
/** Concrete Key Wrapping Algorithm SPI. */
diff --git a/gnu/javax/crypto/jce/keyring/GnuKeyring.java b/gnu/javax/crypto/jce/keyring/GnuKeyring.java
index c30da69a2..39d402a00 100644
--- a/gnu/javax/crypto/jce/keyring/GnuKeyring.java
+++ b/gnu/javax/crypto/jce/keyring/GnuKeyring.java
@@ -1,5 +1,5 @@
/* GnuKeyring.java -- KeyStore adapter for a pair of private and public Keyrings
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -77,7 +77,8 @@ import javax.crypto.SecretKey;
public class GnuKeyring
extends KeyStoreSpi
{
- private static final Logger log = Logger.getLogger(GnuKeyring.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(GnuKeyring.class.getName()) : null;
private static final String NOT_LOADED = "not loaded";
/** TRUE if the keystore is loaded; FALSE otherwise. */
diff --git a/gnu/javax/crypto/jce/params/BlockCipherParameters.java b/gnu/javax/crypto/jce/params/BlockCipherParameters.java
index fde83b1f3..a6dd24751 100644
--- a/gnu/javax/crypto/jce/params/BlockCipherParameters.java
+++ b/gnu/javax/crypto/jce/params/BlockCipherParameters.java
@@ -1,5 +1,5 @@
/* BlockCipherParameters.java --
- Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -59,7 +59,8 @@ import javax.crypto.spec.IvParameterSpec;
public class BlockCipherParameters
extends AlgorithmParametersSpi
{
- private static final Logger log = Logger.getLogger(BlockCipherParameters.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(BlockCipherParameters.class.getName()) : null;
/** The underlying block cipher specification. */
protected BlockCipherParameterSpec cipherSpec;
private static final String DEFAULT_FORMAT = "ASN.1";
diff --git a/gnu/javax/crypto/jce/prng/ICMRandomSpi.java b/gnu/javax/crypto/jce/prng/ICMRandomSpi.java
index bbd5d4768..b4fcdf81f 100644
--- a/gnu/javax/crypto/jce/prng/ICMRandomSpi.java
+++ b/gnu/javax/crypto/jce/prng/ICMRandomSpi.java
@@ -1,5 +1,5 @@
/* ICMRandomSpi.java --
- Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -58,7 +58,8 @@ import java.util.logging.Logger;
public class ICMRandomSpi
extends SecureRandomSpi
{
- private static final Logger log = Logger.getLogger(ICMRandomSpi.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(ICMRandomSpi.class.getName()) : null;
/** Class-wide prng to generate random material for the underlying prng. */
private static final ICMGenerator prng; // blank final
static
diff --git a/gnu/javax/crypto/jce/prng/UMacRandomSpi.java b/gnu/javax/crypto/jce/prng/UMacRandomSpi.java
index 910e65c70..20a467ee3 100644
--- a/gnu/javax/crypto/jce/prng/UMacRandomSpi.java
+++ b/gnu/javax/crypto/jce/prng/UMacRandomSpi.java
@@ -1,5 +1,5 @@
/* UMacRandomSpi.java --
- Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -57,7 +57,8 @@ import java.util.logging.Logger;
public class UMacRandomSpi
extends SecureRandomSpi
{
- private static final Logger log = Logger.getLogger(UMacRandomSpi.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(UMacRandomSpi.class.getName()) : null;
/** Class-wide prng to generate random material for the underlying prng. */
private static final UMacGenerator prng; // blank final
diff --git a/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java b/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java
index 89e9c4c80..a1a19c3b3 100644
--- a/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java
+++ b/gnu/javax/crypto/key/dh/GnuDHKeyPairGenerator.java
@@ -1,5 +1,5 @@
/* GnuDHKeyPairGenerator.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -40,7 +40,6 @@ package gnu.javax.crypto.key.dh;
import gnu.java.security.Configuration;
import gnu.java.security.Registry;
-import gnu.java.security.hash.Sha160;
import gnu.java.security.key.IKeyPairGenerator;
import gnu.java.security.util.PRNG;
@@ -68,7 +67,9 @@ import javax.crypto.spec.DHParameterSpec;
public class GnuDHKeyPairGenerator
implements IKeyPairGenerator
{
- private static final Logger log = Logger.getLogger(GnuDHKeyPairGenerator.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(GnuDHKeyPairGenerator.class.getName()) : null;
+
/**
* Property name of an optional {@link SecureRandom} instance to use. The
* default is to use a classloader singleton from {@link PRNG}.
@@ -95,10 +96,8 @@ public class GnuDHKeyPairGenerator
public static final int DEFAULT_EXPONENT_SIZE = 160;
/** Default encoding format to use when none was specified. */
private static final int DEFAULT_ENCODING_FORMAT = Registry.RAW_ENCODING_ID;
- /** The SHA instance to use. */
- private Sha160 sha = new Sha160();
/** The optional {@link SecureRandom} instance to use. */
- private SecureRandom rnd = null;
+ private SecureRandom rnd;
/** The desired size in bits of the public prime (p). */
private int l;
/** The desired size in bits of the private exponent (x). */
diff --git a/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java b/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java
index 59e5bc943..25f3d8425 100644
--- a/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java
+++ b/gnu/javax/crypto/key/srp6/SRPKeyPairGenerator.java
@@ -1,5 +1,5 @@
/* SRPKeyPairGenerator.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -59,7 +59,9 @@ import java.util.logging.Logger;
public class SRPKeyPairGenerator
implements IKeyPairGenerator
{
- private static final Logger log = Logger.getLogger(SRPKeyPairGenerator.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SRPKeyPairGenerator.class.getName()) : null;
+
private static final BigInteger ZERO = BigInteger.ZERO;
private static final BigInteger ONE = BigInteger.ONE;
private static final BigInteger TWO = BigInteger.valueOf(2L);
diff --git a/gnu/javax/crypto/keyring/Entry.java b/gnu/javax/crypto/keyring/Entry.java
index d45924940..b29c0442c 100644
--- a/gnu/javax/crypto/keyring/Entry.java
+++ b/gnu/javax/crypto/keyring/Entry.java
@@ -1,5 +1,5 @@
/* Entry.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -50,7 +50,8 @@ import java.util.logging.Logger;
*/
public abstract class Entry
{
- private static final Logger log = Logger.getLogger(Entry.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(Entry.class.getName()) : null;
private static final String[] TYPES = new String[] {
"Encrypted",
"PasswordEncrypted",
diff --git a/gnu/javax/crypto/keyring/EnvelopeEntry.java b/gnu/javax/crypto/keyring/EnvelopeEntry.java
index 76aba7d7b..faaa7a808 100644
--- a/gnu/javax/crypto/keyring/EnvelopeEntry.java
+++ b/gnu/javax/crypto/keyring/EnvelopeEntry.java
@@ -1,5 +1,5 @@
/* EnvelopeEntry.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -58,7 +58,8 @@ import java.util.logging.Logger;
public abstract class EnvelopeEntry
extends Entry
{
- private static final Logger log = Logger.getLogger(EnvelopeEntry.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(EnvelopeEntry.class.getName()) : null;
/** The envelope that contains this one (if any). */
protected EnvelopeEntry containingEnvelope;
/** The contained entries. */
diff --git a/gnu/javax/crypto/keyring/GnuPublicKeyring.java b/gnu/javax/crypto/keyring/GnuPublicKeyring.java
index d7387f892..474014f39 100644
--- a/gnu/javax/crypto/keyring/GnuPublicKeyring.java
+++ b/gnu/javax/crypto/keyring/GnuPublicKeyring.java
@@ -1,5 +1,5 @@
/* GnuPublicKeyring.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -55,7 +55,8 @@ public class GnuPublicKeyring
extends BaseKeyring
implements IPublicKeyring
{
- private static final Logger log = Logger.getLogger(GnuPublicKeyring.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(GnuPublicKeyring.class.getName()) : null;
public static final int USAGE = Registry.GKR_CERTIFICATES;
public GnuPublicKeyring(String mac, int macLen)
diff --git a/gnu/javax/crypto/mac/OMAC.java b/gnu/javax/crypto/mac/OMAC.java
index 6758b314f..c9ea36ef9 100644
--- a/gnu/javax/crypto/mac/OMAC.java
+++ b/gnu/javax/crypto/mac/OMAC.java
@@ -1,5 +1,5 @@
/* OMAC.java --
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -65,7 +65,8 @@ import java.util.logging.Logger;
public class OMAC
implements IMac
{
- private static final Logger log = Logger.getLogger(OMAC.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(OMAC.class.getName()) : null;
private static final byte C1 = (byte) 0x87;
private static final byte C2 = 0x1b;
// Test key for OMAC-AES-128
diff --git a/gnu/javax/crypto/pad/BasePad.java b/gnu/javax/crypto/pad/BasePad.java
index feeaca2f0..50b3bf094 100644
--- a/gnu/javax/crypto/pad/BasePad.java
+++ b/gnu/javax/crypto/pad/BasePad.java
@@ -1,5 +1,5 @@
/* BasePad.java --
- Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -52,7 +52,8 @@ import java.util.logging.Logger;
public abstract class BasePad
implements IPad
{
- private static final Logger log = Logger.getLogger(BasePad.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(BasePad.class.getName()) : null;
/** The canonical name prefix of the padding algorithm. */
protected String name;
/** The block size, in bytes, for this instance. */
diff --git a/gnu/javax/crypto/pad/PKCS1_V1_5.java b/gnu/javax/crypto/pad/PKCS1_V1_5.java
index e303264ae..021107e69 100644
--- a/gnu/javax/crypto/pad/PKCS1_V1_5.java
+++ b/gnu/javax/crypto/pad/PKCS1_V1_5.java
@@ -1,5 +1,5 @@
/* PKCS1_V1_5.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -66,7 +66,8 @@ import java.util.logging.Logger;
public class PKCS1_V1_5
extends BasePad
{
- private static final Logger log = Logger.getLogger(PKCS1_V1_5.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(PKCS1_V1_5.class.getName()) : null;
private EME_PKCS1_V1_5 codec;
/**
diff --git a/gnu/javax/crypto/pad/PKCS7.java b/gnu/javax/crypto/pad/PKCS7.java
index 9dd67fc81..1ee839e5a 100644
--- a/gnu/javax/crypto/pad/PKCS7.java
+++ b/gnu/javax/crypto/pad/PKCS7.java
@@ -1,5 +1,5 @@
/* PKCS7.java --
- Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -65,7 +65,8 @@ import java.util.logging.Logger;
public final class PKCS7
extends BasePad
{
- private static final Logger log = Logger.getLogger(PKCS7.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(PKCS7.class.getName()) : null;
/**
* Trivial package-private constructor for use by the <i>Factory</i> class.
diff --git a/gnu/javax/crypto/pad/TBC.java b/gnu/javax/crypto/pad/TBC.java
index 5cd177058..9fcc41550 100644
--- a/gnu/javax/crypto/pad/TBC.java
+++ b/gnu/javax/crypto/pad/TBC.java
@@ -1,5 +1,5 @@
/* TBC.java --
- Copyright (C) 2001, 2002, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -64,7 +64,8 @@ import java.util.logging.Logger;
public final class TBC
extends BasePad
{
- private static final Logger log = Logger.getLogger(TBC.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(TBC.class.getName()) : null;
/**
* Trivial package-private constructor for use by the <i>Factory</i> class.
diff --git a/gnu/javax/crypto/prng/CSPRNG.java b/gnu/javax/crypto/prng/CSPRNG.java
index ecea2f469..04d381a7a 100644
--- a/gnu/javax/crypto/prng/CSPRNG.java
+++ b/gnu/javax/crypto/prng/CSPRNG.java
@@ -1,5 +1,5 @@
/* CSPRNG.java -- continuously-seeded pseudo-random number generator.
- Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -87,7 +87,9 @@ import java.util.logging.Logger;
public class CSPRNG
extends BasePRNG
{
- private static final Logger log = Logger.getLogger(CSPRNG.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(CSPRNG.class.getName()) : null;
+
/**
* Property name for the list of files to read for random values. The mapped
* value is a list with the following values:
@@ -325,20 +327,24 @@ public class CSPRNG
attrib.put(PROGRAM_SOURCES, l);
l = new LinkedList();
for (int i = 0; (s = getProperty(OTHER + i)) != null; i++)
- try
- {
- Class c = Class.forName(s.trim());
- l.add(c.newInstance());
- }
- catch (ClassNotFoundException cnfe)
- {
- }
- catch (InstantiationException ie)
- {
- }
- catch (IllegalAccessException iae)
- {
- }
+ {
+ try
+ {
+ l.add((EntropySource)Class.forName(s.trim()).newInstance());
+ }
+ catch (ClassNotFoundException cnfe)
+ {
+ // ignore
+ }
+ catch (InstantiationException ie)
+ {
+ // ignore
+ }
+ catch (IllegalAccessException iae)
+ {
+ // ignore
+ }
+ }
attrib.put(OTHER_SOURCES, l);
instance.init(attrib);
return instance;
diff --git a/gnu/javax/crypto/sasl/SaslInputStream.java b/gnu/javax/crypto/sasl/SaslInputStream.java
index 6a6c85751..e505d4525 100644
--- a/gnu/javax/crypto/sasl/SaslInputStream.java
+++ b/gnu/javax/crypto/sasl/SaslInputStream.java
@@ -1,5 +1,5 @@
/* SaslInputStream.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -57,7 +57,8 @@ import javax.security.sasl.SaslServer;
public class SaslInputStream
extends InputStream
{
- private static final Logger log = Logger.getLogger(SaslInputStream.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SaslInputStream.class.getName()) : null;
private SaslClient client;
private SaslServer server;
private int maxRawSendSize;
diff --git a/gnu/javax/crypto/sasl/SaslOutputStream.java b/gnu/javax/crypto/sasl/SaslOutputStream.java
index 0de1ce850..eee0ba0f9 100644
--- a/gnu/javax/crypto/sasl/SaslOutputStream.java
+++ b/gnu/javax/crypto/sasl/SaslOutputStream.java
@@ -1,5 +1,5 @@
/* SaslOutputStream.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -56,7 +56,8 @@ import javax.security.sasl.SaslServer;
public class SaslOutputStream
extends OutputStream
{
- private static final Logger log = Logger.getLogger(SaslOutputStream.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SaslOutputStream.class.getName()) : null;
private SaslClient client;
private SaslServer server;
private int maxRawSendSize;
diff --git a/gnu/javax/crypto/sasl/srp/SRPClient.java b/gnu/javax/crypto/sasl/srp/SRPClient.java
index 8e44e4ead..c20d477c7 100644
--- a/gnu/javax/crypto/sasl/srp/SRPClient.java
+++ b/gnu/javax/crypto/sasl/srp/SRPClient.java
@@ -1,5 +1,5 @@
/* SRPClient.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -87,7 +87,8 @@ public class SRPClient
extends ClientMechanism
implements SaslClient
{
- private static final Logger log = Logger.getLogger(SRPClient.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SRPClient.class.getName()) : null;
private String uid; // the unique key for this type of client
private String U; // the authentication identity
BigInteger N, g, A, B;
diff --git a/gnu/javax/crypto/sasl/srp/SRPServer.java b/gnu/javax/crypto/sasl/srp/SRPServer.java
index fca5c3bf3..c92ada4b3 100644
--- a/gnu/javax/crypto/sasl/srp/SRPServer.java
+++ b/gnu/javax/crypto/sasl/srp/SRPServer.java
@@ -1,5 +1,5 @@
/* SRPServer.java --
- Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006, 2010 Free Software Foundation, Inc.
This file is a part of GNU Classpath.
@@ -79,7 +79,8 @@ public class SRPServer
extends ServerMechanism
implements SaslServer
{
- private static final Logger log = Logger.getLogger(SRPServer.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(SRPServer.class.getName()) : null;
private String U = null; // client's username
private BigInteger N, g, A, B;
private byte[] s; // salt
diff --git a/gnu/javax/security/auth/login/ConfigFileParser.java b/gnu/javax/security/auth/login/ConfigFileParser.java
index 5c4c4261f..bebd036f9 100644
--- a/gnu/javax/security/auth/login/ConfigFileParser.java
+++ b/gnu/javax/security/auth/login/ConfigFileParser.java
@@ -1,5 +1,5 @@
/* ConfigFileParser.java -- JAAS Login Configuration default syntax parser
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -91,9 +91,11 @@ import javax.security.auth.login.AppConfigurationEntry;
*/
public final class ConfigFileParser
{
- private static final Logger log = Logger.getLogger(ConfigFileParser.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(ConfigFileParser.class.getName()) : null;
+
private ConfigFileTokenizer cft;
- private Map map = new HashMap();
+ private final Map map = new HashMap();
// default 0-arguments constructor
diff --git a/gnu/javax/security/auth/login/ConfigFileTokenizer.java b/gnu/javax/security/auth/login/ConfigFileTokenizer.java
index fc35bf772..f120f4e60 100644
--- a/gnu/javax/security/auth/login/ConfigFileTokenizer.java
+++ b/gnu/javax/security/auth/login/ConfigFileTokenizer.java
@@ -1,5 +1,5 @@
/* ConfigFileTokenizer.java -- JAAS Login Configuration default syntax tokenizer
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -81,7 +81,9 @@ import java.util.logging.Logger;
*/
public class ConfigFileTokenizer
{
- private static final Logger log = Logger.getLogger(ConfigFileParser.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(ConfigFileParser.class.getName()) : null;
+
/** A constant indicating that the end of the stream has been read. */
public static final int TT_EOF = -1;
/** A constant indicating that a word token has been read. */
@@ -92,7 +94,7 @@ public class ConfigFileTokenizer
public String sval;
public int ttype;
- private BufferedReader br;
+ private final BufferedReader br;
boolean initialised;
private CPStringBuilder sb;
private int sbNdx;
@@ -103,10 +105,7 @@ public class ConfigFileTokenizer
/** Trivial constructor. */
ConfigFileTokenizer(Reader r)
{
- super();
-
br = r instanceof BufferedReader ? (BufferedReader) r : new BufferedReader(r);
- initialised = false;
}
// Class methods
diff --git a/gnu/javax/security/auth/login/GnuConfiguration.java b/gnu/javax/security/auth/login/GnuConfiguration.java
index 20d8f3afd..6afe1cd19 100644
--- a/gnu/javax/security/auth/login/GnuConfiguration.java
+++ b/gnu/javax/security/auth/login/GnuConfiguration.java
@@ -1,5 +1,5 @@
/* GnuConfiguration.java -- GNU Classpath implementation of JAAS Configuration
- Copyright (C) 2006 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2010 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -128,7 +128,9 @@ import javax.security.auth.login.Configuration;
*/
public final class GnuConfiguration extends Configuration
{
- private static final Logger log = Logger.getLogger(GnuConfiguration.class.getName());
+ private static final Logger log = gnu.java.security.Configuration.DEBUG ?
+ Logger.getLogger(GnuConfiguration.class.getName()) : null;
+
/**
* The internal map of login modules keyed by application name. Each entry in
* this map is a {@link List} of {@link AppConfigurationEntry}s for that
diff --git a/java/math/BigInteger.java b/java/math/BigInteger.java
index 953e557a8..00f5c70ad 100644
--- a/java/math/BigInteger.java
+++ b/java/math/BigInteger.java
@@ -1,5 +1,6 @@
/* java.math.BigInteger -- Arbitary precision integers
- Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2010
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -64,7 +65,8 @@ import java.util.logging.Logger;
*/
public class BigInteger extends Number implements Comparable<BigInteger>
{
- private static final Logger log = Logger.getLogger(BigInteger.class.getName());
+ private static final Logger log = Configuration.DEBUG ?
+ Logger.getLogger(BigInteger.class.getName()) : null;
/** All integers are stored in 2's-complement form.
* If words == null, the ival is the value of this BigInteger.