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
Should be possible to customize model transformation (Transformation is not @ChainOverridable) #64
Comments
Adding the ChainOverridable annotation to the transformations produces strange exceptions in Xtext, e.g.
The culprit are the public methods with the caching keyword "create". After changing their scope to private (to skip them by the OverrideAnnotationProcessor) results in invalid generated Java code, e.g. missing method parameters. |
But for Transformation.xtend it's working for me. Only DslTransformation and Rest are firing this error. |
It looks like there's a bug with create methods and active annotation processing. I posted a question here: NPE is triggered when it tries to call getReturnType() on method:
|
With Xtext / Xtend 2.5.2 this seems to work now. I need this for #99. |
…turn types and makes a few methods public (needed for #99)
…reate factory methods and re-adds the removed private keyword
Enabling
With the test case |
Using This is due to the inheritance hierarchy created by Sculptors active annotation processor and maintaining separate instances: The instance of the overriding class has it's state (via extending the class annotated with |
After all this troubles it is maybe time to change implementation. Maybe get rid of annotation processor (or at least extensive manipulation we use) and use some kind of proxy and IoC manipulations. What do you think? |
Somebody took over our bug in Xtend: Fix: Maybe we will be able to override also 'create' methods finally. |
But this doesn't solve our issues with the cache implementation generated for Xtends create methods (as mentioned by Jan Koehnlein in his comment): So it seems that we have to come up with our own cache implementation for create methods, eg. within the chain link code. |
Yes I was playing with this, however I always found obstacle to finish it. That's why I filled this ticket on Xtend, 3 different errors always fired. Now 'maybe' we can find way to override create methods. It was impossible without this fix. |
…methods by refactoring the overridable methods into a helper class
In the version before, this was done through AOP advices in the file src/main/resources/extensions/SpecialCases.ext, like in the following snippet:
The text was updated successfully, but these errors were encountered: