Skip to content

Commit

Permalink
Fix warn issues of build
Browse files Browse the repository at this point in the history
  • Loading branch information
nroduit committed Jan 31, 2025
1 parent 7e4bec1 commit e077f94
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.language>java</sonar.language>
<sonar.java.source>${java-version}</sonar.java.source>
<sonar.test.exclusions>src/test/**/*</sonar.test.exclusions>
<sonar.exclusions>**/src/test/**</sonar.exclusions>
<!--suppress UnresolvedMavenProperty -->
<sonar.coverage.jacoco.xmlReportPaths>${maven.multiModuleProjectDirectory}/tests/target/site/jacoco-aggregate/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,14 @@ public final class JIThumbnailCache {
queue,
ThreadUtil.getThreadFactory("Thumbnail Cache")); // NON-NLS

private final Map<URI, ThumbnailIcon> cachedThumbnails;

public JIThumbnailCache() {
this.cachedThumbnails =
Collections.synchronizedMap(
new LinkedHashMap<>(80) {

private static final int MAX_ENTRIES = 100;

@Override
protected boolean removeEldestEntry(final Map.Entry eldest) {
return size() > MAX_ENTRIES;
}
});
}
private final Map<URI, ThumbnailIcon> cachedThumbnails =
Collections.synchronizedMap(
new LinkedHashMap<>(80) {
@Override
protected boolean removeEldestEntry(final Map.Entry eldest) {
return size() > 100;
}
});

public synchronized void invalidate() {
this.cachedThumbnails.clear();
Expand Down

0 comments on commit e077f94

Please sign in to comment.