[tomcat] 02/02: Clean-up, formatting. No functional change.
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 commit 15a1d0e0c4fbfb3afe5d3c86f8f1dd8655c38499 Author: Mark Thomas AuthorDate: Fri May 5 16:45:14 2023 +0100 Clean-up, formatting. No functional change. Preparation before back-porting RFC 918 priorities. --- .../tomcat/util/http/parser/Authorization.java | 21 +-- .../org/apache/tomcat/util/http/parser/Cookie.java | 48 +++-- .../apache/tomcat/util/http/parser/EntityTag.java | 10 +- java/org/apache/tomcat/util/http/parser/Host.java | 12 +- .../apache/tomcat/util/http/parser/HttpParser.java | 210 + .../apache/tomcat/util/http/parser/MediaType.java | 6 +- .../tomcat/util/http/parser/MediaTypeCache.java| 13 +- .../apache/tomcat/util/http/parser/TokenList.java | 22 +-- .../apache/tomcat/util/http/parser/Upgrade.java| 2 +- 9 files changed, 146 insertions(+), 198 deletions(-) diff --git a/java/org/apache/tomcat/util/http/parser/Authorization.java b/java/org/apache/tomcat/util/http/parser/Authorization.java index 8afba9bd1c..bb7b1a16e9 100644 --- a/java/org/apache/tomcat/util/http/parser/Authorization.java +++ b/java/org/apache/tomcat/util/http/parser/Authorization.java @@ -32,8 +32,8 @@ public class Authorization { static { // Digest field types. // Note: These are more relaxed than RFC2617. This adheres to the -// recommendation of RFC2616 that servers are tolerant of buggy -// clients when they can be so without ambiguity. +// recommendation of RFC2616 that servers are tolerant of buggy +// clients when they can be so without ambiguity. fieldTypes.put("username", FieldType.QUOTED_STRING); fieldTypes.put("realm", FieldType.QUOTED_STRING); fieldTypes.put("nonce", FieldType.QUOTED_STRING); @@ -58,21 +58,18 @@ public class Authorization { /** - * Parses an HTTP Authorization header for DIGEST authentication as per RFC - * 2617 section 3.2.2. + * Parses an HTTP Authorization header for DIGEST authentication as per RFC 2617 section 3.2.2. * * @param input The header value to parse * - * @return A map of directives and values as {@link String}s or - * null if a parsing error occurs. Although the - * values returned are {@link String}s they will have been - * validated to ensure that they conform to RFC 2617. + * @return A map of directives and values as {@link String}s or null if a parsing error occurs. + * Although the values returned are {@link String}s they will have been validated to ensure that they + * conform to RFC 2617. * - * @throws IllegalArgumentException If the header does not conform to RFC - * 2617 - * @throws java.io.IOException If an error occurs while reading the input + * @throws IllegalArgumentException If the header does not conform to RFC 2617 + * @throws java.io.IOException If an error occurs while reading the input */ -public static Map parseAuthorizationDigest (StringReader input) +public static Map parseAuthorizationDigest(StringReader input) throws IllegalArgumentException, IOException { Map result = new HashMap<>(); diff --git a/java/org/apache/tomcat/util/http/parser/Cookie.java b/java/org/apache/tomcat/util/http/parser/Cookie.java index 7a0310ceaf..63b30d76c7 100644 --- a/java/org/apache/tomcat/util/http/parser/Cookie.java +++ b/java/org/apache/tomcat/util/http/parser/Cookie.java @@ -27,27 +27,28 @@ import org.apache.tomcat.util.res.StringManager; /** - * Cookie header parser based on RFC6265 - * The parsing of cookies using RFC6265 is more relaxed that the - * specification in the following ways: + * + * Cookie header parser based on RFC6265 + * + * + * The parsing of cookies using RFC6265 is more relaxed that the specification in the following ways: + * * - * Values 0x80 to 0xFF are permitted in cookie-octet to support the use of - * UTF-8 in cookie values as used by HTML 5. - * For cookies without a value, the '=' is not required after the name as - * some browsers do not sent it. + * Values 0x80 to 0xFF are permitted in cookie-octet to support the use of UTF-8 in cookie values as used by HTML + * 5. + * For cookies without a value, the '=' is not required after the name as some browsers do not sent it. * - * - * Implementation note: - * This class has been carefully tuned. Before committing any changes, ensure - * that the TesterCookiePerformance unit test continues to give results within - * 1% for the old and new parsers. + * + * Implementation note: + * This class has been carefully tuned. Before committing any changes, ensure that the TesterCookiePerformance unit test + * continues to giv
[tomcat] 02/02: Clean-up changelog
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit b894ac363aec45be80c279323db4960a898ecd7f Author: Mark Thomas AuthorDate: Thu Jun 11 19:33:00 2020 +0100 Clean-up changelog --- webapps/docs/changelog.xml | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index a3c1f3c..888f540 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -90,12 +90,12 @@ shell feature that is not available by default on Solaris 10. (markt) -Remove bndlib from dependencies as it is not required. Pull request -provided by Raymond Augé. (markt) +64513: Remove bndlib from dependencies as it is not required. +Pull request provided by Raymond Augé. (markt) -Bnd files don't need to be filtered (save some work). Pull request -provided by Raymond Augé. (rotty3000) +64515: Bnd files don't need to be filtered (save some work). +Pull request provided by Raymond Augé. (markt) - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Clean-up. Fix Javdoc warnings on newer JREs. Align with 8.5.x.
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 commit d7bd7729b686929e33559e16635e8a235dcecf48 Author: Mark Thomas AuthorDate: Mon Feb 17 11:17:14 2020 + Clean-up. Fix Javdoc warnings on newer JREs. Align with 8.5.x. --- java/org/apache/catalina/core/StandardContext.java | 550 + 1 file changed, 244 insertions(+), 306 deletions(-) diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 85a6147..d96deab 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -14,8 +14,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - - package org.apache.catalina.core; import java.io.BufferedReader; @@ -201,7 +199,6 @@ public class StandardContext extends ContainerBase // - Instance Variables - /** * Allow multipart/form-data requests to be parsed even when the * target servlet doesn't specify @MultipartConfig or have a @@ -259,7 +256,6 @@ public class StandardContext extends ContainerBase * The set of application listeners that are required to have limited access * to ServletContext methods. See Servlet 3.0 section 4.4. */ - private final Set noPluggabilityListeners = new HashSet(); /** @@ -767,6 +763,7 @@ public class StandardContext extends ContainerBase */ private boolean webXmlNamespaceAware = Globals.STRICT_SERVLET_COMPLIANCE; + /** * Attribute value used to turn on/off TLD processing */ @@ -867,12 +864,10 @@ public class StandardContext extends ContainerBase /** * If an HttpClient keep-alive timer thread has been started by this web * application and is still running, should Tomcat change the context class - * loader from the current - * {@link org.apache.catalina.loader.WebappClassLoaderBase} to - * {@link org.apache.catalina.loader.WebappClassLoaderBase#parent} to - * prevent a memory leak? Note that the keep-alive timer thread will stop on - * its own once the keep-alives all expire however, on a busy system that - * might not happen for some time. + * loader from the current {@link ClassLoader} to + * {@link ClassLoader#getParent()} to prevent a memory leak? Note that the + * keep-alive timer thread will stop on its own once the keep-alives all + * expire however, on a busy system that might not happen for some time. */ private boolean clearReferencesHttpClientKeepAliveThread = true; @@ -880,7 +875,7 @@ public class StandardContext extends ContainerBase * Should Tomcat renew the threads of the thread pool when the application * is stopped to avoid memory leaks because of uncleaned ThreadLocal * variables. This also requires that the threadRenewalDelay property of the - * StandardThreadExecutor of ThreadPoolExecutor be set to a positive value. + * StandardThreadExecutor or ThreadPoolExecutor be set to a positive value. */ private boolean renewThreadsWhenStoppingContext = true; @@ -1280,7 +1275,7 @@ public class StandardContext extends ContainerBase /** - * Is caching allowed ? + * @return Is caching allowed? */ public boolean isCachingAllowed() { return cachingAllowed; @@ -1289,6 +1284,8 @@ public class StandardContext extends ContainerBase /** * Set caching allowed flag. + * + * @param cachingAllowed {@code true} to permit caching */ public void setCachingAllowed(boolean cachingAllowed) { this.cachingAllowed = cachingAllowed; @@ -1297,6 +1294,8 @@ public class StandardContext extends ContainerBase /** * Set allow linking. + * + * @param allowLinking {@code true} to permit linking */ public void setAllowLinking(boolean allowLinking) { this.allowLinking = allowLinking; @@ -1304,7 +1303,7 @@ public class StandardContext extends ContainerBase /** - * Is linking allowed. + * @return Is linking allowed? */ public boolean isAllowLinking() { return allowLinking; @@ -1364,6 +1363,8 @@ public class StandardContext extends ContainerBase /** * Set cache TTL. + * + * @param cacheTTL Time between cache entry revalidation in milliseconds */ public void setCacheTTL(int cacheTTL) { this.cacheTTL = cacheTTL; @@ -1371,7 +1372,7 @@ public class StandardContext extends ContainerBase /** - * Get cache TTL. + * @return cache TTL. */ public int getCacheTTL() { return cacheTTL; @@ -1379,7 +1380,7 @@ public class StandardContext extends ContainerBase /** - * Return the maximum size of the cache
[tomcat] 02/02: Clean-up. Align with 9.0.x
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 2b31bed3a0951f77a5fae77e8fcf7e26ffa3ee7a Author: Mark Thomas AuthorDate: Mon Feb 17 11:11:36 2020 + Clean-up. Align with 9.0.x --- java/org/apache/catalina/core/StandardContext.java | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/java/org/apache/catalina/core/StandardContext.java b/java/org/apache/catalina/core/StandardContext.java index 80e6558..24a5296 100644 --- a/java/org/apache/catalina/core/StandardContext.java +++ b/java/org/apache/catalina/core/StandardContext.java @@ -3610,13 +3610,10 @@ public class StandardContext extends ContainerBase */ @Override public String[] findServletMappings() { - synchronized (servletMappingsLock) { String results[] = new String[servletMappings.size()]; -return - (servletMappings.keySet().toArray(results)); +return servletMappings.keySet().toArray(results); } - } @@ -5084,7 +5081,7 @@ public class StandardContext extends ContainerBase Boolean.valueOf((getCluster() != null)), Boolean.valueOf(distributable))); } -if ( (getCluster() != null) && distributable) { +if ((getCluster() != null) && distributable) { try { contextManager = getCluster().createManager(getName()); } catch (Exception ex) { @@ -6129,8 +6126,7 @@ public class StandardContext extends ContainerBase } else return false; } -if ( (urlPattern.startsWith("/")) && -(urlPattern.indexOf("*.") < 0)) { +if (urlPattern.startsWith("/") && !urlPattern.contains("*.")) { checkUnusualURLPattern(urlPattern); return true; } else - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: clean-up
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit b91143221e4fe12d95373afcfe4818c4e6660220 Author: Mark Thomas AuthorDate: Mon Feb 17 10:05:09 2020 + clean-up --- test/javax/servlet/http/TestHttpServlet.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/javax/servlet/http/TestHttpServlet.java b/test/javax/servlet/http/TestHttpServlet.java index 8de9d9f..28be42d 100644 --- a/test/javax/servlet/http/TestHttpServlet.java +++ b/test/javax/servlet/http/TestHttpServlet.java @@ -158,8 +158,6 @@ public class TestHttpServlet extends TomcatBaseTest { } - - @Test public void testDoOptions() throws Exception { doTestDoOptions(new OptionsServlet(), "GET, HEAD, OPTIONS"); - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Clean-up
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 commit 55944c22724f5688cf32dd5b7befb1b084866e3b Author: Mark Thomas AuthorDate: Thu Nov 14 21:59:21 2019 + Clean-up --- res/findbugs/filter-false-positives.xml | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/res/findbugs/filter-false-positives.xml b/res/findbugs/filter-false-positives.xml index 50bca30..21ed1b0 100644 --- a/res/findbugs/filter-false-positives.xml +++ b/res/findbugs/filter-false-positives.xml @@ -701,7 +701,9 @@ - + + + @@ -914,4 +916,4 @@ - \ No newline at end of file + - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org
[tomcat] 02/02: Clean-up. Remove unused code. Align with 9.0.x.
This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git commit 5ee1614cfe9ee6511d77c422957eadc486db1dc8 Author: Mark Thomas AuthorDate: Fri Sep 13 16:56:09 2019 +0100 Clean-up. Remove unused code. Align with 9.0.x. --- java/org/apache/coyote/http2/Stream.java | 14 +- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/java/org/apache/coyote/http2/Stream.java b/java/org/apache/coyote/http2/Stream.java index 6b6eb93..32de3fe 100644 --- a/java/org/apache/coyote/http2/Stream.java +++ b/java/org/apache/coyote/http2/Stream.java @@ -376,7 +376,7 @@ public class Stream extends AbstractStream implements HeaderEmitter { headerState = HEADER_STATE_REGULAR; } -switch(name) { +switch (name) { case ":method": { if (coyoteRequest.method().isNull()) { coyoteRequest.method().setString(value); @@ -777,7 +777,6 @@ public class Stream extends AbstractStream implements HeaderEmitter { private volatile boolean closed = false; private volatile StreamException reset = null; private volatile boolean endOfStreamSent = false; -private volatile boolean writeInterest = false; /* The write methods are synchronized to ensure that only one thread at * a time is able to access the buffer. Without this protection, a @@ -943,21 +942,10 @@ public class Stream extends AbstractStream implements HeaderEmitter { if (getWindowSize() > 0 && allocationManager.isWaitingForStream() || handler.getWindowSize() > 0 && allocationManager.isWaitingForConnection() || dataLeft) { -writeInterest = true; return false; } else { return true; } - -} - -synchronized boolean isRegisteredForWrite() { -if (writeInterest) { -writeInterest = false; -return true; -} else { -return false; -} } @Override - To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org