From 6ceafa82bdfacf0ef34c45a7292d5bf6d074a470 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Thu, 6 Sep 2018 21:57:12 +0200 Subject: [PATCH 1/2] up --- src/test/java/spoon/test/ctType/CtTypeTest.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/test/java/spoon/test/ctType/CtTypeTest.java b/src/test/java/spoon/test/ctType/CtTypeTest.java index 4c6e45775aa..ec243aa7b98 100644 --- a/src/test/java/spoon/test/ctType/CtTypeTest.java +++ b/src/test/java/spoon/test/ctType/CtTypeTest.java @@ -162,6 +162,13 @@ public void testIsSubTypeOfonTypeReferences() { }); assertTrue(count[0] > (9 * 8)); + + // contract: isSubTypeOf does not throw an exception + // #2288 cannot be reproduced, probably fixed by #2406 + CtTypeReference typeReferenceWithNoDeclaration = launcher.getFactory().createTypeReference(); + typeReferenceWithNoDeclaration.setSimpleName("DoesNotExist"); + assertFalse(typeReferenceWithNoDeclaration.isSubtypeOf(oCtType.getReference())); + assertFalse(oCtType.isSubtypeOf(typeReferenceWithNoDeclaration)); } private void checkIsSubtype(CtTypeReference superType, CtTypeReference subType, Map> nameToTypeRef) { From c83b5abf931840b397f700ff7103adf4b7496511 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Tue, 11 Sep 2018 16:17:38 +0200 Subject: [PATCH 2/2] Update CtTypeTest.java --- src/test/java/spoon/test/ctType/CtTypeTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/spoon/test/ctType/CtTypeTest.java b/src/test/java/spoon/test/ctType/CtTypeTest.java index ec243aa7b98..c7330394a11 100644 --- a/src/test/java/spoon/test/ctType/CtTypeTest.java +++ b/src/test/java/spoon/test/ctType/CtTypeTest.java @@ -163,7 +163,7 @@ public void testIsSubTypeOfonTypeReferences() { assertTrue(count[0] > (9 * 8)); - // contract: isSubTypeOf does not throw an exception + // contract: isSubTypeOf does not throw any exception // #2288 cannot be reproduced, probably fixed by #2406 CtTypeReference typeReferenceWithNoDeclaration = launcher.getFactory().createTypeReference(); typeReferenceWithNoDeclaration.setSimpleName("DoesNotExist");