You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by br...@apache.org on 2016/06/12 11:56:22 UTC
commons-crypto git commit: Remove unused methods
Repository: commons-crypto
Updated Branches:
refs/heads/master 305b82608 -> 71daf8286
Remove unused methods
Project: http://git-wip-us.apache.org/repos/asf/commons-crypto/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-crypto/commit/71daf828
Tree: http://git-wip-us.apache.org/repos/asf/commons-crypto/tree/71daf828
Diff: http://git-wip-us.apache.org/repos/asf/commons-crypto/diff/71daf828
Branch: refs/heads/master
Commit: 71daf8286102c117c08039a5ac24a03fca4c969e
Parents: 305b826
Author: Benedikt Ritter <be...@gmail.com>
Authored: Sun Jun 12 13:56:10 2016 +0200
Committer: Benedikt Ritter <be...@gmail.com>
Committed: Sun Jun 12 13:56:10 2016 +0200
----------------------------------------------------------------------
.../commons/crypto/utils/ReflectionUtils.java | 58 --------------------
1 file changed, 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-crypto/blob/71daf828/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 88d292a..9aa334b 100644
--- a/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
+++ b/src/main/java/org/apache/commons/crypto/utils/ReflectionUtils.java
@@ -89,64 +89,6 @@ 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 returned.An
- * exception is thrown if the returned class does not implement the named
- * interface.
- *
- * @param <U> type for the class.
- * @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>, or
- * <code>defaultValue</code>.
- */
- public static <U> Class<? extends U> getClass(String name,
- Class<? extends U> defaultValue, Class<U> xface) {
- try {
- Class<?> theClass = null;
- if (name != null && !name.isEmpty()) {
- theClass = getClassByName(name);
- }
- if (theClass == null) {
- theClass = defaultValue;
- }
- if (theClass != null && !xface.isAssignableFrom(theClass)) {
- throw new RuntimeException(theClass + " not " + xface.getName());
- } else if (theClass != null) {
- return theClass.asSubclass(xface);
- } else {
- return null;
- }
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
- * 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
- * returned.
- *
- * @param name the class name.
- * @param defaultValue default value.
- * @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);
- if (valueString == null) {
- return defaultValue;
- }
- try {
- return getClassByName(valueString);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException(e);
- }
- }
-
- /**
* Loads a class by name.
*
* @param name the class name.