Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review feat: Support (partially) JDK9 in Spoon #1585

Merged
merged 21 commits into from
Oct 26, 2017

Conversation

surli
Copy link
Collaborator

@surli surli commented Oct 9, 2017

The goal of this PR is to be able to use JDK9 to compile and run Spoon.
However with the introduced changes I also had to use the new version of JDT.
This PR should fix #1584 #1599

@monperrus monperrus changed the title chore: Use oracleJDK9 on Travis WIP chore: Use oracleJDK9 on Travis Oct 12, 2017
@surli
Copy link
Collaborator Author

surli commented Oct 17, 2017

Hmmm we might have to wait a little bit longer before being able to build Spoon in JDK9: lots of standard Maven Plugin are not yet ready to be used with JDK9.
See: https://cwiki.apache.org/confluence/display/MAVEN/Java+9+-+Jigsaw

@monperrus
Copy link
Collaborator

maven-antrun-plugin can be removed now.

@surli
Copy link
Collaborator Author

surli commented Oct 17, 2017

maven-antrun-plugin can be removed now.

It's not my issue anymore, apparently Maven enforcer does not support JDK9 yet...
And according to the link, Javadoc and Site are buggy

@surli
Copy link
Collaborator Author

surli commented Oct 18, 2017

For now Spoon is still not running on CI because spoon-maven-plugin is not yet compatible with JDK9.
However I manage to run the tests on my machine and obtained the following results:
[ERROR] Tests run: 1186, Failures: 9, Errors: 20, Skipped: 2

[INFO] Results:

[INFO]

[ERROR] Failures:

[ERROR] MavenLauncherTest.spoonMavenLauncherTest:14 expected:<8> but was:<9>

[ERROR] CtTypeInformationTest.testGetSuperclass:140 expected:<61> but was:<81>

[ERROR] ImportTest.testMissingImport:211 expected:<[fr.inria.internal]> but was:<[]>

[ERROR] ImportBuilderTest.testWithSimpleImport:61 expected:<[Type]Annotation> but was:<[Global]Annotation>

[ERROR] ParentTest.testParentOfCtPackageReference:155 expected:<[com.awesome]> but was:<[]>

[ERROR] PositionTest.testPositionInterface:87 expected:<77> but was:<96>

[ERROR] TypeReferenceTest.testInvocationWithFieldAccessInNoClasspath:429 Can't compile TestBot.java

[ERROR] ReplaceTest.testReplaceAPackageReferenceByAnotherOne:356 expected:<[com.awesome]> but was:<[]>

[ERROR] TypeTest.test:172 expected:<[android.content.]DialogInterface$OnCl...> but was:<[]DialogInterface$OnCl...>

[ERROR] Errors:

[ERROR] AnnotationTest.annotationOverrideFQNIsOK:1013 » NullPointer

[ERROR] AnnotationTest.testGetAnnotationFromParameter:958 » NullPointer

[ERROR] CompilationTest.testPrecompile:264 » NullPointer

[ERROR] NewClassTest.testCtNewClassInNoClasspath:154 » NullPointer

[ERROR] CtClassTest.testNoClasspathWithSuperClassOfAClassInAnInterface » NullPointer

[ERROR] CtClassTest.testParentOfTheEnclosingClassOfStaticClass:71 » NullPointer

[ERROR] CtClassTest.testSpoonShouldInferImplicitPackageInNoClasspath » NullPointer

[ERROR] ExecutableRefTest.testSameTypeInConstructorCallBetweenItsObjectAndItsExecutable » NullPointer

[ERROR] ImportAndExtendWithPackageNameTest.testBuildModel:21 » ArrayIndexOutOfBounds 0

[ERROR] LambdaTest.testFieldAccessInLambdaNoClassPathExternal1Example » NullPointer

[ERROR] LiteralTest.testCharLiteralInNoClasspath » NullPointer

[ERROR] ParameterTest.testParameterInNoClasspath » NullPointer

[ERROR] ElasticsearchStackoverflowTest.testStackOverflow » NullPointer

[ERROR] TypeReferenceTest.testPackageInNoClasspath » NullPointer

[ERROR] TypeReferenceTest.testTypeReferenceSpecifiedInClassDeclarationInNoClasspath » NullPointer

[ERROR] VariableAccessTest.testParameterReferenceInConstructorNoClasspath » NullPointer

[ERROR] SignatureTest.testArgumentNotNullForExecutableReference » NullPointer

[ERROR] TypeTest.testPolyTypBindingInTernaryExpression » NullPointer

[ERROR] AccessTest.testVariableAccessInNoClasspath » NullPointer

[ERROR] VisibilityTest.testInvocationVisibilityInFieldDeclaration:147 » NullPointer

[INFO]

[ERROR] Tests run: 1186, Failures: 9, Errors: 20, Skipped: 2

I had to update version of JDT core and also the internal APIs of Spoon, because of the introduction of modules.
For now my changes are only to make it compiles, I'll continue to work on it for fixing bugs.

@surli surli changed the title WIP chore: Use oracleJDK9 on Travis WIP feat: Support (partially) JDK9 in Spoon Oct 19, 2017
@surli surli changed the title WIP feat: Support (partially) JDK9 in Spoon review feat: Support (partially) JDK9 in Spoon Oct 23, 2017
@surli
Copy link
Collaborator Author

surli commented Oct 24, 2017

@monperrus for me it's ready to merge. It's a basis to start improving Spoon model to add Java 9 modules.

@monperrus
Copy link
Collaborator

OK for me. I'll merge.

@monperrus monperrus merged commit 75f1883 into INRIA:master Oct 26, 2017
@monperrus
Copy link
Collaborator

thanks a lot for this super important contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

set up travis to build and run the test suite on a Java 9 JVM
2 participants