From b807845b9b03bbe02babcf03fa7e6dbd80b41fcf Mon Sep 17 00:00:00 2001 From: Christoph Kutzinski Date: Sun, 20 Jan 2013 13:48:02 +0100 Subject: [PATCH] Added serialVersionUID to all Callables --- core/src/main/java/hudson/FilePath.java | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index e0b6dca298..25362a7f94 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -543,6 +543,7 @@ public final class FilePath implements Serializable { */ public FilePath absolutize() throws IOException, InterruptedException { return new FilePath(channel,act(new FileCallable() { + private static final long serialVersionUID = 1L; public String invoke(File f, VirtualChannel channel) throws IOException { return f.getAbsolutePath(); } @@ -560,6 +561,7 @@ public final class FilePath implements Serializable { */ public void symlinkTo(final String target, final TaskListener listener) throws IOException, InterruptedException { act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { Util.createSymlink(f.getParentFile(),target,f.getName(),listener); return null; @@ -576,6 +578,7 @@ public final class FilePath implements Serializable { */ public String readLink() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public String invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { return Util.resolveSymlink(f); } @@ -884,6 +887,7 @@ public final class FilePath implements Serializable { * @since 1.482 */ public static abstract class AbstractInterceptorCallableWrapper implements DelegatingCallable { + private static final long serialVersionUID = 1L; private final DelegatingCallable callable; @@ -960,6 +964,7 @@ public final class FilePath implements Serializable { */ public URI toURI() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public URI invoke(File f, VirtualChannel channel) { return f.toURI(); } @@ -971,6 +976,7 @@ public final class FilePath implements Serializable { */ public void mkdirs() throws IOException, InterruptedException { if(!act(new FileCallable() { + private static final long serialVersionUID = 1L; public Boolean invoke(File f, VirtualChannel channel) throws IOException, InterruptedException { if(f.mkdirs() || f.exists()) return true; // OK @@ -989,6 +995,7 @@ public final class FilePath implements Serializable { */ public void deleteRecursive() throws IOException, InterruptedException { act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteRecursive(f); return null; @@ -1001,6 +1008,7 @@ public final class FilePath implements Serializable { */ public void deleteContents() throws IOException, InterruptedException { act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteContentsRecursive(f); return null; @@ -1094,6 +1102,7 @@ public final class FilePath implements Serializable { public FilePath createTempFile(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new FileCallable() { + private static final long serialVersionUID = 1L; public String invoke(File dir, VirtualChannel channel) throws IOException { File f = File.createTempFile(prefix, suffix, dir); return f.getName(); @@ -1149,6 +1158,7 @@ public final class FilePath implements Serializable { public FilePath createTextTempFile(final String prefix, final String suffix, final String contents, final boolean inThisDirectory) throws IOException, InterruptedException { try { return new FilePath(channel,act(new FileCallable() { + private static final long serialVersionUID = 1L; public String invoke(File dir, VirtualChannel channel) throws IOException { if(!inThisDirectory) dir = new File(System.getProperty("java.io.tmpdir")); @@ -1191,6 +1201,7 @@ public final class FilePath implements Serializable { public FilePath createTempDir(final String prefix, final String suffix) throws IOException, InterruptedException { try { return new FilePath(this,act(new FileCallable() { + private static final long serialVersionUID = 1L; public String invoke(File dir, VirtualChannel channel) throws IOException { File f = File.createTempFile(prefix, suffix, dir); f.delete(); @@ -1210,6 +1221,7 @@ public final class FilePath implements Serializable { */ public boolean delete() throws IOException, InterruptedException { act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { Util.deleteFile(f); return null; @@ -1223,6 +1235,7 @@ public final class FilePath implements Serializable { */ public boolean exists() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public Boolean invoke(File f, VirtualChannel channel) throws IOException { return f.exists(); } @@ -1238,6 +1251,7 @@ public final class FilePath implements Serializable { */ public long lastModified() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public Long invoke(File f, VirtualChannel channel) throws IOException { return f.lastModified(); } @@ -1289,6 +1303,7 @@ public final class FilePath implements Serializable { */ public boolean isDirectory() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public Boolean invoke(File f, VirtualChannel channel) throws IOException { return f.isDirectory(); } @@ -1302,6 +1317,7 @@ public final class FilePath implements Serializable { */ public long length() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public Long invoke(File f, VirtualChannel channel) throws IOException { return f.length(); } @@ -1326,6 +1342,7 @@ public final class FilePath implements Serializable { public void chmod(final int mask) throws IOException, InterruptedException { if(!isUnix() || mask==-1) return; act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { _chmod(f, mask); @@ -1376,6 +1393,7 @@ public final class FilePath implements Serializable { public int mode() throws IOException, InterruptedException, PosixException { if(!isUnix()) return -1; return act(new FileCallable() { + private static final long serialVersionUID = 1L; public Integer invoke(File f, VirtualChannel channel) throws IOException { return IOUtils.mode(f); } @@ -1422,6 +1440,7 @@ public final class FilePath implements Serializable { throw new IllegalArgumentException("Non-serializable filter of " + filter.getClass()); } return act(new FileCallable>() { + private static final long serialVersionUID = 1L; public List invoke(File f, VirtualChannel channel) throws IOException { File[] children = f.listFiles(filter); if(children ==null) return null; @@ -1474,6 +1493,7 @@ public final class FilePath implements Serializable { */ public FilePath[] list(final String includes, final String excludes, final boolean defaultExcludes) throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public FilePath[] invoke(File f, VirtualChannel channel) throws IOException { String[] files = glob(f, includes, excludes, defaultExcludes); @@ -1511,6 +1531,7 @@ public final class FilePath implements Serializable { final Pipe p = Pipe.createRemoteToLocal(); channel.callAsync(new Callable() { + private static final long serialVersionUID = 1L; public Void call() throws IOException { FileInputStream fis=null; try { @@ -1562,6 +1583,7 @@ public final class FilePath implements Serializable { } return channel.call(new Callable() { + private static final long serialVersionUID = 1L; public OutputStream call() throws IOException { File f = new File(remote).getAbsoluteFile(); f.getParentFile().mkdirs(); @@ -1580,6 +1602,7 @@ public final class FilePath implements Serializable { */ public void write(final String content, final String encoding) throws IOException, InterruptedException { act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { f.getParentFile().mkdirs(); FileOutputStream fos = new FileOutputStream(f); @@ -1599,6 +1622,7 @@ public final class FilePath implements Serializable { */ public String digest() throws IOException, InterruptedException { return act(new FileCallable() { + private static final long serialVersionUID = 1L; public String invoke(File f, VirtualChannel channel) throws IOException { return Util.getDigestOf(new FileInputStream(f)); } @@ -1614,6 +1638,7 @@ public final class FilePath implements Serializable { throw new IOException("renameTo target must be on the same host"); } act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { f.renameTo(new File(target.remote)); return null; @@ -1631,6 +1656,7 @@ public final class FilePath implements Serializable { throw new IOException("pullUpTo target must be on the same host"); } act(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { File t = new File(target.getRemote()); @@ -1783,6 +1809,7 @@ public final class FilePath implements Serializable { if(this.channel==target.channel) { // local to local copy. return act(new FileCallable() { + private static final long serialVersionUID = 1L; public Integer invoke(File base, VirtualChannel channel) throws IOException { if(!base.exists()) return 0; assert target.channel==null; @@ -1825,6 +1852,7 @@ public final class FilePath implements Serializable { final Pipe pipe = Pipe.createLocalToRemote(); Future future = target.actAsync(new FileCallable() { + private static final long serialVersionUID = 1L; public Void invoke(File f, VirtualChannel channel) throws IOException { try { readFromTar(remote+'/'+fileMask, f,TarCompression.GZIP.extract(pipe.getIn())); @@ -1846,6 +1874,7 @@ public final class FilePath implements Serializable { final Pipe pipe = Pipe.createRemoteToLocal(); Future future = actAsync(new FileCallable() { + private static final long serialVersionUID = 1L; public Integer invoke(File f, VirtualChannel channel) throws IOException { try { return writeToTar(f,fileMask,excludes,TarCompression.GZIP.compress(pipe.getOut())); -- GitLab