-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
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
Implement default methods in TaskListener and BuildListener #3122
Conversation
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
@@ -82,12 +70,13 @@ public void close() { | |||
private final StackTraceElement caller; | |||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
|
|||
public LogOutputStream(Logger logger, Level level, StackTraceElement caller) { | |||
LogOutputStream(Logger logger, Level level, StackTraceElement caller) { |
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.
🐛 - Potential breaker for code depending on this constructor.
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.
Not true; the class was private
already, so the public
modifier on its constructor was just misleading.
@@ -58,7 +52,7 @@ | |||
* | |||
* @author Kohsuke Kawaguchi | |||
*/ | |||
public class StreamTaskListener extends AbstractTaskListener implements Serializable, Closeable { | |||
public class StreamTaskListener implements TaskListener, Closeable { |
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.
🐛 You can no longer cast to AbstractTaskListener or check for instanceof AbstractTaskListener.
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.
That is true, but AbstractTaskListener
was only ever a convenience base class, so there was never a legitimate reason to do so to begin with.
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 was unable to find the implementation, which may be affected. But I agree that keeping the inheritance from a deprecated class would be the safest option for now. This old class is not doing anything wrong anyway
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.
As in #2879 I would prefer to eliminate all usages of the deprecated type to reduce confusion, since there is no plausible risk from the technical API change here.
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.
A couple small compatibility issues but otherwise looks reasonable AFAICT.
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.
Not issues I think.
@@ -82,12 +70,13 @@ public void close() { | |||
private final StackTraceElement caller; | |||
private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); | |||
|
|||
public LogOutputStream(Logger logger, Level level, StackTraceElement caller) { | |||
LogOutputStream(Logger logger, Level level, StackTraceElement caller) { |
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.
Not true; the class was private
already, so the public
modifier on its constructor was just misleading.
@@ -58,7 +52,7 @@ | |||
* | |||
* @author Kohsuke Kawaguchi | |||
*/ | |||
public class StreamTaskListener extends AbstractTaskListener implements Serializable, Closeable { | |||
public class StreamTaskListener implements TaskListener, Closeable { |
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.
That is true, but AbstractTaskListener
was only ever a convenience base class, so there was never a legitimate reason to do so to begin with.
No strong opinion since I do not see any usages which will be affected by the change. |
And I would be happy to break any such usage if there were one, because it would be ridiculous. |
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.
Weak 🐝 since I cannot find any usages of the API to be broken. @reviewbybees done, I'd guess
formally it's ready to go. YOLO. |
noting that this caused a breakage as the class |
@jtnord Normally that would be irrelevant since master → agent connections will use identical bytecode. Would only matter for other uses of Remoting involving diachronic serialization. Probably fixable by adding a |
@jtnord Do you have an issue reference for that? |
Would avoid the need for
LessAbstractTaskListener
in jenkinsci/workflow-support-plugin#15, for example.@reviewbybees