-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
fix(FieldAccessTest): adapt FieldAccessTest to oracle jdk 11/jdt changes #2789
Conversation
So apparently this test is checking the following file: https://github.com/INRIA/spoon/blob/master/src/test/resources/noclasspath/FieldAccessRes.java But for me the following code looks really wrong:
since I don't think we are allowed to change the length of an array... IMO it worth it to change the test to do a more classical check, such as:
|
For some reason |
That's actually interesting. Could you try by upgrading jdt to 3.15.0: this is the last version on Maven and it has been released for Java 11, maybe it will fix it. |
With: A a = new A();
a.length = 5; we have with jdk 11:
wheras with jdk 8:
|
Ok, I'm on it |
Migrating to jdt 3.15.0 does solve the issue. But |
@@ -108,7 +108,7 @@ public JDTBatchCompiler(JDTBasedSpoonCompiler jdtCompiler) { | |||
} else { | |||
for (Map.Entry<String, CompilationUnit> entry : pathToModCU.entrySet()) { | |||
if (fileName.startsWith(entry.getKey())) { // associate CUs to module by common prefix | |||
compilationUnit.setModule(entry.getValue()); | |||
//compilationUnit.setModule(entry.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the broken api call.
No, sorry 💭 |
@nharrand I pushed the potential solution for 3.15.0 compatibility problem |
da0ca50
to
f3459cf
Compare
This should work, thanks to @pvojtechovsky ! |
Dear all, I'd like to nominate Nicolas Harrand (@nharrand) to become an integrator in Spoon. Nicolas has done several key contributions over the past year: * he has added support for paths in order to uniquely identify AST nodes (#1874), this feature is unique (to my knowledge, it does not exist in any other source code analysis library for Java), and enables original source code analysis over time and versions. * he has added support for analysis of binary files with decompilation (#2455) * he has laid down the foundations of a modularized Spoon, which will likely be key in the future * he has ported Spoon to JDK 11 (#2789). This kind of infrastructure contribution is also very important in the long term. In addition, Nicolas has proven his ability to communicate constructively and respectfully over issues and pull-requests. What do you think?
Related to adding a travis build with jdk 11 See #2782
CtFieldWrite.getTarget()
onarray.length
used to return aCtVariableWrite
for some reasons... But with jdk 11 now returns aCtVariableRead
...FieldAccessTest#testFieldAccessOnUnknownType()
has been changed to handle both... by expecting aCtVariableAccess
.This (combined with #2787) fixes tests for jdk 11 as can be seen here ( https://travis-ci.org/INRIA/spoon/jobs/460289160 ).
Wether this is satisfaying or not, is up to debate. WDYT?