[ 
https://issues.apache.org/jira/browse/CAMEL-10116?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15362967#comment-15362967
 ] 

ASF GitHub Bot commented on CAMEL-10116:
----------------------------------------

GitHub user anoordover opened a pull request:

    https://github.com/apache/camel/pull/1063

    CAMEL-10116: Retrieve last MessageHistory when getting NodeId and Rou…

    Following changes are made:
    
    - MessageHistories is changed to LinkedList to facilitate getting last item;
    - The fetching of the NodeId and RouteId from the last MessageHistory in 
the AwaitThreadEntry is moved to the methods getNodeId and getRouteId.
    
    The test on AsyncProcessorAwaitManager is changed which shows that the 
dumping of the last NodeId and RouteId is error-prone.
    
    I suddenly see that I used java 8 optional and lambda's to get the last 
NodeId, so I guess this can't be cherry-picked to 2.17.3 as is. Sorry.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/anoordover/camel CAMEL-10116

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/camel/pull/1063.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1063
    
----
commit d940bf8d40279f14d1a677ceff0e5afc3f42e191
Author: Arno Noordover <[email protected]>
Date:   2016-07-05T18:24:35Z

    CAMEL-10116: Retrieve last MessageHistory when getting NodeId and RouteId

----


> NullPointerException in DefaultAsyncProcessorAwaitManager
> ---------------------------------------------------------
>
>                 Key: CAMEL-10116
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10116
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.17.1
>            Reporter: Wolfgang Nagele
>            Assignee: Arno Noordover
>             Fix For: 2.17.3, 2.18.0
>
>
> The following statement can cause a NPE (line #256 in 
> DefaultAsyncProcessorAwaitManager at version 2.17.1):
> {{MessageHistory history = list.get(list.size() - 1);}}
> {code}
> java.lang.NullPointerException: null
>         at 
> org.apache.camel.impl.DefaultAsyncProcessorAwaitManager$AwaitThreadEntry.<init>(DefaultAsyncProcessorAwaitManager.java:257)
>  ~[camel-core-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.impl.DefaultAsyncProcessorAwaitManager$AwaitThreadEntry.<init>(DefaultAsyncProcessorAwaitManager.java:238)
>  ~[camel-core-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.impl.DefaultAsyncProcessorAwaitManager.await(DefaultAsyncProcessorAwaitManager.java:73)
>  ~[camel-core-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:122)
>  ~[camel-core-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)
>  ~[camel-core-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.component.stream.StreamConsumer.processLine(StreamConsumer.java:218)
>  ~[camel-stream-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.component.stream.StreamConsumer.readFromStream(StreamConsumer.java:146)
>  ~[camel-stream-2.17.1.jar!/:2.17.1]
>         at 
> org.apache.camel.component.stream.StreamConsumer.run(StreamConsumer.java:99) 
> ~[camel-stream-2.17.1.jar!/:2.17.1]
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
>  [na:1.8.0_91]
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
>  [na:1.8.0_91]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_91]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to