[GitHub] [tomcat] markt-asf commented on issue #252: 8.5.x

2020-04-02 Thread GitBox
markt-asf commented on issue #252: 8.5.x
URL: https://github.com/apache/tomcat/pull/252#issuecomment-607731339
 
 
   I can see why this is necessary and I support making the necessary changes 
to Tomcat to support solving this problem. The patch as proposed cannot be 
applied as the o.a.t.util package should not have a dependency on o.a.catalina. 
It should be possible to use the HttpServletRequest instead. I'll take a look 
at a variation on this patch for master and then back-port.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] lkirchev commented on issue #252: 8.5.x

2020-04-02 Thread GitBox
lkirchev commented on issue #252: 8.5.x
URL: https://github.com/apache/tomcat/pull/252#issuecomment-607765082
 
 
   Thanks a lot Mark! Yes, you are right, I overlooked the dependency I 
introduced. I added another commit with a proposal for replacing 
o.a.c.c.Request with HttpServletRequest. 
   Only to mention that in the TestCookieProcessorGeneration the usage of the 
newly introduced dummy implementation of HttpServletRequest could be replace 
just with nulls - this reference is never used in the two implementations of 
CookieProcessor in Tomcat. 
   However, I didn't like very much the idea to use nulls, that's why I 
introduced the dummy implementation.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[tomcat] branch master updated: Add a new flag in Catalina for errors on init

2020-04-02 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 62efcf7  Add a new flag in Catalina for errors on init
62efcf7 is described below

commit 62efcf70ecf0a96f5f12a3f3ebfefc146a9ec336
Author: remm 
AuthorDate: Thu Apr 2 13:28:47 2020 +0200

Add a new flag in Catalina for errors on init

Use the system property as the default value, same as Connector.
I experimented having it extend LifecycleBase, but it wasn't that
successful.
---
 java/org/apache/catalina/startup/Catalina.java | 27 +-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/startup/Catalina.java 
