Author: markt Date: Sun Jan 8 18:42:10 2012 New Revision: 1228908 URL: http://svn.apache.org/viewvc?rev=1228908&view=rev Log: Mark unused code as deprecated Based on the UCDector report
Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/Ascii.java tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java tomcat/trunk/java/org/apache/tomcat/util/buf/HexUtils.java tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java tomcat/trunk/java/org/apache/tomcat/util/buf/UDecoder.java tomcat/trunk/java/org/apache/tomcat/util/buf/UEncoder.java Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/Ascii.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/Ascii.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/Ascii.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/Ascii.java Sun Jan 8 18:42:10 2012 @@ -75,8 +75,9 @@ public final class Ascii { /** * Returns the upper case equivalent of the specified ASCII character. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ - + @Deprecated public static int toUpper(int c) { return toUpper[c & 0xff] & 0xff; } @@ -91,32 +92,36 @@ public final class Ascii { /** * Returns true if the specified ASCII character is upper or lower case. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ - + @Deprecated public static boolean isAlpha(int c) { return isAlpha[c & 0xff]; } /** * Returns true if the specified ASCII character is upper case. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ - + @Deprecated public static boolean isUpper(int c) { return isUpper[c & 0xff]; } /** * Returns true if the specified ASCII character is lower case. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ - + @Deprecated public static boolean isLower(int c) { return isLower[c & 0xff]; } /** * Returns true if the specified ASCII character is white space. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ - + @Deprecated public static boolean isWhite(int c) { return isWhite[c & 0xff]; } @@ -214,6 +219,10 @@ public final class Ascii { return n; } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public static long parseLong(char[] b, int off, int len) throws NumberFormatException { Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/B2CConverter.java Sun Jan 8 18:42:10 2012 @@ -81,6 +81,10 @@ public class B2CConverter { private ReadConvertor conv; private String encoding; + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated protected B2CConverter() { } Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/ByteChunk.java Sun Jan 8 18:42:10 2012 @@ -141,7 +141,10 @@ public final class ByteChunk implements allocate( initial, -1 ); } - //-------------------- + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public ByteChunk getClone() { try { return (ByteChunk)this.clone(); @@ -195,6 +198,10 @@ public final class ByteChunk implements isSet=true; } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public void setOptimizedWrite(boolean optimizedWrite) { this.optimizedWrite = optimizedWrite; } @@ -295,7 +302,9 @@ public final class ByteChunk implements * * @param c * @throws IOException + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void append( char c ) throws IOException { @@ -399,6 +408,10 @@ public final class ByteChunk implements } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public int substract(ByteChunk src) throws IOException { @@ -663,7 +676,11 @@ public final class ByteChunk implements return true; } - /* Returns true if the message bytes start with the specified byte array */ + /** + * Returns true if the message bytes start with the specified byte array. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public boolean startsWith(byte[] b2) { byte[] b1 = buff; if (b1 == null && b2 == null) { @@ -732,7 +749,10 @@ public final class ByteChunk implements return hashBytes( buff, start, end-start); } - // hash ignoring case + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public int hashIgnoreCase() { return hashBytesIC( buff, start, end-start ); } @@ -860,7 +880,9 @@ public final class ByteChunk implements * @return The position of the first instance a byte that is not * in the list of bytes to search for or -1 if no such byte * is found. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public static int findNotBytes(byte bytes[], int start, int end, byte b[]) { int blen = b.length; int offset = start; Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/C2BConverter.java Sun Jan 8 18:42:10 2012 @@ -47,20 +47,35 @@ public final class C2BConverter { this.enc=encoding; } - /** Create a converter + /** + * Create a converter + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public C2BConverter(String encoding) throws IOException { this( new ByteChunk(1024), encoding ); } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public ByteChunk getByteChunk() { return bb; } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public String getEncoding() { return enc; } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public void setByteChunk(ByteChunk bb) { this.bb=bb; ios.setByteChunk( bb ); @@ -98,8 +113,11 @@ public final class C2BConverter { conv.write( c ); } - /** Convert a message bytes chars to bytes + /** + * Convert a message bytes chars to bytes + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public final void convert(MessageBytes mb ) throws IOException { int type=mb.getType(); if( type==MessageBytes.T_BYTES ) { Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/CharChunk.java Sun Jan 8 18:42:10 2012 @@ -86,6 +86,10 @@ public final class CharChunk implements // -------------------- + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public CharChunk getClone() { try { return (CharChunk)this.clone(); @@ -111,6 +115,10 @@ public final class CharChunk implements end=0; } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public void reset() { buff=null; } @@ -306,8 +314,11 @@ public final class CharChunk implements } - /** Add data to the buffer + /** + * Add data to the buffer. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void append( StringBuilder sb ) throws IOException { @@ -394,6 +405,10 @@ public final class CharChunk implements } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public int substract(CharChunk src) throws IOException { @@ -517,6 +532,10 @@ public final class CharChunk implements return new String(buff, start, end-start); } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public int getInt() { return Ascii.parseInt(buff, start, @@ -588,6 +607,10 @@ public final class CharChunk implements return true; } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public boolean equals(byte b2[], int off2, int len2) { char b1[]=buff; if( b2==null && b1==null ) { @@ -658,7 +681,10 @@ public final class CharChunk implements return code; } - // hash ignoring case + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public int hashIgnoreCase() { int code=0; for (int i = start; i < end; i++) { Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/HexUtils.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/HexUtils.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/HexUtils.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/HexUtils.java Sun Jan 8 18:42:10 2012 @@ -72,7 +72,9 @@ public final class HexUtils { /** * Provide a mechanism for ensuring this class is loaded. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public static void load() { // Nothing to do } Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/MessageBytes.java Sun Jan 8 18:42:10 2012 @@ -78,6 +78,10 @@ public final class MessageBytes implemen return factory.newInstance(); } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public MessageBytes getClone() { try { return (MessageBytes)this.clone(); @@ -128,7 +132,9 @@ public final class MessageBytes implemen /** Set the encoding. If the object was constructed from bytes[]. any * previous conversion is reset. * If no encoding is set, we'll use 8859-1. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void setCharset(Charset charset) { if( !byteC.isNull() ) { // if the encoding changes we need to reset the conversion results @@ -365,7 +371,9 @@ public final class MessageBytes implemen /** * Returns true if the message bytes starts with the specified string. * @param s the string + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public boolean startsWith(String s) { switch (type) { case T_STR: @@ -444,6 +452,10 @@ public final class MessageBytes implemen } } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public int indexOf(char c) { return indexOf( c, 0); } @@ -521,8 +533,11 @@ public final class MessageBytes implemen private long longValue; private boolean hasLongValue=false; - /** Set the buffer to the representation of an int + /** + * Set the buffer to the representation of an int + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void setInt(int i) { byteC.allocate(16, 32); int current = i; @@ -606,8 +621,11 @@ public final class MessageBytes implemen } // Used for headers conversion - /** Convert the buffer to an int, cache the value + /** + * Convert the buffer to an int, cache the value + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public int getInt() { if( hasIntValue ) { @@ -650,6 +668,10 @@ public final class MessageBytes implemen private static MessageBytesFactory factory=new MessageBytesFactory(); + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public static void setFactory( MessageBytesFactory mbf ) { factory=mbf; } Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/UDecoder.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/UDecoder.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/UDecoder.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/UDecoder.java Sun Jan 8 18:42:10 2012 @@ -62,7 +62,9 @@ public final class UDecoder { /** URLDecode, will modify the source. Includes converting * '+' to ' '. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void convert( ByteChunk mb ) throws IOException { @@ -129,7 +131,9 @@ public final class UDecoder { /** In-buffer processing - the buffer will be modified * Includes converting '+' to ' '. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void convert( CharChunk mb ) throws IOException { @@ -192,7 +196,9 @@ public final class UDecoder { /** URLDecode, will modify the source * Includes converting '+' to ' '. + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. */ + @Deprecated public void convert(MessageBytes mb) throws IOException { @@ -230,6 +236,10 @@ public final class UDecoder { // XXX Old code, needs to be replaced !!!! // + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public final String convert(String str) { return convert(str, true); Modified: tomcat/trunk/java/org/apache/tomcat/util/buf/UEncoder.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/buf/UEncoder.java?rev=1228908&r1=1228907&r2=1228908&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/buf/UEncoder.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/buf/UEncoder.java Sun Jan 8 18:42:10 2012 @@ -48,6 +48,10 @@ public final class UEncoder { initSafeChars(); } + /** + * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards. + */ + @Deprecated public void setEncoding( String s ) { encoding=s; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org