Skip to content
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

Merged
merged 1 commit into from
Jan 14, 2016
Merged

feat(process): Allows interruption of a processor. #485

merged 1 commit into from
Jan 14, 2016

Conversation

GerardPaligot
Copy link
Contributor

Closes #478

*/
package spoon.processing;

public class ProcessInterrupt extends RuntimeException {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to InterruptProcess?

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ProcessInterruption

@GerardPaligot
Copy link
Contributor Author

Adds documentation in the website.

for (CtElement e : new ArrayList<CtElement>(elements)) {
process(e, p);
}
p.processingDone();
Copy link
Collaborator

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.

@GerardPaligot
Copy link
Contributor Author

@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.
Copy link
Collaborator

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).

@GerardPaligot
Copy link
Contributor Author

@monperrus PR ok.

@monperrus monperrus merged commit 1dcdbe6 into INRIA:master Jan 14, 2016
@GerardPaligot GerardPaligot deleted the feat_478 branch January 14, 2016 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants