-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
feat(process): Allows interruption of a processor. #485
Conversation
*/ | ||
package spoon.processing; | ||
|
||
public class ProcessInterrupt extends RuntimeException { |
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.
rename to InterruptProcess?
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.
I have chosen the name specified in the issue but I can change it. A better solution can be InterruptProcessException
.
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.
ProcessInterruption
Adds documentation in the website. |
for (CtElement e : new ArrayList<CtElement>(elements)) { | ||
process(e, p); | ||
} | ||
p.processingDone(); |
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.
If ProcessInterrupt
is thrown in processingDone
the method processingDone
will be called two times.
@monperrus PR ok. |
@@ -19,7 +19,8 @@ of the processor class. There is also an optional overridable method for queryin | |||
elements at a finer grain. | |||
|
|||
The process method takes the requested element as input and does the analysis | |||
(here detecting empty catch blocks). | |||
(here detecting empty catch blocks). At any time, you can interrupt the processing | |||
of your processor with the call of `interrupt()` method. |
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.
At any time, you can interrupt the processing of the model with a call to interrupt()
(this stops all processors, and proceeds with the next step which is usually pretty-printing the code to disk).
@monperrus PR ok. |
Closes #478