Author: markt
Date: Fri Jul 28 15:31:10 2017
New Revision: 1803284

URL: http://svn.apache.org/viewvc?rev=1803284&view=rev
Log:
Remove deprecated code

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSet.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSetBase.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/Rules.java
    tomcat/trunk/java/org/apache/tomcat/util/digester/RulesBase.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java?rev=1803284&r1=1803283&r2=1803284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/CallMethodRule.java Fri 
Jul 28 15:31:10 2017
@@ -14,15 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.tomcat.util.digester;
 
-
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.xml.sax.Attributes;
 
-
 /**
  * <p>Rule implementation that calls a method on an object on the stack
  * (normally the top/parent object), passing arguments collected from
@@ -63,7 +59,6 @@ import org.xml.sax.Attributes;
  * then it is always invoked, regardless of whether the parameters were
  * available or not (missing parameters are passed as null values).</p>
  */
-
 public class CallMethodRule extends Rule {
 
     // ----------------------------------------------------------- Constructors
@@ -76,11 +71,11 @@ public class CallMethodRule extends Rule
      * @param paramCount The number of parameters to collect, or
      *  zero for a single argument from the body of this element.
      */
-    public CallMethodRule(String methodName,
-                          int paramCount) {
+    public CallMethodRule(String methodName, int paramCount) {
         this(0, methodName, paramCount);
     }
 
+
     /**
      * Construct a "call method" rule with the specified method name.  The
      * parameter types (if any) default to java.lang.String.
@@ -93,10 +88,7 @@ public class CallMethodRule extends Rule
      * @param paramCount The number of parameters to collect, or
      *  zero for a single argument from the body of this element.
      */
-    public CallMethodRule(int targetOffset,
-                          String methodName,
-                          int paramCount) {
-
+    public CallMethodRule(int targetOffset, String methodName, int paramCount) 
{
         this.targetOffset = targetOffset;
         this.methodName = methodName;
         this.paramCount = paramCount;
@@ -108,9 +100,9 @@ public class CallMethodRule extends Rule
                 this.paramTypes[i] = String.class;
             }
         }
-        this.paramClassNames = null;
     }
 
+
     /**
      * Construct a "call method" rule with the specified method name.
      * The method should accept no parameters.
@@ -118,9 +110,7 @@ public class CallMethodRule extends Rule
      * @param methodName Method name of the parent method to call
      */
     public CallMethodRule(String methodName) {
-
         this(0, methodName, 0, null);
-
     }
 
 
@@ -144,10 +134,8 @@ public class CallMethodRule extends Rule
      *  Java wrapper class instead, such as <code>java.lang.Boolean.TYPE</code>
      *  for a <code>boolean</code> parameter)
      */
-    public CallMethodRule(  int targetOffset,
-                            String methodName,
-                            int paramCount,
-                            Class<?> paramTypes[]) {
+    public CallMethodRule(int targetOffset, String methodName, int paramCount,
+            Class<?> paramTypes[]) {
 
         this.targetOffset = targetOffset;
         this.methodName = methodName;
@@ -161,13 +149,11 @@ public class CallMethodRule extends Rule
             this.paramTypes = new Class[paramTypes.length];
             System.arraycopy(paramTypes, 0, this.paramTypes, 0, 
this.paramTypes.length);
         }
-        this.paramClassNames = null;
     }
 
 
     // ----------------------------------------------------- Instance Variables
 
-
     /**
      * The body text collected from this element.
      */
@@ -181,6 +167,7 @@ public class CallMethodRule extends Rule
      */
     protected final int targetOffset;
 
+
     /**
      * The method name to call on the parent object.
      */
@@ -200,20 +187,13 @@ public class CallMethodRule extends Rule
      */
     protected Class<?> paramTypes[] = null;
 
-    /**
-     * The names of the classes of the parameters to be collected.
-     * This attribute allows creation of the classes to be postponed until the 
digester is set.
-     *
-     * @deprecated Unused. This will be removed in Tomcat 9.
-     */
-    @Deprecated
-    protected final String paramClassNames[];
 
     /**
      * Should <code>MethodUtils.invokeExactMethod</code> be used for 
reflection.
      */
     protected boolean useExactMatch = false;
 
