tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject [tomcat] branch 7.0.x updated: Fix Javadoc warnings when building with Java 13
Date Tue, 12 Nov 2019 10:49:31 GMT
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new aacd9cb  Fix Javadoc warnings when building with Java 13
aacd9cb is described below

commit aacd9cbee771ef00bb0e381c7814336c38068739
Author: Mark Thomas <markt@apache.org>
AuthorDate: Tue Nov 12 10:47:41 2019 +0000

    Fix Javadoc warnings when building with Java 13
---
 java/org/apache/tomcat/util/buf/CharChunk.java     | 22 +++++++++++++++++++
 .../apache/tomcat/util/buf/LocalStrings.properties |  2 ++
 java/org/apache/tomcat/util/buf/MessageBytes.java  | 25 +++++++++++++++++++---
 java/org/apache/tomcat/util/buf/StringCache.java   | 25 ++++++++++++++++++----
 java/org/apache/tomcat/util/buf/UDecoder.java      | 25 +++++++++++++++-------
 java/org/apache/tomcat/util/buf/UEncoder.java      | 10 ++++++---
 6 files changed, 91 insertions(+), 18 deletions(-)

diff --git a/java/org/apache/tomcat/util/buf/CharChunk.java b/java/org/apache/tomcat/util/buf/CharChunk.java
index 9428649..f0babe6 100644
--- a/java/org/apache/tomcat/util/buf/CharChunk.java
+++ b/java/org/apache/tomcat/util/buf/CharChunk.java
@@ -40,6 +40,10 @@ public final class CharChunk extends AbstractChunk implements CharSequence
{
         /**
          * Read new characters.
          *
+         * @param cbuf Buffer to read the characters into
+         * @param off  Offset for target buffer
+         * @param len  length of data to read
+         *
          * @return The number of characters read
          *
          * @throws IOException If an I/O error occurs during reading
@@ -92,6 +96,7 @@ public final class CharChunk extends AbstractChunk implements CharSequence
{
     // --------------------
 
     /**
+     * @return {@link #clone()}
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -359,6 +364,12 @@ public final class CharChunk extends AbstractChunk implements CharSequence
{
 
 
     /**
+     * @param src Destination for subtracted data
+     *
+     * @return count of bytes removed
+     *
+     * @throws IOException If an I/O error occurs
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -495,6 +506,8 @@ public final class CharChunk extends AbstractChunk implements CharSequence
{
 
 
     /**
+     * @return Buffer content parsed into an int
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -588,6 +601,13 @@ public final class CharChunk extends AbstractChunk implements CharSequence
{
 
 
     /**
+     * @param b2    Byte array to test
+     * @param off2  Offset for byte array
+     * @param len2  Length of byte array
+     *
+     * @return {@code true} if the contents of the provided byte array are
+     *         equal to the contents of this object
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -685,6 +705,8 @@ public final class CharChunk extends AbstractChunk implements CharSequence
{
 
 
     /**
+     * @return case insensitive (all lower case) hash code
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
diff --git a/java/org/apache/tomcat/util/buf/LocalStrings.properties b/java/org/apache/tomcat/util/buf/LocalStrings.properties
index 9fe0db8..1f5e8b0 100644
--- a/java/org/apache/tomcat/util/buf/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/buf/LocalStrings.properties
@@ -17,6 +17,8 @@ b2cConverter.unknownEncoding=The character encoding [{0}] is not supported
 
 c2bConverter.recycleFailed=Failed to recycle the C2B Converter. Creating new BufferedWriter,
WriteConvertor and IntermediateOutputStream.
 
+uDecoder.eof=End of file (EOF)
+uDecoder.noSlash=The encoded slash character is not allowed
 uDecoder.convertHexDigit.notHex=[{0}] is not a hexadecimal digit
 uDecoder.urlDecode.conversionError=Failed to decode [{0}] using character set [{1}]
 uDecoder.urlDecode.missingDigit=Failed to decode [{0}] because the % character must be followed
by two hexademical digits
diff --git a/java/org/apache/tomcat/util/buf/MessageBytes.java b/java/org/apache/tomcat/util/buf/MessageBytes.java
index a83f83c..a1fbc9e 100644
--- a/java/org/apache/tomcat/util/buf/MessageBytes.java
+++ b/java/org/apache/tomcat/util/buf/MessageBytes.java
@@ -82,6 +82,7 @@ public final class MessageBytes implements Cloneable, Serializable {
     }
 
     /**
+     * @return {@link #clone()}
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -392,8 +393,10 @@ public final class MessageBytes implements Cloneable, Serializable {
 
 
     /**
-     * Returns true if the message bytes starts with the specified string.
      * @param s the string
+     *
+     * @return true if the message bytes starts with the specified string.
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -476,6 +479,10 @@ public final class MessageBytes implements Cloneable, Serializable {
     }
 
     /**
+     * @param c the character
+     *
+     * @return index of the specified character.
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -504,9 +511,11 @@ public final class MessageBytes implements Cloneable, Serializable {
     }
 
     /**
-     * Returns true if the message bytes starts with the specified string.
      * @param c the character
      * @param starting The start position
+     *
+     * @return index of the specified character.
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -563,6 +572,9 @@ public final class MessageBytes implements Cloneable, Serializable {
 
     /**
      * Set the buffer to the representation of an int
+     *
+     * @param i The int
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -606,7 +618,9 @@ public final class MessageBytes implements Cloneable, Serializable {
         type=T_BYTES;
     }
 
-    /** Set the buffer to the representation of an long
+    /**
+     * Set the buffer to the representation of a long.
+     * @param l The long
      */
     public void setLong(long l) {
         byteC.allocate(32, 64);
@@ -651,6 +665,9 @@ public final class MessageBytes implements Cloneable, Serializable {
     // Used for headers conversion
     /**
      * Convert the buffer to an int, cache the value
+     *
+     * @return The contents of the buffer parsed as an int
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -699,6 +716,8 @@ public final class MessageBytes implements Cloneable, Serializable {
     private static MessageBytesFactory factory=new MessageBytesFactory();
 
     /**
+     * @param mbf New factory for MessageByte instances
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
diff --git a/java/org/apache/tomcat/util/buf/StringCache.java b/java/org/apache/tomcat/util/buf/StringCache.java
index de74c4f..dc9a768 100644
--- a/java/org/apache/tomcat/util/buf/StringCache.java
+++ b/java/org/apache/tomcat/util/buf/StringCache.java
@@ -22,6 +22,8 @@ import java.util.HashMap;
 import java.util.Map.Entry;
 import java.util.TreeMap;
 
+import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 /**
  * This class implements a String cache for ByteChunk and CharChunk.
  *
@@ -30,8 +32,7 @@ import java.util.TreeMap;
 public class StringCache {
 
 
-    private static final org.apache.juli.logging.Log log=
-        org.apache.juli.logging.LogFactory.getLog( StringCache.class );
+    private static final Log log = LogFactory.getLog(StringCache.class);
 
 
     // ------------------------------------------------------- Static Variables
@@ -447,7 +448,9 @@ public class StringCache {
 
     /**
      * Compare given byte chunk with byte array.
-     * Return -1, 0 or +1 if inferior, equal, or superior to the String.
+     * @param name The name to compare
+     * @param compareTo The compared to data
+     * @return -1, 0 or +1 if inferior, equal, or superior to the String.
      */
     protected static final int compare(ByteChunk name, byte[] compareTo) {
         int result = 0;
@@ -481,6 +484,8 @@ public class StringCache {
     /**
      * Find an entry given its name in the cache and return the associated
      * String.
+     * @param name The name to find
+     * @return the corresponding value
      */
     protected static final String find(ByteChunk name) {
         int pos = findClosest(name, bcCache, bcCache.length);
@@ -497,6 +502,10 @@ public class StringCache {
      * Find an entry given its name in a sorted array of map elements.
      * This will return the index for the closest inferior or equal item in the
      * given array.
+     * @param name The name to find
+     * @param array The array in which to look
+     * @param len The effective length of the array
+     * @return the position of the best match
      */
     protected static final int findClosest(ByteChunk name, ByteEntry[] array,
             int len) {
@@ -542,7 +551,9 @@ public class StringCache {
 
     /**
      * Compare given char chunk with char array.
-     * Return -1, 0 or +1 if inferior, equal, or superior to the String.
+     * @param name The name to compare
+     * @param compareTo The compared to data
+     * @return -1, 0 or +1 if inferior, equal, or superior to the String.
      */
     protected static final int compare(CharChunk name, char[] compareTo) {
         int result = 0;
@@ -576,6 +587,8 @@ public class StringCache {
     /**
      * Find an entry given its name in the cache and return the associated
      * String.
+     * @param name The name to find
+     * @return the corresponding value
      */
     protected static final String find(CharChunk name) {
         int pos = findClosest(name, ccCache, ccCache.length);
@@ -591,6 +604,10 @@ public class StringCache {
      * Find an entry given its name in a sorted array of map elements.
      * This will return the index for the closest inferior or equal item in the
      * given array.
+     * @param name The name to find
+     * @param array The array in which to look
+     * @param len The effective length of the array
+     * @return the position of the best match
      */
     protected static final int findClosest(CharChunk name, CharEntry[] array,
             int len) {
diff --git a/java/org/apache/tomcat/util/buf/UDecoder.java b/java/org/apache/tomcat/util/buf/UDecoder.java
index 2cf00a0..0689d1e 100644
--- a/java/org/apache/tomcat/util/buf/UDecoder.java
+++ b/java/org/apache/tomcat/util/buf/UDecoder.java
@@ -53,7 +53,7 @@ public final class UDecoder {
     }
 
     /** Unexpected end of data. */
-    private static final IOException EXCEPTION_EOF = new DecodeException("EOF");
+    private static final IOException EXCEPTION_EOF = new DecodeException(sm.getString("uDecoder.eof"));
 
     /** %xx with not-hex digit */
     private static final IOException EXCEPTION_NOT_HEX_DIGIT = new DecodeException(
@@ -67,8 +67,10 @@ public final class UDecoder {
     {
     }
 
-    /** URLDecode, will modify the source.  Includes converting
-     *  '+' to ' '.
+    /**
+     * URLDecode, will modify the source.
+     * @param mb The URL encoded bytes
+     * @throws IOException Invalid %xx URL encoding
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -138,8 +140,10 @@ public final class UDecoder {
     // -------------------- Additional methods --------------------
     // XXX What do we do about charset ????
 
-    /** In-buffer processing - the buffer will be modified
-     *  Includes converting  '+' to ' '.
+    /**
+     * In-buffer processing - the buffer will be modified.
+     * @param mb The URL encoded chars
+     * @throws IOException Invalid %xx URL encoding
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -207,8 +211,10 @@ public final class UDecoder {
         mb.setEnd( idx );
     }
 
-    /** URLDecode, will modify the source
-     *  Includes converting  '+' to ' '.
+    /**
+     * URLDecode, will modify the source Includes converting  '+' to ' '.
+     * @param mb The URL encoded String, bytes or chars
+     * @throws IOException Invalid %xx URL encoding
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -254,6 +260,9 @@ public final class UDecoder {
     // XXX Old code, needs to be replaced !!!!
     //
     /**
+     * %xx decoding of a query string. FIXME: this is inefficient.
+     * @param str The URL encoded string
+     * @return the decoded string
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -320,7 +329,7 @@ public final class UDecoder {
                 char res = (char) Integer.parseInt(
                         str.substring(strPos + 1, strPos + 3), 16);
                 if (noSlash && (res == '/')) {
-                    throw new IllegalArgumentException("noSlash");
+                    throw new IllegalArgumentException(sm.getString("uDecoder.noSlash"));
                 }
                 dec.append(res);
                 strPos += 3;
diff --git a/java/org/apache/tomcat/util/buf/UEncoder.java b/java/org/apache/tomcat/util/buf/UEncoder.java
index 307d50f..3c64f1f 100644
--- a/java/org/apache/tomcat/util/buf/UEncoder.java
+++ b/java/org/apache/tomcat/util/buf/UEncoder.java
@@ -70,15 +70,16 @@ public final class UEncoder {
      * on instances created by this constructor will throw an
      * {@link IllegalStateException}.
      *
-     * @param safeCharsSet
-     *            safe characters for this encoder
+     * @param safeCharsSet safe characters for this encoder
      */
     public UEncoder(SafeCharsSet safeCharsSet) {
         this.safeChars = safeCharsSet.getSafeChars();
         readOnlySafeChars = true;
     }
 
-     /**
+    /**
+     * @param s    Encoding to use
+     *
      * @deprecated Unused. Will be removed in Tomcat 8.0.x onwards.
      */
     @Deprecated
@@ -100,6 +101,9 @@ public final class UEncoder {
     * @param s string to be encoded
     * @param start the beginning index, inclusive
     * @param end the ending index, exclusive
+    *
+    * @return A new CharChunk contained the URL encoded string
+    *
     * @throws IOException If an I/O error occurs
     */
    public CharChunk encodeURL(String s, int start, int end)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message