Skip to content

Commit 4a98fcb

Browse files
committed
fixed ambiguous reference to Entry type
1 parent 29ab58c commit 4a98fcb

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

org.springframework.core/src/main/java/org/springframework/core/type/classreading/CachingMetadataReaderFactory.java

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2010 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,7 +19,6 @@
1919
import java.io.IOException;
2020
import java.util.LinkedHashMap;
2121
import java.util.Map;
22-
import java.util.Map.Entry;
2322

2423
import org.springframework.core.io.Resource;
2524
import org.springframework.core.io.ResourceLoader;
@@ -37,19 +36,9 @@ public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory {
3736

3837
private static final int MAX_ENTRIES = 256;
3938

40-
@SuppressWarnings("serial")
41-
private static final <K, V> Map<K, V> createLRUCache() {
42-
return new LinkedHashMap<K, V>(MAX_ENTRIES, 0.75f, true) {
43-
44-
@Override
45-
protected boolean removeEldestEntry(Entry<K, V> eldest) {
46-
return size() > MAX_ENTRIES;
47-
}
48-
};
49-
}
50-
5139
private final Map<Resource, MetadataReader> classReaderCache = createLRUCache();
5240

41+
5342
/**
5443
* Create a new CachingMetadataReaderFactory for the default class loader.
5544
*/
@@ -74,6 +63,7 @@ public CachingMetadataReaderFactory(ClassLoader classLoader) {
7463
super(classLoader);
7564
}
7665

66+
7767
@Override
7868
public MetadataReader getMetadataReader(Resource resource) throws IOException {
7969
synchronized (this.classReaderCache) {
@@ -85,4 +75,16 @@ public MetadataReader getMetadataReader(Resource resource) throws IOException {
8575
return metadataReader;
8676
}
8777
}
88-
}
78+
79+
80+
@SuppressWarnings("serial")
81+
private static <K, V> Map<K, V> createLRUCache() {
82+
return new LinkedHashMap<K, V>(MAX_ENTRIES, 0.75f, true) {
83+
@Override
84+
protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
85+
return size() > MAX_ENTRIES;
86+
}
87+
};
88+
}
89+
90+
}

0 commit comments

Comments
 (0)