Left base folder: /home/cmeng/source/minidns.git/minidns-0.3.2
Right base folder: /home/cmeng/ws_experiment/android/minidns-0.3.2
--- minidns-core/src/main/java/org/minidns/idna/DefaultIdnaTransformator.java	2018-08-02 17:57:53.000000000 
+++ minidns-core/src/main/java/org/minidns/idna/DefaultIdnaTransformator.java	2018-08-25 14:46:01.000000000 
@@ -7,21 +7,25 @@
  * You may choose either license to govern your use of this software only
  * upon the condition that you accept all of the terms of either
  * the Apache License 2.0, the LGPL 2.1+ or the WTFPL.
  */
 package org.minidns.idna;
 
+import org.minidns.dnsname.DnsName;
+
 import java.net.IDN;
 
 public class DefaultIdnaTransformator implements IdnaTransformator {
 
     @Override
     public String toASCII(String input) {
+        if (DnsName.ROOT.ace.equals(input)) {
+            return DnsName.ROOT.ace;
+        }
         return IDN.toASCII(input);
     }
 
     @Override
     public String toUnicode(String input) {
         return IDN.toUnicode(input);
     }
-
 }
--- minidns-core/src/main/java/org/minidns/idna/MiniDnsIdna.java	2018-08-02 17:57:53.000000000 
+++ minidns-core/src/main/java/org/minidns/idna/MiniDnsIdna.java	2018-08-25 14:46:46.000000000 
@@ -19,13 +19,13 @@
     }
 
     public static String toUnicode(String string) {
         return idnaTransformator.toUnicode(string);
     }
 
-    public void setActiveTransformator(IdnaTransformator idnaTransformator) {
-        if (idnaTransformator != null) {
+    public static void setActiveTransformator(IdnaTransformator idnaTransformator) {
+        if (idnaTransformator == null) {
             throw new IllegalArgumentException();
         }
         MiniDnsIdna.idnaTransformator = idnaTransformator;
     }
 }
--- minidns-core/src/main/java/org/minidns/record/TLSA.java	2018-08-02 17:57:53.000000000 
+++ minidns-core/src/main/java/org/minidns/record/TLSA.java	2018-08-27 09:05:59.000000000 
@@ -14,30 +14,33 @@
 import java.io.DataOutputStream;
 import java.io.IOException;
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.concurrent.Callable;
 
 public class TLSA extends Data {
 
     private static final Map<Byte, CertUsage> CERT_USAGE_LUT = new HashMap<>();
 
     public enum CertUsage {
-
         caConstraint((byte) 0),
         serviceCertificateConstraint((byte) 1),
         trustAnchorAssertion((byte) 2),
         domainIssuedCertificate((byte) 3),
         ;
 
         public final byte byteValue;
 
         private CertUsage(byte byteValue) {
             this.byteValue = byteValue;
-            CERT_USAGE_LUT.put(byteValue, this);
+        }
+
+        public byte getByteValue() {
+            return byteValue;
         }
     }
 
     private static final Map<Byte, Selector> SELECTOR_LUT = new HashMap<>();
 
     public enum Selector {
@@ -46,13 +49,16 @@
         ;
 
         public final byte byteValue;
 
         private Selector(byte byteValue) {
             this.byteValue = byteValue;
-            SELECTOR_LUT.put(byteValue, this);
+        }
+
+        public byte getByteValue() {
+            return byteValue;
         }
     }
 
     private static final Map<Byte, MatchingType> MATCHING_TYPE_LUT = new HashMap<>();
 
     public enum MatchingType {
@@ -62,13 +68,30 @@
         ;
 
         public final byte byteValue;
 
         private MatchingType(byte byteValue) {
             this.byteValue = byteValue;
-            MATCHING_TYPE_LUT.put(byteValue, this);
+        }
+
+        public byte getByteValue() {
+            return byteValue;
+        }
+    }
+
+    static void initLUTs() {
+        for (CertUsage certUsage : CertUsage.values()) {
+            CERT_USAGE_LUT.put(certUsage.getByteValue(), certUsage);
+        }
+
+        for (Selector selector : Selector.values()) {
+            SELECTOR_LUT.put(selector.getByteValue(), selector);
+        }
+
+        for (MatchingType matchingType : MatchingType.values()) {
+            MATCHING_TYPE_LUT.put(matchingType.getByteValue(), matchingType);
         }
     }
 
     /**
      * The provided association that will be used to match the certificate presented in
      * the TLS handshake.
@@ -104,12 +127,15 @@
         byte[] certificateAssociation = new byte[length - 3];
         if (dis.read(certificateAssociation) != certificateAssociation.length) throw new IOException();
         return new TLSA(certUsage, selector, matchingType, certificateAssociation);
     }
 
     TLSA(byte certUsageByte, byte selectorByte, byte matchingTypeByte, byte[] certificateAssociation) {
+        if (CERT_USAGE_LUT.isEmpty())
+            initLUTs();
+
         this.certUsageByte = certUsageByte;
         this.certUsage = CERT_USAGE_LUT.get(certUsageByte);
 
         this.selectorByte = selectorByte;
         this.selector = SELECTOR_LUT.get(selectorByte);
 