b/java/org/apache/catalina/startup/Catalina.java
index f5a0974..362d0d0 100644
--- a/java/org/apache/catalina/startup/Catalina.java
+++ b/java/org/apache/catalina/startup/Catalina.java
@@ -132,6 +132,13 @@ public class Catalina {
 protected boolean loaded = false;
 
 
+/**
+ * Rethrow exceptions on init failure.
+ */
+protected boolean throwOnInitFailure =
+
Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE");
+
+
 // --- Constructors
 
 public Catalina() {
@@ -163,6 +170,24 @@ public class Catalina {
 
 
 /**
+ * @return true if an exception should be thrown if an error
+ * occurs during server init
+ */
+public boolean getThrowOnInitFailure() {
+return throwOnInitFailure;
+}
+
+
+/**
+ * Set the behavior regarding errors that could occur during server init.
+ * @param throwOnInitFailure the new flag value
+ */
+public void setThrowOnInitFailure(boolean throwOnInitFailure) {
+this.throwOnInitFailure = throwOnInitFailure;
+}
+
+
+/**
  * Set the shared extensions class loader.
  *
  * @param parentClassLoader The shared extensions class loader.
@@ -583,7 +608,7 @@ public class Catalina {
 try {
 getServer().init();
 } catch (LifecycleException e) {
-if 
(Boolean.getBoolean("org.apache.catalina.startup.EXIT_ON_INIT_FAILURE")) {
+if (throwOnInitFailure) {
 throw new java.lang.Error(e);
 } else {
 log.error(sm.getString("catalina.initError"), e);


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



[tomcat] branch master updated: Expose the HttpServletRequest to CookieProcessor.generateHeader()

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 623b2c9  Expose the HttpServletRequest to 
CookieProcessor.generateHeader()
623b2c9 is described below

commit 623b2c9d0997481f1c5229135fa2f92e24303e47
Author: Mark Thomas 
AuthorDate: Thu Apr 2 12:36:55 2020 +0100

Expose the HttpServletRequest to CookieProcessor.generateHeader()
---
 java/org/apache/catalina/connector/Response.java   | 11 +---
 .../catalina/core/ApplicationPushBuilder.java  |  2 +-
 .../apache/tomcat/util/http/CookieProcessor.java   | 33 ++
 .../tomcat/util/http/LegacyCookieProcessor.java|  8 ++
 .../tomcat/util/http/Rfc6265CookieProcessor.java   |  8 ++
 .../util/http/TestCookieProcessorGeneration.java   |  6 ++--
 webapps/docs/changelog.xml |  6 
 7 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 17d086b..9e4b77e 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -41,6 +41,7 @@ import jakarta.servlet.ServletOutputStream;
 import jakarta.servlet.ServletResponse;
 import jakarta.servlet.SessionTrackingMode;
 import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.servlet.http.HttpServletResponseWrapper;
 
@@ -943,9 +944,9 @@ public class Response implements HttpServletResponse {
 // from the generateHeader() invocation
 if (SecurityUtil.isPackageProtectionEnabled()) {
 return AccessController.doPrivileged(
-new PrivilegedGenerateCookieString(getContext(), cookie));
+new PrivilegedGenerateCookieString(getContext(), cookie, 
request.getRequest()));
 } else {
-return getContext().getCookieProcessor().generateHeader(cookie);
+return getContext().getCookieProcessor().generateHeader(cookie, 
request.getRequest());
 }
 }
 
@@ -1804,15 +1805,17 @@ public class Response implements HttpServletResponse {
 
 private final Context context;
 private final Cookie cookie;
+private final HttpServletRequest request;
 
-public PrivilegedGenerateCookieString(Context context, Cookie cookie) {
+public PrivilegedGenerateCookieString(Context context, Cookie cookie, 
HttpServletRequest request) {
 this.context = context;
 this.cookie = cookie;
+this.request = request;
 }
 
 @Override
 public String run(){
-return context.getCookieProcessor().generateHeader(cookie);
+return context.getCookieProcessor().generateHeader(cookie, 
request);
 }
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java 
b/java/org/apache/catalina/core/ApplicationPushBuilder.java
index 3dbf66e..f3f7a68 100644
--- a/java/org/apache/catalina/core/ApplicationPushBuilder.java
+++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java
@@ -439,7 +439,7 @@ public class ApplicationPushBuilder implements PushBuilder {
 // However, if passed a Cookie with just a name and value set it
 // will generate an appropriate header for the Cookie header on the
 // pushed request.
-result.append(cookieProcessor.generateHeader(cookie));
+result.append(cookieProcessor.generateHeader(cookie, null));
 }
 return result.toString();
 }
diff --git a/java/org/apache/tomcat/util/http/CookieProcessor.java 
b/java/org/apache/tomcat/util/http/CookieProcessor.java
index 22f44c2..c230d4f 100644
--- a/java/org/apache/tomcat/util/http/CookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/CookieProcessor.java
@@ -19,6 +19,7 @@ package org.apache.tomcat.util.http;
 import java.nio.charset.Charset;
 
 import jakarta.servlet.http.Cookie;
+import jakarta.servlet.http.HttpServletRequest;
 
 public interface CookieProcessor {
 
@@ -38,10 +39,42 @@ public interface CookieProcessor {
  *
  * @return The header value in a form that can be added directly to the
  * response
+ *
+ * @deprecated This method has been replaced with
+ * {@link #generateHeader(Cookie, HttpServletRequest)} and will
+ * be removed from Tomcat 10 onwards.
  */
+@Deprecated
 String generateHeader(Cookie cookie);
 
 /**
+ * Generate the {@code Set-Cookie} HTTP header value for the given Cookie.
+ * This method receives as parameter the servlet request so that it can 
make
+ * decisions based on request properties. One such use-case is decide if 
the
+ * SameSite attribute shou

[tomcat] branch master updated: Add credit.

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new ed8531b  Add credit.
ed8531b is described below

commit ed8531b212d3392efc1f393dca2d471297bfaa87
Author: Mark Thomas 
AuthorDate: Thu Apr 2 12:46:16 2020 +0100

Add credit.
---
 webapps/docs/changelog.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8d30e22..649bb9c 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -168,7 +168,7 @@
 Expose the associated HttpServletRequest to the
 CookieProcessor when generating a cookie header so the
 header can be tailored based on the properties of the request, such as
-the user agent, if required. (markt)
+the user agent, if required. Based on a patch by Lazar Kirchev. (markt)
   
 
   


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



[tomcat] branch 9.0.x updated: Expose the HttpServletRequest to CookieProcessor.generateHeader()

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new fcda8f4  Expose the HttpServletRequest to 
CookieProcessor.generateHeader()
fcda8f4 is described below

commit fcda8f4e40d38997f167ad7d41a259cb846f9272
Author: Mark Thomas 
AuthorDate: Thu Apr 2 12:36:55 2020 +0100

Expose the HttpServletRequest to CookieProcessor.generateHeader()
---
 java/org/apache/catalina/connector/Response.java   | 11 +---
 .../catalina/core/ApplicationPushBuilder.java  |  2 +-
 .../apache/tomcat/util/http/CookieProcessor.java   | 33 ++
 .../tomcat/util/http/LegacyCookieProcessor.java|  8 ++
 .../tomcat/util/http/Rfc6265CookieProcessor.java   |  8 ++
 .../util/http/TestCookieProcessorGeneration.java   |  6 ++--
 webapps/docs/changelog.xml |  6 
 7 files changed, 66 insertions(+), 8 deletions(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 3900c30..a58945d 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -42,6 +42,7 @@ import javax.servlet.ServletOutputStream;
 import javax.servlet.ServletResponse;
 import javax.servlet.SessionTrackingMode;
 import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 import javax.servlet.http.HttpServletResponseWrapper;
 
@@ -968,9 +969,9 @@ public class Response implements HttpServletResponse {
 // from the generateHeader() invocation
 if (SecurityUtil.isPackageProtectionEnabled()) {
 return AccessController.doPrivileged(
-new PrivilegedGenerateCookieString(getContext(), cookie));
+new PrivilegedGenerateCookieString(getContext(), cookie, 
request.getRequest()));
 } else {
-return getContext().getCookieProcessor().generateHeader(cookie);
+return getContext().getCookieProcessor().generateHeader(cookie, 
request.getRequest());
 }
 }
 
@@ -1829,15 +1830,17 @@ public class Response implements HttpServletResponse {
 
 private final Context context;
 private final Cookie cookie;
+private final HttpServletRequest request;
 
-public PrivilegedGenerateCookieString(Context context, Cookie cookie) {
+public PrivilegedGenerateCookieString(Context context, Cookie cookie, 
HttpServletRequest request) {
 this.context = context;
 this.cookie = cookie;
+this.request = request;
 }
 
 @Override
 public String run(){
-return context.getCookieProcessor().generateHeader(cookie);
+return context.getCookieProcessor().generateHeader(cookie, 
request);
 }
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java 
b/java/org/apache/catalina/core/ApplicationPushBuilder.java
index 58858ae..277413e 100644
--- a/java/org/apache/catalina/core/ApplicationPushBuilder.java
+++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java
@@ -439,7 +439,7 @@ public class ApplicationPushBuilder implements PushBuilder {
 // However, if passed a Cookie with just a name and value set it
 // will generate an appropriate header for the Cookie header on the
 // pushed request.
-result.append(cookieProcessor.generateHeader(cookie));
+result.append(cookieProcessor.generateHeader(cookie, null));
 }
 return result.toString();
 }
diff --git a/java/org/apache/tomcat/util/http/CookieProcessor.java 
b/java/org/apache/tomcat/util/http/CookieProcessor.java
index e0efbf1..19d7070 100644
--- a/java/org/apache/tomcat/util/http/CookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/CookieProcessor.java
@@ -19,6 +19,7 @@ package org.apache.tomcat.util.http;
 import java.nio.charset.Charset;
 
 import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
 
 public interface CookieProcessor {
 
@@ -38,10 +39,42 @@ public interface CookieProcessor {
  *
  * @return The header value in a form that can be added directly to the
  * response
+ *
+ * @deprecated This method has been replaced with
+ * {@link #generateHeader(Cookie, HttpServletRequest)} and will
+ * be removed from Tomcat 10 onwards.
  */
+@Deprecated
 String generateHeader(Cookie cookie);
 
 /**
+ * Generate the {@code Set-Cookie} HTTP header value for the given Cookie.
+ * This method receives as parameter the servlet request so that it can 
make
+ * decisions based on request properties. One such use-case is decide if 
the
+ * SameSite attribute should be added to the c

[tomcat] branch 8.5.x updated: Expose the HttpServletRequest to CookieProcessor.generateHeader()

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new e81d0ff  Expose the HttpServletRequest to 
CookieProcessor.generateHeader()
e81d0ff is described below

commit e81d0ff318818243c3a9d520ebf2f51491d81c0f
Author: Mark Thomas 
AuthorDate: Thu Apr 2 12:36:55 2020 +0100

Expose the HttpServletRequest to CookieProcessor.generateHeader()
---
 java/org/apache/catalina/connector/Response.java   |  4 ++--
 .../catalina/core/ApplicationPushBuilder.java  |  2 +-
 .../apache/tomcat/util/http/CookieProcessor.java   | 25 ++
 .../tomcat/util/http/CookieProcessorBase.java  | 17 +++
 .../tomcat/util/http/LegacyCookieProcessor.java|  8 +++
 .../tomcat/util/http/Rfc6265CookieProcessor.java   |  8 +++
 .../util/http/TestCookieProcessorGeneration.java   |  6 +++---
 webapps/docs/changelog.xml |  6 ++
 8 files changed, 70 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/catalina/connector/Response.java 
b/java/org/apache/catalina/connector/Response.java
index 97c18a5..b204bca 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -974,11 +974,11 @@ public class Response implements HttpServletResponse {
 return AccessController.doPrivileged(new 
PrivilegedAction() {
 @Override
 public String run(){
-return 
getContext().getCookieProcessor().generateHeader(cookie);
+return 
getContext().getCookieProcessor().generateHeader(cookie, request.getRequest());
 }
 });
 } else {
-return getContext().getCookieProcessor().generateHeader(cookie);
+return getContext().getCookieProcessor().generateHeader(cookie, 
request.getRequest());
 }
 }
 
diff --git a/java/org/apache/catalina/core/ApplicationPushBuilder.java 
b/java/org/apache/catalina/core/ApplicationPushBuilder.java
index 98ba60d..052bef0 100644
--- a/java/org/apache/catalina/core/ApplicationPushBuilder.java
+++ b/java/org/apache/catalina/core/ApplicationPushBuilder.java
@@ -425,7 +425,7 @@ public class ApplicationPushBuilder {
 // However, if passed a Cookie with just a name and value set it
 // will generate an appropriate header for the Cookie header on the
 // pushed request.
-result.append(cookieProcessor.generateHeader(cookie));
+result.append(cookieProcessor.generateHeader(cookie, null));
 }
 return result.toString();
 }
diff --git a/java/org/apache/tomcat/util/http/CookieProcessor.java 
b/java/org/apache/tomcat/util/http/CookieProcessor.java
index e0efbf1..ffda7b7 100644
--- a/java/org/apache/tomcat/util/http/CookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/CookieProcessor.java
@@ -19,6 +19,7 @@ package org.apache.tomcat.util.http;
 import java.nio.charset.Charset;
 
 import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServletRequest;
 
 public interface CookieProcessor {
 
@@ -38,10 +39,34 @@ public interface CookieProcessor {
  *
  * @return The header value in a form that can be added directly to the
  * response
+ *
+ * @deprecated This method has been replaced with
+ * {@link #generateHeader(Cookie, HttpServletRequest)} and will
+ * be removed from Tomcat 10 onwards.
  */
+@Deprecated
 String generateHeader(Cookie cookie);
 
 /**
+ * Generate the {@code Set-Cookie} HTTP header value for the given Cookie.
+ * This method receives as parameter the servlet request so that it can 
make
+ * decisions based on request properties. One such use-case is decide if 
the
+ * SameSite attribute should be added to the cookie based on the User-Agent
+ * or other request header because there are browser versions incompatible
+ * with the SameSite attribute. This is described by https://www.chromium.org/updates/same-site/incompatible-clients";>the
+ * Chromium project.
+ *
+ * @param request The servlet request
+ *
+ * @param cookie The cookie for which the header will be generated
+ *
+ * @return The header value in a form that can be added directly to the
+ * response
+ */
+String generateHeader(Cookie cookie, HttpServletRequest request);
+
+/**
  * Obtain the character set that will be used when converting between bytes
  * and characters when parsing and/or generating HTTP headers for cookies.
  *
diff --git a/java/org/apache/tomcat/util/http/CookieProcessorBase.java 
b/java/org/apache/tomcat/util/http/CookieProcessorBase.java
index 589df47..f00fc95 100644
--- a/java/org/apache/tomcat/util/http/CookieProcessorBase.java
++

[GitHub] [tomcat] markt-asf closed pull request #252: 8.5.x

2020-04-02 Thread GitBox
markt-asf closed pull request #252: 8.5.x
URL: https://github.com/apache/tomcat/pull/252
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] markt-asf commented on issue #252: 8.5.x

2020-04-02 Thread GitBox
markt-asf commented on issue #252: 8.5.x
URL: https://github.com/apache/tomcat/pull/252#issuecomment-607806850
 
 
   Thanks. While I'm not merging this specific PR I do want to assure you that 
the PR was very helpful in resolving this. Having a concrete proposal to work 
from is much easier than developing one from scratch. The end result isn't that 
different from what you proposed. I opted for `null` rather than dummy request 
objects as it simplified things a little. The only other difference was the 
changes to handle the deprecation so we end up with a single `generateHeader()` 
in Tomcat 10 onwards.
   
   Thanks again for your contribution.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



buildbot failure in on tomcat-trunk

2020-04-02 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5080

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] ed8531b212d3392efc1f393dca2d471297bfaa87
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



[GitHub] [tomcat] lkirchev commented on issue #252: 8.5.x

2020-04-02 Thread GitBox
lkirchev commented on issue #252: 8.5.x
URL: https://github.com/apache/tomcat/pull/252#issuecomment-607819295
 
 
   Thanks a lot Mark! I didn't expect to merge the PR when I added the last 
commit, I just wanted to bring it most closely to a state you can reuse.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[tomcat] branch master updated: Add a comment to explain code that might appear to be unnecessary.

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new c42a118  Add a comment to explain code that might appear to be 
unnecessary.
c42a118 is described below

commit c42a118833dc6e3142eebc9895105b4da0020373
Author: Mark Thomas 
AuthorDate: Thu Apr 2 14:42:04 2020 +0100

Add a comment to explain code that might appear to be unnecessary.
---
 java/org/apache/catalina/ha/session/DeltaSession.java | 5 +
 1 file changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index 9875fb2..469f8bb 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -113,6 +113,11 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 return createRequest(null, false);
 }
 
+/*
+ * DeltaRequest instances are created via this protected method to enable
+ * sub-classes to over-ride the method to use custom DeltaRequest
+ * implementations.
+ */
 protected DeltaRequest createRequest(String sessionId, boolean 
recordAllActions) {
 return new DeltaRequest(sessionId, recordAllActions);
 }


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



[tomcat] branch 8.5.x updated: Added extension point for custom delta requests

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new d3dc830  Added extension point for custom delta requests
d3dc830 is described below

commit d3dc83083ae312c5fea22012b7dd46ca48515154
Author: Thomas Stock 
AuthorDate: Thu Feb 13 12:55:32 2020 +0100

Added extension point for custom delta requests
---
 .../apache/catalina/ha/session/DeltaSession.java| 21 +
 webapps/docs/changelog.xml  |  9 +
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index 2465c60..201cce8 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -106,7 +106,20 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 super(manager);
 boolean recordAllActions = manager instanceof ClusterManagerBase &&
 ((ClusterManagerBase)manager).isRecordAllActions();
-deltaRequest = new DeltaRequest(getIdInternal(), recordAllActions);
+deltaRequest = createRequest(getIdInternal(), recordAllActions);
+}
+
+private DeltaRequest createRequest() {
+return createRequest(null, false);
+}
+
+/*
+ * DeltaRequest instances are created via this protected method to enable
+ * sub-classes to over-ride the method to use custom DeltaRequest
+ * implementations.
+ */
+protected DeltaRequest createRequest(String sessionId, boolean 
recordAllActions) {
+return new DeltaRequest(sessionId, recordAllActions);
 }
 
 // - ReplicatedMapEntry
@@ -145,10 +158,10 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 deltaRequestPool = ((ClusterManagerBase) 
manager).getDeltaRequestPool();
 newDeltaRequest = deltaRequestPool.pop();
 if (newDeltaRequest == null) {
-newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
+newDeltaRequest = createRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
 }
 } else {
-newDeltaRequest = new DeltaRequest();
+newDeltaRequest = createRequest();
 }
 
 DeltaRequest oldDeltaRequest = replaceDeltaRequest(newDeltaRequest);
@@ -679,7 +692,7 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 
 DeltaRequest newDeltaRequest = deltaRequestPool.pop();
 if (newDeltaRequest == null) {
-newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
+newDeltaRequest = createRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
 }
 
 ReplicationStream ois = ((ClusterManagerBase) 
manager).getReplicationStream(delta);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 0245bd2..61483dc 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -120,6 +120,15 @@
   
 
   
+  
+
+  
+Refactor the creation of DeltaRequest objects to make it
+simpler to use custom implementations. Based on a pull request provided
+by Thomas Stock. (markt)
+  
+
+  
   
 
   


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



[tomcat] branch 9.0.x updated: Added extension point for custom delta requests

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 40a5f17  Added extension point for custom delta requests
40a5f17 is described below

commit 40a5f176f2918d46084d7cceb7ecb27e933e8701
Author: Thomas Stock 
AuthorDate: Thu Feb 13 12:55:32 2020 +0100

Added extension point for custom delta requests
---
 .../apache/catalina/ha/session/DeltaSession.java| 21 +
 webapps/docs/changelog.xml  |  9 +
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index 2465c60..201cce8 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -106,7 +106,20 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 super(manager);
 boolean recordAllActions = manager instanceof ClusterManagerBase &&
 ((ClusterManagerBase)manager).isRecordAllActions();
-deltaRequest = new DeltaRequest(getIdInternal(), recordAllActions);
+deltaRequest = createRequest(getIdInternal(), recordAllActions);
+}
+
+private DeltaRequest createRequest() {
+return createRequest(null, false);
+}
+
+/*
+ * DeltaRequest instances are created via this protected method to enable
+ * sub-classes to over-ride the method to use custom DeltaRequest
+ * implementations.
+ */
+protected DeltaRequest createRequest(String sessionId, boolean 
recordAllActions) {
+return new DeltaRequest(sessionId, recordAllActions);
 }
 
 // - ReplicatedMapEntry
