From ea54c6391e2cfa24bee00a5b45c4661e2a6cf560 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 5 Feb 2009 21:07:53 +0000 Subject: [PATCH] deprecated ConcurrentMap --- .../java/org/springframework/core/CollectionFactory.java | 8 +++++--- .../main/java/org/springframework/core/ConcurrentMap.java | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java b/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java index 99c2b5868e0..1574b3563cb 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java +++ b/org.springframework.core/src/main/java/org/springframework/core/CollectionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2009 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. @@ -45,8 +45,8 @@ import org.springframework.util.ClassUtils; /** * Factory for collections, being aware of Commons Collection 3.x's extended - * collections as well as of JDK 1.5+ concurrent collections and backport-concurrent - * collections. Mainly for internal use within the framework. + * collections as well as of JDK 1.5+ concurrent collections. + * Mainly for internal use within the framework. * *

The goal of this class is to avoid runtime dependencies on JDK 1.5+ and * Commons Collections 3.x, simply using the best collection implementation @@ -209,6 +209,7 @@ public abstract class CollectionFactory { * @see java.util.TreeSet * @see java.util.LinkedHashSet */ + @SuppressWarnings("unchecked") public static Collection createApproximateCollection(Object collection, int initialCapacity) { if (collection instanceof LinkedList) { return new LinkedList(); @@ -272,6 +273,7 @@ public abstract class CollectionFactory { /** * ConcurrentMap adapter for the JDK ConcurrentHashMap class. */ + @Deprecated private static class JdkConcurrentHashMap extends ConcurrentHashMap implements ConcurrentMap { private JdkConcurrentHashMap(int initialCapacity) { diff --git a/org.springframework.core/src/main/java/org/springframework/core/ConcurrentMap.java b/org.springframework.core/src/main/java/org/springframework/core/ConcurrentMap.java index 57f5c07707c..8bcaa5b9734 100644 --- a/org.springframework.core/src/main/java/org/springframework/core/ConcurrentMap.java +++ b/org.springframework.core/src/main/java/org/springframework/core/ConcurrentMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2007 the original author or authors. + * Copyright 2002-2009 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. @@ -29,7 +29,10 @@ import java.util.Map; * * @author Juergen Hoeller * @since 2.5 + * @deprecated as of Spring 3.0, since standard {@link java.util.concurrent.ConcurrentMap} + * is available on Java 5+ anyway */ +@Deprecated public interface ConcurrentMap extends Map { V putIfAbsent(K key, V value);