This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 43294ebaee Code clean-up - formatting. No functional change. 43294ebaee is described below commit 43294ebaee217f3042c2352afc64a0594062f7c1 Author: Mark Thomas <ma...@apache.org> AuthorDate: Thu May 22 12:02:36 2025 +0100 Code clean-up - formatting. No functional change. --- java/org/apache/tomcat/util/buf/AbstractChunk.java | 21 ++++++++++++++------- java/org/apache/tomcat/util/buf/ByteChunk.java | 22 ++++++++++------------ java/org/apache/tomcat/util/buf/HexUtils.java | 6 +++--- java/org/apache/tomcat/util/buf/StringCache.java | 6 +++--- java/org/apache/tomcat/util/buf/StringUtils.java | 6 +++--- 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/java/org/apache/tomcat/util/buf/AbstractChunk.java b/java/org/apache/tomcat/util/buf/AbstractChunk.java index bdc53c93e7..67c11aa942 100644 --- a/java/org/apache/tomcat/util/buf/AbstractChunk.java +++ b/java/org/apache/tomcat/util/buf/AbstractChunk.java @@ -85,6 +85,7 @@ public abstract class AbstractChunk implements Cloneable, Serializable { /** * Set the start position of the data in the buffer. + * * @param start the new start position */ public void setStart(int start) { @@ -105,6 +106,7 @@ public abstract class AbstractChunk implements Cloneable, Serializable { /** * Set the end position of the data in the buffer. + * * @param end the new end position */ public void setEnd(int end) { @@ -114,6 +116,7 @@ public abstract class AbstractChunk implements Cloneable, Serializable { /** * @return start + * * @deprecated Unused. This method will be removed in Tomcat 12. */ @Deprecated @@ -123,7 +126,9 @@ public abstract class AbstractChunk implements Cloneable, Serializable { /** * Set start. + * * @param off the new start + * * @deprecated Unused. This method will be removed in Tomcat 12. */ @Deprecated @@ -155,15 +160,15 @@ public abstract class AbstractChunk implements Cloneable, Serializable { /** - * Return the index of the first occurrence of the subsequence of - * the given String, or -1 if it is not found. + * Return the index of the first occurrence of the subsequence of the given String, or -1 if it is not found. * - * @param src the String to look for + * @param src the String to look for * @param srcStart the subsequence start in the String - * @param srcLen the subsequence length in the String + * @param srcLen the subsequence length in the String * @param myOffset the index on which to start the search in the buffer - * @return the position of the first character of the first occurrence - * of the subsequence in the buffer, or -1 if not found + * + * @return the position of the first character of the first occurrence of the subsequence in the buffer, or -1 if + * not found */ public int indexOf(String src, int srcStart, int srcLen, int myOffset) { char first = src.charAt(srcStart); @@ -171,7 +176,8 @@ public abstract class AbstractChunk implements Cloneable, Serializable { // Look for first char int srcEnd = srcStart + srcLen; - mainLoop: for (int i = myOffset + start; i <= (end - srcLen); i++) { + mainLoop: + for (int i = myOffset + start; i <= (end - srcLen); i++) { if (getBufferElement(i) != first) { continue; } @@ -225,6 +231,7 @@ public abstract class AbstractChunk implements Cloneable, Serializable { /** * @param index the element location in the buffer + * * @return the element */ protected abstract int getBufferElement(int index); diff --git a/java/org/apache/tomcat/util/buf/ByteChunk.java b/java/org/apache/tomcat/util/buf/ByteChunk.java index 6d26b9dd94..93fac3a57a 100644 --- a/java/org/apache/tomcat/util/buf/ByteChunk.java +++ b/java/org/apache/tomcat/util/buf/ByteChunk.java @@ -41,17 +41,13 @@ import java.nio.charset.StandardCharsets; * chars and Strings until the strings are needed. In addition, the charset is determined later, from headers or user * code. * <p> - * In a server it is very important to be able to operate on - * the original byte[] without converting everything to chars. - * Some protocols are ASCII only, and some allow different - * non-UNICODE encodings. The encoding is not known beforehand, - * and can even change during the execution of the protocol. - * ( for example a multipart message may have parts with different - * encoding ) + * In a server it is very important to be able to operate on the original byte[] without converting everything to chars. + * Some protocols are ASCII only, and some allow different non-UNICODE encodings. The encoding is not known beforehand, + * and can even change during the execution of the protocol. ( for example a multipart message may have parts with + * different encoding ) * <p> - * For HTTP, it is not very clear how the encoding of RequestURI - * and mime values can be determined, but it is a great advantage - * to be able to parse the request without converting to string. + * For HTTP, it is not very clear how the encoding of RequestURI and mime values can be determined, but it is a great + * advantage to be able to parse the request without converting to string. * * @author d...@sun.com * @author James Todd [go...@sun.com] @@ -566,7 +562,8 @@ public final class ByteChunk extends AbstractChunk { // entire byte array. This is expensive if only a small subset of the // bytes will be used. The code below is from Apache Harmony. CharBuffer cb; - if (malformedInputAction == CodingErrorAction.REPLACE && unmappableCharacterAction == CodingErrorAction.REPLACE) { + if (malformedInputAction == CodingErrorAction.REPLACE && + unmappableCharacterAction == CodingErrorAction.REPLACE) { cb = charset.decode(ByteBuffer.wrap(buff, start, end - start)); } else { cb = charset.newDecoder().onMalformedInput(malformedInputAction) @@ -701,9 +698,10 @@ public final class ByteChunk extends AbstractChunk { * <p> * NOTE: This only works for characters in the range 0-127. * - * @param c2 the array to compare to + * @param c2 the array to compare to * @param off2 offset * @param len2 length + * * @return <code>true</code> if the comparison succeeded, <code>false</code> otherwise */ public boolean equals(char[] c2, int off2, int len2) { diff --git a/java/org/apache/tomcat/util/buf/HexUtils.java b/java/org/apache/tomcat/util/buf/HexUtils.java index 55fe2107c4..949de67448 100644 --- a/java/org/apache/tomcat/util/buf/HexUtils.java +++ b/java/org/apache/tomcat/util/buf/HexUtils.java @@ -33,9 +33,9 @@ public final class HexUtils { /** * Table for HEX to DEC byte translation. */ - private static final int[] DEC = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, - 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 10, 11, 12, 13, 14, 15, }; + private static final int[] DEC = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 10, + 11, 12, 13, 14, 15, }; /** diff --git a/java/org/apache/tomcat/util/buf/StringCache.java b/java/org/apache/tomcat/util/buf/StringCache.java index 9f157017bf..7081f59d73 100644 --- a/java/org/apache/tomcat/util/buf/StringCache.java +++ b/java/org/apache/tomcat/util/buf/StringCache.java @@ -481,8 +481,8 @@ public class StringCache { * * @return the corresponding value * - * @deprecated Unused. Will be removed in Tomcat 11. - * Use {@link #find(ByteChunk, CodingErrorAction, CodingErrorAction)} + * @deprecated Unused. Will be removed in Tomcat 11. Use + * {@link #find(ByteChunk, CodingErrorAction, CodingErrorAction)} */ @Deprecated protected static final String find(ByteChunk name) { @@ -500,7 +500,7 @@ public class StringCache { * @return the corresponding value */ protected static String find(ByteChunk name, CodingErrorAction malformedInputAction, - CodingErrorAction unmappableCharacterAction) { + CodingErrorAction unmappableCharacterAction) { int pos = findClosest(name, bcCache, bcCache.length); if ((pos < 0) || (compare(name, bcCache[pos].name) != 0) || !(name.getCharset().equals(bcCache[pos].charset)) || !malformedInputAction.equals(bcCache[pos].malformedInputAction) || diff --git a/java/org/apache/tomcat/util/buf/StringUtils.java b/java/org/apache/tomcat/util/buf/StringUtils.java index 9419ee6dd7..0460053c17 100644 --- a/java/org/apache/tomcat/util/buf/StringUtils.java +++ b/java/org/apache/tomcat/util/buf/StringUtils.java @@ -101,11 +101,11 @@ public final class StringUtils { } /** - * Splits a comma-separated string into an array of String values. - * Whitespace around the commas is removed. - * Null or empty values will return a zero-element array. + * Splits a comma-separated string into an array of String values. Whitespace around the commas is removed. Null or + * empty values will return a zero-element array. * * @param s The string to split by commas. + * * @return An array of String values. */ public static String[] splitCommaSeparated(String s) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org