aboutsummaryrefslogtreecommitdiff
path: root/common/src/test/java/com
diff options
context:
space:
mode:
authoremcmanus <emcmanus@google.com>2015-01-08 17:35:58 -0800
committerChristian Edward Gruber <cgruber@google.com>2015-01-21 13:45:58 -0800
commit3a728350f0b116c38310bbc96f2007d4f30d92b1 (patch)
tree5afc75530453fc9b77854cafb05b43d0e0b2511a /common/src/test/java/com
parentd1f1f9a1c13a9ab76db20380ad6479da2af88bc6 (diff)
downloadauto-3a728350f0b116c38310bbc96f2007d4f30d92b1.tar.gz
Ensure that MoreTypes.equivalence() works in the presence of intersection-type bounds, even though the representation of those differs between Java 7 and Java 8.
------------- Created by MOE: http://code.google.com/p/moe-java MOE_MIGRATED_REVID=83567846
Diffstat (limited to 'common/src/test/java/com')
-rw-r--r--common/src/test/java/com/google/auto/common/MoreTypesTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/src/test/java/com/google/auto/common/MoreTypesTest.java b/common/src/test/java/com/google/auto/common/MoreTypesTest.java
index 22ae5183..d41b9f39 100644
--- a/common/src/test/java/com/google/auto/common/MoreTypesTest.java
+++ b/common/src/test/java/com/google/auto/common/MoreTypesTest.java
@@ -66,6 +66,9 @@ public class MoreTypesTest {
TypeElement setElement = elements.getTypeElement(Set.class.getCanonicalName());
TypeElement enumElement = elements.getTypeElement(Enum.class.getCanonicalName());
TypeElement funkyBounds = elements.getTypeElement(FunkyBounds.class.getCanonicalName());
+ TypeElement funkierBounds = elements.getTypeElement(FunkierBounds.class.getCanonicalName());
+ TypeMirror funkyBoundsVar = ((DeclaredType) funkyBounds.asType()).getTypeArguments().get(0);
+ TypeMirror funkierBoundsVar = ((DeclaredType) funkierBounds.asType()).getTypeArguments().get(0);
DeclaredType mapOfObjectToObjectType =
types.getDeclaredType(mapElement, objectType, objectType);
TypeMirror mapType = mapElement.asType();
@@ -77,6 +80,9 @@ public class MoreTypesTest {
.addEquivalenceGroup(objectType)
.addEquivalenceGroup(stringType)
.addEquivalenceGroup(funkyBounds.asType())
+ .addEquivalenceGroup(funkierBounds.asType())
+ .addEquivalenceGroup(funkyBoundsVar)
+ .addEquivalenceGroup(funkierBoundsVar)
// Enum<E extends Enum<E>>
.addEquivalenceGroup(enumElement.asType())
// Map<K, V>
@@ -173,6 +179,9 @@ public class MoreTypesTest {
@SuppressWarnings("unused")
private static final class FunkyBounds<T extends Number & Comparable<T>> {}
+ @SuppressWarnings("unused")
+ private static final class FunkierBounds<T extends Number & Comparable<T> & Cloneable> {}
+
@Test public void testReferencedTypes() {
Elements elements = compilationRule.getElements();
TypeElement testDataElement = elements