I just tried recoder as a lightweigth alternative to the Eclipse JDT platform and found the library very interesting.
I have an issue regarding the print() method of SourceFileRepository. This method checks if the DataLocation of the compilation unit is the same instance as the OriginalDataLocation and if it is the case, it creates a new DataLocation (based on the output path or one of the input path).
This is a problem since I just want to write back the new source to the original file. Is there any good reasons why this check was implemented like that? I wonder, because the check uses the == operator and not even the equals() method.
I found two workarounds for this: I can manually write the source by retrieving the location or I can set the DataLocation to a new instance of FileDataLocation pointing to the same file, so this is not a showstopper.
By the way, thanks for this great framework. There is still room for improvements in the documentation (I lost the count of code I wrote before I made this thing work!) and for source format preservation, but the transformation mechanism with the rollback capability is very powerfull! I still have to compare performance with JDT, but recoder seems to be very efficient! The source code seems to be very clean and understandable too. If you need any help on this project, I might be able to help.
Regards,
Barthlmy
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all!
I just tried recoder as a lightweigth alternative to the Eclipse JDT platform and found the library very interesting.
I have an issue regarding the print() method of SourceFileRepository. This method checks if the DataLocation of the compilation unit is the same instance as the OriginalDataLocation and if it is the case, it creates a new DataLocation (based on the output path or one of the input path).
This is a problem since I just want to write back the new source to the original file. Is there any good reasons why this check was implemented like that? I wonder, because the check uses the == operator and not even the equals() method.
I found two workarounds for this: I can manually write the source by retrieving the location or I can set the DataLocation to a new instance of FileDataLocation pointing to the same file, so this is not a showstopper.
By the way, thanks for this great framework. There is still room for improvements in the documentation (I lost the count of code I wrote before I made this thing work!) and for source format preservation, but the transformation mechanism with the rollback capability is very powerfull! I still have to compare performance with JDT, but recoder seems to be very efficient! The source code seems to be very clean and understandable too. If you need any help on this project, I might be able to help.
Regards,
Barthlmy