-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
review fix: launcher#setArgs cannot be called twice #2141
Conversation
By the way, the only way to make this case working is by using Personally what I would want as a user is:
|
I would say they spoon model is not ready to coexist with another spoon model made by same launcher. Note that each model produced by launcher actually MUST share So it looks like that idea needs deeper refactoring |
Ok then we should prevent calling twice |
I agree ... and later we might think about that refactoring. It is not nice when model specific things are in StandartEnvironment... |
src/main/java/spoon/Launcher.java
Outdated
@@ -99,6 +99,8 @@ | |||
private List<String> processorTypes = new ArrayList<>(); | |||
private List<Processor<? extends CtElement>> processors = new ArrayList<>(); | |||
|
|||
private boolean processed; |
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.
explicitly set it to false?
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.
add a comment about the meaning of the field?
This PR shows that the current behaviour is to never reset the model, even if the same launcher is called twice with different arguments.
My current test shows that
model
andmodel2
are the same and they contain 2 types at the end of the test.I don't know if it's an expected behaviour or not, but it looks very dangerous to me. WDYT?