From 31089671b1f5f099ea9f37e1a80bbe8cdad9984d Mon Sep 17 00:00:00 2001 From: kkolinko Date: Mon, 11 Jul 2011 18:40:48 +0000 Subject: [PATCH] Followup to r1145209 Do not expose TCN_FULL_VERSION as a public constant, but calculate it when needed. Using this way it will be easier to throw away the code in AprEndpoint when it becomes unneeded. I do not mind reintroducing the constant if it were used in two or more places. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1145285 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/jni/Library.java | 5 ----- java/org/apache/tomcat/util/net/AprEndpoint.java | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/java/org/apache/tomcat/jni/Library.java b/java/org/apache/tomcat/jni/Library.java index 3c6634ffc..de71253e8 100644 --- a/java/org/apache/tomcat/jni/Library.java +++ b/java/org/apache/tomcat/jni/Library.java @@ -102,8 +102,6 @@ public final class Library { public static int TCN_PATCH_VERSION = 0; /* TCN_IS_DEV_VERSION */ public static int TCN_IS_DEV_VERSION = 0; - /* TCN_FULL_VERSION */ - public static int TCN_FULL_VERSION = 0; /* APR_MAJOR_VERSION */ public static int APR_MAJOR_VERSION = 0; /* APR_MINOR_VERSION */ @@ -180,9 +178,6 @@ public final class Library { TCN_MINOR_VERSION = version(0x02); TCN_PATCH_VERSION = version(0x03); TCN_IS_DEV_VERSION = version(0x04); - TCN_FULL_VERSION = TCN_MAJOR_VERSION * 1000 + - TCN_MINOR_VERSION * 100 + - TCN_PATCH_VERSION; APR_MAJOR_VERSION = version(0x11); APR_MINOR_VERSION = version(0x12); APR_PATCH_VERSION = version(0x13); diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 0fcf400ff..9efb2c381 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -473,7 +473,10 @@ public class AprEndpoint extends AbstractEndpoint { // SSL protocol int value; // This branch can be removed, once the required version is at least 1.1.21. - if (Library.TCN_FULL_VERSION <= 1120) { + int tcnFullVersion = Library.TCN_MAJOR_VERSION * 1000 + + Library.TCN_MINOR_VERSION * 100 + + Library.TCN_PATCH_VERSION; + if (tcnFullVersion <= 1120) { value = SSL.SSL_PROTOCOL_ALL; if ("SSLv2".equalsIgnoreCase(SSLProtocol)) { value = SSL.SSL_PROTOCOL_SSLV2; -- 2.11.0