diff --git a/httpclient/src/main/java/org/apache/http/client/utils/Idn.java b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/Idn.java similarity index 95% rename from httpclient/src/main/java/org/apache/http/client/utils/Idn.java rename to httpclient/src/main/java-deprecated/org/apache/http/client/utils/Idn.java index 41c0e2b2a..072c7e896 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/Idn.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/Idn.java @@ -29,8 +29,11 @@ package org.apache.http.client.utils; /** * Abstraction of international domain name (IDN) conversion. * + * @deprecated (4.4) use standard {@link java.net.IDN}. + * * @since 4.0 */ +@Deprecated public interface Idn { /** * Converts a name from its punycode representation to Unicode. diff --git a/httpclient/src/main/java/org/apache/http/client/utils/JdkIdn.java b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/JdkIdn.java similarity index 97% rename from httpclient/src/main/java/org/apache/http/client/utils/JdkIdn.java rename to httpclient/src/main/java-deprecated/org/apache/http/client/utils/JdkIdn.java index 7e2ee7ba0..99898b827 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/JdkIdn.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/JdkIdn.java @@ -34,9 +34,12 @@ import org.apache.http.annotation.Immutable; /** * Uses the java.net.IDN class through reflection. * + * @deprecated (4.4) use standard {@link java.net.IDN}. + * * @since 4.0 */ @Immutable +@Deprecated public class JdkIdn implements Idn { private final Method toUnicode; diff --git a/httpclient/src/main/java/org/apache/http/client/utils/Punycode.java b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/Punycode.java similarity index 96% rename from httpclient/src/main/java/org/apache/http/client/utils/Punycode.java rename to httpclient/src/main/java-deprecated/org/apache/http/client/utils/Punycode.java index 750f503f5..2d17f3459 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/Punycode.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/Punycode.java @@ -32,9 +32,12 @@ import org.apache.http.annotation.Immutable; * Facade that provides conversion between Unicode and Punycode domain names. * It will use an appropriate implementation. * + * @deprecated (4.4) use standard {@link java.net.IDN}. + * * @since 4.0 */ @Immutable +@Deprecated public class Punycode { private static final Idn impl; static { diff --git a/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/Rfc3492Idn.java similarity index 98% rename from httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java rename to httpclient/src/main/java-deprecated/org/apache/http/client/utils/Rfc3492Idn.java index e76590a19..29dabc471 100644 --- a/httpclient/src/main/java/org/apache/http/client/utils/Rfc3492Idn.java +++ b/httpclient/src/main/java-deprecated/org/apache/http/client/utils/Rfc3492Idn.java @@ -33,9 +33,12 @@ import org.apache.http.annotation.Immutable; /** * Implementation from pseudo code in RFC 3492. * + * @deprecated (4.4) use standard {@link java.net.IDN}. + * * @since 4.0 */ @Immutable +@Deprecated public class Rfc3492Idn implements Idn { private static final int base = 36; private static final int tmin = 1; diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixFilter.java b/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixFilter.java index 0d811d3bf..50e9cfc5d 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixFilter.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/PublicSuffixFilter.java @@ -26,11 +26,11 @@ */ package org.apache.http.impl.cookie; +import java.net.IDN; import java.util.Collection; import java.util.HashSet; import java.util.Set; -import org.apache.http.client.utils.Punycode; import org.apache.http.cookie.Cookie; import org.apache.http.cookie.CookieAttributeHandler; import org.apache.http.cookie.CookieOrigin; @@ -101,7 +101,7 @@ public class PublicSuffixFilter implements CookieAttributeHandler { if (domain.startsWith(".")) { domain = domain.substring(1); } - domain = Punycode.toUnicode(domain); + domain = IDN.toUnicode(domain); // An exception rule takes priority over any other matching rule. if (this.exceptions != null) {