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

[cleanup] Fix type of Callable #43

Merged
merged 1 commit into from
Mar 8, 2022
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
@@ -1,22 +1,22 @@
package org.jenkinsci.plugins.SemanticVersioning;

import hudson.FilePath;
import hudson.remoting.Callable;
import jenkins.security.MasterToSlaveCallable;
import org.jenkinsci.plugins.SemanticVersioning.naming.NamingStrategy;
import org.jenkinsci.plugins.SemanticVersioning.parsing.BuildDefinitionParser;
import org.jenkinsci.remoting.RoleChecker;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.PrintStream;
import java.io.Serializable;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SemanticVersioningCallable implements Callable<SemanticVersioningResult,IOException>, Serializable {
public class SemanticVersioningCallable extends MasterToSlaveCallable<SemanticVersioningResult, IOException> implements Serializable {

private static final long serialVersionUID = -2239554739563636620L;

Expand All @@ -29,14 +29,8 @@ public class SemanticVersioningCallable implements Callable<SemanticVersioningRe
private BuildDefinitionParser parser;
private NamingStrategy namingStrategy;



public SemanticVersioningCallable() {
}

@Override
public void checkRoles(RoleChecker arg0) throws SecurityException {
}

@Override
public SemanticVersioningResult call() throws IOException {
Expand Down Expand Up @@ -77,9 +71,7 @@ public SemanticVersioningResult call() throws IOException {
baos.flush();

List<String> log = new ArrayList<String>();
for(String l : new String(baos.toByteArray(),"utf-8").split("[\\r\\n]+")) {
log.add(l);
}
Collections.addAll(log, baos.toString("utf-8").split("[\\r\\n]+"));

out.setLog(log);

Expand Down