directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cristian Tarsoaga (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DIRSERVER-2127) Don't rely on sun.net.util since it is not visible in OSGi.
Date Tue, 01 Mar 2016 22:22:18 GMT
Cristian Tarsoaga created DIRSERVER-2127:
--------------------------------------------

             Summary: Don't rely on sun.net.util since it is not visible in OSGi.
                 Key: DIRSERVER-2127
                 URL: https://issues.apache.org/jira/browse/DIRSERVER-2127
             Project: Directory ApacheDS
          Issue Type: Bug
    Affects Versions: 2.0.0-M21
            Reporter: Cristian Tarsoaga
            Priority: Minor


>From ee47e87b6d3e88d411220ccce43d8feecf4e5dec Mon Sep 17 00:00:00 2001
From: Ciprian Ciubotariu <cheepeero@gmx.net>
Date: Sat, 27 Feb 2016 01:35:22 +0200
Subject: [PATCH] Use a better IPv6 address parser

Don't rely on sun.net.util since it is not visible in OSGi.
---
 ldap/model/pom.xml                                                   | 5 +++++
 .../main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java   | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ldap/model/pom.xml b/ldap/model/pom.xml
index fc4c4a9..a370828 100644
--- a/ldap/model/pom.xml
+++ b/ldap/model/pom.xml
@@ -96,6 +96,11 @@
       <artifactId>annotations</artifactId>
       <scope>provided</scope>
     </dependency>
+    <dependency>
+      <groupId>commons-validator</groupId>
+      <artifactId>commons-validator</artifactId>
+      <version>1.5.0</version>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
index 8811139..716e862 100644
--- a/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
+++ b/ldap/model/src/main/java/org/apache/directory/api/ldap/model/url/LdapUrl.java
@@ -28,6 +28,7 @@ import java.util.List;
 import java.util.Set;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
+import org.apache.commons.validator.routines.InetAddressValidator;
 
 import org.apache.directory.api.i18n.I18n;
 import org.apache.directory.api.ldap.model.exception.LdapInvalidDnException;
@@ -507,7 +508,7 @@ public class LdapUrl
         {
             String hostString = new String( chars, start, pos - start );
             
-            if ( sun.net.util.IPAddressUtil.isIPv6LiteralAddress( hostString ) )
+            if ( InetAddressValidator.getInstance().isValidInet6Address( hostString ) )
             {
                 host = hostString;
                 
-- 
2.4.10




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message