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).
+