From 7979e2cbf96d280a18a1ba0973a0050f1efce2ee Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 9 Apr 2009 16:20:23 +0000 Subject: [PATCH] Drop some unused methods git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@763723 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tomcat/util/IntrospectionUtils.java | 106 --------------------- 1 file changed, 106 deletions(-) diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java b/java/org/apache/tomcat/util/IntrospectionUtils.java index 83bdfdf74..61b3f70c2 100644 --- a/java/org/apache/tomcat/util/IntrospectionUtils.java +++ b/java/org/apache/tomcat/util/IntrospectionUtils.java @@ -701,117 +701,11 @@ public final class IntrospectionUtils { return getClassPath(jarsV); } - // -------------------- Mapping command line params to setters - - public static boolean processArgs(Object proxy, String args[]) - throws Exception { - String args0[] = null; - if (null != findMethod(proxy.getClass(), "getOptions1", new Class[] {})) { - args0 = (String[]) callMethod0(proxy, "getOptions1"); - } - - if (args0 == null) { - //args0=findVoidSetters(proxy.getClass()); - args0 = findBooleanSetters(proxy.getClass()); - } - Hashtable h = null; - if (null != findMethod(proxy.getClass(), "getOptionAliases", - new Class[] {})) { - h = (Hashtable) callMethod0(proxy, - "getOptionAliases"); - } - return processArgs(proxy, args, args0, null, h); - } - - public static boolean processArgs(Object proxy, String args[], - String args0[], String args1[], - Hashtable aliases) throws Exception { - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - if (arg.startsWith("-")) - arg = arg.substring(1); - if (aliases != null && aliases.get(arg) != null) - arg = (String) aliases.get(arg); - - if (args0 != null) { - boolean set = false; - for (int j = 0; j < args0.length; j++) { - if (args0[j].equalsIgnoreCase(arg)) { - setProperty(proxy, args0[j], "true"); - set = true; - break; - } - } - if (set) - continue; - } - if (args1 != null) { - for (int j = 0; j < args1.length; j++) { - if (args1[j].equalsIgnoreCase(arg)) { - i++; - if (i >= args.length) - return false; - setProperty(proxy, arg, args[i]); - break; - } - } - } else { - // if args1 is not specified,assume all other options have param - i++; - if (i >= args.length) - return false; - setProperty(proxy, arg, args[i]); - } - - } - return true; - } - // -------------------- other utils -------------------- public static void clear() { objectMethods.clear(); } - public static String[] findVoidSetters(Class c) { - Method m[] = findMethods(c); - if (m == null) - return null; - Vector v = new Vector(); - for (int i = 0; i < m.length; i++) { - if (m[i].getName().startsWith("set") - && m[i].getParameterTypes().length == 0) { - String arg = m[i].getName().substring(3); - v.addElement(unCapitalize(arg)); - } - } - String s[] = new String[v.size()]; - for (int i = 0; i < s.length; i++) { - s[i] = v.elementAt(i); - } - return s; - } - - public static String[] findBooleanSetters(Class c) { - Method m[] = findMethods(c); - if (m == null) - return null; - Vector v = new Vector(); - for (int i = 0; i < m.length; i++) { - if (m[i].getName().startsWith("set") - && m[i].getParameterTypes().length == 1 - && "boolean".equalsIgnoreCase(m[i].getParameterTypes()[0] - .getName())) { - String arg = m[i].getName().substring(3); - v.addElement(unCapitalize(arg)); - } - } - String s[] = new String[v.size()]; - for (int i = 0; i < s.length; i++) { - s[i] = v.elementAt(i); - } - return s; - } - static Hashtable,Method[]> objectMethods = new Hashtable,Method[]>(); -- 2.11.0