Remove unused code
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Mar 2011 13:10:33 +0000 (13:10 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 15 Mar 2011 13:10:33 +0000 (13:10 +0000)
Fix some Eclipse warnings

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1081765 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/jasper/util/Enumerator.java
java/org/apache/jasper/xmlparser/ASCIIReader.java
java/org/apache/jasper/xmlparser/TreeNode.java
java/org/apache/jasper/xmlparser/UTF8Reader.java
java/org/apache/jasper/xmlparser/XMLEncodingDetector.java
java/org/apache/jasper/xmlparser/XMLString.java
java/org/apache/jasper/xmlparser/XMLStringBuffer.java

index f827077..3b0dc4e 100644 (file)
@@ -20,11 +20,9 @@ package org.apache.jasper.util;
 
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.NoSuchElementException;
 
 
@@ -45,31 +43,6 @@ public final class Enumerator<T> implements Enumeration<T> {
 
 
     /**
-     * Return an Enumeration over the values of the specified Collection.
-     *
-     * @param collection Collection whose values should be enumerated
-     */
-    public Enumerator(Collection<T> collection) {
-
-        this(collection.iterator());
-
-    }
-
-
-    /**
-     * Return an Enumeration over the values of the specified Collection.
-     *
-     * @param collection Collection whose values should be enumerated
-     * @param clone true to clone iterator
-     */
-    public Enumerator(Collection<T> collection, boolean clone) {
-
-        this(collection.iterator(), clone);
-
-    }
-
-
-    /**
      * Return an Enumeration over the values returned by the
      * specified Iterator.
      *
@@ -106,31 +79,6 @@ public final class Enumerator<T> implements Enumeration<T> {
     }
 
 
-    /**
-     * Return an Enumeration over the values of the specified Map.
-     *
-     * @param map Map whose values should be enumerated
-     */
-    public Enumerator(Map<?,T> map) {
-
-        this(map.values().iterator());
-
-    }
-
-
-    /**
-     * Return an Enumeration over the values of the specified Map.
-     *
-     * @param map Map whose values should be enumerated
-     * @param clone true to clone iterator
-     */
-    public Enumerator(Map<?,T> map, boolean clone) {
-
-        this(map.values().iterator(), clone);
-
-    }
-
-
     // ----------------------------------------------------- Instance Variables
 
 
index 5ca1b49..b8c8c56 100644 (file)
@@ -31,15 +31,7 @@ import org.apache.jasper.compiler.Localizer;
  *
  * @version $Id$
  */
-public class ASCIIReader
-    extends Reader {
-
-    //
-    // Constants
-    //
-
-    /** Default byte buffer size (2048). */
-    public static final int DEFAULT_BUFFER_SIZE = 2048;
+public class ASCIIReader extends Reader {
 
     //
     // Data
index 6a71b69..dc23f67 100644 (file)
@@ -45,18 +45,6 @@ public class TreeNode {
 
 
     /**
-     * Construct a new node with no parent.
-     *
-     * @param name The name of this node
-     */
-    public TreeNode(String name) {
-
-        this(name, null);
-
-    }
-
-
-    /**
      * Construct a new node with the specified parent.
      *
      * @param name The name of this node
@@ -254,32 +242,6 @@ public class TreeNode {
 
 
     /**
-     * Remove any existing value for the specified attribute name.
-     *
-     * @param name The attribute name to remove
-     */
-    public void removeAttribute(String name) {
-
-        if (attributes != null)
-            attributes.remove(name);
-
-    }
-
-
-    /**
-     * Remove a child node from this node, if it is one.
-     *
-     * @param node The child node to remove
-     */
-    public void removeNode(TreeNode node) {
-
-        if (children != null)
-            children.remove(node);
-
-    }
-
-
-    /**
      * Set the body text associated with this node (if any).
      *
      * @param body The body text (if any)
index a09b60f..5dff697 100644 (file)
@@ -35,13 +35,6 @@ public class UTF8Reader
     private final org.apache.juli.logging.Log log=
         org.apache.juli.logging.LogFactory.getLog( UTF8Reader.class );
     
-    //
-    // Constants
-    //
-
-    /** Default byte buffer size (2048). */
-    public static final int DEFAULT_BUFFER_SIZE = 2048;
-
     // debugging
 
     /** Debug read. */
index 63c1321..f25e82e 100644 (file)
@@ -1068,7 +1068,6 @@ public class XMLEncodingDetector {
 
         private InputStream fInputStream;
         private byte[] fData;
-        private int fStartOffset;
         private int fEndOffset;
         private int fOffset;
         private int fLength;
@@ -1077,21 +1076,12 @@ public class XMLEncodingDetector {
         public RewindableInputStream(InputStream is) {
             fData = new byte[DEFAULT_XMLDECL_BUFFER_SIZE];
             fInputStream = is;
-            fStartOffset = 0;
             fEndOffset = -1;
             fOffset = 0;
             fLength = 0;
             fMark = 0;
         }
 
-        public void setStartOffset(int offset) {
-            fStartOffset = offset;
-        }
-
-        public void rewind() {
-            fOffset = fStartOffset;
-        }
-
         @Override
         public int read() throws IOException {
             int b = 0;
@@ -1199,12 +1189,12 @@ public class XMLEncodingDetector {
         }
 
         @Override
-        public void mark(int howMuch) {
+        public synchronized void mark(int howMuch) {
             fMark = fOffset;
         }
 
         @Override
-        public void reset() {
+        public synchronized void reset() {
             fOffset = fMark;
         }
 
index a6b36b9..7f995f8 100644 (file)
@@ -72,31 +72,6 @@ public class XMLString {
     public XMLString() {
     } // <init>()
 
-    /**
-     * Constructs an XMLString structure preset with the specified
-     * values.
-     * 
-     * @param ch     The character array.
-     * @param offset The offset into the character array.
-     * @param length The length of characters from the offset.
-     */
-    public XMLString(char[] ch, int offset, int length) {
-        setValues(ch, offset, length);
-    } // <init>(char[],int,int)
-
-    /**
-     * Constructs an XMLString structure with copies of the values in
-     * the given structure.
-     * <p>
-     * <strong>Note:</strong> This does not copy the character array;
-     * only the reference to the array is copied.
-     *
-     * @param string The XMLString to copy.
-     */
-    public XMLString(XMLString string) {
-        setValues(string);
-    } // <init>(XMLString)
-
     //
     // Public methods
     //
@@ -135,29 +110,6 @@ public class XMLString {
         this.length = -1;
     } // clear()
 
-    /**
-     * Returns true if the contents of this XMLString structure and
-     * the specified array are equal.
-     * 
-     * @param ch     The character array.
-     * @param offset The offset into the character array.
-     * @param length The length of characters from the offset.
-     */
-    public boolean equals(char[] ch, int offset, int length) {
-        if (ch == null) {
-            return false;
-        }
-        if (this.length != length) {
-            return false;
-        }
-
-        for (int i=0; i<length; i++) {
-            if (this.ch[this.offset+i] != ch[offset+i] ) {
-                return false;
-            }
-        }
-        return true;
-    } // equals(char[],int,int):boolean
 
     /**
      * Returns true if the contents of this XMLString structure and
index 63357ce..9c08dd4 100644 (file)
@@ -76,30 +76,6 @@ public class XMLStringBuffer
         ch = new char[size];
     } // <init>(int)
 
-    /** Constructs a string buffer from a char. */
-    public XMLStringBuffer(char c) {
-        this(1);
-        append(c);
-    } // <init>(char)
-
-    /** Constructs a string buffer from a String. */
-    public XMLStringBuffer(String s) {
-        this(s.length());
-        append(s);
-    } // <init>(String)
-
-    /** Constructs a string buffer from the specified character array. */
-    public XMLStringBuffer(char[] ch, int offset, int length) {
-        this(length);
-        append(ch, offset, length);
-    } // <init>(char[],int,int)
-
-    /** Constructs a string buffer from the specified XMLString. */
-    public XMLStringBuffer(XMLString s) {
-        this(s.length);
-        append(s);
-    } // <init>(XMLString)
-
     //
     // Public methods
     //