@@ -145,10 +158,10 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 deltaRequestPool = ((ClusterManagerBase) 
manager).getDeltaRequestPool();
 newDeltaRequest = deltaRequestPool.pop();
 if (newDeltaRequest == null) {
-newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
+newDeltaRequest = createRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
 }
 } else {
-newDeltaRequest = new DeltaRequest();
+newDeltaRequest = createRequest();
 }
 
 DeltaRequest oldDeltaRequest = replaceDeltaRequest(newDeltaRequest);
@@ -679,7 +692,7 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 
 DeltaRequest newDeltaRequest = deltaRequestPool.pop();
 if (newDeltaRequest == null) {
-newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
+newDeltaRequest = createRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
 }
 
 ReplicationStream ois = ((ClusterManagerBase) 
manager).getReplicationStream(delta);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 00f5eb8..e0a6bfe 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -127,6 +127,15 @@
   
 
   
+  
+
+  
+Refactor the creation of DeltaRequest objects to make it
+simpler to use custom implementations. Based on a pull request provided
+by Thomas Stock. (markt)
+  
+
+  
   
 
   


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



[tomcat] branch 7.0.x updated: Added extension point for custom delta requests

2020-04-02 Thread markt
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 db89a2a  Added extension point for custom delta requests
db89a2a is described below

commit db89a2a54df18bfdc7a1a03bc130511320a0eda8
Author: Thomas Stock 
AuthorDate: Thu Feb 13 12:55:32 2020 +0100

Added extension point for custom delta requests
---
 .../apache/catalina/ha/session/DeltaSession.java| 21 +
 webapps/docs/changelog.xml  |  9 +
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/ha/session/DeltaSession.java 
b/java/org/apache/catalina/ha/session/DeltaSession.java
index 4662914..5b68513 100644
--- a/java/org/apache/catalina/ha/session/DeltaSession.java
+++ b/java/org/apache/catalina/ha/session/DeltaSession.java
@@ -109,7 +109,20 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 super(manager);
 boolean recordAllActions = manager instanceof ClusterManagerBase &&
 ((ClusterManagerBase)manager).isRecordAllActions();
-deltaRequest = new DeltaRequest(getIdInternal(), recordAllActions);
+deltaRequest = createRequest(getIdInternal(), recordAllActions);
+}
+
+private DeltaRequest createRequest() {
+return createRequest(null, false);
+}
+
+/*
+ * DeltaRequest instances are created via this protected method to enable
+ * sub-classes to over-ride the method to use custom DeltaRequest
+ * implementations.
+ */
+protected DeltaRequest createRequest(String sessionId, boolean 
recordAllActions) {
+return new DeltaRequest(sessionId, recordAllActions);
 }
 
 // - ReplicatedMapEntry
@@ -148,10 +161,10 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 deltaRequestPool = ((ClusterManagerBase) 
manager).getDeltaRequestPool();
 newDeltaRequest = deltaRequestPool.pop();
 if (newDeltaRequest == null) {
-newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
+newDeltaRequest = createRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
 }
 } else {
-newDeltaRequest = new DeltaRequest();
+newDeltaRequest = createRequest();
 }
 
 DeltaRequest oldDeltaRequest = replaceDeltaRequest(newDeltaRequest);
@@ -693,7 +706,7 @@ public class DeltaSession extends StandardSession 
implements Externalizable,Clus
 
 DeltaRequest newDeltaRequest = deltaRequestPool.pop();
 if (newDeltaRequest == null) {
-newDeltaRequest = new DeltaRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
+newDeltaRequest = createRequest(null, ((ClusterManagerBase) 
manager).isRecordAllActions());
 }
 
 ReplicationStream ois = ((ClusterManagerBase) 
manager).getReplicationStream(delta);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 3cc3eae..d9fa048 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -110,6 +110,15 @@
   
 
   
+  
+
+  
+Refactor the creation of DeltaRequest objects to make it
+simpler to use custom implementations. Based on a pull request provided
+by Thomas Stock. (markt)
+  
+
+  
   
 
   


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



[GitHub] [tomcat] markt-asf commented on issue #257: Added extension point for custom delta requests

2020-04-02 Thread GitBox
markt-asf commented on issue #257: Added extension point for custom delta 
requests
URL: https://github.com/apache/tomcat/pull/257#issuecomment-607859022
 
 
   Thanks for the additional PR. I've back-ported the original fix to 9.0.x, 
8.5.x and 7.0.x along with a comment that explains why the code has been added.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] markt-asf closed pull request #257: Added extension point for custom delta requests

