Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2124319102 for ; Tue, 22 Mar 2016 17:01:26 +0000 (UTC) Received: (qmail 3773 invoked by uid 500); 22 Mar 2016 17:01:25 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 3676 invoked by uid 500); 22 Mar 2016 17:01:25 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 3647 invoked by uid 99); 22 Mar 2016 17:01:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Mar 2016 17:01:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8756F2C1F5C for ; Tue, 22 Mar 2016 17:01:25 +0000 (UTC) Date: Tue, 22 Mar 2016 17:01:25 +0000 (UTC) From: "Sverker Abrahamsson (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-9745) Splitter - Should skip null messages if iterator returns null MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-9745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15206784#comment-15206784 ] Sverker Abrahamsson commented on CAMEL-9745: -------------------------------------------- For TarIterator I wrote a suggestion for a solution, but it depends on knowing the size of the file being spitted up and keeping track of how much is consumed. However, that is not always the case as the input may just be an input stream (originally in the tar case from a tape drive) so it falls back to the old logic so that case must be handled anyway. It might be preferable to just do as you suggest and skip if null is returned from next(), hence no need to keep track of the length of the data to be splitted. > Splitter - Should skip null messages if iterator returns null > ------------------------------------------------------------- > > Key: CAMEL-9745 > URL: https://issues.apache.org/jira/browse/CAMEL-9745 > Project: Camel > Issue Type: Improvement > Components: camel-core > Affects Versions: 2.16.2 > Reporter: Claus Ibsen > Assignee: Claus Ibsen > Fix For: 2.16.3, 2.18.0, 2.17.1 > > > When splitting and using an iterator the usually hasNext -> next is paired so if hasNext returns true, then next returns data. But there can be situations where this is tricky to determine up front, and therefore a hasNext may return true, and then next() return null if there was no data really. Then the splitter should just skip that null and continue. -- This message was sent by Atlassian JIRA (v6.3.4#6332)