Skip to content

Commit

Permalink
[#noissue] Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Sep 20, 2024
1 parent fc086c7 commit efb0c0d
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;

/**
Expand Down Expand Up @@ -95,10 +96,14 @@ public void serviceCreationFailed(Class<?> type, Class<?> impl, Throwable except
}

private static class TraceRepositoryCache implements RepositoryCache {
private final RepositoryCache delegate = new DefaultRepositoryCache();
private final RepositoryCache delegate;
private final AtomicInteger hit = new AtomicInteger();
private final AtomicInteger miss = new AtomicInteger();

public TraceRepositoryCache(RepositoryCache delegate) {
this.delegate = Objects.requireNonNull(delegate, "delegate");
}

@Override
public void put(RepositorySystemSession session, Object key, Object data) {
if (logger.isInfoEnabled()) {
Expand Down Expand Up @@ -141,11 +146,12 @@ static DefaultRepositorySystemSession newRepositorySystemSession(RepositorySyste
}

private static RepositoryCache newRepositoryCache() {
RepositoryCache cache = new DefaultRepositoryCache();
final String enableTraceCache = System.getProperty("pinpoint.ittest.tracecache", "false");
if (Boolean.parseBoolean(enableTraceCache)) {
return new TraceRepositoryCache();
return new TraceRepositoryCache(cache);
}
return new DefaultRepositoryCache();
return cache;
}

private static String resolveLocalRepository() {
Expand Down

0 comments on commit efb0c0d

Please sign in to comment.