diff --git a/src/test/java/spoon/reflect/declaration/CtTypeInformationTest.java b/src/test/java/spoon/reflect/declaration/CtTypeInformationTest.java index 86af04411bf..6b40a0f46f1 100644 --- a/src/test/java/spoon/reflect/declaration/CtTypeInformationTest.java +++ b/src/test/java/spoon/reflect/declaration/CtTypeInformationTest.java @@ -133,13 +133,18 @@ private CtTypeInformation getLastResolvedSuperclass(ClassTypingContext ctc) thro @Test public void testGetSuperclass() throws Exception { - int expectedNumberInJDK8 = 62; // in Java 1.8.0_151 + int expectedNumberInJDK8_151 = 62; // in Java 1.8.0_151 + int expectedNumberInJDK8_111 = 61; // in Java 1.8.0_XXX with XXX before 151 int expectedNumberInJDK9 = 81; int expectedNumber; if (System.getProperty("java.version").startsWith("1.8.")) { - expectedNumber = expectedNumberInJDK8; + if (System.getProperty("java.version").endsWith("151")) { + expectedNumber = expectedNumberInJDK8_151; + } else { + expectedNumber = expectedNumberInJDK8_111; + } } else { expectedNumber = expectedNumberInJDK9; }