-
Notifications
You must be signed in to change notification settings - Fork 375
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
Reuse classes from different compilation units #100
Comments
Thanks for your suggestion. I'm not sure how we can easily add compilation products on the classpath for subsequent compilations. This seems to be a can of worms I'm not convinced we should open automatically. However, perhaps there's a way to achieve this through I'm happy to review specific suggestions, but cannot spend time on investigations of this topic, right now. |
Yeah I have realized that while writing the issue and I do agree that it should not be done open by default.
Wonder if something like: String data = Files.readString(Path.of("data/MyData.java"));
String route = Files.readString(Path.of("data/MyRoutes.java"));
var unit = Reflect.compilationUnit(data, route);
var result = unit.onClass("my.example.MyRoutes").create().get(); could be acceptable |
That's a different suggestion, which I can see more realistically as it is 1) indeed a missing feature, 2) not raising more questions than it answers :) I've created a new feature request for this: #101 I was not aware that this was an option for you from your original feature request, where it may be possible that the two classes are not compiled at the same time. Of course, if you are in full control of your classes, and when you want to compile them, then you can also nest the |
Yeah, the original requirement was based on the fact that the classes are compiled at different times, but after thinking a little bit more about my current set-up I can easily collect and compile them in a single step :) |
Expected behavior and actual behavior:
Assuming I have some code like:
Where the class
MyData
is needed byMyRoutes
in this case for unmarshalling from json, then the code above fails with:I don't know if this is supported by jOOR.
Steps to reproduce the problem:
Versions:
The text was updated successfully, but these errors were encountered: