From 2505225c6ff7ea4e53fa3ada3ab43affd0a4fd00 Mon Sep 17 00:00:00 2001 From: rbuj Date: Mon, 28 Jul 2014 10:58:51 +0200 Subject: xmerge: If statement is redundant Change-Id: I62914ab65258de36790387b7a8865a32b0d7bca6 Reviewed-on: https://gerrit.libreoffice.org/10587 Reviewed-by: David Tardon Tested-by: David Tardon --- .../org/openoffice/xmerge/merger/diff/ParaNodeIterator.java | 10 +++------- .../java/org/openoffice/xmerge/merger/diff/RowIterator.java | 8 ++------ .../org/openoffice/xmerge/merger/diff/TextNodeIterator.java | 12 ++++-------- 3 files changed, 9 insertions(+), 21 deletions(-) (limited to 'xmerge') diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java index 23ba1d3b7f07..48d63474f648 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/ParaNodeIterator.java @@ -67,13 +67,9 @@ public final class ParaNodeIterator extends NodeIterator { // can use an array later to check all possible tags for // future expansion - if (node.getNodeType() == Node.ELEMENT_NODE && - (node.getNodeName().equals(SUPPORTED_TAG1) || - node.getNodeName().equals(SUPPORTED_TAG2))) { - return true; - } else { - return false; - } + return node.getNodeType() == Node.ELEMENT_NODE && + (node.getNodeName().equals(SUPPORTED_TAG1) || + node.getNodeName().equals(SUPPORTED_TAG2)); } } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java index 779393e33540..02ac53f37a4c 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/RowIterator.java @@ -56,12 +56,8 @@ public final class RowIterator extends NodeIterator { // can use an array later to check all possible tags for // future expansion - if (node.getNodeType() == Node.ELEMENT_NODE && - node.getNodeName().equals(OfficeConstants.TAG_TABLE_ROW)) { - return true; - } else { - return false; - } + return node.getNodeType() == Node.ELEMENT_NODE && + node.getNodeName().equals(OfficeConstants.TAG_TABLE_ROW); } } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java index 24509141d2d5..61b886b99aa1 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/diff/TextNodeIterator.java @@ -60,14 +60,10 @@ public final class TextNodeIterator extends NodeIterator { // can use an array later to check all possible tags for // future expansion - if (node.getNodeType() == Node.TEXT_NODE || - node.getNodeName().equals(OfficeConstants.TAG_SPACE) || - node.getNodeName().equals(OfficeConstants.TAG_TAB_STOP) || - node.getNodeName().equals(OfficeConstants.TAG_LINE_BREAK)) { - return true; - } else { - return false; - } + return node.getNodeType() == Node.TEXT_NODE || + node.getNodeName().equals(OfficeConstants.TAG_SPACE) || + node.getNodeName().equals(OfficeConstants.TAG_TAB_STOP) || + node.getNodeName().equals(OfficeConstants.TAG_LINE_BREAK); } } -- cgit