Skip to content

Commit fdad02a

Browse files
committed
see 05/31 log
1 parent 6e835ae commit fdad02a

File tree

3 files changed

+39
-65
lines changed

3 files changed

+39
-65
lines changed

gradle/config/config.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ gradle.ext {
77
compileSdkVersion = 27
88
minSdkVersion = 14
99
targetSdkVersion = 27
10-
versionCode = 1_023_007
11-
versionName = '1.23.7'// E.g. 1.9.72 => 1,009,072
10+
versionCode = 1_023_008
11+
versionName = '1.23.8'// E.g. 1.9.72 => 1,009,072
1212

1313
bus = [
1414
isPublish: false,
15-
isDebug : false,
15+
isDebug : true,
1616
version : '1.7',
1717
group : 'com.blankj'
1818
]
@@ -185,4 +185,4 @@ class ModuleConfig {
185185
" }\n"
186186
}
187187
}
188-
//./gradlew clean utilcode-lib:bintrayUpload
188+
//./gradlew clean :utilcode:lib:bintrayUpload

utilcode/lib/src/main/java/com/blankj/utilcode/util/BusUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private static Object injectShell(final String name, final Object[] objects) {
5858
public static <T> T postStatic(final String name, final Object... objects) {
5959
if (name == null || name.length() == 0) return null;
6060
Object o = injectShell(name, objects);
61+
com.blankj.utilcode.util.LogUtils.e("BusUtils");
6162
if (NULL.equals(o)) {
6263
com.blankj.utilcode.util.LogUtils.e("BusUtils", "static bus of <" + name + "> didn\'t exist.");
6364
return null;

utilcode/lib/src/test/java/com/blankj/utilcode/util/BaseTest.java

Lines changed: 34 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
import java.util.concurrent.CountDownLatch;
1414
import java.util.concurrent.Executor;
15-
import java.util.concurrent.TimeUnit;
1615

1716
/**
1817
* <pre>
@@ -39,65 +38,39 @@ public void execute(@NonNull Runnable command) {
3938

4039
@Test
4140
public void test() throws Exception {
42-
ThreadUtils.Task<Void> task = new ThreadUtils.Task<Void>() {
43-
@Override
44-
public Void doInBackground() throws Throwable {
45-
System.out.println("haha");
46-
return null;
47-
}
48-
49-
@Override
50-
public void onSuccess(Void result) {
51-
System.out.println("onSuccess");
52-
}
53-
54-
@Override
55-
public void onCancel() {
56-
System.out.println("onCancel");
57-
}
58-
59-
@Override
60-
public void onFail(Throwable t) {
61-
System.out.println(t.toString());
62-
}
63-
};
64-
ThreadUtils.executeBySingleAtFixRate(task, 1, 1, TimeUnit.SECONDS);
65-
66-
6741
final CountDownLatch countDownLatch = new CountDownLatch(1);
68-
//// for (int i = 0; i < 100; i++) {
69-
//// final int finalI = i;
70-
// ThreadUtils.Task<Void> task = new ThreadUtils.Task<Void>() {
71-
//
72-
// @Override
73-
// public Void doInBackground() throws Throwable {
74-
// for (int j = 0; j < 10000; j++) {
75-
// Thread.sleep(100);
76-
// System.out.println(j);
77-
// }
78-
// return null;
79-
// }
80-
//
81-
// @Override
82-
// public void onSuccess(@Nullable Void result) {
83-
// System.out.println(Thread.currentThread().getName());
84-
// }
85-
//
86-
// @Override
87-
// public void onCancel() {
88-
// System.out.println("onCancel");
89-
// }
90-
//
91-
// @Override
92-
// public void onFail(Throwable t) {
93-
// System.out.println(t + "onFail");
94-
// }
95-
// };
96-
// ThreadUtils.executeBySingle(task);
97-
//
98-
//// }
99-
Thread.sleep(100);
100-
task.cancel();
42+
for (int i = 0; i < 100; i++) {
43+
final int finalI = i;
44+
ThreadUtils.Task<Void> task = new ThreadUtils.Task<Void>() {
45+
46+
@Override
47+
public Void doInBackground() throws Throwable {
48+
for (int j = 0; j < 10000; j++) {
49+
Thread.sleep(100);
50+
System.out.println(j);
51+
}
52+
return null;
53+
}
54+
55+
@Override
56+
public void onSuccess(Void result) {
57+
System.out.println(finalI + Thread.currentThread().getName());
58+
}
59+
60+
@Override
61+
public void onCancel() {
62+
System.out.println(finalI + "onCancel");
63+
}
64+
65+
@Override
66+
public void onFail(Throwable t) {
67+
System.out.println(finalI + "onFail" + t);
68+
}
69+
};
70+
ThreadUtils.executeBySingle(task);
71+
Thread.sleep(100);
72+
task.cancel();
73+
}
10174
countDownLatch.countDown();
10275
countDownLatch.await();
10376

@@ -228,8 +201,8 @@ public void onFail(Throwable t) {
228201
static class Person implements Comparable<Person> {
229202

230203
String name;
231-
int age;
232-
int time;
204+
int age;
205+
int time;
233206

234207
public Person(String name) {
235208
this.name = name;

0 commit comments

Comments
 (0)