Skip to content

Commit

Permalink
fixed insidious little bug. "" compared with == instead of .equals().…
Browse files Browse the repository at this point in the history
… Was working because "" was usually within the LRUCache, unless it's size was set small enough.
  • Loading branch information
jdereg committed Dec 11, 2023
1 parent 4718547 commit 871e411
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/test/java/com/cedarsoftware/util/TestCompactMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ protected Map<String, Object> getNewMap()
assert map.size() == 2;
assert !map.isEmpty();

assert map.remove("alpha") == "beta";
assert map.remove("alpha").equals("beta");
assert map.size() == 1;
assert !map.isEmpty();

Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/cedarsoftware/util/TestConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ public void testNullInstance()
assert false == convert2AtomicBoolean(null).get();
assert 0 == convert2AtomicInteger(null).get();
assert 0L == convert2AtomicLong(null).get();
assert "" == convert2String(null);
assert "".equals(convert2String(null));
}

@Test
Expand Down

0 comments on commit 871e411

Please sign in to comment.