From 07dbab9f023838445356e8c108f4a5edb3a9dbdd Mon Sep 17 00:00:00 2001 From: zzz Date: Wed, 11 May 2022 07:54:56 -0400 Subject: [PATCH] Util: Rename modified apache classes (Gitlab ticket #353) to avoid conflict in applications linking to apache jars As requested by 'mesh' project Remove with-libhttpclient-java build option No known external uses other than obsolete i2pcontrol plugin --- .../net/i2p/i2pcontrol/HostCheckHandler.java | 2 +- build.properties | 6 ------ build.xml | 2 +- core/java/build.xml | 19 ++++--------------- .../conn/ssl/DefaultHostnameVerifier.java | 6 +++--- .../i2p}/apache/http/conn/ssl/package.html | 3 +++ .../http/conn/util/InetAddressUtils.java | 2 +- .../http/conn/util/PublicSuffixList.java | 4 ++-- .../conn/util/PublicSuffixListParser.java | 2 +- .../http/conn/util/PublicSuffixMatcher.java | 6 +++--- .../i2p}/apache/http/conn/util/package.html | 3 +++ .../i2p}/apache/http/util/Args.java | 2 +- .../i2p}/apache/http/util/package.html | 3 +++ core/java/src/net/i2p/util/Addresses.java | 2 +- .../src/net/i2p/util/I2PSSLSocketFactory.java | 8 ++++---- debian-alt/bionic/i2p-router.links | 9 --------- debian-alt/doc/dependencies.txt | 7 ------- debian/i2p-router.links | 9 --------- history.txt | 3 +++ .../src/net/i2p/router/RouterVersion.java | 2 +- 20 files changed, 35 insertions(+), 65 deletions(-) rename core/java/src/{org => net/i2p}/apache/http/conn/ssl/DefaultHostnameVerifier.java (98%) rename core/java/src/{org => net/i2p}/apache/http/conn/ssl/package.html (70%) rename core/java/src/{org => net/i2p}/apache/http/conn/util/InetAddressUtils.java (99%) rename core/java/src/{org => net/i2p}/apache/http/conn/util/PublicSuffixList.java (96%) rename core/java/src/{org => net/i2p}/apache/http/conn/util/PublicSuffixListParser.java (99%) rename core/java/src/{org => net/i2p}/apache/http/conn/util/PublicSuffixMatcher.java (96%) rename core/java/src/{org => net/i2p}/apache/http/conn/util/package.html (69%) rename core/java/src/{org => net/i2p}/apache/http/util/Args.java (97%) rename core/java/src/{org => net/i2p}/apache/http/util/package.html (69%) diff --git a/apps/i2pcontrol/java/net/i2p/i2pcontrol/HostCheckHandler.java b/apps/i2pcontrol/java/net/i2p/i2pcontrol/HostCheckHandler.java index 7b8587ddc..8f60e4bb6 100644 --- a/apps/i2pcontrol/java/net/i2p/i2pcontrol/HostCheckHandler.java +++ b/apps/i2pcontrol/java/net/i2p/i2pcontrol/HostCheckHandler.java @@ -12,7 +12,7 @@ import net.i2p.I2PAppContext; import net.i2p.data.DataHelper; import net.i2p.util.Log; -import org.apache.http.conn.util.InetAddressUtils; +import net.i2p.apache.http.conn.util.InetAddressUtils; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.server.handler.HandlerWrapper; diff --git a/build.properties b/build.properties index 3ba22a0c4..936891a0e 100644 --- a/build.properties +++ b/build.properties @@ -169,12 +169,6 @@ require.gettext=true #with-famfamfam-flag-png=true # Don't include json-simple library, we will use libjson-simple-java package #with-libjson-simple-java=true -# Don't compile org.apache.http classes, we will use libhttpclient-java and libhttpcore-java packages -# 2 MB of dependencies vs. 20 KB of copied source -# Requires 4.4 or higher. -# Debian: Not in wheezy/jessie -# Ubuntu: Only in wily and later -#with-libhttpclient-java=true ### Redhat packages ### # uncomment to prevent classpaths in jar manifests diff --git a/build.xml b/build.xml index 06ae6b514..0324dcb45 100644 --- a/build.xml +++ b/build.xml @@ -866,7 +866,7 @@ additionalparam="-notimestamp" doctitle="I2P Javadocs for Release ${release.number} Build ${i2p.build.number}${build.extra} (API ${api.version})" windowtitle="I2P Anonymous Network - Java Documentation - API Version ${api.version}"> - + diff --git a/core/java/build.xml b/core/java/build.xml index 1e50e81a4..13b4aee33 100644 --- a/core/java/build.xml +++ b/core/java/build.xml @@ -43,13 +43,6 @@ - - - - - - - @@ -57,7 +50,7 @@ - + @@ -66,9 +59,6 @@ - - - @@ -87,7 +77,6 @@ - @@ -118,7 +107,7 @@ - + @@ -341,7 +330,7 @@ - + @@ -371,7 +360,7 @@ - + diff --git a/core/java/src/org/apache/http/conn/ssl/DefaultHostnameVerifier.java b/core/java/src/net/i2p/apache/http/conn/ssl/DefaultHostnameVerifier.java similarity index 98% rename from core/java/src/org/apache/http/conn/ssl/DefaultHostnameVerifier.java rename to core/java/src/net/i2p/apache/http/conn/ssl/DefaultHostnameVerifier.java index 39318b308..4a28adec7 100644 --- a/core/java/src/org/apache/http/conn/ssl/DefaultHostnameVerifier.java +++ b/core/java/src/net/i2p/apache/http/conn/ssl/DefaultHostnameVerifier.java @@ -25,7 +25,7 @@ * */ -package org.apache.http.conn.ssl; +package net.i2p.apache.http.conn.ssl; import java.net.InetAddress; import java.net.UnknownHostException; @@ -49,8 +49,8 @@ import javax.net.ssl.SSLException; import javax.net.ssl.SSLSession; import javax.security.auth.x500.X500Principal; -import org.apache.http.conn.util.InetAddressUtils; -import org.apache.http.conn.util.PublicSuffixMatcher; +import net.i2p.apache.http.conn.util.InetAddressUtils; +import net.i2p.apache.http.conn.util.PublicSuffixMatcher; import net.i2p.I2PAppContext; import net.i2p.util.Log; diff --git a/core/java/src/org/apache/http/conn/ssl/package.html b/core/java/src/net/i2p/apache/http/conn/ssl/package.html similarity index 70% rename from core/java/src/org/apache/http/conn/ssl/package.html rename to core/java/src/net/i2p/apache/http/conn/ssl/package.html index 31242f694..d46db3e38 100644 --- a/core/java/src/org/apache/http/conn/ssl/package.html +++ b/core/java/src/net/i2p/apache/http/conn/ssl/package.html @@ -5,4 +5,7 @@ For I2PSSSLSocketFactory. Small modifications to remove additional Apache dependencies. Apache 2.0 license.

+

+Moved to net.i2p.apache.* packages in release 1.8.0 (API 0.9.54). +

diff --git a/core/java/src/org/apache/http/conn/util/InetAddressUtils.java b/core/java/src/net/i2p/apache/http/conn/util/InetAddressUtils.java similarity index 99% rename from core/java/src/org/apache/http/conn/util/InetAddressUtils.java rename to core/java/src/net/i2p/apache/http/conn/util/InetAddressUtils.java index c7b8b85e7..0e9234caf 100644 --- a/core/java/src/org/apache/http/conn/util/InetAddressUtils.java +++ b/core/java/src/net/i2p/apache/http/conn/util/InetAddressUtils.java @@ -25,7 +25,7 @@ * */ -package org.apache.http.conn.util; +package net.i2p.apache.http.conn.util; import java.util.regex.Pattern; diff --git a/core/java/src/org/apache/http/conn/util/PublicSuffixList.java b/core/java/src/net/i2p/apache/http/conn/util/PublicSuffixList.java similarity index 96% rename from core/java/src/org/apache/http/conn/util/PublicSuffixList.java rename to core/java/src/net/i2p/apache/http/conn/util/PublicSuffixList.java index cf6b959c9..7e21280f5 100644 --- a/core/java/src/org/apache/http/conn/util/PublicSuffixList.java +++ b/core/java/src/net/i2p/apache/http/conn/util/PublicSuffixList.java @@ -24,12 +24,12 @@ * . * */ -package org.apache.http.conn.util; +package net.i2p.apache.http.conn.util; import java.util.Collections; import java.util.List; -import org.apache.http.util.Args; +import net.i2p.apache.http.util.Args; /** * Public suffix is a set of DNS names or wildcards concatenated with dots. It represents diff --git a/core/java/src/org/apache/http/conn/util/PublicSuffixListParser.java b/core/java/src/net/i2p/apache/http/conn/util/PublicSuffixListParser.java similarity index 99% rename from core/java/src/org/apache/http/conn/util/PublicSuffixListParser.java rename to core/java/src/net/i2p/apache/http/conn/util/PublicSuffixListParser.java index 2cd2f4ec4..008d003ff 100644 --- a/core/java/src/org/apache/http/conn/util/PublicSuffixListParser.java +++ b/core/java/src/net/i2p/apache/http/conn/util/PublicSuffixListParser.java @@ -24,7 +24,7 @@ * . * */ -package org.apache.http.conn.util; +package net.i2p.apache.http.conn.util; import java.io.BufferedReader; import java.io.IOException; diff --git a/core/java/src/org/apache/http/conn/util/PublicSuffixMatcher.java b/core/java/src/net/i2p/apache/http/conn/util/PublicSuffixMatcher.java similarity index 96% rename from core/java/src/org/apache/http/conn/util/PublicSuffixMatcher.java rename to core/java/src/net/i2p/apache/http/conn/util/PublicSuffixMatcher.java index 6da27bb7a..2f14c7f80 100644 --- a/core/java/src/org/apache/http/conn/util/PublicSuffixMatcher.java +++ b/core/java/src/net/i2p/apache/http/conn/util/PublicSuffixMatcher.java @@ -24,7 +24,7 @@ * . * */ -package org.apache.http.conn.util; +package net.i2p.apache.http.conn.util; import java.net.IDN; import java.util.Collection; @@ -32,7 +32,7 @@ import java.util.Locale; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.apache.http.util.Args; +import net.i2p.apache.http.util.Args; /** * Utility class that can test if DNS names match the content of the Public Suffix List. @@ -40,7 +40,7 @@ import org.apache.http.util.Args; * An up-to-date list of suffixes can be obtained from * publicsuffix.org * - * @see org.apache.http.conn.util.PublicSuffixList + * @see net.i2p.apache.http.conn.util.PublicSuffixList * * @since 4.4 */ diff --git a/core/java/src/org/apache/http/conn/util/package.html b/core/java/src/net/i2p/apache/http/conn/util/package.html similarity index 69% rename from core/java/src/org/apache/http/conn/util/package.html rename to core/java/src/net/i2p/apache/http/conn/util/package.html index e2627cb12..5d729c355 100644 --- a/core/java/src/org/apache/http/conn/util/package.html +++ b/core/java/src/net/i2p/apache/http/conn/util/package.html @@ -5,4 +5,7 @@ For HostnameVerifier. Small modifications to remove additional Apache dependencies. Apache 2.0 license.

+

+Moved to net.i2p.apache.* packages in release 1.8.0 (API 0.9.54). +

diff --git a/core/java/src/org/apache/http/util/Args.java b/core/java/src/net/i2p/apache/http/util/Args.java similarity index 97% rename from core/java/src/org/apache/http/util/Args.java rename to core/java/src/net/i2p/apache/http/util/Args.java index b39d87a7e..18b4c3d92 100644 --- a/core/java/src/org/apache/http/util/Args.java +++ b/core/java/src/net/i2p/apache/http/util/Args.java @@ -25,7 +25,7 @@ * */ -package org.apache.http.util; +package net.i2p.apache.http.util; public class Args { diff --git a/core/java/src/org/apache/http/util/package.html b/core/java/src/net/i2p/apache/http/util/package.html similarity index 69% rename from core/java/src/org/apache/http/util/package.html rename to core/java/src/net/i2p/apache/http/util/package.html index 08d0217e6..8279bf08f 100644 --- a/core/java/src/org/apache/http/util/package.html +++ b/core/java/src/net/i2p/apache/http/util/package.html @@ -5,4 +5,7 @@ For HostnameVerifier. Small modifications to remove additional Apache dependencies. Apache 2.0 license.

+

+Moved to net.i2p.apache.* packages in release 1.8.0 (API 0.9.54). +

diff --git a/core/java/src/net/i2p/util/Addresses.java b/core/java/src/net/i2p/util/Addresses.java index a1b393728..5c64c43c4 100644 --- a/core/java/src/net/i2p/util/Addresses.java +++ b/core/java/src/net/i2p/util/Addresses.java @@ -28,7 +28,7 @@ import java.util.Set; import java.util.SortedSet; import java.util.TreeSet; -import org.apache.http.conn.util.InetAddressUtils; +import net.i2p.apache.http.conn.util.InetAddressUtils; import net.i2p.I2PAppContext; import net.i2p.data.DataHelper; diff --git a/core/java/src/net/i2p/util/I2PSSLSocketFactory.java b/core/java/src/net/i2p/util/I2PSSLSocketFactory.java index 6cb11ac2a..a4511024b 100644 --- a/core/java/src/net/i2p/util/I2PSSLSocketFactory.java +++ b/core/java/src/net/i2p/util/I2PSSLSocketFactory.java @@ -85,10 +85,10 @@ import net.i2p.I2PAppContext; import net.i2p.crypto.KeyStoreUtil; import net.i2p.data.DataHelper; -import org.apache.http.conn.ssl.DefaultHostnameVerifier; -import org.apache.http.conn.util.PublicSuffixList; -import org.apache.http.conn.util.PublicSuffixListParser; -import org.apache.http.conn.util.PublicSuffixMatcher; +import net.i2p.apache.http.conn.ssl.DefaultHostnameVerifier; +import net.i2p.apache.http.conn.util.PublicSuffixList; +import net.i2p.apache.http.conn.util.PublicSuffixListParser; +import net.i2p.apache.http.conn.util.PublicSuffixMatcher; /** * Loads trusted ASCII certs from ~/.i2p/certificates/ and $I2P/certificates/. diff --git a/debian-alt/bionic/i2p-router.links b/debian-alt/bionic/i2p-router.links index 4269c995b..2b14e57c3 100644 --- a/debian-alt/bionic/i2p-router.links +++ b/debian-alt/bionic/i2p-router.links @@ -111,12 +111,3 @@ usr/share/flags/countries/16x11/se.png usr/share/i2p/eepsite/docroot/help/lib/se usr/share/flags/countries/16x11/tr.png usr/share/i2p/eepsite/docroot/help/lib/tr.png usr/share/flags/countries/16x11/ua.png usr/share/i2p/eepsite/docroot/help/lib/ua.png usr/share/flags/countries/16x11/us.png usr/share/i2p/eepsite/docroot/help/lib/us.png - - -# comment out if not building with libhttpclient-java and libhttpcore-java -# 2 MB of dependencies vs. 20 KB of copied source -# Requires 4.4 or higher. -# Debian: Not in wheezy/jessie -# Ubuntu: Only in wily and later -#usr/share/java/httpclient.jar usr/share/i2p/lib/httpclient.jar -#usr/share/java/httpcore.jar usr/share/i2p/lib/httpcore.jar diff --git a/debian-alt/doc/dependencies.txt b/debian-alt/doc/dependencies.txt index 31140150b..d69f6477d 100644 --- a/debian-alt/doc/dependencies.txt +++ b/debian-alt/doc/dependencies.txt @@ -126,13 +126,6 @@ the binaries or sources. We bundle most of the source from https://github.com/rrd4j/rrd4j No package or not widely available. -* libhttpclient-java - We only use a few classes from this large package. - We require 4.4 or higher which is not available in older distributions. - This is 2 MB of dependencies, instead we bundle 20 KB of copied source. - If we do add this dependency, we use only the code in - /usr/share/java/httpclient.jar and /usr/share/java/httpcore.jar. - * UPnP (cybergarage) Large subsystem, large number of Java source files, modified with several fixes. From https://github.com/cybergarage/cybergarage-upnp diff --git a/debian/i2p-router.links b/debian/i2p-router.links index 7bce62ac1..fb32bac1a 100644 --- a/debian/i2p-router.links +++ b/debian/i2p-router.links @@ -116,12 +116,3 @@ usr/share/flags/countries/16x11/se.png usr/share/i2p/eepsite/docroot/help/lib/se usr/share/flags/countries/16x11/tr.png usr/share/i2p/eepsite/docroot/help/lib/tr.png usr/share/flags/countries/16x11/ua.png usr/share/i2p/eepsite/docroot/help/lib/ua.png usr/share/flags/countries/16x11/us.png usr/share/i2p/eepsite/docroot/help/lib/us.png - - -# comment out if not building with libhttpclient-java and libhttpcore-java -# 2 MB of dependencies vs. 20 KB of copied source -# Requires 4.4 or higher. -# Debian: Not in wheezy/jessie -# Ubuntu: Only in wily and later -#usr/share/java/httpclient.jar usr/share/i2p/lib/httpclient.jar -#usr/share/java/httpcore.jar usr/share/i2p/lib/httpcore.jar diff --git a/history.txt b/history.txt index 9d1147103..2c4e4574d 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2022-05-11 zzz + * Util: Rename modified apache classes (Gitlab ticket #353) + 2022-05-02 zzz * GeoIP 2022-05-01 * Tomcat 9.0.62 diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index a4b4ca39e..d1964d0a7 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Git"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 16; + public final static long BUILD = 17; /** for example "-test" */ public final static String EXTRA = "-rc";