Skip to content

Commit

Permalink
added serialVersionUID to all serializable classes (relates to JENKIN…
Browse files Browse the repository at this point in the history
…S-10030)
  • Loading branch information
kutzi committed Aug 13, 2011
1 parent 53e687b commit 9418134
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/main/java/hudson/scm/PerJobCredentialStore.java
Expand Up @@ -22,6 +22,8 @@
* @author Kohsuke Kawaguchi
*/
final class PerJobCredentialStore implements Saveable, RemotableSVNAuthenticationProvider {
private static final long serialVersionUID = 8509067873170016632L;

private final transient AbstractProject<?,?> project;

/**
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -1115,6 +1115,8 @@ else if (project.getLastBuild()!=null) {
final ISVNAuthenticationProvider authProvider = getDescriptor().createAuthenticationProvider(project);

return ch.call(new DelegatingCallable<PollingResult,IOException> () {
private static final long serialVersionUID = 8200959096894789583L;

public ClassLoader getClassLoader() {
return Hudson.getInstance().getPluginManager().uberClassLoader;
}
Expand Down Expand Up @@ -1401,6 +1403,11 @@ public static class DescriptorImpl extends SCMDescriptor<SubversionSCM> implemen
* to be passed to SVNKit.
*/
public static abstract class Credential implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3707951427730113110L;

/**
* @param kind
* One of the constants defined in {@link ISVNAuthenticationManager},
Expand All @@ -1413,6 +1420,10 @@ public static abstract class Credential implements Serializable {
* Username/password based authentication.
*/
public static final class PasswordCredential extends Credential {
/**
*
*/
private static final long serialVersionUID = -1676145651108866745L;
private final String userName;
private final String password; // scrambled by base64

Expand All @@ -1434,6 +1445,10 @@ public SVNAuthentication createSVNAuthentication(String kind) {
* Public key authentication for Subversion over SSH.
*/
public static final class SshPublicKeyCredential extends Credential {
/**
*
*/
private static final long serialVersionUID = -4649332611621900514L;
private final String userName;
private final String passphrase; // scrambled by base64
private final String id;
Expand Down Expand Up @@ -1502,6 +1517,11 @@ public SVNSSHAuthentication createSVNAuthentication(String kind) throws SVNExcep
if(channel!=null) {
// remote
privateKey = channel.call(new Callable<String,IOException>() {
/**
*
*/
private static final long serialVersionUID = -3088632649290496373L;

public String call() throws IOException {
return FileUtils.readFileToString(getKeyFile(),"iso-8859-1");
}
Expand All @@ -1524,6 +1544,10 @@ public String call() throws IOException {
* SSL client certificate based authentication.
*/
public static final class SslClientCertificateCredential extends Credential {
/**
*
*/
private static final long serialVersionUID = 5455755079546887446L;
private final Secret certificate;
private final String password; // scrambled by base64

Expand Down Expand Up @@ -1567,6 +1591,11 @@ interface RemotableSVNAuthenticationProvider extends Serializable {
private transient final RemotableSVNAuthenticationProviderImpl remotableProvider = new RemotableSVNAuthenticationProviderImpl();

private final class RemotableSVNAuthenticationProviderImpl implements RemotableSVNAuthenticationProvider {
/**
*
*/
private static final long serialVersionUID = 1243451839093253666L;

public Credential getCredential(SVNURL url, String realm) {
for (SubversionCredentialProvider p : SubversionCredentialProvider.all()) {
Credential c = p.getCredential(url,realm);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/scm/browsers/AbstractSventon.java
Expand Up @@ -33,6 +33,8 @@
* @author Kohsuke Kawaguchi
*/
public abstract class AbstractSventon extends SubversionRepositoryBrowser {
private static final long serialVersionUID = 3514464895743639935L;

/**
* The URL of the Sventon 2.x repository.
*
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/hudson/scm/browsers/CollabNetSVN.java
Expand Up @@ -42,6 +42,9 @@
*/
public class CollabNetSVN extends SubversionRepositoryBrowser
{
private static final long serialVersionUID = 4638328794797996597L;


@Extension
public static class DescriptorImpl extends Descriptor<RepositoryBrowser<?>> {
public String getDisplayName() {
Expand Down
Expand Up @@ -66,7 +66,8 @@
*/
public class ListSubversionTagsParameterDefinition extends ParameterDefinition implements Comparable<ListSubversionTagsParameterDefinition> {

/**
private static final long serialVersionUID = 5458217954492915951L;
/**
* The Subversion repository which contains the tags to be listed.
*/
private final String tagsDir;
Expand Down Expand Up @@ -172,7 +173,12 @@ public List<String> getTags() {
catch(SVNException e) {
// logs are not translated (IMO, this is a bad idea to translate logs)
LOGGER.log(Level.SEVERE, "An SVN exception occurred while listing the directory entries at " + getTagsDir(), e);
return new ArrayList() {{
return new ArrayList() {/**
*
*/
private static final long serialVersionUID = -2461060214177503398L;

{
add("&lt;" + ResourceBundleHolder.get(ListSubversionTagsParameterDefinition.class).format("SVNException") + "&gt;");
}};
}
Expand All @@ -185,7 +191,12 @@ public List<String> getTags() {
}
else {
LOGGER.log(Level.INFO, "No directory entries were found for the following SVN repository: {0}", getTagsDir());
return new ArrayList() {{
return new ArrayList() {/**
*
*/
private static final long serialVersionUID = -2725829892794981542L;

{
add("&lt;" + ResourceBundleHolder.get(ListSubversionTagsParameterDefinition.class).format("NoDirectoryEntriesFound") + "&gt;");
}};
}
Expand Down
Expand Up @@ -39,7 +39,8 @@
*/
public class ListSubversionTagsParameterValue extends ParameterValue {

@Exported(visibility=3) private String tagsDir; // this att comes from ListSubversionTagsParameterDefinition
private static final long serialVersionUID = 9192758635921187885L;
@Exported(visibility=3) private String tagsDir; // this att comes from ListSubversionTagsParameterDefinition
@Exported(visibility=3) private String tag;

@DataBoundConstructor
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/hudson/scm/subversion/CheckoutUpdater.java
Expand Up @@ -52,12 +52,19 @@
* @author Kohsuke Kawaguchi
*/
public class CheckoutUpdater extends WorkspaceUpdater {
private static final long serialVersionUID = -3502075714024708011L;

@DataBoundConstructor
public CheckoutUpdater() {}

@Override
public UpdateTask createTask() {
return new UpdateTask() {
/**
*
*/
private static final long serialVersionUID = 8349986526712487762L;

@Override
public List<External> perform() throws IOException, InterruptedException {
final SVNUpdateClient svnuc = manager.getUpdateClient();
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/hudson/scm/subversion/UpdateUpdater.java
Expand Up @@ -52,6 +52,8 @@
* @author Kohsuke Kawaguchi
*/
public class UpdateUpdater extends WorkspaceUpdater {
private static final long serialVersionUID = 1451258464864424355L;

@DataBoundConstructor
public UpdateUpdater() {
}
Expand All @@ -62,6 +64,11 @@ public UpdateTask createTask() {
}

public static class TaskImpl extends UpdateTask {
/**
*
*/
private static final long serialVersionUID = -5766470969352844330L;

/**
* Returns true if we can use "svn update" instead of "svn checkout"
*/
Expand Down
Expand Up @@ -41,6 +41,8 @@
* @author Kohsuke Kawaguchi
*/
public class UpdateWithCleanUpdater extends WorkspaceUpdater {
private static final long serialVersionUID = 8427138737745329413L;

@DataBoundConstructor
public UpdateWithCleanUpdater() {}

Expand All @@ -51,6 +53,11 @@ public UpdateTask createTask() {

// mostly "svn update" plus extra
public static class TaskImpl extends UpdateUpdater.TaskImpl {
/**
*
*/
private static final long serialVersionUID = -5120852266435704852L;

@Override
protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException {
listener.getLogger().println("Cleaning up " + local);
Expand Down
Expand Up @@ -38,6 +38,8 @@
* @author Kohsuke Kawaguchi
*/
public class UpdateWithRevertUpdater extends WorkspaceUpdater {
private static final long serialVersionUID = 485917115133281105L;

@DataBoundConstructor
public UpdateWithRevertUpdater() {}

Expand All @@ -48,6 +50,11 @@ public UpdateTask createTask() {

// mostly "svn update" plus extra
public static class TaskImpl extends UpdateUpdater.TaskImpl {
/**
*
*/
private static final long serialVersionUID = -8562813147341259328L;

@Override
protected void preUpdate(ModuleLocation module, File local) throws SVNException, IOException {
listener.getLogger().println("Reverting " + local);
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/hudson/scm/subversion/WorkspaceUpdater.java
Expand Up @@ -54,6 +54,8 @@
*/
@ExportedBean
public abstract class WorkspaceUpdater extends AbstractDescribableImpl<WorkspaceUpdater> implements ExtensionPoint, Serializable {
private static final long serialVersionUID = 8902811304319899817L;

/**
* Creates the {@link UpdateTask} instance, which performs the actual check out / update.
*/
Expand Down

0 comments on commit 9418134

Please sign in to comment.