Skip to content

Commit

Permalink
Merge pull request #3154 from oleg-nenashev/bug/JENKINS-48116
Browse files Browse the repository at this point in the history
[JENKINS-48116] - Restore AbstractTaskListener binary compatibility in the core.
  • Loading branch information
oleg-nenashev committed Nov 26, 2017
2 parents b431eb4 + 60085a0 commit f33506f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions core/src/main/java/hudson/util/AbstractTaskListener.java
@@ -1,11 +1,16 @@
package hudson.util;

import hudson.RestrictedSince;
import hudson.model.TaskListener;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;


/**
* @deprecated implement {@link TaskListener} directly
*/
@Deprecated
@Restricted(NoExternalUse.class)
@RestrictedSince("2.91")
public abstract class AbstractTaskListener implements TaskListener {
}
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/util/LogTaskListener.java
Expand Up @@ -35,10 +35,13 @@
import java.util.logging.LogRecord;
import java.util.logging.Logger;

// TODO: AbstractTaskListener is empty now, but there are dependencies on that e.g. Ruby Runtime - JENKINS-48116)
// The change needs API deprecation policy or external usages cleanup.

/**
* {@link TaskListener} which sends messages to a {@link Logger}.
*/
public class LogTaskListener implements TaskListener, Closeable {
public class LogTaskListener extends AbstractTaskListener implements TaskListener, Closeable {

// would be simpler to delegate to the LogOutputStream but this would incompatibly change the serial form
private final TaskListener delegate;
Expand Down
5 changes: 4 additions & 1 deletion core/src/main/java/hudson/util/StreamTaskListener.java
Expand Up @@ -44,6 +44,9 @@
import java.util.logging.Logger;
import org.kohsuke.stapler.framework.io.WriterOutputStream;

// TODO: AbstractTaskListener is empty now, but there are dependencies on that e.g. Ruby Runtime - JENKINS-48116)
// The change needs API deprecation policy or external usages cleanup.

/**
* {@link TaskListener} that generates output into a single stream.
*
Expand All @@ -52,7 +55,7 @@
*
* @author Kohsuke Kawaguchi
*/
public class StreamTaskListener implements TaskListener, Closeable {
public class StreamTaskListener extends AbstractTaskListener implements TaskListener, Closeable {
private PrintStream out;
private Charset charset;

Expand Down

0 comments on commit f33506f

Please sign in to comment.