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

In DefaultUnitOfWork:popRouteContext() avoid exception thrown

    XMLWordPrintableJSON

Details

    • Novice

    Description

      Instead of

          public RouteContext popRouteContext() {
              try {
                  return routeContextStack.pop();
              } catch (NoSuchElementException e) {
                  // ignore and return null
              }
              return null;
          }
      

      can just write

          public RouteContext popRouteContext() {
              return routeContextStack.pollFirst();
          }
      

      I understand the cost of an exception is low, but still it doesn't look nice to see zillions of exceptions in a flight recording caused by Camel.

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            lichtin Martin Lichtin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: