From 87ea431979b34751587576d542c261318c1c6de4 Mon Sep 17 00:00:00 2001 From: akarnokd Date: Tue, 2 Dec 2014 14:54:51 +0100 Subject: [PATCH] Fixed wrong Java 8 reflection API call --- src/main/java/rx/internal/schedulers/NewThreadWorker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/rx/internal/schedulers/NewThreadWorker.java b/src/main/java/rx/internal/schedulers/NewThreadWorker.java index 17128709db..5354999055 100644 --- a/src/main/java/rx/internal/schedulers/NewThreadWorker.java +++ b/src/main/java/rx/internal/schedulers/NewThreadWorker.java @@ -37,8 +37,8 @@ public NewThreadWorker(ThreadFactory threadFactory) { // Java 7+: cancelled future tasks can be removed from the executor thus avoiding memory leak for (Method m : executor.getClass().getMethods()) { if (m.getName().equals("setRemoveOnCancelPolicy") - && m.getParameterCount() == 1 - && m.getParameters()[0].getType() == Boolean.TYPE) { + && m.getParameterTypes().length == 1 + && m.getParameterTypes()[0] == Boolean.TYPE) { try { m.invoke(executor, true); } catch (Exception ex) {