Community
Participate
Working Groups
This is a generalization of bug 473417. As a litmus test, can working copy API of the JDT Java model be implemented on top of Handly? Some things to consider: * Private working copies (WorkingCopyOwner) * Reconcile problem reporting (IProblemRequestor) * Reconcile parameters (AST level, reconcile flags) and return value (AST) The last item will be taken care of in bug 473417.
Pushed to master: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=7b355e78bc055d526f598dde33334fa6e2179014 Breaking change: SourceFile#becomeWorkingCopy now takes an IWorkingCopyInfoFactory (new interface) in addition to other parameters.
A reference implementation in Java model example: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=4cd8079750351d647a187a70d0d44bf3cc75e5a9 Demonstrates problem reporting and private working copy.
Reopened because one of the added JUnit tests failed on Hundson. It had succeeded on my machine. The nature of the failure suggests it has to to with Java compiler settings for a test project and can probably be fixed by introducing project-specific settings for Errors/Warnings.
New Gerrit change created: https://git.eclipse.org/r/54738
No, actually it has do with JDT compiler version: the test fails on the "Latest Platform" (4.5) but succeeds on the "Base Platform" (3.8). Line 5 in Test010/src/X.java ("syntaxError") results in 3 errors [Pb(240) Syntax error, insert "Identifier (" to complete MethodHeaderName, Pb(240) Syntax error, insert ")" to complete MethodDeclaration, Pb(240) Syntax error, insert ";" to complete MethodDeclaration] with 4.5 compiler, whereas 3.8 compiler reports only 1 error [Pb(232) Syntax error on token "syntaxError", delete this token]. As a workaround, the test should check that the list of problems is not empty instead of checking the size of the list. This would be fine for the intended assertion that "problems are reported to the given problem requestor".
Gerrit change https://git.eclipse.org/r/54738 was merged to [master]. Commit: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=21dbc07502959eb72c5219ebb438e07575069168
Fixed the failing test as detailed in comment 5.
Further polish: http://git.eclipse.org/c/handly/org.eclipse.handly.git/commit/?id=70d8b1824741205ac6724afc3f7f1b64e6ad7c4a Note that there are now two overloads of SourceFile#becomeWorkingCopy: one that takes the factory argument and one the doesn't. The latter is binary compatible with the 0.3 version, but with a noticeable contract change: it now returns the WorkingCopyInfo previously associated with the source file and doesn't throw IllegalStateException if the buffers are different.