mawiesne commented on code in PR #154:
URL: https://github.com/apache/opennlp-sandbox/pull/154#discussion_r1671637812


##########
summarizer/src/main/java/opennlp/summarization/Sentence.java:
##########
@@ -135,20 +131,25 @@ public int getWordCnt()
        }
 
        // Should add an article id to the sentence class. For now returns true 
if the ids are the same.
+
        @Override
-       public boolean equals(Object o) {
+       public final boolean equals(Object o) {
                if (this == o) return true;
-               if (o == null || getClass() != o.getClass()) return false;
-               Sentence sentence = (Sentence) o;
-               return sentId == sentence.sentId;
+               if (!(o instanceof Sentence sentence)) return false;
+
+    return sentId == sentence.sentId;

Review Comment:
   Good pointer, will look at it and auto-format all classes in that package.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to