Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

fix TechDebt - Remove Guava as direct dependency #7379 #7380

Merged
merged 1 commit into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions app/common/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@
<artifactId>jsr305</artifactId>
</dependency>

<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<!-- Testing -->
<dependency>
<groupId>junit</groupId>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public void evictAll() {
@Override
public <K, V> Cache<K, V> getCache(final String name, boolean soft) {
Cache<K, V> cache = (Cache<K, V>) caches.computeIfAbsent(name, n -> this.newCache(soft));
if ((soft && !(cache instanceof GuavaSoftCache)) || (!soft && (cache instanceof GuavaSoftCache))) {
if ((soft && !(cache instanceof LRUSoftCache)) || (!soft && (cache instanceof LRUSoftCache))) {
LOG.warn("Cache {} is being used in mixed 'soft' and 'hard' mode", name);
}
return cache;
}

private <K, V> Cache<K, V> newCache(boolean soft) {
if (soft) {
return new GuavaSoftCache<>(maxElements);
return new LRUSoftCache<>(maxElements);
}
return new LRUDefaultCache<>(maxElements);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void testSyndesisSoftCacheEmptiedOnHeapFull() {

@Test
public void testGuavaSoftCacheEmptiedOnHeapFull() {
Cache<String, byte[]> cache = new GuavaSoftCache<>(MAX_ELEMENTS);
Cache<String, byte[]> cache = new LRUSoftCache<>(MAX_ELEMENTS);
doTest(cache);
}

Expand Down