You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2015/04/07 19:00:13 UTC

[3/4] incubator-nifi git commit: NIFI-491: Fixed bug that caused InvocationTargetException.getCause().getCause() instead of InvocationTargetException.getCause(); also if null passed into logger, avoid the NPE that results

NIFI-491: Fixed bug that caused InvocationTargetException.getCause().getCause() instead of InvocationTargetException.getCause(); also if null passed into logger, avoid the NPE that results


Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/c974ea90
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/c974ea90
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/c974ea90

Branch: refs/heads/develop
Commit: c974ea90f89186bfd5f12e34f2cec3728d237b89
Parents: a7862a1
Author: Mark Payne <ma...@hotmail.com>
Authored: Tue Apr 7 12:41:31 2015 -0400
Committer: Mark Payne <ma...@hotmail.com>
Committed: Tue Apr 7 12:41:31 2015 -0400

----------------------------------------------------------------------
 .../nifi/controller/scheduling/StandardProcessScheduler.java     | 4 ++--
 .../main/java/org/apache/nifi/processor/SimpleProcessLogger.java | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/c974ea90/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
index 43e05dd..7725823 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/scheduling/StandardProcessScheduler.java
@@ -339,8 +339,8 @@ public final class StandardProcessScheduler implements ProcessScheduler {
                             final ProcessorLog procLog = new SimpleProcessLogger(procNode.getIdentifier(), procNode.getProcessor());
 
                             procLog.error("{} failed to invoke @OnScheduled method due to {}; processor will not be scheduled to run for {}",
-                                    new Object[]{procNode.getProcessor(), cause.getCause(), administrativeYieldDuration}, cause.getCause());
-                            LOG.error("Failed to invoke @OnScheduled method due to {}", cause.getCause().toString(), cause.getCause());
+                                    new Object[]{procNode.getProcessor(), cause, administrativeYieldDuration}, cause);
+                            LOG.error("Failed to invoke @OnScheduled method due to {}", cause.toString(), cause);
 
                             ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnUnscheduled.class, procNode.getProcessor(), processContext);
                             ReflectionUtils.quietlyInvokeMethodsWithAnnotation(OnStopped.class, procNode.getProcessor(), processContext);

http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/c974ea90/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
----------------------------------------------------------------------
diff --git a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
index 25d8f10..0a345a0 100644
--- a/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
+++ b/nifi/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/processor/SimpleProcessLogger.java
@@ -243,7 +243,7 @@ public class SimpleProcessLogger implements ProcessorLog {
         for (int i = 0; i < os.length; i++) {
             modifiedArgs[i + 1] = os[i];
         }
-        modifiedArgs[modifiedArgs.length - 1] = t.toString();
+        modifiedArgs[modifiedArgs.length - 1] = (t == null) ? "" : t.toString();
 
         return modifiedArgs;
     }