Skip to content
Permalink
Browse files

[JENKINS-48116] - Restrore AbstractTaskListener binary compatibility …

…in the core.

Since we have the confirmed regression due to the binary compatibility change, I think we need to restore the compatibility.
OTOH, I restricted the class, so all users will be forced to stop using it when they updgrade the core.
  • Loading branch information...
oleg-nenashev committed Nov 21, 2017
1 parent d4419b5 commit 60085a0f10409265aa6d028ed5ae9a3b7b9e30f2
@@ -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 {
}
@@ -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;
@@ -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.
*
@@ -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;

0 comments on commit 60085a0

Please sign in to comment.
You can’t perform that action at this time.