+
     // --------------------------------------------------------- Public Methods
 
     /**
@@ -225,40 +205,16 @@ public class CallMethodRule extends Rule
         return useExactMatch;
     }
 
+
     /**
      * Set whether <code>MethodUtils.invokeExactMethod</code>
      * should be used for the reflection.
      * @param useExactMatch The flag value
      */
-    public void setUseExactMatch(boolean useExactMatch)
-    {
+    public void setUseExactMatch(boolean useExactMatch) {
         this.useExactMatch = useExactMatch;
     }
 
-    /**
-     * Set the associated digester.
-     * If needed, this class loads the parameter classes from their names.
-     */
-    @Override
-    public void setDigester(Digester digester)
-    {
-        // call superclass
-        super.setDigester(digester);
-        // if necessary, load parameter classes
-        if (this.paramClassNames != null) {
-            this.paramTypes = new Class[paramClassNames.length];
-            for (int i = 0; i < this.paramClassNames.length; i++) {
-                try {
-                    this.paramTypes[i] =
-                            
digester.getClassLoader().loadClass(this.paramClassNames[i]);
-                } catch (ClassNotFoundException e) {
-                    // use the digester log
-                    digester.getLogger().error("(CallMethodRule) Cannot load 
class " + this.paramClassNames[i], e);
-                    this.paramTypes[i] = null; // Will cause NPE later
-                }
-            }
-        }
-    }
 
     /**
      * Process the start of this element.
@@ -433,11 +389,10 @@ public class CallMethodRule extends Rule
      */
     @Override
     public void finish() throws Exception {
-
         bodyText = null;
-
     }
 
+
     /**
      * Subclasses may override this method to perform additional processing of 
the
      * invoked method's result.
@@ -448,6 +403,7 @@ public class CallMethodRule extends Rule
         // do nothing
     }
 
+
     /**
      * Render a printable version of this Rule.
      */
@@ -471,6 +427,4 @@ public class CallMethodRule extends Rule
         sb.append("]");
         return sb.toString();
     }
-
-
-}
+}
\ No newline at end of file

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java?rev=1803284&r1=1803283&r2=1803284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/Digester.java Fri Jul 28 
15:31:10 2017
@@ -584,34 +584,6 @@ public class Digester extends DefaultHan
 
 
     /**
-     * @return the namespace URI that will be applied to all subsequently
-     * added <code>Rule</code> objects.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 9
-     */
-    @Deprecated
-    public String getRuleNamespaceURI() {
-        return getRules().getNamespaceURI();
-    }
-
-
-    /**
-     * Set the namespace URI that will be applied to all subsequently
-     * added <code>Rule</code> objects.
-     *
-     * @param ruleNamespaceURI Namespace URI that must match on all
-     *  subsequently added rules, or <code>null</code> for matching
-     *  regardless of the current namespace URI
-     *
-     * @deprecated Unused. Will be removed in Tomcat 9
-     */
-    @Deprecated
-    public void setRuleNamespaceURI(String ruleNamespaceURI) {
-        getRules().setNamespaceURI(ruleNamespaceURI);
-    }
-
-
-    /**
      * @return the SAXParser we will use to parse the input stream.  If there
      * is a problem creating the parser, return <code>null</code>.
      */
@@ -1526,21 +1498,7 @@ public class Digester extends DefaultHan
      * @param ruleSet The RuleSet instance to configure from
      */
     public void addRuleSet(RuleSet ruleSet) {
-
-        String oldNamespaceURI = getRuleNamespaceURI();
-        @SuppressWarnings("deprecation")
-        String newNamespaceURI = ruleSet.getNamespaceURI();
-        if (log.isDebugEnabled()) {
-            if (newNamespaceURI == null) {
-                log.debug("addRuleSet() with no namespace URI");
-            } else {
-                log.debug("addRuleSet() with namespace URI " + 
newNamespaceURI);
-            }
-        }
-        setRuleNamespaceURI(newNamespaceURI);
         ruleSet.addRuleInstances(this);
-        setRuleNamespaceURI(oldNamespaceURI);
-
     }
 
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSet.java?rev=1803284&r1=1803283&r2=1803284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSet.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSet.java Fri Jul 28 
15:31:10 2017
@@ -14,10 +14,8 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
 package org.apache.tomcat.util.digester;
 
