Repository: commons-crypto Updated Branches: refs/heads/master ea89d8023 -> 1e788102e
CRYPTO-33: avoid shadowing JVM class (Xianda Ke via Dapeng Sun) Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/1e788102 Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/1e788102 Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/1e788102 Branch: refs/heads/master Commit: 1e788102e18509b65d49aa42273f990f1281f3c0 Parents: ea89d80 Author: Sun Dapeng <s...@apache.org> Authored: Fri Apr 29 17:14:46 2016 +0800 Committer: Sun Dapeng <s...@apache.org> Committed: Fri Apr 29 17:14:46 2016 +0800 ---------------------------------------------------------------------- .../crypto/cipher/CipherTransformation.java | 2 +- .../commons/crypto/cipher/CryptoCipher.java | 10 +++--- .../apache/commons/crypto/cipher/JceCipher.java | 4 +-- .../commons/crypto/cipher/OpensslCipher.java | 2 +- .../commons/crypto/conf/ConfigurationKeys.java | 1 - .../random/OpensslCryptoRandomNative.java | 2 +- .../commons/crypto/random/OsCryptoRandom.java | 2 +- .../commons/crypto/stream/input/Input.java | 6 ++-- .../crypto/stream/output/ChannelOutput.java | 2 +- .../commons/crypto/stream/output/Output.java | 4 +-- .../crypto/stream/output/StreamOutput.java | 2 +- .../commons/crypto/utils/ReflectionUtils.java | 32 ++++++++++---------- 12 files changed, 34 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/cipher/CipherTransformation.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/CipherTransformation.java b/src/main/java/org/apache/commons/crypto/cipher/CipherTransformation.java index 4bf0883..f3480f2 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/CipherTransformation.java +++ b/src/main/java/org/apache/commons/crypto/cipher/CipherTransformation.java @@ -78,7 +78,7 @@ public enum CipherTransformation { } /** - * Converts to CipherTransformation from name, {@link #algorithmBlockSize} + * Converts to CipherTransformation from name, {@link #algorithmBlockSize} * is fixed for certain cipher transformation, just need to compare the name. * * @param name cipher transformation name http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java index a47de36..f8a861a 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java +++ b/src/main/java/org/apache/commons/crypto/cipher/CryptoCipher.java @@ -41,7 +41,7 @@ public interface CryptoCipher extends Closeable { int ENCRYPT_MODE = javax.crypto.Cipher.ENCRYPT_MODE; /** - * A constant representing decrypt mode. The mode constant to be used + * A constant representing decrypt mode. The mode constant to be used * when calling init method of the CryptoCipher. */ int DECRYPT_MODE = javax.crypto.Cipher.DECRYPT_MODE; @@ -55,14 +55,14 @@ public interface CryptoCipher extends Closeable { /** * Gets the properties for this cipher. - * + * * @return the properties for this cipher. */ Properties getProperties(); /** * Initializes the cipher with mode, key and iv. - * + * * @param mode {@link #ENCRYPT_MODE} or {@link #DECRYPT_MODE} * @param key crypto key for the cipher * @param params the algorithm parameters @@ -82,7 +82,7 @@ public interface CryptoCipher extends Closeable { /** * Continues a multiple-part encryption/decryption operation. The data * is encrypted or decrypted, depending on how this cipher was initialized. - * + * * @param inBuffer the input ByteBuffer * @param outBuffer the output ByteBuffer * @return int number of bytes stored in <code>output</code> @@ -111,7 +111,7 @@ public interface CryptoCipher extends Closeable { /** * Encrypts or decrypts data in a single-part operation, or finishes a * multiple-part operation. - * + * * @param inBuffer the input ByteBuffer * @param outBuffer the output ByteBuffer * @return int number of bytes stored in <code>output</code> http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java b/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java index 57750c2..1bc0ec8 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java +++ b/src/main/java/org/apache/commons/crypto/cipher/JceCipher.java @@ -81,7 +81,7 @@ public class JceCipher implements CryptoCipher { /** * Initializes the cipher with mode, key and iv. - * + * * @param mode {@link #ENCRYPT_MODE} or {@link #DECRYPT_MODE} * @param key crypto key for the cipher * @param params the algorithm parameters @@ -108,7 +108,7 @@ public class JceCipher implements CryptoCipher { /** * Continues a multiple-part encryption/decryption operation. The data * is encrypted or decrypted, depending on how this cipher was initialized. - * + * * @param inBuffer the input ByteBuffer * @param outBuffer the output ByteBuffer * @return int number of bytes stored in <code>output</code> http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/cipher/OpensslCipher.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/cipher/OpensslCipher.java b/src/main/java/org/apache/commons/crypto/cipher/OpensslCipher.java index e258466..782022e 100644 --- a/src/main/java/org/apache/commons/crypto/cipher/OpensslCipher.java +++ b/src/main/java/org/apache/commons/crypto/cipher/OpensslCipher.java @@ -43,7 +43,7 @@ public class OpensslCipher implements CryptoCipher { /** * Constructs a {@link org.apache.commons.crypto.cipher.CryptoCipher} using JNI into OpenSSL - * + * * @param props properties for OpenSSL cipher * @param transformation transformation for OpenSSL cipher * @throws GeneralSecurityException if OpenSSL cipher initialize failed http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java index 989cee3..dc1233b 100644 --- a/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java +++ b/src/main/java/org/apache/commons/crypto/conf/ConfigurationKeys.java @@ -17,7 +17,6 @@ */ package org.apache.commons.crypto.conf; -import org.apache.commons.crypto.cipher.CryptoCipher; import org.apache.commons.crypto.cipher.OpensslCipher; import org.apache.commons.crypto.random.CryptoRandom; http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/random/OpensslCryptoRandomNative.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/random/OpensslCryptoRandomNative.java b/src/main/java/org/apache/commons/crypto/random/OpensslCryptoRandomNative.java index c72cad6..8b4a0a1 100644 --- a/src/main/java/org/apache/commons/crypto/random/OpensslCryptoRandomNative.java +++ b/src/main/java/org/apache/commons/crypto/random/OpensslCryptoRandomNative.java @@ -39,5 +39,5 @@ public class OpensslCryptoRandomNative { * @return true if use {@link OpensslCryptoRandomNative} to * generate the user-specified number of random bits. */ - public native static boolean nextRandBytes(byte[] bytes); + public native static boolean nextRandBytes(byte[] bytes); } http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java b/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java index 4e6c063..1f895f0 100644 --- a/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java +++ b/src/main/java/org/apache/commons/crypto/random/OsCryptoRandom.java @@ -34,7 +34,7 @@ import org.apache.commons.logging.LogFactory; */ public class OsCryptoRandom extends Random implements CryptoRandom { public static final Log LOG = LogFactory.getLog(OsCryptoRandom.class); - + private static final long serialVersionUID = 6391500337172057900L; private final int RESERVOIR_LENGTH = 8192; http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/stream/input/Input.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/stream/input/Input.java b/src/main/java/org/apache/commons/crypto/stream/input/Input.java index a63c6ca..1657a7c 100644 --- a/src/main/java/org/apache/commons/crypto/stream/input/Input.java +++ b/src/main/java/org/apache/commons/crypto/stream/input/Input.java @@ -95,7 +95,7 @@ public interface Input { * Reads up to the specified number of bytes from a given position within a * stream and return the number of bytes read. * This does not change the current offset of the stream and is thread-safe. - * + * * An implementation may not support positioned read. If the implementation * doesn't support positioned read, it throws UnsupportedOperationException. * @@ -114,8 +114,8 @@ public interface Input { /** * Seeks to the given offset from the start of the stream. * The next read() will be from that location. - * - * An implementation may not support seek. If the implementation + * + * An implementation may not support seek. If the implementation * doesn't support seek, it throws UnsupportedOperationException. * * @param position the offset from the start of the stream. http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/stream/output/ChannelOutput.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/stream/output/ChannelOutput.java b/src/main/java/org/apache/commons/crypto/stream/output/ChannelOutput.java index bae82a8..9805484 100644 --- a/src/main/java/org/apache/commons/crypto/stream/output/ChannelOutput.java +++ b/src/main/java/org/apache/commons/crypto/stream/output/ChannelOutput.java @@ -22,7 +22,7 @@ import java.nio.ByteBuffer; import java.nio.channels.WritableByteChannel; /** - * The ChannelOutput class takes a <code>WritableByteChannel</code> object and wraps it as + * The ChannelOutput class takes a <code>WritableByteChannel</code> object and wraps it as * <code>Output</code> object acceptable by <code>CryptoOutputStream</code> as the output target. */ public class ChannelOutput implements Output { http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/stream/output/Output.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/stream/output/Output.java b/src/main/java/org/apache/commons/crypto/stream/output/Output.java index 903fcea..34f1610 100644 --- a/src/main/java/org/apache/commons/crypto/stream/output/Output.java +++ b/src/main/java/org/apache/commons/crypto/stream/output/Output.java @@ -52,7 +52,7 @@ public interface Output { * If some other I/O error occurs. */ int write(ByteBuffer src) throws IOException; - + /** * Flushes this output and forces any buffered output bytes * to be written out if the under layer output method support. @@ -65,7 +65,7 @@ public interface Output { * @throws IOException if an I/O error occurs. */ void flush() throws IOException; - + /** * Closes this output and releases any system resources associated * with the under layer output. http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/stream/output/StreamOutput.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/stream/output/StreamOutput.java b/src/main/java/org/apache/commons/crypto/stream/output/StreamOutput.java index e359c0d..ac7b691 100644 --- a/src/main/java/org/apache/commons/crypto/stream/output/StreamOutput.java +++ b/src/main/java/org/apache/commons/crypto/stream/output/StreamOutput.java @@ -22,7 +22,7 @@ import java.io.OutputStream; import java.nio.ByteBuffer; /** - * The StreamOutput class takes a <code>OutputStream</code> object and wraps it as + * The StreamOutput class takes a <code>OutputStream</code> object and wraps it as * <code>Output</code> object acceptable by <code>CryptoOutputStream</code> as the output target. */ public class StreamOutput implements Output { http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/1e788102/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java ---------------------------------------------------------------------- diff --git a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java index 4e1abd1..c864ced 100644 --- a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java +++ b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java @@ -87,21 +87,21 @@ public class ReflectionUtils { } } - /** + /** * Gets the value of the <code>name</code> property as a <code>Class</code> * implementing the interface specified by <code>xface</code>. - * If no such property is specified, then <code>defaultValue</code> is + * If no such property is specified, then <code>defaultValue</code> is * returned.An exception is thrown if the returned class does not * implement the named interface. - * + * * @param name the class name of default implementation. * @param defaultValue default value. * @param xface the interface implemented by the named class. - * @return property value as a <code>Class</code>, + * @return property value as a <code>Class</code>, * or <code>defaultValue</code>. */ - public static <U> Class<? extends U> getClass(String name, - Class<? extends U> defaultValue, + public static <U> Class<? extends U> getClass(String name, + Class<? extends U> defaultValue, Class<U> xface) { try { Class<?> theClass = null; @@ -123,15 +123,15 @@ public class ReflectionUtils { } } - /** + /** * Gets the value of the <code>name</code> property as a <code>Class</code>. - * If no such property is specified, then <code>defaultValue</code> is + * If no such property is specified, then <code>defaultValue</code> is * returned. - * + * * @param name the class name. * @param defaultValue default value. - * @return property value as a <code>Class</code>, - * or <code>defaultValue</code>. + * @return property value as a <code>Class</code>, + * or <code>defaultValue</code>. */ public static Class<?> getClass(String name, Class<?> defaultValue) { String valueString = System.getProperty(name); @@ -147,7 +147,7 @@ public class ReflectionUtils { /** * Loads a class by name. - * + * * @param name the class name. * @return the class object. * @throws ClassNotFoundException if the class is not found. @@ -160,12 +160,12 @@ public class ReflectionUtils { } return ret; } - + /** * Loads a class by name, returning null rather than throwing an exception * if it couldn't be loaded. This is to avoid the overhead of creating * an exception. - * + * * @param name the class name. * @return the class object, or null if it could not be found. */ @@ -182,11 +182,11 @@ public class ReflectionUtils { } Class<?> clazz = null; - WeakReference<Class<?>> ref = map.get(name); + WeakReference<Class<?>> ref = map.get(name); if (ref != null) { clazz = ref.get(); } - + if (clazz == null) { try { clazz = Class.forName(name, true, classLoader);