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

[JENKINS-40909] Steps which traditionally extended AbstractStepExecutionImpl cannot just switch the superclass #17

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,23 @@
* make sure the {@link Step} is {@link Serializable} and do not mark it {@code transient}.
* (For a {@link AbstractSynchronousStepExecution} these considerations are irrelevant.)
* @author Kohsuke Kawaguchi
* @deprecated Directly extend {@link StepExecution} and avoid Guice.
*/
@Deprecated
public abstract class AbstractStepExecutionImpl extends StepExecution {

/**
* @deprecated Directly extend {@link StepExecution} and avoid Guice for a new step.
* Or see {@link #AbstractStepExecutionImpl(StepContext)} for an existing step.
*/
@Deprecated
protected AbstractStepExecutionImpl() {
}

/**
* Constructor for compatibility.
* Retain this constructor and override {@link #onResume} (do <strong>not</strong> call the {@code super} implementation)
* if your execution historically extended {@link AbstractStepExecutionImpl}, for serial form compatibility.
* For new steps, extend {@link StepExecution} directly.
*/
protected AbstractStepExecutionImpl(StepContext context) {
super(context);
}
Expand All @@ -33,11 +42,13 @@ protected AbstractStepExecutionImpl(StepContext context) {
* Reinject {@link StepContextParameter}s.
* The {@link Step} will not be reinjected.
*/
// Cannot mark this @Deprecated without producing a warning for overriders.
@Override
public void onResume() {
inject();
}

@Deprecated
protected void inject() {
try {
AbstractStepImpl.prepareInjector(getContext(), null).injectMembers(this);
Expand Down