2020-04-02 Thread GitBox
markt-asf closed pull request #257: Added extension point for custom delta 
requests
URL: https://github.com/apache/tomcat/pull/257
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



Re: Remaining Tomcat 10 items

2020-04-02 Thread Rémy Maucherat
On Fri, Mar 27, 2020 at 6:13 PM Mark Thomas  wrote:

> On 26/03/2020 16:47, Rémy Maucherat wrote:
> > On Mon, Mar 23, 2020 at 10:37 AM Rémy Maucherat  > > wrote:
> >
> > - Remove the use of system properties to control configuration
> > wherever possible.
> > I still don't see the point for quite a few of them. For others
> > however, using sys props was a mistake, example the facade
> > recycling. Also, the digester can now pull from system and env
> > properties, giving full flexibility. Also also, this is a handy way
> > to do things in cloud. I think we should target the ones which
> > should make sense.
> >
> >
> > I think I'm done with that area for now as I'm a bit skeptical about
> > this for JULI, EL, JSP and Websockets. Any reasonable candidates for
> > removal left ?
>

Ok, so all are now done except:


>
> Digester
>  - Not sure. Likely to be tricky
>
> Clustering
>  - org.apache.catalina.tribes.dns_lookups
>Any DNS names are going to *have* to be resolved at some point for
>the cluster to work. I'd probably remove this and let the user
>specify DNS name or IP address as they wish.
>

This one. I'd remove it outright.


>
> EL
>  - Can't do anything about these without spec changes
>
> Jasper
>  - Could all move to o.a.jasper.Options
>
> Security
>  - ALLOW_BACKSLASH
>Remove it. It is just wrong. If we must keep it, move it to the
>Connector.
>  - ALLOW_ENCODED_SLASH
>I plan to replace this with a Connector option
>
> Spec
>  - STRICT_SERVLET_COMPLIANCE
>Is a useful short-cut
>

I would prefer keeping it (useful shortcut indeed), even though it might be
technically feasible to remove it.


