Alejandro Anadon created PHOENIX-6084:
-----------------------------------------

             Summary: Error in public package when builded
                 Key: PHOENIX-6084
                 URL: https://issues.apache.org/jira/browse/PHOENIX-6084
             Project: Phoenix
          Issue Type: Bug
          Components: core
    Affects Versions: 5.0.0
            Reporter: Alejandro Anadon


It is very easy to reproduce. Just download the 5.0.0-HBase-2.0 
([https://phoenix.apache.org/download.html)] and make the next  (and very 
simple) class in java using the "phoenix-5.0.0-HBase-2.0-client.jar" that is 
inside of the package :

-----

import com.google.common.net.InternetDomainName;

public class TestBug{
 public static void main(String[] args){
 InternetDomainName domainName;
 domainName=InternetDomainName.from("www.mydomain.com"); 
 System.out.println(domainName.isUnderPublicSuffix());
 
 domainName=InternetDomainName.from("www.mydomain.net");
 System.out.println(domainName.isUnderPublicSuffix());
 
 
domainName=InternetDomainName.from("nonopublicsufix.org.apache.phoenix.shaded.net.al");
 System.out.println(domainName.isUnderPublicSuffix());
 
 domainName=InternetDomainName.from("org.apache.phoenix.shaded.net.al");
 System.out.println(domainName.isPublicSuffix());
 }
 }

------

 

Expected result:

 

true   -> [www.mydomain.com|http://www.mydomain.com/] is under .com public 
suffix

true -> [www.mydomain.net|http://www.mydomain.com/] is under .net public suffix

false -> nonopublicsufix.org.apache.phoenix.shaded.net.al is under NON public 
suffix org.apache.phoenix.shaded.net.al

false -> org.apache.phoenix.shaded.net.al is NOT a public sufix

 

Actually result:

true  -> ok
false   -> Error
true  -> Error
true  -> Error

 

I found the error in jar (I had not the knowledge to find it in the source 
code).

The error is in the actually class "com.google.common.net.TldPatterns" that is 
in the current jar  "phoenix-5.0.0-HBase-2.0-client.jar".

 

If you decompile it , you can see something like this:
       EXACT = ImmutableSet.of((Object)"ac", (Object)"com.ac", 
(Object)"edu.ac", (Object)"gov.ac", (Object)"org.apache.phoenix.shaded.net.ac", 
(Object)"mil.ac", (Object[])new String[] { "org.ac", "ad", "nom.ad", "ae", 
"co.ae", "org.apache.phoenix.shaded.net.ae", " ........
and it seems that all domains that should begings with "net" (p.e. "net.ac"), 
when building the file (it is a generated file), it makes a mistake and add 
"org.apache.phoenix.shaded" leaving it as "org.apache.phoenix.shaded.net.ac" 
and this makes the error.

I guest that as this is a generated class, there should be something bad when 
building the complete package.

 

I didn't test it in other versions (I solved it building my own classes; but it 
is not a clean solution).

 

 

I know that this bug is NOT from the core of Phoenix; but in my case, I uses 
the "phoenix-5.0.0-HBase-2.0-client.jar" for access to phenix, and the 
"com.google.common.net.InternetDomainName" class for domains funtions.

So I do not know if this is the right place to create the issue.

(I take the opportunity to ask something:

I have been able to conect phoenix using hibernate ORM satisfactorily .

I created a "Dialect" and make 3 o 4 changes in hibernate core to change 
"insert" to "upsert".

It is large to splain how I did it and it is not correct to do it here, but if 
somebody tell me the right place to do it, I'll do it).
 
 
 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to