ICUDebug.java
2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.agl.impl;
import com.adobe.agl.util.VersionInfo;
public final class ICUDebug {
private static String params;
private static boolean debug;
private static boolean help;
public static final String javaVersionString;
public static final boolean isJDK14OrHigher;
public static final VersionInfo javaVersion;
public static VersionInfo getInstanceLenient(String s) {
char[] chars = s.toCharArray();
int r = 0;
int w = 0;
int count = 0;
boolean numeric = false;
while (r < chars.length) {
char c;
if ((c = chars[r++]) < '0' || c > '9') {
if (!numeric) continue;
if (count == 3) break;
numeric = false;
chars[w++] = 46;
++count;
continue;
}
numeric = true;
chars[w++] = c;
}
while (w > 0 && chars[w - 1] == '.') {
--w;
}
String vs = new String(chars, 0, w);
return VersionInfo.getInstance(vs);
}
public static boolean enabled() {
return debug;
}
public static boolean enabled(String arg) {
if (debug) {
boolean result;
boolean bl = result = params.indexOf(arg) != -1;
if (help) {
System.out.println("\nICUDebug.enabled(" + arg + ") = " + result);
}
return result;
}
return false;
}
public static String value(String arg) {
String result = "false";
if (debug) {
int index = params.indexOf(arg);
if (index != -1) {
int limit;
result = params.length() > (index += arg.length()) && params.charAt(index) == '=' ? params.substring(index, (limit = params.indexOf(",", ++index)) == -1 ? params.length() : limit) : "true";
}
if (help) {
System.out.println("\nICUDebug.value(" + arg + ") = " + result);
}
}
return result;
}
static {
VersionInfo java14Version;
try {
params = System.getProperty("ICUDebug");
}
catch (SecurityException e) {
// empty catch block
}
debug = params != null;
boolean bl = ICUDebug.help = debug && (params.equals("") || params.indexOf("help") != -1);
if (debug) {
System.out.println("\nICUDebug=" + params);
}
isJDK14OrHigher = (ICUDebug.javaVersion = ICUDebug.getInstanceLenient(ICUDebug.javaVersionString = System.getProperty("java.version"))).compareTo(java14Version = VersionInfo.getInstance("1.4.0")) >= 0;
}
}