>  - Move the remaining ones to the Context or related object where
>possible (I haven't checked how easy that would be)
>
> Sessions
>  - Move to the Manager or related object where possible (I haven't
>checked how easy that would be)
>
> JULI
>  - Look tricky to remove any of these.
>
> JAR Scanning
>  - Leave as is
>
> WebSockets
>  - Ideally want to set these per web app but we'd need to find a
>configuration mechanism to use
>

Not done yet.


>
> Other
>  - Looks like NioSelectorShared has already been refactored out.
>  - The rest look difficult to remove.
>

Yes, the rest are either impossible to remove, or super legacy ways to set
default values and possibly "widely" used [looking at something like
"jvmRoute", "catalina.config" or "catalina.useNaming" for example].

Rémy


[tomcat] branch master updated: Support for default values in property value expressions

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 6f356df  Support for default values in property value expressions
6f356df is described below

commit 6f356df24241db9f655c8adb0c51aea95a2ab05d
Author: bohmber 
AuthorDate: Mon Mar 2 20:25:30 2020 +0100

Support for default values in property value expressions
---
 .../org/apache/tomcat/util/IntrospectionUtils.java | 60 --
 .../apache/tomcat/util/TestIntrospectionUtils.java | 37 -
 webapps/docs/changelog.xml |  5 ++
 webapps/docs/config/systemprops.xml|  5 +-
 4 files changed, 87 insertions(+), 20 deletions(-)

diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index 2d17a72..aa2f40c 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -219,12 +219,21 @@ public final class IntrospectionUtils {
 }
 
 /**
- * Replace ${NAME} with the property value.
+ * Replaces ${NAME} in the value with the value of the property 'NAME'.
+ * Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT',
+ * if the property 'NAME:DEFAULT' is not set,
+ * the expression is replaced with the value of the property 'NAME',
+ * if the property 'NAME' is not set,
+ * the expression is replaced with 'DEFAULT'.
+ * If the property is not set and there is no default the value will be
+ * returned unmodified.
+ *
  * @param value The value
  * @param staticProp Replacement properties
  * @param dynamicProp Replacement properties
  * @param classLoader Class loader associated with the code requesting the
  *property
+ *
  * @return the replacement value
  */
 public static String replaceProperties(String value,
@@ -256,25 +265,21 @@ public final class IntrospectionUtils {
 continue;
 }
 String n = value.substring(pos + 2, endName);
-String v = null;
-if (staticProp != null) {
-v = (String) staticProp.get(n);
-}
-if (v == null && dynamicProp != null) {
-for (PropertySource propertySource : dynamicProp) {
-if (propertySource instanceof SecurePropertySource) {
-v = ((SecurePropertySource) 
propertySource).getProperty(n, classLoader);
-} else {
-v = propertySource.getProperty(n);
-}
-if (v != null) {
-break;
+String v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+// {name:default}
+int col = n.indexOf(':');
+if (col != -1) {
+String dV = n.substring(col+1);
+n = n.substring(0, col);
+v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+v = dV;
 }
+} else {
+v = "${" + n + "}";
 }
 }
-if (v == null)
-v = "${" + n + "}";
-
 sb.append(v);
 prev = endName + 1;
 }
@@ -284,6 +289,27 @@ public final class IntrospectionUtils {
 return sb.toString();
 }
 
+private static String getProperty(String name, Hashtable 
staticProp,
+PropertySource[] dynamicProp, ClassLoader classLoader) {
+String v = null;
+if (staticProp != null) {
+v = (String) staticProp.get(name);
+}
+if (v == null && dynamicProp != null) {
+for (PropertySource propertySource : dynamicProp) {
+if (propertySource instanceof SecurePropertySource) {
+v = ((SecurePropertySource) 
propertySource).getProperty(name, classLoader);
+} else {
+v = propertySource.getProperty(name);
+}
+if (v != null) {
+break;
+}
+}
+}
+return v;
+}
+
 /**
  * Reverse of Introspector.decapitalize.
  * @param name The name
diff --git a/test/org/apache/tomcat/util/TestIntrospectionUtils.java 
b/test/org/apache/tomcat/util/TestIntrospectionUtils.java
index 64864f6..ef27174 100644
--- a/test/org/apache/tomcat/util/TestIntrospectionUtils.java
+++ b/test/org/apache/tomcat/util/TestIntrospectionUtils.java
@@ -16,6

[tomcat] branch 9.0.x updated: Support for default values in property value expressions

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new cdfea5d  Support for default values in property value expressions
cdfea5d is described below

commit cdfea5d3df5c3c4d65d9922e78f05fa967ab0a97
Author: bohmber 
AuthorDate: Mon Mar 2 20:25:30 2020 +0100

Support for default values in property value expressions
---
 .../org/apache/tomcat/util/IntrospectionUtils.java | 60 --
 .../apache/tomcat/util/TestIntrospectionUtils.java | 37 -
 webapps/docs/changelog.xml |  5 ++
 webapps/docs/config/systemprops.xml|  5 +-
 4 files changed, 87 insertions(+), 20 deletions(-)

diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index 0c2eb6e..9987533 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -219,7 +219,15 @@ public final class IntrospectionUtils {
 }
 
 /**
- * Replace ${NAME} with the property value.
+ * Replaces ${NAME} in the value with the value of the property 'NAME'.
+ * Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT',
+ * if the property 'NAME:DEFAULT' is not set,
+ * the expression is replaced with the value of the property 'NAME',
+ * if the property 'NAME' is not set,
+ * the expression is replaced with 'DEFAULT'.
+ * If the property is not set and there is no default the value will be
+ * returned unmodified.
+ *
  * @param value The value
  * @param staticProp Replacement properties
  * @param dynamicProp Replacement properties
@@ -239,6 +247,7 @@ public final class IntrospectionUtils {
  * @param dynamicProp Replacement properties
  * @param classLoader Class loader associated with the code requesting the
  *property
+ *
  * @return the replacement value
  */
 public static String replaceProperties(String value,
@@ -270,25 +279,21 @@ public final class IntrospectionUtils {
 continue;
 }
 String n = value.substring(pos + 2, endName);
-String v = null;
-if (staticProp != null) {
-v = (String) staticProp.get(n);
-}
-if (v == null && dynamicProp != null) {
-for (PropertySource propertySource : dynamicProp) {
-if (propertySource instanceof SecurePropertySource) {
-v = ((SecurePropertySource) 
propertySource).getProperty(n, classLoader);
-} else {
-v = propertySource.getProperty(n);
-}
-if (v != null) {
-break;
+String v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+// {name:default}
+int col = n.indexOf(':');
+if (col != -1) {
+String dV = n.substring(col+1);
+n = n.substring(0, col);
+v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+v = dV;
 }
+} else {
+v = "${" + n + "}";
 }
 }
-if (v == null)
-v = "${" + n + "}";
-
 sb.append(v);
 prev = endName + 1;
 }
@@ -298,6 +303,27 @@ public final class IntrospectionUtils {
 return sb.toString();
 }
 
+private static String getProperty(String name, Hashtable 
staticProp,
+PropertySource[] dynamicProp, ClassLoader classLoader) {
+String v = null;
+if (staticProp != null) {
+v = (String) staticProp.get(name);
+}
+if (v == null && dynamicProp != null) {
+for (PropertySource propertySource : dynamicProp) {
+if (propertySource instanceof SecurePropertySource) {
+v = ((SecurePropertySource) 
propertySource).getProperty(name, classLoader);
+} else {
+v = propertySource.getProperty(name);
+}
+if (v != null) {
+break;
+}
+}
+}
+return v;
+}
+
 /**
  * Reverse of Introspector.decapitalize.
  * @param name The name
diff --git a/test/org/apache/tomcat/util/TestIntrospectionUtils.java 
b/test/org/apache/tomcat/util/TestIntrospectionUtils.java
index 64864f6..ef27174 100644
--- a/test/org/apache/tom

[tomcat] branch 8.5.x updated: Support for default values in property value expressions

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new dcf3193  Support for default values in property value expressions
dcf3193 is described below

commit dcf3193bd6a293492fb7efe756827aece33f4a51
Author: bohmber 
AuthorDate: Mon Mar 2 20:25:30 2020 +0100

Support for default values in property value expressions
---
 .../org/apache/tomcat/util/IntrospectionUtils.java | 60 --
 .../apache/tomcat/util/TestIntrospectionUtils.java | 37 -
 webapps/docs/changelog.xml |  5 ++
 webapps/docs/config/systemprops.xml|  5 +-
 4 files changed, 87 insertions(+), 20 deletions(-)

diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index 5058088..9cb648d 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -231,7 +231,15 @@ public final class IntrospectionUtils {
 }
 
 /**
- * Replace ${NAME} with the property value.
+ * Replaces ${NAME} in the value with the value of the property 'NAME'.
+ * Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT',
+ * if the property 'NAME:DEFAULT' is not set,
+ * the expression is replaced with the value of the property 'NAME',
+ * if the property 'NAME' is not set,
+ * the expression is replaced with 'DEFAULT'.
+ * If the property is not set and there is no default the value will be
+ * returned unmodified.
+ *
  * @param value The value
  * @param staticProp Replacement properties
  * @param dynamicProp Replacement properties
@@ -251,6 +259,7 @@ public final class IntrospectionUtils {
  * @param dynamicProp Replacement properties
  * @param classLoader Class loader associated with the code requesting the
  *property
+ *
  * @return the replacement value
  */
 public static String replaceProperties(String value,
@@ -282,25 +291,21 @@ public final class IntrospectionUtils {
 continue;
 }
 String n = value.substring(pos + 2, endName);
-String v = null;
-if (staticProp != null) {
-v = (String) staticProp.get(n);
-}
-if (v == null && dynamicProp != null) {
-for (PropertySource propertySource : dynamicProp) {
-if (propertySource instanceof SecurePropertySource) {
-v = ((SecurePropertySource) 
propertySource).getProperty(n, classLoader);
-} else {
-v = propertySource.getProperty(n);
-}
-if (v != null) {
-break;
+String v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+// {name:default}
+int col = n.indexOf(':');
+if (col != -1) {
+String dV = n.substring(col+1);
+n = n.substring(0, col);
+v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+v = dV;
 }
+} else {
+v = "${" + n + "}";
 }
 }
-if (v == null)
-v = "${" + n + "}";
-
 sb.append(v);
 prev = endName + 1;
 }
@@ -310,6 +315,27 @@ public final class IntrospectionUtils {
 return sb.toString();
 }
 
+private static String getProperty(String name, Hashtable 
staticProp,
+PropertySource[] dynamicProp, ClassLoader classLoader) {
+String v = null;
+if (staticProp != null) {
+v = (String) staticProp.get(name);
+}
+if (v == null && dynamicProp != null) {
+for (PropertySource propertySource : dynamicProp) {
+if (propertySource instanceof SecurePropertySource) {
+v = ((SecurePropertySource) 
propertySource).getProperty(name, classLoader);
+} else {
+v = propertySource.getProperty(name);
+}
+if (v != null) {
+break;
+}
+}
+}
+return v;
+}
+
 /**
  * Reverse of Introspector.decapitalize.
  * @param name The name
diff --git a/test/org/apache/tomcat/util/TestIntrospectionUtils.java 
b/test/org/apache/tomcat/util/TestIntrospectionUtils.java
index 64864f6..ef27174 100644
--- a/test/org/apache/tom

[tomcat] branch 7.0.x updated: Support for default values in property value expressions

2020-04-02 Thread markt
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 c4e9cad  Support for default values in property value expressions
c4e9cad is described below

commit c4e9cad2c5339aa8fb14eaeb8b4646b07b42045d
Author: bohmber 
AuthorDate: Mon Mar 2 20:25:30 2020 +0100

Support for default values in property value expressions
---
 .../org/apache/tomcat/util/IntrospectionUtils.java | 70 --
 .../apache/tomcat/util/TestIntrospectionUtils.java | 37 +++-
 webapps/docs/changelog.xml |  5 ++
 webapps/docs/config/systemprops.xml|  5 +-
 4 files changed, 96 insertions(+), 21 deletions(-)

diff --git a/java/org/apache/tomcat/util/IntrospectionUtils.java 
b/java/org/apache/tomcat/util/IntrospectionUtils.java
index bdce1e4..b33254c 100644
--- a/java/org/apache/tomcat/util/IntrospectionUtils.java
+++ b/java/org/apache/tomcat/util/IntrospectionUtils.java
@@ -491,7 +491,15 @@ public final class IntrospectionUtils {
 }
 
 /**
- * Replace ${NAME} with the property value.
+ * Replaces ${NAME} in the value with the value of the property 'NAME'.
+ * Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT',
+ * if the property 'NAME:DEFAULT' is not set,
+ * the expression is replaced with the value of the property 'NAME',
+ * if the property 'NAME' is not set,
+ * the expression is replaced with 'DEFAULT'.
+ * If the property is not set and there is no default the value will be
+ * returned unmodified.
+ *
  * @param value The value
  * @param staticProp Replacement properties
  * @param dynamicProp Replacement properties
@@ -505,12 +513,21 @@ public final class IntrospectionUtils {
 }
 
 /**
- * Replace ${NAME} with the property value.
+ * Replaces ${NAME} in the value with the value of the property 'NAME'.
+ * Replaces ${NAME:DEFAULT} with the value of the property 'NAME:DEFAULT',
+ * if the property 'NAME:DEFAULT' is not set,
+ * the expression is replaced with the value of the property 'NAME',
+ * if the property 'NAME' is not set,
+ * the expression is replaced with 'DEFAULT'.
+ * If the property is not set and there is no default the value will be
+ * returned unmodified.
+ *
  * @param value The value
  * @param staticProp Replacement properties
  * @param dynamicProp Replacement properties
  * @param classLoader Class loader associated with the code requesting the
  *property
+ *
  * @return the replacement value
  */
 public static String replaceProperties(String value,
@@ -542,25 +559,21 @@ public final class IntrospectionUtils {
 continue;
 }
 String n = value.substring(pos + 2, endName);
-String v = null;
-if (staticProp != null) {
-v = (String) staticProp.get(n);
-}
-if (v == null && dynamicProp != null) {
-for (PropertySource propertySource : dynamicProp) {
-if (propertySource instanceof SecurePropertySource) {
-v = ((SecurePropertySource) 
propertySource).getProperty(n, classLoader);
-} else {
-v = propertySource.getProperty(n);
-}
-if (v != null) {
-break;
+String v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+// {name:default}
+int col = n.indexOf(':');
+if (col != -1) {
+String dV = n.substring(col+1);
+n = n.substring(0, col);
+v = getProperty(n, staticProp, dynamicProp, 
classLoader);
+if (v == null) {
+v = dV;
 }
+} else {
+v = "${" + n + "}";
 }
 }
-if (v == null)
-v = "${" + n + "}";
-
 sb.append(v);
 prev = endName + 1;
 }
@@ -570,6 +583,27 @@ public final class IntrospectionUtils {
 return sb.toString();
 }
 
+private static String getProperty(String name, Hashtable 
staticProp,
+PropertySource[] dynamicProp, ClassLoader classLoader) {
+String v = null;
+if (staticProp != null) {
+v = (String) staticProp.get(name);
+}
+if (v == null && dynamicProp != null) {
+for (PropertySource propertySource : dynamicProp) {
+if (propertySource i

[tomcat] branch master updated: Fix checkstyle

2020-04-02 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
 new 951c6ea  Fix checkstyle
951c6ea is described below

commit 951c6ead687ba479010ca4137cb360f54f292ff3
Author: remm 
AuthorDate: Thu Apr 2 16:49:41 2020 +0200

Fix checkstyle

The other branches are ok.
---
 java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java 
b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
index 2f0c874..f726681 100644
--- a/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
+++ b/java/org/apache/tomcat/util/http/Rfc6265CookieProcessor.java
@@ -22,6 +22,8 @@ import java.text.FieldPosition;
 import java.util.BitSet;
 import java.util.Date;
 
+import jakarta.servlet.http.HttpServletRequest;
+
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.buf.ByteChunk;
@@ -29,8 +31,6 @@ import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.parser.Cookie;
 import org.apache.tomcat.util.res.StringManager;
 
-import jakarta.servlet.http.HttpServletRequest;
-
 public class Rfc6265CookieProcessor extends CookieProcessorBase {
 
 private static final Log log = 
LogFactory.getLog(Rfc6265CookieProcessor.class);


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



Re: Remaining Tomcat 10 items

2020-04-02 Thread Mark Thomas
On 02/04/2020 15:02, Rémy Maucherat wrote:
> On Fri, Mar 27, 2020 at 6:13 PM Mark Thomas  > wrote:
> 
> On 26/03/2020 16:47, Rémy Maucherat wrote:
> > On Mon, Mar 23, 2020 at 10:37 AM Rémy Maucherat  
> > >> wrote:
> >
> >     - Remove the use of system properties to control configuration
> >     wherever possible.
> >     I still don't see the point for quite a few of them. For others
> >     however, using sys props was a mistake, example the facade
> >     recycling. Also, the digester can now pull from system and env
> >     properties, giving full flexibility. Also also, this is a
> handy way
> >     to do things in cloud. I think we should target the ones which
> >     should make sense.
> >
> >
> > I think I'm done with that area for now as I'm a bit skeptical about
> > this for JULI, EL, JSP and Websockets. Any reasonable candidates for
> > removal left ?
> 
> 
> Ok, so all are now done except:

Nice.

> Digester
>  - Not sure. Likely to be tricky
> 
> Clustering
>  - org.apache.catalina.tribes.dns_lookups
>    Any DNS names are going to *have* to be resolved at some point for
>    the cluster to work. I'd probably remove this and let the user
>    specify DNS name or IP address as they wish.
> 
> This one. I'd remove it outright.

I agree. Deprecate it in 10, back-port and then remove it in 10.

I can do this next as I have just finished going through the open PRs.

> EL
>  - Can't do anything about these without spec changes
> 
> Jasper
>  - Could all move to o.a.jasper.Options
> 
> Security
>  - ALLOW_BACKSLASH
>    Remove it. It is just wrong. If we must keep it, move it to the
>    Connector.
>  - ALLOW_ENCODED_SLASH
>    I plan to replace this with a Connector option
> 
> Spec
>  - STRICT_SERVLET_COMPLIANCE
>    Is a useful short-cut
> 
> 
> I would prefer keeping it (useful shortcut indeed), even though it might
> be technically feasible to remove it.

It looks like this could be made per web application if we wanted.
Whether there is a need to do that (keeping the system property as the
default) is TBD. I don't recall any requests to do that so maybe wiat
until we get one.

>  - Move the remaining ones to the Context or related object where
>    possible (I haven't checked how easy that would be)
> 
> Sessions
>  - Move to the Manager or related object where possible (I haven't
>    checked how easy that would be)
> 
> JULI
>  - Look tricky to remove any of these.
> 
> JAR Scanning
>  - Leave as is
> 
> WebSockets
>  - Ideally want to set these per web app but we'd need to find a
>    configuration mechanism to use
> 
> Not done yet.

ServletContext initialisation parameters come to mind but I need to
check how accessible they are from the code that needs to use the
configuration. I think that might be something for M5.

> Other
>  - Looks like NioSelectorShared has already been refactored out.
>  - The rest look difficult to remove.
> 
> 
> Yes, the rest are either impossible to remove, or super legacy ways to
> set default values and possibly "widely" used [looking at something like
> "jvmRoute", "catalina.config" or "catalina.useNaming" for example].

Agreed.

What we have though is a huge improvement on where things were. Thanks
for all you have done on this.

Mark

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



[tomcat] branch master updated: Deprecate the org.apache.catalina.tribes.dns_lookups system property

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new e64d3d7  Deprecate the org.apache.catalina.tribes.dns_lookups system 
property
e64d3d7 is described below

commit e64d3d7260de4c4a68303b62c8520cda9be3f4c9
Author: Mark Thomas 
AuthorDate: Thu Apr 2 15:56:09 2020 +0100

Deprecate the org.apache.catalina.tribes.dns_lookups system property
---
 java/org/apache/catalina/tribes/membership/MemberImpl.java | 3 +++
 webapps/docs/config/systemprops.xml| 2 ++
 2 files changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/tribes/membership/MemberImpl.java 
b/java/org/apache/catalina/tribes/membership/MemberImpl.java
index 1c6c82d..eb52eae 100644
--- a/java/org/apache/catalina/tribes/membership/MemberImpl.java
+++ b/java/org/apache/catalina/tribes/membership/MemberImpl.java
@@ -38,7 +38,10 @@ public class MemberImpl implements Member, 
java.io.Externalizable {
 /**
  * Should a call to getName or getHostName try to do a DNS lookup?
  * default is false
+ *
+ * @deprecated This will be removed without replacement in Tomact 10 
onwards
  */
+@Deprecated
 public static final boolean DO_DNS_LOOKUPS = 
Boolean.parseBoolean(System.getProperty("org.apache.catalina.tribes.dns_lookups","false"));
 
 public static final transient byte[] TRIBES_MBR_BEGIN = new byte[] {84, 
82, 73, 66, 69, 83, 45, 66, 1, 0};
diff --git a/webapps/docs/config/systemprops.xml 
b/webapps/docs/config/systemprops.xml
index 2fc5a33..f4391ca 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -69,6 +69,8 @@
   
 
 
+  This system property is deprecated and will be removed without
+  replacement in Apache Tomcat 10 onwards.
   If true, the clustering module will attempt to use DNS to
   resolve any host names provided in the cluster configuration.
   If not specified, the default value of false will be 
used.


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



[tomcat] branch 9.0.x updated: Deprecate the org.apache.catalina.tribes.dns_lookups system property

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new d3ae1dc  Deprecate the org.apache.catalina.tribes.dns_lookups system 
property
d3ae1dc is described below

commit d3ae1dcf5c9d4e3f10d721c43b7a52b51317908d
Author: Mark Thomas 
AuthorDate: Thu Apr 2 15:56:09 2020 +0100

Deprecate the org.apache.catalina.tribes.dns_lookups system property
---
 java/org/apache/catalina/tribes/membership/MemberImpl.java | 3 +++
 webapps/docs/config/systemprops.xml| 2 ++
 2 files changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/tribes/membership/MemberImpl.java 
b/java/org/apache/catalina/tribes/membership/MemberImpl.java
index 1c6c82d..eb52eae 100644
--- a/java/org/apache/catalina/tribes/membership/MemberImpl.java
+++ b/java/org/apache/catalina/tribes/membership/MemberImpl.java
@@ -38,7 +38,10 @@ public class MemberImpl implements Member, 
java.io.Externalizable {
 /**
  * Should a call to getName or getHostName try to do a DNS lookup?
  * default is false
+ *
+ * @deprecated This will be removed without replacement in Tomact 10 
onwards
  */
+@Deprecated
 public static final boolean DO_DNS_LOOKUPS = 
Boolean.parseBoolean(System.getProperty("org.apache.catalina.tribes.dns_lookups","false"));
 
 public static final transient byte[] TRIBES_MBR_BEGIN = new byte[] {84, 
82, 73, 66, 69, 83, 45, 66, 1, 0};
diff --git a/webapps/docs/config/systemprops.xml 
b/webapps/docs/config/systemprops.xml
index b472daf..75ce6e7 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -69,6 +69,8 @@
   
 
 
+  This system property is deprecated and will be removed without
+  replacement in Apache Tomcat 10 onwards.
   If true, the clustering module will attempt to use DNS to
   resolve any host names provided in the cluster configuration.
   If not specified, the default value of false will be 
used.


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



[tomcat] branch 8.5.x updated: Deprecate the org.apache.catalina.tribes.dns_lookups system property

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 72c5ba8  Deprecate the org.apache.catalina.tribes.dns_lookups system 
property
72c5ba8 is described below

commit 72c5ba860f53201116d00adc34a06daab36d6b37
Author: Mark Thomas 
AuthorDate: Thu Apr 2 15:56:09 2020 +0100

Deprecate the org.apache.catalina.tribes.dns_lookups system property
---
 java/org/apache/catalina/tribes/membership/MemberImpl.java | 3 +++
 webapps/docs/config/systemprops.xml| 2 ++
 2 files changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/tribes/membership/MemberImpl.java 
b/java/org/apache/catalina/tribes/membership/MemberImpl.java
index 1c6c82d..eb52eae 100644
--- a/java/org/apache/catalina/tribes/membership/MemberImpl.java
+++ b/java/org/apache/catalina/tribes/membership/MemberImpl.java
@@ -38,7 +38,10 @@ public class MemberImpl implements Member, 
java.io.Externalizable {
 /**
  * Should a call to getName or getHostName try to do a DNS lookup?
  * default is false
+ *
+ * @deprecated This will be removed without replacement in Tomact 10 
onwards
  */
+@Deprecated
 public static final boolean DO_DNS_LOOKUPS = 
Boolean.parseBoolean(System.getProperty("org.apache.catalina.tribes.dns_lookups","false"));
 
 public static final transient byte[] TRIBES_MBR_BEGIN = new byte[] {84, 
82, 73, 66, 69, 83, 45, 66, 1, 0};
diff --git a/webapps/docs/config/systemprops.xml 
b/webapps/docs/config/systemprops.xml
index 2ffcce1..f047a39 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -69,6 +69,8 @@
   
 
 
+  This system property is deprecated and will be removed without
+  replacement in Apache Tomcat 10 onwards.
   If true, the clustering module will attempt to use DNS to
   resolve any host names provided in the cluster configuration.
   If not specified, the default value of false will be 
used.


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



[tomcat] branch 7.0.x updated: Deprecate the org.apache.catalina.tribes.dns_lookups system property

2020-04-02 Thread markt
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 ebdb601  Deprecate the org.apache.catalina.tribes.dns_lookups system 
property
ebdb601 is described below

commit ebdb601ccc146ddda2e24d67a8d267928b78bddf
Author: Mark Thomas 
AuthorDate: Thu Apr 2 15:56:09 2020 +0100

Deprecate the org.apache.catalina.tribes.dns_lookups system property
---
 java/org/apache/catalina/tribes/membership/MemberImpl.java | 3 +++
 webapps/docs/config/systemprops.xml| 2 ++
 2 files changed, 5 insertions(+)

diff --git a/java/org/apache/catalina/tribes/membership/MemberImpl.java 
b/java/org/apache/catalina/tribes/membership/MemberImpl.java
index b3634a8..acf3afb 100644
--- a/java/org/apache/catalina/tribes/membership/MemberImpl.java
+++ b/java/org/apache/catalina/tribes/membership/MemberImpl.java
@@ -38,7 +38,10 @@ public class MemberImpl implements Member, 
java.io.Externalizable {
 /**
  * Should a call to getName or getHostName try to do a DNS lookup?
  * default is false
+ *
+ * @deprecated This will be removed without replacement in Tomact 10 
onwards
  */
+@Deprecated
 public static final boolean DO_DNS_LOOKUPS = 
Boolean.parseBoolean(System.getProperty("org.apache.catalina.tribes.dns_lookups","false"));
 
 /**
diff --git a/webapps/docs/config/systemprops.xml 
b/webapps/docs/config/systemprops.xml
index 954ceed..928391b 100644
--- a/webapps/docs/config/systemprops.xml
+++ b/webapps/docs/config/systemprops.xml
@@ -60,6 +60,8 @@
   
 
 
+  This system property is deprecated and will be removed without
+  replacement in Apache Tomcat 10 onwards.
   If true, the clustering module will attempt to use DNS to
   resolve any host names provided in the cluster configuration.
   If not specified, the default value of false will be 
used.


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



[tomcat] branch master updated: Remove deprecated code.

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 2ada85d  Remove deprecated code.
2ada85d is described below

commit 2ada85d0acc170b48d6799bef8f62d39fd0058d9
Author: Mark Thomas 
AuthorDate: Thu Apr 2 16:06:17 2020 +0100

Remove deprecated code.
---
 .../tribes/membership/LocalStrings.properties  |  1 -
 .../tribes/membership/LocalStrings_fr.properties   |  1 -
 .../tribes/membership/LocalStrings_ja.properties   |  1 -
 .../tribes/membership/LocalStrings_ko.properties   |  1 -
 .../catalina/tribes/membership/MemberImpl.java | 27 +-
 webapps/docs/changelog.xml |  9 
 webapps/docs/config/systemprops.xml| 15 
 7 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/java/org/apache/catalina/tribes/membership/LocalStrings.properties 
b/java/org/apache/catalina/tribes/membership/LocalStrings.properties
index 6237640..2816301 100644
--- a/java/org/apache/catalina/tribes/membership/LocalStrings.properties
+++ b/java/org/apache/catalina/tribes/membership/LocalStrings.properties
@@ -51,7 +51,6 @@ memberImpl.invalid.package.end=Invalid package, should end 
with:[{0}]
 memberImpl.large.payload=Payload is too large for tribes to handle.
 memberImpl.notEnough.bytes=Not enough bytes in member package.
 memberImpl.package.small=Member package too small to validate.
-memberImpl.unableParse.hostname=Unable to parse hostname.
 
 staticMember.invalid.uuidLength=UUID must be exactly 16 bytes, not:[{0}]
 
diff --git 
a/java/org/apache/catalina/tribes/membership/LocalStrings_fr.properties 
b/java/org/apache/catalina/tribes/membership/LocalStrings_fr.properties
index 558c801..4d9d6aa 100644
--- a/java/org/apache/catalina/tribes/membership/LocalStrings_fr.properties
+++ b/java/org/apache/catalina/tribes/membership/LocalStrings_fr.properties
@@ -51,7 +51,6 @@ memberImpl.invalid.package.end=le paquet est invalide, il 
devrait se terminer pa
 memberImpl.large.payload=Le contenu est trop gros pour être géré par Tribes
 memberImpl.notEnough.bytes=Pas assez d'octets dans le paquet membre
 memberImpl.package.small=Le paquet du membre est trop petit pour être validé
-memberImpl.unableParse.hostname=Incapable d'analyser le nom d'hôte (hostname)
 
 staticMember.invalid.uuidLength=Un UUID doit faire exactement 16 octets et non 
[{0}]
 
diff --git 
a/java/org/apache/catalina/tribes/membership/LocalStrings_ja.properties 
b/java/org/apache/catalina/tribes/membership/LocalStrings_ja.properties
index 60a639d..fd34211 100644
--- a/java/org/apache/catalina/tribes/membership/LocalStrings_ja.properties
+++ b/java/org/apache/catalina/tribes/membership/LocalStrings_ja.properties
@@ -51,7 +51,6 @@ memberImpl.invalid.package.end=不正なパッケージです。[{0}] で終端
 memberImpl.large.payload=ペイロードはtribes が処理するには大きすぎます。
 memberImpl.notEnough.bytes=メンバーパッケージのバイト長が不足しています。
 memberImpl.package.small=メンバーパッケージが小さすぎて検証できません。
-memberImpl.unableParse.hostname=ホスト名を解析できません。
 
 staticMember.invalid.uuidLength=UUIDは正確に16バイトでなければなりません。[{0}]
 
diff --git 
a/java/org/apache/catalina/tribes/membership/LocalStrings_ko.properties 
b/java/org/apache/catalina/tribes/membership/LocalStrings_ko.properties
index 7f53838..258ade1 100644
--- a/java/org/apache/catalina/tribes/membership/LocalStrings_ko.properties
+++ b/java/org/apache/catalina/tribes/membership/LocalStrings_ko.properties
@@ -51,7 +51,6 @@ memberImpl.invalid.package.end=유효하지 않은 패키지. [{0}](으)로 끝
 memberImpl.large.payload=Payload가 너무 커서 tribe들이 처리할 수 없습니다.
 memberImpl.notEnough.bytes=멤버 데이터 바이트 배열에 충분한 데이터가 존재하지 않습니다.
 memberImpl.package.small=멤버 패키지가 너무 작아서, 유효한지 확인할 수 없습니다.
-memberImpl.unableParse.hostname=호스트 이름을 파싱할 수 없습니다.
 
 staticMember.invalid.uuidLength=UUID는 정확히 16 바이트여야만 합니다. [{0}]이어서는 안됩니다.
 
diff --git a/java/org/apache/catalina/tribes/membership/MemberImpl.java 
b/java/org/apache/catalina/tribes/membership/MemberImpl.java
index eb52eae..8e994e0 100644
--- a/java/org/apache/catalina/tribes/membership/MemberImpl.java
+++ b/java/org/apache/catalina/tribes/membership/MemberImpl.java
@@ -35,15 +35,6 @@ import org.apache.catalina.tribes.util.StringManager;
  */
 public class MemberImpl implements Member, java.io.Externalizable {
 
-/**
- * Should a call to getName or getHostName try to do a DNS lookup?
- * default is false
- *
- * @deprecated This will be removed without replacement in Tomact 10 
onwards
- */
-@Deprecated
-public static final boolean DO_DNS_LOOKUPS = 
Boolean.parseBoolean(System.getProperty("org.apache.catalina.tribes.dns_lookups","false"));
-
 public static final transient byte[] TRIBES_MBR_BEGIN = new byte[] {84, 
82, 73, 66, 69, 83, 45, 66, 1, 0};
 public static final transient byte[] TRIBES_MBR_END   = new byte[] {84, 
82, 73, 66, 69, 83, 45, 69, 1, 0};
 protected

[GitHub] [tomcat] markt-asf commented on issue #249: Support for default values in property value expressions

2020-04-02 Thread GitBox
markt-asf commented on issue #249: Support for default values in property value 
expressions
URL: https://github.com/apache/tomcat/pull/249#issuecomment-607903803
 
 
   Thanks for thr PR. A variation has been applied to all currently supported 
branches.


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



[GitHub] [tomcat] markt-asf closed pull request #249: Support for default values in property value expressions

2020-04-02 Thread GitBox
markt-asf closed pull request #249: Support for default values in property 
value expressions
URL: https://github.com/apache/tomcat/pull/249
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

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



buildbot failure in on tomcat-9-trunk

2020-04-02 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-9-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-9-trunk/builds/146

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' 
triggered this build
Build Source Stamp: [branch 9.0.x] cdfea5d3df5c3c4d65d9922e78f05fa967ab0a97
Blamelist: Thomas Stock ,bohmber 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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



Time to tag 10.0.0-M4, 9.0.34, 8.5.54

2020-04-02 Thread Mark Thomas
Hi all,

I've reviewed the open Bugzilla issues and Pull Requests and I think we
are in a position to tag the April round of releases. I'll start this
process later today or tomorrow as time allows.

Mark

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



buildbot success in on tomcat-trunk

2020-04-02 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5082

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 2ada85d0acc170b48d6799bef8f62d39fd0058d9
Blamelist: Mark Thomas ,bohmber ,remm 


Build succeeded!

Sincerely,
 -The Buildbot




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



buildbot success in on tomcat-9-trunk

2020-04-02 Thread buildbot
The Buildbot has detected a restored build on builder tomcat-9-trunk while 
building tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-9-trunk/builds/147

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-9-commit' 
triggered this build
Build Source Stamp: [branch 9.0.x] d3ae1dcf5c9d4e3f10d721c43b7a52b51317908d
Blamelist: Mark Thomas 

Build succeeded!

Sincerely,
 -The Buildbot




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



[tomcat] branch 8.5.x updated: Improve code coverage

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 3031d06  Improve code coverage
3031d06 is described below

commit 3031d06fcbcdcd23d72b7b3f4f8ee6c6c892e0a8
Author: Mark Thomas 
AuthorDate: Thu Apr 2 20:40:40 2020 +0100

Improve code coverage
---
 .../apache/tomcat/util/res/TestStringManager.java| 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/util/res/TestStringManager.java 
b/test/org/apache/tomcat/util/res/TestStringManager.java
index 2a5bb96..7caeead 100644
--- a/test/org/apache/tomcat/util/res/TestStringManager.java
+++ b/test/org/apache/tomcat/util/res/TestStringManager.java
@@ -16,13 +16,15 @@
  */
 package org.apache.tomcat.util.res;
 
+import java.util.Locale;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 public class TestStringManager {
 
-private static final StringManager sm =
-StringManager.getManager("org.apache.naming");
+private static final String PACKAGE_NAME = "org.apache.tomcat.util";
+private static final StringManager sm = 
StringManager.getManager(PACKAGE_NAME);
 
 @Test
 public void testNullKey() {
@@ -43,4 +45,18 @@ public class TestStringManager {
 sm.getString("namingContext.nameNotBound", (Object[]) null);
 sm.getString("namingContext.nameNotBound", new Object[1]);
 }
+
+@Test
+public void testFrench() {
+StringManager sm = StringManager.getManager(PACKAGE_NAME, 
Locale.FRENCH);
+Assert.assertEquals(Locale.FRENCH, sm.getLocale());
+}
+
+@Test
+public void testMissing() {
+
Thread.currentThread().setContextClassLoader(TestStringManager.class.getClassLoader());
+StringManager sm = StringManager.getManager("org.does.no.exist");
+Assert.assertNull(sm.getLocale());
+}
+
 }


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



[tomcat] branch 9.0.x updated: Improve code coverage

2020-04-02 Thread markt
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


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 34eefd0  Improve code coverage
34eefd0 is described below

commit 34eefd07c471acbcc8d6a806084de243a6f2d875
Author: Mark Thomas 
AuthorDate: Thu Apr 2 20:40:40 2020 +0100

Improve code coverage
---
 .../apache/tomcat/util/res/TestStringManager.java| 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/util/res/TestStringManager.java 
b/test/org/apache/tomcat/util/res/TestStringManager.java
index 2a5bb96..7caeead 100644
--- a/test/org/apache/tomcat/util/res/TestStringManager.java
+++ b/test/org/apache/tomcat/util/res/TestStringManager.java
@@ -16,13 +16,15 @@
  */
 package org.apache.tomcat.util.res;
 
+import java.util.Locale;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 public class TestStringManager {
 
-private static final StringManager sm =
-StringManager.getManager("org.apache.naming");
+private static final String PACKAGE_NAME = "org.apache.tomcat.util";
+private static final StringManager sm = 
StringManager.getManager(PACKAGE_NAME);
 
 @Test
 public void testNullKey() {
@@ -43,4 +45,18 @@ public class TestStringManager {
 sm.getString("namingContext.nameNotBound", (Object[]) null);
 sm.getString("namingContext.nameNotBound", new Object[1]);
 }
+
+@Test
+public void testFrench() {
+StringManager sm = StringManager.getManager(PACKAGE_NAME, 
Locale.FRENCH);
+Assert.assertEquals(Locale.FRENCH, sm.getLocale());
+}
+
+@Test
+public void testMissing() {
+
Thread.currentThread().setContextClassLoader(TestStringManager.class.getClassLoader());
+StringManager sm = StringManager.getManager("org.does.no.exist");
+Assert.assertNull(sm.getLocale());
+}
+
 }


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



[tomcat] branch master updated: Improve code coverage

2020-04-02 Thread markt
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
 new 58b0fbc  Improve code coverage
58b0fbc is described below

commit 58b0fbcf901ee9a41a2a94c470c97e6b5db8eae6
Author: Mark Thomas 
AuthorDate: Thu Apr 2 20:40:40 2020 +0100

Improve code coverage
---
 .../apache/tomcat/util/res/TestStringManager.java| 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/util/res/TestStringManager.java 
b/test/org/apache/tomcat/util/res/TestStringManager.java
index 2a5bb96..7caeead 100644
--- a/test/org/apache/tomcat/util/res/TestStringManager.java
+++ b/test/org/apache/tomcat/util/res/TestStringManager.java
@@ -16,13 +16,15 @@
  */
 package org.apache.tomcat.util.res;
 
+import java.util.Locale;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 public class TestStringManager {
 
-private static final StringManager sm =
-StringManager.getManager("org.apache.naming");
+private static final String PACKAGE_NAME = "org.apache.tomcat.util";
+private static final StringManager sm = 
StringManager.getManager(PACKAGE_NAME);
 
 @Test
 public void testNullKey() {
@@ -43,4 +45,18 @@ public class TestStringManager {
 sm.getString("namingContext.nameNotBound", (Object[]) null);
 sm.getString("namingContext.nameNotBound", new Object[1]);
 }
+
+@Test
+public void testFrench() {
+StringManager sm = StringManager.getManager(PACKAGE_NAME, 
Locale.FRENCH);
+Assert.assertEquals(Locale.FRENCH, sm.getLocale());
+}
+
+@Test
+public void testMissing() {
+
Thread.currentThread().setContextClassLoader(TestStringManager.class.getClassLoader());
+StringManager sm = StringManager.getManager("org.does.no.exist");
+Assert.assertNull(sm.getLocale());
+}
+
 }


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



[tomcat] branch 7.0.x updated: Improve code coverage

2020-04-02 Thread markt
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 301929b  Improve code coverage
301929b is described below

commit 301929b9ef4780f0605416e76489dcab96d5ed61
Author: Mark Thomas 
AuthorDate: Thu Apr 2 20:40:40 2020 +0100

Improve code coverage
---
 .../apache/tomcat/util/res/TestStringManager.java| 20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/test/org/apache/tomcat/util/res/TestStringManager.java 
b/test/org/apache/tomcat/util/res/TestStringManager.java
index 2a5bb96..7caeead 100644
--- a/test/org/apache/tomcat/util/res/TestStringManager.java
+++ b/test/org/apache/tomcat/util/res/TestStringManager.java
@@ -16,13 +16,15 @@
  */
 package org.apache.tomcat.util.res;
 
+import java.util.Locale;
+
 import org.junit.Assert;
 import org.junit.Test;
 
 public class TestStringManager {
 
-private static final StringManager sm =
-StringManager.getManager("org.apache.naming");
+private static final String PACKAGE_NAME = "org.apache.tomcat.util";
+private static final StringManager sm = 
StringManager.getManager(PACKAGE_NAME);
 
 @Test
 public void testNullKey() {
@@ -43,4 +45,18 @@ public class TestStringManager {
 sm.getString("namingContext.nameNotBound", (Object[]) null);
 sm.getString("namingContext.nameNotBound", new Object[1]);
 }
+
+@Test
+public void testFrench() {
+StringManager sm = StringManager.getManager(PACKAGE_NAME, 
Locale.FRENCH);
+Assert.assertEquals(Locale.FRENCH, sm.getLocale());
+}
+
+@Test
+public void testMissing() {
+
Thread.currentThread().setContextClassLoader(TestStringManager.class.getClassLoader());
+StringManager sm = StringManager.getManager("org.does.no.exist");
+Assert.assertNull(sm.getLocale());
+}
+
 }


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



buildbot failure in on tomcat-trunk

2020-04-02 Thread buildbot
The Buildbot has detected a new failure on builder tomcat-trunk while building 
tomcat. Full details are available at:
https://ci.apache.org/builders/tomcat-trunk/builds/5083

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: asf946_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-tomcat-commit' 
triggered this build
Build Source Stamp: [branch master] 58b0fbcf901ee9a41a2a94c470c97e6b5db8eae6
Blamelist: Mark Thomas 

BUILD FAILED: failed compile_1

Sincerely,
 -The Buildbot




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