[tomcat] branch 8.5.x updated: Fix copy/paste error & simplify

2023-06-14 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 27fe45a184 Fix copy/paste error & simplify
27fe45a184 is described below

commit 27fe45a1842fd0e734e50b767d8d4c3d60d30854
Author: Mark Thomas 
AuthorDate: Wed Jun 14 09:10:07 2023 +0100

Fix copy/paste error & simplify
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 10 --
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index ee704bd1f3..bc78d0c90e 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -379,18 +379,16 @@ public abstract class AbstractEndpoint {
 
 if (certificate.getStoreType() == StoreType.PEM) {
 // PEM file based
-String keySource = certificate.getCertificateKeystoreFile();
-keySource = certificate.getCertificateKeyFile();
-certificateInfo = sm.getString("endpoint.tls.info.cert.pem", 
keySource, certificate.getCertificateFile(),
-certificate.getCertificateChainFile());
+certificateInfo = sm.getString("endpoint.tls.info.cert.pem", 
certificate.getCertificateKeyFile(),
+certificate.getCertificateFile(), 
certificate.getCertificateChainFile());
 } else {
 // Keystore based
-String keyStore = certificate.getCertificateKeystoreFile();
 String keyAlias = certificate.getCertificateKeyAlias();
 if (keyAlias == null) {
 keyAlias = SSLUtilBase.DEFAULT_KEY_ALIAS;
 }
-certificateInfo = sm.getString("endpoint.tls.info.cert.keystore", 
keyStore, keyAlias);
+certificateInfo =
+sm.getString("endpoint.tls.info.cert.keystore", 
certificate.getCertificateKeystoreFile(), keyAlias);
 }
 
 String trustStoreSource = sslHostConfig.getTruststoreFile();


-
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: Fix copy/paste error

2023-01-12 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 5250758127 Fix copy/paste error
5250758127 is described below

commit 525075812738411fd01f3f31e1f1b01561cd9ceb
Author: Mark Thomas 
AuthorDate: Thu Jan 12 22:23:30 2023 +

Fix copy/paste error
---
 test/org/apache/catalina/tribes/TesterMulticast.java | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/catalina/tribes/TesterMulticast.java 
b/test/org/apache/catalina/tribes/TesterMulticast.java
index 866d50ed30..3fb019b775 100644
--- a/test/org/apache/catalina/tribes/TesterMulticast.java
+++ b/test/org/apache/catalina/tribes/TesterMulticast.java
@@ -18,8 +18,8 @@ package org.apache.catalina.tribes;
 
 import java.net.DatagramPacket;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
 import java.net.MulticastSocket;
-import java.net.NetworkInterface;
 import java.net.UnknownHostException;
 
 /**
@@ -82,8 +82,7 @@ public class TesterMulticast {
 public void run() {
 try (MulticastSocket s = new MulticastSocket(PORT)) {
 s.setLoopbackMode(false);
-NetworkInterface networkInterface = 
NetworkInterface.getByInetAddress(INET_ADDRESS);
-s.setNetworkInterface(networkInterface);
+s.joinGroup(new InetSocketAddress(INET_ADDRESS, 0), null);
 DatagramPacket p = new DatagramPacket(new byte[4], 4);
 p.setAddress(INET_ADDRESS);
 p.setPort(PORT);
@@ -110,8 +109,7 @@ public class TesterMulticast {
 public void run() {
 try (MulticastSocket s = new MulticastSocket(PORT)) {
 s.setLoopbackMode(false);
-NetworkInterface networkInterface = 
NetworkInterface.getByInetAddress(INET_ADDRESS);
-s.setNetworkInterface(networkInterface);
+s.joinGroup(new InetSocketAddress(INET_ADDRESS, 0), null);
 DatagramPacket p = new DatagramPacket(new byte[4], 4);
 p.setAddress(INET_ADDRESS);
 p.setPort(PORT);


-
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: Fix copy/paste error

2022-05-10 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 9dc00acdd0 Fix copy/paste error
9dc00acdd0 is described below

commit 9dc00acdd04be9554954e5400d6c5f7650512c3d
Author: Mark Thomas 
AuthorDate: Tue May 10 16:09:38 2022 +0100

Fix copy/paste error
---
 java/org/apache/catalina/filters/CsrfPreventionFilter.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/filters/CsrfPreventionFilter.java 
b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
index 2f811c226b..bfa65fc99c 100644
--- a/java/org/apache/catalina/filters/CsrfPreventionFilter.java
+++ b/java/org/apache/catalina/filters/CsrfPreventionFilter.java
@@ -262,7 +262,8 @@ public class CsrfPreventionFilter extends 
CsrfPreventionFilterBase {
  *  cache. Unused by the default implementation.
  * @param session   The session associated with the request.
  *
- * @return A newly created {@link NonceCache}
+ * @return The {@link NonceCache} currently associated with the request
+ * and/or session
  */
 protected NonceCache getNonceCache(HttpServletRequest request, 
HttpSession session) {
 @SuppressWarnings("unchecked")


-
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: Fix copy/paste error. Fix backport.

2022-02-10 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 defad3a  Fix copy/paste error. Fix backport.
defad3a is described below

commit defad3a508c730c283bd550d644aac04ba03df20
Author: Mark Thomas 
AuthorDate: Thu Feb 10 17:16:30 2022 +

Fix copy/paste error. Fix backport.
---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index 0c47367..8653707 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -110,7 +110,7 @@ public class AprEndpoint extends AbstractEndpoint 
implements SNICallBack {
 
 private int previousAcceptedPort = -1;
 private String previousAcceptedAddress = null;
-private long previouspreviousAcceptedSocketNanoTime = 0;
+private long previousAcceptedSocketNanoTime = 0;
 
 
 
@@ -780,13 +780,14 @@ public class AprEndpoint extends AbstractEndpoint 
implements SNICallBack {
 long currentNanoTime = System.nanoTime();
 if (wrapper.getRemotePort() == previousAcceptedPort) {
 if 
(wrapper.getRemoteAddr().equals(previousAcceptedAddress)) {
-if (currentNanoTime - 
previouspreviousAcceptedSocketNanoTime < 1000) {
+if (currentNanoTime - 
previousAcceptedSocketNanoTime < 1000) {
 throw new 
IOException(sm.getString("endpoint.err.duplicateAccept"));
 }
 }
 }
 previousAcceptedPort = wrapper.getRemotePort();
 previousAcceptedAddress = wrapper.getRemoteAddr();
+previousAcceptedSocketNanoTime = currentNanoTime;
 }
 
 wrapper.setKeepAliveLeft(getMaxKeepAliveRequests());

-
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: Fix copy/paste error

2021-09-17 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 04e5c05  Fix copy/paste error
04e5c05 is described below

commit 04e5c054e3de762780faa735ed703b0bf90cc870
Author: Mark Thomas 
AuthorDate: Fri Sep 17 22:09:16 2021 +0100

Fix copy/paste error
---
 java/org/apache/el/parser/AstValue.java  | 12 +---
 test/org/apache/el/TestMethodExpressionImpl.java | 13 +
 2 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/java/org/apache/el/parser/AstValue.java 
b/java/org/apache/el/parser/AstValue.java
index 4db4a50..dec6259 100644
--- a/java/org/apache/el/parser/AstValue.java
+++ b/java/org/apache/el/parser/AstValue.java
@@ -214,13 +214,11 @@ public final class AstValue extends SimpleNode {
 Target t = getTarget(ctx);
 Class[] types = null;
 if (isParametersProvided()) {
-if (isParametersProvided()) {
-Object[] values = ((AstMethodParameters) this.jjtGetChild(
-this.jjtGetNumChildren() - 1)).getParameters(ctx);
-types = getTypesFromValues(values);
-} else {
-types = paramTypes;
-}
+Object[] values = ((AstMethodParameters) this.jjtGetChild(
+this.jjtGetNumChildren() - 1)).getParameters(ctx);
+types = getTypesFromValues(values);
+} else {
+types = paramTypes;
 }
 Method m = ReflectionUtil.getMethod(ctx, t.base, t.property, types, 
null);
 return new MethodInfo(m.getName(), m.getReturnType(), 
m.getParameterTypes());
diff --git a/test/org/apache/el/TestMethodExpressionImpl.java 
b/test/org/apache/el/TestMethodExpressionImpl.java
index 2c863e3..6b6812d 100644
--- a/test/org/apache/el/TestMethodExpressionImpl.java
+++ b/test/org/apache/el/TestMethodExpressionImpl.java
@@ -927,4 +927,17 @@ public class TestMethodExpressionImpl {
 Assert.assertEquals(1, mi.getParamTypes().length);
 Assert.assertEquals(String.class, mi.getParamTypes()[0]);
 }
+
+
+@Test
+public void testGetMethodInfo02() throws Exception {
+MethodExpression me = factory.createMethodExpression(context,
+"#{beanA.setName}", null, new Class[] { String.class } );
+// This is the call that failed
+MethodInfo mi = me.getMethodInfo(context);
+// The rest is to check it worked correctly
+Assert.assertEquals(void.class, mi.getReturnType());
+Assert.assertEquals(1, mi.getParamTypes().length);
+Assert.assertEquals(String.class, mi.getParamTypes()[0]);
+}
 }

-
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: Fix copy/paste error

2019-07-31 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 40b5f50  Fix copy/paste error
40b5f50 is described below

commit 40b5f501c4a36690c4e599ccd20ecc4902a6710d
Author: Mark Thomas 
AuthorDate: Wed Jul 31 11:43:15 2019 +0100

Fix copy/paste error
---
 java/org/apache/catalina/valves/RemoteIpValve.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/RemoteIpValve.java 
b/java/org/apache/catalina/valves/RemoteIpValve.java
index 89aa4b4..ae5bacc 100644
--- a/java/org/apache/catalina/valves/RemoteIpValve.java
+++ b/java/org/apache/catalina/valves/RemoteIpValve.java
@@ -739,7 +739,7 @@ public class RemoteIpValve extends ValveBase {
 request.setAttribute(AccessLog.PROTOCOL_ATTRIBUTE,
 request.getProtocol());
 request.setAttribute(AccessLog.SERVER_NAME_ATTRIBUTE,
-Integer.valueOf(request.getServerName()));
+request.getServerName());
 request.setAttribute(AccessLog.SERVER_PORT_ATTRIBUTE,
 Integer.valueOf(request.getServerPort()));
 }


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