From ab513c23c94050db7e15cb2a9a0c50b4bcdfb369 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 1 Apr 2010 10:36:57 +0000 Subject: [PATCH] fixed ambiguous reference to Entry type git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3214 50f2f4bb-b051-0410-bef5-90022cba6387 --- .../CachingMetadataReaderFactory.java | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/type/classreading/CachingMetadataReaderFactory.java b/org.springframework.core/src/main/java/org/springframework/core/type/classreading/CachingMetadataReaderFactory.java index 3eabbc5adb1..a44ce7f0673 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/type/classreading/CachingMetadataReaderFactory.java +++ b/org.springframework.core/src/main/java/org/springframework/core/type/classreading/CachingMetadataReaderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2010 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.core.type.classreading; import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map; -import java.util.Map.Entry; import org.springframework.core.io.Resource; import org.springframework.core.io.ResourceLoader; @@ -37,19 +36,9 @@ public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory { private static final int MAX_ENTRIES = 256; - @SuppressWarnings("serial") - private static final Map createLRUCache() { - return new LinkedHashMap(MAX_ENTRIES, 0.75f, true) { - - @Override - protected boolean removeEldestEntry(Entry eldest) { - return size() > MAX_ENTRIES; - } - }; - } - private final Map classReaderCache = createLRUCache(); + /** * Create a new CachingMetadataReaderFactory for the default class loader. */ @@ -74,6 +63,7 @@ public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory { super(classLoader); } + @Override public MetadataReader getMetadataReader(Resource resource) throws IOException { synchronized (this.classReaderCache) { @@ -85,4 +75,16 @@ public class CachingMetadataReaderFactory extends SimpleMetadataReaderFactory { return metadataReader; } } -} \ No newline at end of file + + + @SuppressWarnings("serial") + private static Map createLRUCache() { + return new LinkedHashMap(MAX_ENTRIES, 0.75f, true) { + @Override + protected boolean removeEldestEntry(Map.Entry eldest) { + return size() > MAX_ENTRIES; + } + }; + } + +}