-
 /**
  * <p>Public interface defining a shorthand means of configuring a complete
  * set of related <code>Rule</code> definitions, possibly associated with
@@ -34,26 +32,8 @@ package org.apache.tomcat.util.digester;
  *     your RuleSet to configure the necessary rules.</li>
  * </ul>
  */
-
 public interface RuleSet {
 
-
-    // ------------------------------------------------------------- Properties
-
-
-    /**
-     * @return the namespace URI that will be applied to all Rule instances
-     * created from this RuleSet.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 9
-     */
-    @Deprecated
-    public String getNamespaceURI();
-
-
-    // --------------------------------------------------------- Public Methods
-
-
     /**
      * Add the set of Rule instances defined in this RuleSet to the
      * specified <code>Digester</code> instance, associating them with
@@ -63,7 +43,5 @@ public interface RuleSet {
      * @param digester Digester instance to which the new Rule instances
      *  should be added.
      */
-    public void addRuleInstances(Digester digester);
-
-
+    void addRuleInstances(Digester digester);
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSetBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSetBase.java?rev=1803284&r1=1803283&r2=1803284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSetBase.java 
(original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/RuleSetBase.java Fri Jul 
28 15:31:10 2017
@@ -14,52 +14,15 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.tomcat.util.digester;
 
-
 /**
  * <p>Convenience base class that implements the {@link RuleSet} interface.
  * Concrete implementations should list all of their actual rule creation
  * logic in the <code>addRuleSet()</code> implementation.</p>
  */
-
 public abstract class RuleSetBase implements RuleSet {
 
-
-    // ----------------------------------------------------- Instance Variables
-
-
-    /**
-     * The namespace URI that all Rule instances created by this RuleSet
-     * will be associated with.
-     *
-     * @deprecated Unused. This will be removed in Tomcat 9.
-     */
-    @Deprecated
-    protected String namespaceURI = null;
-
-
-    // ------------------------------------------------------------- Properties
-
-
-    /**
-     * Return the namespace URI that will be applied to all Rule instances
-     * created from this RuleSet.
-     *
-     * @deprecated Unused. This will be removed in Tomcat 9.
-     */
-    @Deprecated
-    @Override
-    public String getNamespaceURI() {
-        return this.namespaceURI;
-    }
-
-
-    // --------------------------------------------------------- Public Methods
-
-
     /**
      * Add the set of Rule instances defined in this RuleSet to the
      * specified <code>Digester</code> instance, associating them with
@@ -71,6 +34,4 @@ public abstract class RuleSetBase implem
      */
     @Override
     public abstract void addRuleInstances(Digester digester);
-
-
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/Rules.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/Rules.java?rev=1803284&r1=1803283&r2=1803284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/Rules.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/Rules.java Fri Jul 28 
15:31:10 2017
@@ -14,27 +14,20 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.tomcat.util.digester;
 
-
 import java.util.List;
 
-
 /**
  * Public interface defining a collection of Rule instances (and corresponding
  * matching patterns) plus an implementation of a matching policy that selects
  * the rules that match a particular pattern of nested elements discovered
  * during parsing.
  */
-
 public interface Rules {
 
-
     // ------------------------------------------------------------- Properties
 
-
     /**
      * @return the Digester instance with which this Rules instance is
      * associated.
@@ -50,33 +43,8 @@ public interface Rules {
     public void setDigester(Digester digester);
 
 
-    /**
-     * @return the namespace URI that will be applied to all subsequently
-     * added <code>Rule</code> objects.
-     *
-     * @deprecated Unused. Will be removed in Tomcat 9
-     */
-    @Deprecated
-    public String getNamespaceURI();
-
-
-    /**
-     * Set the namespace URI that will be applied to all subsequently
-     * added <code>Rule</code> objects.
-     *
-     * @param namespaceURI Namespace URI that must match on all
-     *  subsequently added rules, or <code>null</code> for matching
-     *  regardless of the current namespace URI
-     *
-     * @deprecated Unused. Will be removed in Tomcat 9
-     */
-    @Deprecated
-    public void setNamespaceURI(String namespaceURI);
-
-
     // --------------------------------------------------------- Public Methods
 
-
     /**
      * Register a new Rule instance matching the specified pattern.
      *
@@ -116,6 +84,4 @@ public interface Rules {
      * @return a rules list
      */
     public List<Rule> rules();
-
-
 }

Modified: tomcat/trunk/java/org/apache/tomcat/util/digester/RulesBase.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/digester/RulesBase.java?rev=1803284&r1=1803283&r2=1803284&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/digester/RulesBase.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/digester/RulesBase.java Fri Jul 28 
15:31:10 2017
@@ -14,16 +14,12 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-
-
 package org.apache.tomcat.util.digester;
 
-
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 
-
 /**
  * <p>Default implementation of the <code>Rules</code> interface that supports
  * the standard rule matching behavior.  This class can also be used as a
@@ -40,13 +36,10 @@ import java.util.List;
  *      element, no matter how deeply the pair is nested.</li>
  * </ul>
  */
-
 public class RulesBase implements Rules {
 
-
     // ----------------------------------------------------- Instance Variables
 
-
     /**
      * The set of registered Rule instances, keyed by the matching pattern.
      * Each value is a List containing the Rules for that pattern, in the
@@ -78,7 +71,6 @@ public class RulesBase implements Rules
 
     // ------------------------------------------------------------- Properties
 
-
     /**
      * Return the Digester instance with which this Rules instance is
      * associated.
@@ -96,44 +88,15 @@ public class RulesBase implements Rules
      */
     @Override
     public void setDigester(Digester digester) {
-
         this.digester = digester;
         for (Rule item : rules) {
             item.setDigester(digester);
         }
-
-    }
-
-
-    /**
-     * Return the namespace URI that will be applied to all subsequently
-     * added <code>Rule</code> objects.
-     */
-    @Override
-    public String getNamespaceURI() {
-        return this.namespaceURI;
-    }
-
-
-    /**
-     * Set the namespace URI that will be applied to all subsequently
-     * added <code>Rule</code> objects.
-     *
-     * @param namespaceURI Namespace URI that must match on all
-     *  subsequently added rules, or <code>null</code> for matching
-     *  regardless of the current namespace URI
-     */
-    @Override
-    public void setNamespaceURI(String namespaceURI) {
-
-        this.namespaceURI = namespaceURI;
-
     }
 
 
     // --------------------------------------------------------- Public Methods
 
-
     /**
      * Register a new Rule instance matching the specified pattern.
      *
@@ -148,7 +111,6 @@ public class RulesBase implements Rules
             pattern = pattern.substring(0, patternLength-1);
         }
 
-
         List<Rule> list = cache.get(pattern);
         if (list == null) {
             list = new ArrayList<>();
@@ -162,7 +124,6 @@ public class RulesBase implements Rules
         if (this.namespaceURI != null) {
             rule.setNamespaceURI(this.namespaceURI);
         }
-
     }
 
 
@@ -171,10 +132,8 @@ public class RulesBase implements Rules
      */
     @Override
     public void clear() {
-
         cache.clear();
         rules.clear();
-
     }
 
 
@@ -232,7 +191,6 @@ public class RulesBase implements Rules
 
     // ------------------------------------------------------ Protected Methods
 
-
     /**
      * Return a List of Rule instances for the specified pattern that also
      * match the specified namespace URI (if any).  If there are no such
@@ -263,6 +221,4 @@ public class RulesBase implements Rules
         }
         return results;
     }
-
-
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to