Remove pointless boolean expression See issue OPENNLP-871
Project: http://git-wip-us.apache.org/repos/asf/opennlp/repo Commit: http://git-wip-us.apache.org/repos/asf/opennlp/commit/eb93f64b Tree: http://git-wip-us.apache.org/repos/asf/opennlp/tree/eb93f64b Diff: http://git-wip-us.apache.org/repos/asf/opennlp/diff/eb93f64b Branch: refs/heads/trunk Commit: eb93f64b9f1150f658ba456b4630e1040dac8112 Parents: 1550dac Author: Jörn Kottmann <[email protected]> Authored: Wed Nov 2 20:50:22 2016 +0100 Committer: Jörn Kottmann <[email protected]> Committed: Mon Dec 19 23:39:07 2016 +0100 ---------------------------------------------------------------------- .../src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java | 2 +- opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/opennlp/blob/eb93f64b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java ---------------------------------------------------------------------- diff --git a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java index ee785cc..275cf4d 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java +++ b/opennlp-tools/src/main/java/opennlp/tools/formats/ad/ADSentenceStream.java @@ -164,7 +164,7 @@ public class ADSentenceStream extends /* now we have to take care of the lastLevel. Every time it raises, we will add the leaf to the node at the top. If it decreases, we remove the top. */ - while (line != null && line.length() != 0 && line.startsWith("</s>") == false && !line.equals("&&")) { + while (line != null && line.length() != 0 && !line.startsWith("</s>") && !line.equals("&&")) { TreeElement element = this.getElement(line); if(element != null) { http://git-wip-us.apache.org/repos/asf/opennlp/blob/eb93f64b/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java ---------------------------------------------------------------------- diff --git a/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java b/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java index d36e89e..1fba758 100644 --- a/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java +++ b/opennlp-tools/src/main/java/opennlp/tools/namefind/NameSample.java @@ -245,7 +245,7 @@ public class NameSample { } else if (parts[pi].equals(NameSampleDataStream.END_TAG)) { - if(catchingName == false) { + if(!catchingName) { throw new IOException("Found unexpected annotation: " + errorTokenWithContext(parts, pi)); } catchingName = false;
