tflobbe commented on a change in pull request #1335: SOLR-14316 Remove unchecked type conversion warning in JavaBinCodec's readMapEntry's equals() method URL: https://github.com/apache/lucene-solr/pull/1335#discussion_r391143892
########## File path: solr/solrj/src/test/org/apache/solr/common/util/TestJavaBinCodec.java ########## @@ -287,6 +289,45 @@ public void testAllTypes() throws IOException { ); } + @Test + public void testReadMapEntry() throws IOException { + Map.Entry<Object, Object> extryFromTextDoc1 = getMapFromJavaBinCodec(SOLRJ_DOCS_1); + Map.Entry<Object, Object> extryFromTextDoc1_clone = getMapFromJavaBinCodec(SOLRJ_DOCS_1); + + Map.Entry<Object, Object> extryFromTextDoc2 = getMapFromJavaBinCodec(SOLRJ_DOCS_2); + Map.Entry<Object, Object> extryFromTextDoc2_clone = getMapFromJavaBinCodec(SOLRJ_DOCS_2); + + // exactly same document read twice should have same content + assert (extryFromTextDoc1.equals(extryFromTextDoc1_clone)); Review comment: While this would work because we force to enable assertions while running tests, we usually use JUnit's assertions, such as `assertEquals("", obj1, obj2);` ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org