Consistently define default serialVersionUID
A handful of classes suppressed the warning instead of adding a default serialVersionUID. I only weakly believe that using a default serialVersionUID is better than suppressing the warning in these cases, but I do value consistency. Change-Id: Ic56ecb2d541c5276a9d32ab822b510598be86600
This commit is contained in:
committed by
David Pursehouse
parent
080d30a0f0
commit
d7b29fffc6
@@ -28,8 +28,9 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/** Immutable string safely placed as HTML without further escaping. */
|
/** Immutable string safely placed as HTML without further escaping. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtml {
|
public abstract class SafeHtml implements com.google.gwt.safehtml.shared.SafeHtml {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public static final SafeHtmlResources RESOURCES;
|
public static final SafeHtmlResources RESOURCES;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ package com.google.gwtexpui.safehtml.client;
|
|||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
|
||||||
/** Safely constructs a {@link SafeHtml}, escaping user provided content. */
|
/** Safely constructs a {@link SafeHtml}, escaping user provided content. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public class SafeHtmlBuilder extends SafeHtml {
|
public class SafeHtmlBuilder extends SafeHtml {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Impl impl;
|
private static final Impl impl;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|||||||
@@ -14,8 +14,9 @@
|
|||||||
|
|
||||||
package com.google.gwtexpui.safehtml.client;
|
package com.google.gwtexpui.safehtml.client;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
class SafeHtmlString extends SafeHtml {
|
class SafeHtmlString extends SafeHtml {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final String html;
|
private final String html;
|
||||||
|
|
||||||
SafeHtmlString(String h) {
|
SafeHtmlString(String h) {
|
||||||
|
|||||||
@@ -248,8 +248,9 @@ class RelatedChangesTab implements IsWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
private class RowSafeHtml implements SafeHtml {
|
private class RowSafeHtml implements SafeHtml {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private String html;
|
private String html;
|
||||||
private ChangeAndCommit info;
|
private ChangeAndCommit info;
|
||||||
private final boolean notConnected;
|
private final boolean notConnected;
|
||||||
|
|||||||
@@ -35,10 +35,11 @@ public class RevisionInfoCache {
|
|||||||
|
|
||||||
private final LinkedHashMap<PatchSet.Id, String> psToCommit;
|
private final LinkedHashMap<PatchSet.Id, String> psToCommit;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
private RevisionInfoCache() {
|
private RevisionInfoCache() {
|
||||||
psToCommit =
|
psToCommit =
|
||||||
new LinkedHashMap<PatchSet.Id, String>(LIMIT) {
|
new LinkedHashMap<PatchSet.Id, String>(LIMIT) {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean removeEldestEntry(Map.Entry<PatchSet.Id, String> e) {
|
protected boolean removeEldestEntry(Map.Entry<PatchSet.Id, String> e) {
|
||||||
return size() > LIMIT;
|
return size() > LIMIT;
|
||||||
|
|||||||
@@ -73,9 +73,10 @@ public abstract class NavigationTable<RowItem> extends FancyFlexTable<RowItem> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
private static final LinkedHashMap<String, Object> savedPositions =
|
private static final LinkedHashMap<String, Object> savedPositions =
|
||||||
new LinkedHashMap<String, Object>(10, 0.75f, true) {
|
new LinkedHashMap<String, Object>(10, 0.75f, true) {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean removeEldestEntry(Entry<String, Object> eldest) {
|
protected boolean removeEldestEntry(Entry<String, Object> eldest) {
|
||||||
return size() >= 20;
|
return size() >= 20;
|
||||||
|
|||||||
@@ -55,9 +55,10 @@ import org.eclipse.jgit.errors.ConfigInvalidException;
|
|||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class BecomeAnyAccountLoginServlet extends HttpServlet {
|
class BecomeAnyAccountLoginServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final DynamicItem<WebSession> webSession;
|
private final DynamicItem<WebSession> webSession;
|
||||||
private final SchemaFactory<ReviewDb> schema;
|
private final SchemaFactory<ReviewDb> schema;
|
||||||
private final Accounts accounts;
|
private final Accounts accounts;
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ import org.w3c.dom.Document;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/** Handles username/password based authentication against the directory. */
|
/** Handles username/password based authentication against the directory. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class LdapLoginServlet extends HttpServlet {
|
class LdapLoginServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(LdapLoginServlet.class);
|
private static final Logger log = LoggerFactory.getLogger(LdapLoginServlet.class);
|
||||||
|
|
||||||
private final AccountManager accountManager;
|
private final AccountManager accountManager;
|
||||||
|
|||||||
@@ -32,9 +32,10 @@ import javax.servlet.http.HttpServlet;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class GitLogoServlet extends HttpServlet {
|
class GitLogoServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final long modified;
|
private final long modified;
|
||||||
private final byte[] raw;
|
private final byte[] raw;
|
||||||
|
|
||||||
|
|||||||
@@ -32,10 +32,13 @@ import javax.servlet.http.HttpServlet;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
abstract class GitwebCssServlet extends HttpServlet {
|
abstract class GitwebCssServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
static class Site extends GitwebCssServlet {
|
static class Site extends GitwebCssServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Site(SitePaths paths) throws IOException {
|
Site(SitePaths paths) throws IOException {
|
||||||
super(paths.site_css);
|
super(paths.site_css);
|
||||||
@@ -44,6 +47,8 @@ abstract class GitwebCssServlet extends HttpServlet {
|
|||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
static class Default extends GitwebCssServlet {
|
static class Default extends GitwebCssServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
Default(GitwebCgiConfig gwcc) throws IOException {
|
Default(GitwebCgiConfig gwcc) throws IOException {
|
||||||
super(gwcc.getGitwebCss());
|
super(gwcc.getGitwebCss());
|
||||||
|
|||||||
@@ -32,9 +32,10 @@ import javax.servlet.http.HttpServlet;
|
|||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class GitwebJavaScriptServlet extends HttpServlet {
|
class GitwebJavaScriptServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final long modified;
|
private final long modified;
|
||||||
private final byte[] raw;
|
private final byte[] raw;
|
||||||
|
|
||||||
|
|||||||
@@ -84,9 +84,10 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/** Invokes {@code gitweb.cgi} for the project given in {@code p}. */
|
/** Invokes {@code gitweb.cgi} for the project given in {@code p}. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class GitwebServlet extends HttpServlet {
|
class GitwebServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(GitwebServlet.class);
|
private static final Logger log = LoggerFactory.getLogger(GitwebServlet.class);
|
||||||
|
|
||||||
private static final String PROJECT_LIST_ACTION = "project_list";
|
private static final String PROJECT_LIST_ACTION = "project_list";
|
||||||
|
|||||||
@@ -48,9 +48,10 @@ import org.eclipse.jgit.lib.ObjectId;
|
|||||||
* this site, and will execute it with the site's own protection domain. This opens a massive
|
* this site, and will execute it with the site's own protection domain. This opens a massive
|
||||||
* security hole so we package the content into a zip file.
|
* security hole so we package the content into a zip file.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class CatServlet extends HttpServlet {
|
public class CatServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final Provider<ReviewDb> requestDb;
|
private final Provider<ReviewDb> requestDb;
|
||||||
private final Provider<CurrentUser> userProvider;
|
private final Provider<CurrentUser> userProvider;
|
||||||
private final ChangeEditUtil changeEditUtil;
|
private final ChangeEditUtil changeEditUtil;
|
||||||
|
|||||||
@@ -67,9 +67,10 @@ import org.w3c.dom.Element;
|
|||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
|
|
||||||
/** Sends the Gerrit host page to clients. */
|
/** Sends the Gerrit host page to clients. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class HostPageServlet extends HttpServlet {
|
public class HostPageServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(HostPageServlet.class);
|
private static final Logger log = LoggerFactory.getLogger(HostPageServlet.class);
|
||||||
|
|
||||||
private static final String HPD_ID = "gerrit_hostpagedata";
|
private static final String HPD_ID = "gerrit_hostpagedata";
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
* as it would lose any history token that appears in the URL. Instead we send an HTML page which
|
* as it would lose any history token that appears in the URL. Instead we send an HTML page which
|
||||||
* instructs the browser to replace the URL, but preserve the history token.
|
* instructs the browser to replace the URL, but preserve the history token.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class LegacyGerritServlet extends HttpServlet {
|
public class LegacyGerritServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final byte[] raw;
|
private final byte[] raw;
|
||||||
private final byte[] compressed;
|
private final byte[] compressed;
|
||||||
|
|
||||||
|
|||||||
@@ -46,9 +46,10 @@ import javax.servlet.http.HttpServletResponse;
|
|||||||
* Port 8010
|
* Port 8010
|
||||||
* }</pre>
|
* }</pre>
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
public class SshInfoServlet extends HttpServlet {
|
public class SshInfoServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final SshInfo sshd;
|
private final SshInfo sshd;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -1295,8 +1295,9 @@ public class RestApiServlet extends HttpServlet {
|
|||||||
return new TemporaryBuffer.Heap(est, max);
|
return new TemporaryBuffer.Heap(est, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
private static class AmbiguousViewException extends Exception {
|
private static class AmbiguousViewException extends Exception {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
AmbiguousViewException(String message) {
|
AmbiguousViewException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,9 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
/** Base JSON servlet to ensure the current user is not forged. */
|
/** Base JSON servlet to ensure the current user is not forged. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
final class GerritJsonServlet extends JsonServlet<GerritJsonServlet.GerritCall> {
|
final class GerritJsonServlet extends JsonServlet<GerritJsonServlet.GerritCall> {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(GerritJsonServlet.class);
|
private static final Logger log = LoggerFactory.getLogger(GerritJsonServlet.class);
|
||||||
private static final ThreadLocal<GerritCall> currentCall = new ThreadLocal<>();
|
private static final ThreadLocal<GerritCall> currentCall = new ThreadLocal<>();
|
||||||
private static final ThreadLocal<MethodHandle> currentMethod = new ThreadLocal<>();
|
private static final ThreadLocal<MethodHandle> currentMethod = new ThreadLocal<>();
|
||||||
|
|||||||
@@ -53,9 +53,10 @@ import org.w3c.dom.Document;
|
|||||||
import org.w3c.dom.Element;
|
import org.w3c.dom.Element;
|
||||||
|
|
||||||
/** Handles OpenID based login flow. */
|
/** Handles OpenID based login flow. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class LoginForm extends HttpServlet {
|
class LoginForm extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(LoginForm.class);
|
private static final Logger log = LoggerFactory.getLogger(LoginForm.class);
|
||||||
private static final ImmutableMap<String, String> ALL_PROVIDERS =
|
private static final ImmutableMap<String, String> ALL_PROVIDERS =
|
||||||
ImmutableMap.of(
|
ImmutableMap.of(
|
||||||
|
|||||||
@@ -23,9 +23,10 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
/** Handles the {@code /OpenID} URL for web based single-sign-on. */
|
/** Handles the {@code /OpenID} URL for web based single-sign-on. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class OpenIdLoginServlet extends HttpServlet {
|
class OpenIdLoginServlet extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
private final OpenIdServiceImpl impl;
|
private final OpenIdServiceImpl impl;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -50,8 +50,9 @@ public abstract class AccountDirectory {
|
|||||||
public abstract void fillAccountInfo(Iterable<? extends AccountInfo> in, Set<FillOptions> options)
|
public abstract void fillAccountInfo(Iterable<? extends AccountInfo> in, Set<FillOptions> options)
|
||||||
throws DirectoryException;
|
throws DirectoryException;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public static class DirectoryException extends Exception {
|
public static class DirectoryException extends Exception {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public DirectoryException(String message, Throwable why) {
|
public DirectoryException(String message, Throwable why) {
|
||||||
super(message, why);
|
super(message, why);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ package com.google.gerrit.server.config;
|
|||||||
import com.google.gerrit.reviewdb.client.Project;
|
import com.google.gerrit.reviewdb.client.Project;
|
||||||
|
|
||||||
/** Special name of the project that all projects derive from. */
|
/** Special name of the project that all projects derive from. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public class AllProjectsName extends Project.NameKey {
|
public class AllProjectsName extends Project.NameKey {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public AllProjectsName(String name) {
|
public AllProjectsName(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,9 @@ package com.google.gerrit.server.config;
|
|||||||
import com.google.gerrit.reviewdb.client.Project;
|
import com.google.gerrit.reviewdb.client.Project;
|
||||||
|
|
||||||
/** Special name of the project in which meta data for all users is stored. */
|
/** Special name of the project in which meta data for all users is stored. */
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public class AllUsersName extends Project.NameKey {
|
public class AllUsersName extends Project.NameKey {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public AllUsersName(String name) {
|
public AllUsersName(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -130,8 +130,9 @@ public class QueryDocumentationExecutor {
|
|||||||
return parser != null && searcher != null;
|
return parser != null && searcher != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public static class DocQueryException extends Exception {
|
public static class DocQueryException extends Exception {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
DocQueryException() {}
|
DocQueryException() {}
|
||||||
|
|
||||||
DocQueryException(String msg) {
|
DocQueryException(String msg) {
|
||||||
|
|||||||
@@ -14,8 +14,9 @@
|
|||||||
|
|
||||||
package com.google.gerrit.server.project;
|
package com.google.gerrit.server.project;
|
||||||
|
|
||||||
@SuppressWarnings("serial")
|
|
||||||
public class RuleEvalException extends Exception {
|
public class RuleEvalException extends Exception {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
public RuleEvalException(String message) {
|
public RuleEvalException(String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user