Author: galder.zamarreno(a)jboss.com
Date: 2009-09-09 11:36:57 -0400 (Wed, 09 Sep 2009)
New Revision: 8217
Modified:
core/trunk/src/main/java/org/jboss/cache/util/Immutables.java
Log:
Fix generics issue.
Modified: core/trunk/src/main/java/org/jboss/cache/util/Immutables.java
===================================================================
--- core/trunk/src/main/java/org/jboss/cache/util/Immutables.java 2009-09-07 18:13:13 UTC
(rev 8216)
+++ core/trunk/src/main/java/org/jboss/cache/util/Immutables.java 2009-09-09 15:36:57 UTC
(rev 8217)
@@ -65,7 +65,7 @@
{
if (list == null) return null;
if (list.isEmpty()) return Collections.emptyList();
- if (list.size() == 1) return Collections.singletonList(list.get(0));
+ if (list.size() == 1) return Collections.<T> singletonList(list.get(0));
return new ImmutableListCopy<T>(list);
}
@@ -125,7 +125,7 @@
{
if (set == null) return null;
if (set.isEmpty()) return Collections.emptySet();
- if (set.size() == 1) return Collections.singleton(set.iterator().next());
+ if (set.size() == 1) return Collections.<T>
singleton(set.iterator().next());
Set<? extends T> copy = attemptKnownSetCopy(set);
if (copy == null)
@@ -165,7 +165,7 @@
if (map.size() == 1)
{
Map.Entry<? extends K, ? extends V> me =
map.entrySet().iterator().next();
- return Collections.singletonMap(me.getKey(), me.getValue());
+ return Collections.<K, V> singletonMap(me.getKey(), me.getValue());
}
Map<? extends K, ? extends V> copy = attemptKnownMapCopy(map);
@@ -190,7 +190,7 @@
{
if (collection == null) return null;
if (collection.isEmpty()) return Collections.emptySet();
- if (collection.size() == 1) return
Collections.singleton(collection.iterator().next());
+ if (collection.size() == 1) return Collections.<T>
singleton(collection.iterator().next());
Collection<? extends T> copy = attemptKnownSetCopy(collection);
if (copy == null)
copy = attemptClone(collection);
Show replies by date