Skip to content

Commit

Permalink
fix TechDebt - Remove Guava as direct dependency syndesisio#7379
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurt Stam committed Dec 11, 2019
1 parent 3e14707 commit 76d1f2f
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 89 deletions.
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

0 comments on commit 76d1f2f

Please sign in to comment.