ZoneInfoProvider.java
9.31 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
package org.joda.time.tz;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.SoftReference;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;
import org.joda.time.DateTimeZone;
public class ZoneInfoProvider
implements Provider
{
private final File a;
private final String b;
private final ClassLoader c;
private final Map<String, Object> d;
public ZoneInfoProvider(File paramFile)
throws IOException
{
if (paramFile == null) {
throw new IllegalArgumentException("No file directory provided");
}
if (!paramFile.exists()) {
throw new IOException("File directory doesn't exist: " + paramFile);
}
if (!paramFile.isDirectory()) {
throw new IOException("File doesn't refer to a directory: " + paramFile);
}
this.a = paramFile;
this.b = null;
this.c = null;
this.d = a(a("ZoneInfoMap"));
}
public ZoneInfoProvider(String paramString)
throws IOException
{
this(paramString, null, false);
}
public ZoneInfoProvider(String paramString, ClassLoader paramClassLoader)
throws IOException
{
this(paramString, paramClassLoader, true);
}
private ZoneInfoProvider(String paramString, ClassLoader paramClassLoader, boolean paramBoolean)
throws IOException
{
if (paramString == null) {
throw new IllegalArgumentException("No resource path provided");
}
String str = paramString;
if (!paramString.endsWith("/")) {
str = paramString + '/';
}
this.a = null;
this.b = str;
paramString = paramClassLoader;
if (paramClassLoader == null)
{
paramString = paramClassLoader;
if (!paramBoolean) {
paramString = getClass().getClassLoader();
}
}
this.c = paramString;
this.d = a(a("ZoneInfoMap"));
}
private InputStream a(String paramString)
throws IOException
{
if (this.a != null) {
localObject = new FileInputStream(new File(this.a, paramString));
}
String str;
do
{
return (InputStream)localObject;
str = this.b.concat(paramString);
if (this.c == null) {
break;
}
paramString = this.c.getResourceAsStream(str);
localObject = paramString;
} while (paramString != null);
Object localObject = new StringBuilder(40).append("Resource not found: \"").append(str).append("\" ClassLoader: ");
if (this.c != null) {}
for (paramString = this.c.toString();; paramString = "system")
{
throw new IOException(paramString);
paramString = ClassLoader.getSystemResourceAsStream(str);
break;
}
}
/* Error */
private static Map<String, Object> a(InputStream paramInputStream)
throws IOException
{
// Byte code:
// 0: new 134 java/util/concurrent/ConcurrentHashMap
// 3: dup
// 4: invokespecial 135 java/util/concurrent/ConcurrentHashMap:<init> ()V
// 7: astore_1
// 8: new 137 java/io/DataInputStream
// 11: dup
// 12: aload_0
// 13: invokespecial 140 java/io/DataInputStream:<init> (Ljava/io/InputStream;)V
// 16: astore_0
// 17: aload_0
// 18: aload_1
// 19: invokestatic 143 org/joda/time/tz/ZoneInfoProvider:a (Ljava/io/DataInputStream;Ljava/util/Map;)V
// 22: aload_0
// 23: invokevirtual 146 java/io/DataInputStream:close ()V
// 26: aload_1
// 27: ldc -108
// 29: new 150 java/lang/ref/SoftReference
// 32: dup
// 33: getstatic 155 org/joda/time/DateTimeZone:UTC Lorg/joda/time/DateTimeZone;
// 36: invokespecial 158 java/lang/ref/SoftReference:<init> (Ljava/lang/Object;)V
// 39: invokeinterface 164 3 0
// 44: pop
// 45: aload_1
// 46: areturn
// 47: astore_1
// 48: aload_0
// 49: invokevirtual 146 java/io/DataInputStream:close ()V
// 52: aload_1
// 53: athrow
// 54: astore_0
// 55: goto -29 -> 26
// 58: astore_0
// 59: goto -7 -> 52
// Local variable table:
// start length slot name signature
// 0 62 0 paramInputStream InputStream
// 7 39 1 localConcurrentHashMap java.util.concurrent.ConcurrentHashMap
// 47 6 1 localObject Object
// Exception table:
// from to target type
// 17 22 47 finally
// 22 26 54 java/io/IOException
// 48 52 58 java/io/IOException
}
private static void a(DataInputStream paramDataInputStream, Map<String, Object> paramMap)
throws IOException
{
int j = 0;
int k = paramDataInputStream.readUnsignedShort();
String[] arrayOfString = new String[k];
int i = 0;
while (i < k)
{
arrayOfString[i] = paramDataInputStream.readUTF().intern();
i += 1;
}
k = paramDataInputStream.readUnsignedShort();
i = j;
while (i < k) {
try
{
paramMap.put(arrayOfString[paramDataInputStream.readUnsignedShort()], arrayOfString[paramDataInputStream.readUnsignedShort()]);
i += 1;
}
catch (ArrayIndexOutOfBoundsException paramDataInputStream)
{
throw new IOException("Corrupt zone info map");
}
}
}
/* Error */
private DateTimeZone b(String paramString)
{
// Byte code:
// 0: aload_0
// 1: aload_1
// 2: invokespecial 65 org/joda/time/tz/ZoneInfoProvider:a (Ljava/lang/String;)Ljava/io/InputStream;
// 5: astore_3
// 6: aload_3
// 7: astore_2
// 8: aload_3
// 9: aload_1
// 10: invokestatic 188 org/joda/time/tz/DateTimeZoneBuilder:readFrom (Ljava/io/InputStream;Ljava/lang/String;)Lorg/joda/time/DateTimeZone;
// 13: astore 4
// 15: aload_3
// 16: astore_2
// 17: aload_0
// 18: getfield 70 org/joda/time/tz/ZoneInfoProvider:d Ljava/util/Map;
// 21: aload_1
// 22: new 150 java/lang/ref/SoftReference
// 25: dup
// 26: aload 4
// 28: invokespecial 158 java/lang/ref/SoftReference:<init> (Ljava/lang/Object;)V
// 31: invokeinterface 164 3 0
// 36: pop
// 37: aload_3
// 38: ifnull +7 -> 45
// 41: aload_3
// 42: invokevirtual 191 java/io/InputStream:close ()V
// 45: aload 4
// 47: areturn
// 48: astore 4
// 50: aconst_null
// 51: astore_3
// 52: aload_3
// 53: astore_2
// 54: aload_0
// 55: aload 4
// 57: invokevirtual 195 org/joda/time/tz/ZoneInfoProvider:uncaughtException (Ljava/lang/Exception;)V
// 60: aload_3
// 61: astore_2
// 62: aload_0
// 63: getfield 70 org/joda/time/tz/ZoneInfoProvider:d Ljava/util/Map;
// 66: aload_1
// 67: invokeinterface 199 2 0
// 72: pop
// 73: aload_3
// 74: ifnull +7 -> 81
// 77: aload_3
// 78: invokevirtual 191 java/io/InputStream:close ()V
// 81: aconst_null
// 82: areturn
// 83: astore_1
// 84: aconst_null
// 85: astore_2
// 86: aload_2
// 87: ifnull +7 -> 94
// 90: aload_2
// 91: invokevirtual 191 java/io/InputStream:close ()V
// 94: aload_1
// 95: athrow
// 96: astore_1
// 97: aload 4
// 99: areturn
// 100: astore_1
// 101: goto -20 -> 81
// 104: astore_2
// 105: goto -11 -> 94
// 108: astore_1
// 109: goto -23 -> 86
// 112: astore 4
// 114: goto -62 -> 52
// Local variable table:
// start length slot name signature
// 0 117 0 this ZoneInfoProvider
// 0 117 1 paramString String
// 7 84 2 localInputStream1 InputStream
// 104 1 2 localIOException1 IOException
// 5 73 3 localInputStream2 InputStream
// 13 33 4 localDateTimeZone DateTimeZone
// 48 50 4 localIOException2 IOException
// 112 1 4 localIOException3 IOException
// Exception table:
// from to target type
// 0 6 48 java/io/IOException
// 0 6 83 finally
// 41 45 96 java/io/IOException
// 77 81 100 java/io/IOException
// 90 94 104 java/io/IOException
// 8 15 108 finally
// 17 37 108 finally
// 54 60 108 finally
// 62 73 108 finally
// 8 15 112 java/io/IOException
// 17 37 112 java/io/IOException
}
public Set<String> getAvailableIDs()
{
return new TreeSet(this.d.keySet());
}
public DateTimeZone getZone(String paramString)
{
Object localObject;
if (paramString == null) {
localObject = null;
}
DateTimeZone localDateTimeZone;
do
{
return (DateTimeZone)localObject;
localObject = this.d.get(paramString);
if (localObject == null) {
return null;
}
if (paramString.equals(localObject)) {
return b(paramString);
}
if (!(localObject instanceof SoftReference)) {
break;
}
localDateTimeZone = (DateTimeZone)((SoftReference)localObject).get();
localObject = localDateTimeZone;
} while (localDateTimeZone != null);
return b(paramString);
return getZone((String)localObject);
}
protected void uncaughtException(Exception paramException)
{
Thread localThread = Thread.currentThread();
localThread.getThreadGroup().uncaughtException(localThread, paramException);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/joda/time/tz/ZoneInfoProvider.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/