diff options
author | Jesse Wilson <jessewilson@google.com> | 2009-12-14 21:57:51 -0800 |
---|---|---|
committer | Jesse Wilson <jessewilson@google.com> | 2009-12-14 21:57:51 -0800 |
commit | f4105a1a9bdfcb6ba64b1b03ad24c0d999e8da4c (patch) | |
tree | 6b5f3d74025824643788b91c6ca2a3e80ab458b5 | |
parent | 090f9b4c879985bc747c214f82c62471e60c7742 (diff) | |
download | guava-f4105a1a9bdfcb6ba64b1b03ad24c0d999e8da4c.tar.gz |
Making our code slightly less typesafe to work around a bug in javac.
I couldn't reproduce the specific bug on various versions of javac (1.6.0,
1.6.0 r1, 1.6.0 r13, 1.6.0r16, 1.6.0 r15 on Mac, 1.5.0 r20 on Mac) so I'm
just hoping this change works.
6 files changed, 6 insertions, 6 deletions
diff --git a/src/com/google/common/collect/ImmutableList.java b/src/com/google/common/collect/ImmutableList.java index 0aa250188..b40887439 100644 --- a/src/com/google/common/collect/ImmutableList.java +++ b/src/com/google/common/collect/ImmutableList.java @@ -62,7 +62,7 @@ public abstract class ImmutableList<E> extends ImmutableCollection<E> // Casting to any type is safe because the list will never hold any elements. @SuppressWarnings("unchecked") public static <E> ImmutableList<E> of() { - return (ImmutableList<E>) EmptyImmutableList.INSTANCE; + return (ImmutableList) EmptyImmutableList.INSTANCE; } /** diff --git a/src/com/google/common/collect/ImmutableListMultimap.java b/src/com/google/common/collect/ImmutableListMultimap.java index b71b47aa3..93ef89899 100644 --- a/src/com/google/common/collect/ImmutableListMultimap.java +++ b/src/com/google/common/collect/ImmutableListMultimap.java @@ -54,7 +54,7 @@ public class ImmutableListMultimap<K, V> // Casting is safe because the multimap will never hold any elements. @SuppressWarnings("unchecked") public static <K, V> ImmutableListMultimap<K, V> of() { - return (ImmutableListMultimap<K, V>) EmptyImmutableListMultimap.INSTANCE; + return (ImmutableListMultimap) EmptyImmutableListMultimap.INSTANCE; } /** diff --git a/src/com/google/common/collect/ImmutableMap.java b/src/com/google/common/collect/ImmutableMap.java index 65a002225..8fad466b4 100644 --- a/src/com/google/common/collect/ImmutableMap.java +++ b/src/com/google/common/collect/ImmutableMap.java @@ -58,7 +58,7 @@ public abstract class ImmutableMap<K, V> implements Map<K, V>, Serializable { // Casting to any type is safe because the set will never hold any elements. @SuppressWarnings("unchecked") public static <K, V> ImmutableMap<K, V> of() { - return (ImmutableMap<K, V>) EmptyImmutableMap.INSTANCE; + return (ImmutableMap) EmptyImmutableMap.INSTANCE; } /** diff --git a/src/com/google/common/collect/ImmutableMultiset.java b/src/com/google/common/collect/ImmutableMultiset.java index cd78905c4..fe33d506f 100644 --- a/src/com/google/common/collect/ImmutableMultiset.java +++ b/src/com/google/common/collect/ImmutableMultiset.java @@ -50,7 +50,7 @@ public class ImmutableMultiset<E> extends ImmutableCollection<E> */ @SuppressWarnings("unchecked") // all supported methods are covariant public static <E> ImmutableMultiset<E> of() { - return (ImmutableMultiset<E>) EmptyImmutableMultiset.INSTANCE; + return (ImmutableMultiset) EmptyImmutableMultiset.INSTANCE; } /** diff --git a/src/com/google/common/collect/ImmutableSet.java b/src/com/google/common/collect/ImmutableSet.java index 8410a79ac..20de3b609 100644 --- a/src/com/google/common/collect/ImmutableSet.java +++ b/src/com/google/common/collect/ImmutableSet.java @@ -73,7 +73,7 @@ public abstract class ImmutableSet<E> extends ImmutableCollection<E> // Casting to any type is safe because the set will never hold any elements. @SuppressWarnings({"unchecked"}) public static <E> ImmutableSet<E> of() { - return (ImmutableSet<E>) EmptyImmutableSet.INSTANCE; + return (ImmutableSet) EmptyImmutableSet.INSTANCE; } /** diff --git a/src/com/google/common/collect/ImmutableSetMultimap.java b/src/com/google/common/collect/ImmutableSetMultimap.java index af3ca846c..88f286aa3 100644 --- a/src/com/google/common/collect/ImmutableSetMultimap.java +++ b/src/com/google/common/collect/ImmutableSetMultimap.java @@ -57,7 +57,7 @@ public class ImmutableSetMultimap<K, V> // Casting is safe because the multimap will never hold any elements. @SuppressWarnings("unchecked") public static <K, V> ImmutableSetMultimap<K, V> of() { - return (ImmutableSetMultimap<K, V>) EmptyImmutableSetMultimap.INSTANCE; + return (ImmutableSetMultimap) EmptyImmutableSetMultimap.INSTANCE; } /** |