public final class org.jasypt.normalization.Normalizer extends java.lang.Object
{
private static final java.lang.String ICU_NORMALIZER_CLASS_NAME;
private static final java.lang.String JDK_NORMALIZER_CLASS_NAME;
private static final java.lang.String JDK_NORMALIZER_FORM_CLASS_NAME;
private static java.lang.Boolean useIcuNormalizer;
private static java.lang.reflect.Method javaTextNormalizerMethod;
private static java.lang.Object javaTextNormalizerFormNFCConstant;
public static java.lang.String normalizeToNfc(java.lang.String)
{
char[] v, v;
java.lang.String v, v;
v := @parameter: java.lang.String;
v = new java.lang.String;
v = virtualinvoke v.<java.lang.String: char[] toCharArray()>();
v = staticinvoke <org.jasypt.normalization.Normalizer: char[] normalizeToNfc(char[])>(v);
specialinvoke v.<java.lang.String: void <init>(char[])>(v);
return v;
}
public static char[] normalizeToNfc(char[])
{
org.jasypt.exceptions.EncryptionInitializationException v, v, v, v;
java.lang.IllegalAccessException v;
java.lang.NoSuchMethodException v;
java.lang.NoSuchFieldException v;
char[] v, v, v;
java.lang.Boolean v, v;
java.lang.ClassNotFoundException v, v;
boolean v;
v := @parameter: char[];
v = <org.jasypt.normalization.Normalizer: java.lang.Boolean useIcuNormalizer>;
if v != null goto label;
label:
staticinvoke <org.jasypt.normalization.Normalizer: void initializeIcu4j()>();
label:
goto label;
label:
v := @caughtexception;
label:
staticinvoke <org.jasypt.normalization.Normalizer: void initializeJavaTextNormalizer()>();
label:
goto label;
label:
v := @caughtexception;
v = new org.jasypt.exceptions.EncryptionInitializationException;
specialinvoke v.<org.jasypt.exceptions.EncryptionInitializationException: void <init>(java.lang.String)>("Cannot find a valid UNICODE normalizer: neither java.text.Normalizer nor com.ibm.icu.text.Normalizer have been found at the classpath. If you are using a version of the JDK older than JavaSE 6, you should include the icu4j library in your classpath.");
throw v;
label:
v := @caughtexception;
v = new org.jasypt.exceptions.EncryptionInitializationException;
specialinvoke v.<org.jasypt.exceptions.EncryptionInitializationException: void <init>(java.lang.String)>("Cannot find a valid UNICODE normalizer: java.text.Normalizer has been found at the classpath, but has an incompatible signature for its \'normalize\' method.");
throw v;
label:
v := @caughtexception;
v = new org.jasypt.exceptions.EncryptionInitializationException;
specialinvoke v.<org.jasypt.exceptions.EncryptionInitializationException: void <init>(java.lang.String)>("Cannot find a valid UNICODE normalizer: java.text.Normalizer$Form has been found at the classpath, but seems to have no \'NFC\' value.");
throw v;
label:
v := @caughtexception;
v = new org.jasypt.exceptions.EncryptionInitializationException;
specialinvoke v.<org.jasypt.exceptions.EncryptionInitializationException: void <init>(java.lang.String)>("Cannot find a valid UNICODE normalizer: java.text.Normalizer$Form has been found at the classpath, but seems to have no \'NFC\' value.");
throw v;
label:
v = <org.jasypt.normalization.Normalizer: java.lang.Boolean useIcuNormalizer>;
v = virtualinvoke v.<java.lang.Boolean: boolean booleanValue()>();
if v == 0 goto label;
v = staticinvoke <org.jasypt.normalization.Normalizer: char[] normalizeWithIcu4j(char[])>(v);
return v;
label:
v = staticinvoke <org.jasypt.normalization.Normalizer: char[] normalizeWithJavaNormalizer(char[])>(v);
return v;
catch java.lang.ClassNotFoundException from label to label with label;
catch java.lang.ClassNotFoundException from label to label with label;
catch java.lang.NoSuchMethodException from label to label with label;
catch java.lang.NoSuchFieldException from label to label with label;
catch java.lang.IllegalAccessException from label to label with label;
}
static void initializeIcu4j() throws java.lang.ClassNotFoundException
{
java.lang.Boolean v;
java.lang.ClassLoader v;
java.lang.Thread v;
v = staticinvoke <java.lang.Thread: java.lang.Thread currentThread()>();
v = virtualinvoke v.<java.lang.Thread: java.lang.ClassLoader getContextClassLoader()>();
virtualinvoke v.<java.lang.ClassLoader: java.lang.Class loadClass(java.lang.String)>("com.ibm.icu.text.Normalizer");
v = <java.lang.Boolean: java.lang.Boolean TRUE>;
<org.jasypt.normalization.Normalizer: java.lang.Boolean useIcuNormalizer> = v;
return;
}
static void initializeJavaTextNormalizer() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.NoSuchFieldException, java.lang.IllegalAccessException
{
java.lang.Class[] v;
java.lang.reflect.Field v;
java.lang.Thread v, v;
java.lang.Boolean v;
java.lang.Class v, v;
java.lang.Object v;
java.lang.ClassLoader v, v;
java.lang.reflect.Method v;
v = staticinvoke <java.lang.Thread: java.lang.Thread currentThread()>();
v = virtualinvoke v.<java.lang.Thread: java.lang.ClassLoader getContextClassLoader()>();
v = virtualinvoke v.<java.lang.ClassLoader: java.lang.Class loadClass(java.lang.String)>("java.text.Normalizer");
v = staticinvoke <java.lang.Thread: java.lang.Thread currentThread()>();
v = virtualinvoke v.<java.lang.Thread: java.lang.ClassLoader getContextClassLoader()>();
v = virtualinvoke v.<java.lang.ClassLoader: java.lang.Class loadClass(java.lang.String)>("java.text.Normalizer$Form");
v = newarray (java.lang.Class)[2];
v[0] = class "Ljava/lang/CharSequence;";
v[1] = v;
v = virtualinvoke v.<java.lang.Class: java.lang.reflect.Method getMethod(java.lang.String,java.lang.Class[])>("normalize", v);
<org.jasypt.normalization.Normalizer: java.lang.reflect.Method javaTextNormalizerMethod> = v;
v = virtualinvoke v.<java.lang.Class: java.lang.reflect.Field getField(java.lang.String)>("NFC");
v = virtualinvoke v.<java.lang.reflect.Field: java.lang.Object get(java.lang.Object)>(null);
<org.jasypt.normalization.Normalizer: java.lang.Object javaTextNormalizerFormNFCConstant> = v;
v = <java.lang.Boolean: java.lang.Boolean FALSE>;
<org.jasypt.normalization.Normalizer: java.lang.Boolean useIcuNormalizer> = v;
return;
}
static char[] normalizeWithJavaNormalizer(char[])
{
org.jasypt.exceptions.EncryptionInitializationException v, v;
java.lang.Object[] v;
java.lang.Exception v;
char[] v, v;
java.lang.Object v, v, v;
java.lang.String v;
java.lang.reflect.Method v, v;
v := @parameter: char[];
v = <org.jasypt.normalization.Normalizer: java.lang.reflect.Method javaTextNormalizerMethod>;
if v == null goto label;
v = <org.jasypt.normalization.Normalizer: java.lang.Object javaTextNormalizerFormNFCConstant>;
if v != null goto label;
label:
v = new org.jasypt.exceptions.EncryptionInitializationException;
specialinvoke v.<org.jasypt.exceptions.EncryptionInitializationException: void <init>(java.lang.String)>("Cannot use: java.text.Normalizer$Form, as JDK-based normalization has not been initialized! (check previous execution errors)");
throw v;
label:
v = new java.lang.String;
specialinvoke v.<java.lang.String: void <init>(char[])>(v);
label:
v = <org.jasypt.normalization.Normalizer: java.lang.reflect.Method javaTextNormalizerMethod>;
v = newarray (java.lang.Object)[2];
v[0] = v;
v = <org.jasypt.normalization.Normalizer: java.lang.Object javaTextNormalizerFormNFCConstant>;
v[1] = v;
v = virtualinvoke v.<java.lang.reflect.Method: java.lang.Object invoke(java.lang.Object,java.lang.Object[])>(null, v);
label:
goto label;
label:
v := @caughtexception;
v = new org.jasypt.exceptions.EncryptionInitializationException;
specialinvoke v.<org.jasypt.exceptions.EncryptionInitializationException: void <init>(java.lang.String,java.lang.Throwable)>("Could not perform a valid UNICODE normalization", v);
throw v;
label:
v = virtualinvoke v.<java.lang.String: char[] toCharArray()>();
return v;
catch java.lang.Exception from label to label with label;
}
static char[] normalizeWithIcu4j(char[])
{
int v, v, v, v, v, v, v, v;
char[] v, v, v;
com.ibm.icu.text.Normalizer$Mode v;
v := @parameter: char[];
v = lengthof v;
v = v * 2;
v = newarray (char)[v];
label:
v = <com.ibm.icu.text.Normalizer: com.ibm.icu.text.Normalizer$Mode NFC>;
v = staticinvoke <com.ibm.icu.text.Normalizer: int normalize(char[],char[],com.ibm.icu.text.Normalizer$Mode,int)>(v, v, v, 0);
v = lengthof v;
if v > v goto label;
v = newarray (char)[v];
staticinvoke <java.lang.System: void arraycopy(java.lang.Object,int,java.lang.Object,int,int)>(v, 0, v, 0, v);
v = 0;
label:
v = lengthof v;
if v >= v goto label;
v[v] = 0;
v = v + 1;
goto label;
label:
return v;
label:
v = 0;
label:
v = lengthof v;
if v >= v goto label;
v[v] = 0;
v = v + 1;
goto label;
label:
v = newarray (char)[v];
goto label;
}
private void <init>()
{
org.jasypt.normalization.Normalizer v;
v := @this: org.jasypt.normalization.Normalizer;
specialinvoke v.<java.lang.Object: void <init>()>();
return;
}
static void <clinit>()
{
<org.jasypt.normalization.Normalizer: java.lang.Boolean useIcuNormalizer> = null;
<org.jasypt.normalization.Normalizer: java.lang.reflect.Method javaTextNormalizerMethod> = null;
<org.jasypt.normalization.Normalizer: java.lang.Object javaTextNormalizerFormNFCConstant> = null;
return;
}
}