Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-8213

UseOriginalAggregationStrategy is suspicious to NullPointerException

    XMLWordPrintableJSON

Details

    Description

      The default constructor of UseOriginalAggregationStrategy sets the final field original to null.
      In one corner case, the aggregate will dereference this null pointer, as no null-pointer check is made.

          public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
              if (propagateException) {
                  Exception exception = checkException(oldExchange, newExchange);
                  if (exception != null) {
                      original.setException(exception);
                  }
              }
              return original != null ? original : oldExchange;
          }
      

      This potential NPE should be fixed, maybe a unit test be added.

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            steffen.ryll Steffen Ryll
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: