Return-Path: X-Original-To: apmail-camel-commits-archive@www.apache.org Delivered-To: apmail-camel-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D51B4199E4 for ; Fri, 15 Apr 2016 19:59:34 +0000 (UTC) Received: (qmail 98693 invoked by uid 500); 15 Apr 2016 19:59:34 -0000 Delivered-To: apmail-camel-commits-archive@camel.apache.org Received: (qmail 98644 invoked by uid 500); 15 Apr 2016 19:59:34 -0000 Mailing-List: contact commits-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 commits@camel.apache.org Received: (qmail 98548 invoked by uid 99); 15 Apr 2016 19:59:34 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 19:59:34 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 98629DFF8A; Fri, 15 Apr 2016 19:59:34 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ay@apache.org To: commits@camel.apache.org Date: Fri, 15 Apr 2016 19:59:35 -0000 Message-Id: In-Reply-To: <5199642065f54465b0e7b7a235a0cbc2@git.apache.org> References: <5199642065f54465b0e7b7a235a0cbc2@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/2] camel git commit: a minor simplification to CAMEL-9854 a minor simplification to CAMEL-9854 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a6b710e8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a6b710e8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a6b710e8 Branch: refs/heads/camel-2.16.x Commit: a6b710e8da903469a5cc89bc5940004b9ecd036d Parents: a019505 Author: Akitoshi Yoshida Authored: Tue Apr 12 14:40:11 2016 +0200 Committer: Akitoshi Yoshida Committed: Fri Apr 15 21:49:53 2016 +0200 ---------------------------------------------------------------------- .../component/cxf/converter/DelegatingXMLStreamReader.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/a6b710e8/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/DelegatingXMLStreamReader.java ---------------------------------------------------------------------- diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/DelegatingXMLStreamReader.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/DelegatingXMLStreamReader.java index 005aaed..330bbe9 100644 --- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/DelegatingXMLStreamReader.java +++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/converter/DelegatingXMLStreamReader.java @@ -40,12 +40,10 @@ class DelegatingXMLStreamReader implements XMLStreamReader { public DelegatingXMLStreamReader(XMLStreamReader reader, Map nsmap) { this.reader = reader; + //the original nsmap will be mutated if some of its declarations are redundantly present at the current reader Set prefixes = nsmap.keySet(); for (int i = 0; i < reader.getNamespaceCount(); i++) { - String prefix = reader.getNamespacePrefix(i); - if (prefixes.contains(prefix)) { - prefixes.remove(prefix); - } + prefixes.remove(reader.getNamespacePrefix(i)); } this.xprefixes = prefixes.toArray(new String[0]); }