diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-13 10:19:51 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-08-20 10:35:53 +0200 |
commit | 60f152caeee38579433a31dd3a98e91dc3d23ff6 (patch) | |
tree | 15ba69f938e09bb173ca7de2e1b21b62e740ea40 /xmerge | |
parent | 2922a967a1da5f9c0a07b5390906307d0ae6fe48 (diff) |
java: avoid unnecessary comparisons in boolean expressions
i.e. stuff like "x == true"
Change-Id: Ib82a4a30e736df392405332fa197b588482cffcf
Diffstat (limited to 'xmerge')
5 files changed, 10 insertions, 10 deletions
diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java index d95e37cdc815..982cb3f5aa80 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/Convert.java @@ -89,7 +89,7 @@ public class Convert implements Cloneable { Document inputDoc; - if (toOffice == true) { + if (toOffice) { inputDoc = ci.getPluginFactory().createDeviceDocument(name, is); } else { inputDoc = ci.getPluginFactory().createOfficeDocument(name, is); @@ -115,7 +115,7 @@ public class Convert implements Cloneable { Document inputDoc; - if (toOffice == true) { + if (toOffice) { inputDoc = ci.getPluginFactory().createDeviceDocument(name, is); } else { inputDoc = ci.getPluginFactory().createOfficeDocument(name, is, isZip); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java index 42c6df4fd5ee..db6c9e0e9573 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/converter/xml/EmbeddedXMLObject.java @@ -221,7 +221,7 @@ public class EmbeddedXMLObject extends EmbeddedObject { */ @Override void write(OfficeZip zip) throws IOException { - if (hasChanged == true) { + if (hasChanged) { if (contentDOM != null) { zip.setNamedBytes((objName + "/content.xml"), OfficeDocument.docToBytes(contentDOM)); diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java index c0f486d83476..a17aae751087 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/merger/merge/DocumentMerge.java @@ -72,7 +72,7 @@ public class DocumentMerge implements MergeAlgorithm { if (difference.getOperation() == Difference.DELETE) { haveDeleteOperation = true; } else if (difference.getOperation() == Difference.ADD && - haveDeleteOperation == true) { + haveDeleteOperation) { throw new MergeException( "Differences array is not sorted. Delete before Add"); } diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java index 116ec08d052a..693b7babdb93 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfo.java @@ -85,7 +85,7 @@ public class ConverterInfo { String xsltDeserial) throws RegistryException { - if (isValidOfficeType(officeMime.trim()) == false) { + if (!isValidOfficeType(officeMime.trim())) { RegistryException re = new RegistryException( "Invalid office type"); throw re; @@ -162,7 +162,7 @@ public class ConverterInfo { String version, String vendor, String impl) throws RegistryException { - if (isValidOfficeType(officeMime.trim()) == false) { + if (!isValidOfficeType(officeMime.trim())) { RegistryException re = new RegistryException( "Invalid office type"); throw re; diff --git a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java index bfa23666ee82..2087ce80086b 100644 --- a/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java +++ b/xmerge/source/xmerge/java/org/openoffice/xmerge/util/registry/ConverterInfoMgr.java @@ -180,7 +180,7 @@ public final class ConverterInfoMgr { public static ConverterInfo findConverterInfo(String deviceMime, String officeMime) { if (deviceMime == null || - ConverterInfo.isValidOfficeType(officeMime) == false) { + !ConverterInfo.isValidOfficeType(officeMime)) { return null; } @@ -284,7 +284,7 @@ public final class ConverterInfoMgr { char c = ' '; boolean exitFlag = false; - while (exitFlag == false) { + while (!exitFlag) { System.out.println("\nMenu:"); System.out.println("(L)oad plug-ins from a jar file"); @@ -340,7 +340,7 @@ public final class ConverterInfoMgr { // Unload by Display Name or Jarfile } else if (c == 'T') { - if (validate== true){ + if (validate){ System.out.println("Validation switched off"); validate=false; } else { @@ -366,7 +366,7 @@ public final class ConverterInfoMgr { rc = ConverterInfoMgr.removeByJar(name); } - if (rc == true) { + if (rc) { System.out.println("Remove successful."); } else { System.out.println("Remove failed."); |