You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by GitBox <gi...@apache.org> on 2019/11/26 20:55:50 UTC

[GitHub] [jena] strangepleasures commented on a change in pull request #637: JENA-1784 CacheSimple doesn't check keys for equality

strangepleasures commented on a change in pull request #637: JENA-1784 CacheSimple doesn't check keys for equality
URL: https://github.com/apache/jena/pull/637#discussion_r350975531
 
 

 ##########
 File path: jena-base/src/test/java/org/apache/jena/atlas/lib/cache/CacheSimpleTest.java
 ##########
 @@ -40,4 +40,20 @@ public void testFixedSize() {
 				.forEach(testCache::put);
 		assertEquals("Test cache failed to maintain fixed size!", maxSize, testCache.size());
 	}
+
+	@Test
+	public void testSameHash() {
+		Object key1 = new Object() {
 
 Review comment:
   It's indeed a good practice to override `equals` when you change `hashCode` and vice versa.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services