Skip to content

Commit 87ea431

Browse files
committed
Fixed wrong Java 8 reflection API call
1 parent 4188f58 commit 87ea431

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/rx/internal/schedulers/NewThreadWorker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public NewThreadWorker(ThreadFactory threadFactory) {
3737
// Java 7+: cancelled future tasks can be removed from the executor thus avoiding memory leak
3838
for (Method m : executor.getClass().getMethods()) {
3939
if (m.getName().equals("setRemoveOnCancelPolicy")
40-
&& m.getParameterCount() == 1
41-
&& m.getParameters()[0].getType() == Boolean.TYPE) {
40+
&& m.getParameterTypes().length == 1
41+
&& m.getParameterTypes()[0] == Boolean.TYPE) {
4242
try {
4343
m.invoke(executor, true);
4444
} catch (Exception ex) {

0 commit comments

Comments
 (0)