Skip to content

Commit

Permalink
serialVersionUIDs to random longs instead of 0l,1l,2l, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Gross cogross committed Aug 6, 2024
1 parent 49cd4e9 commit 35f3524
Show file tree
Hide file tree
Showing 156 changed files with 172 additions and 173 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@XmlAccessorType(XmlAccessType.NONE)
public class DatawavePrincipal implements ProxiedUserDetails, Principal, Serializable {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -4882226447158615343L;
private final String username;
private final DatawaveUser primaryUser;
@XmlElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@XmlAccessorType(XmlAccessType.FIELD)
public class ExtJsResponse<T> extends BaseQueryResponse {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 2957709211965763347L;
private List<T> data;
private int total;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class BaseTableCache implements Serializable, TableCache {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -5849784584173005890L;

private final transient Logger log = Logger.getLogger(this.getClass());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface EvictionCallback {
void evict(String dn);
}

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -25185425479055590L;
private static final String LIVE_SERVERS = "/liveServers";
private static final long EVICT_MESSAGE_TIMEOUT = 60 * 1000L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
public class AccumuloTableCacheStatus extends BaseResponse implements HtmlProvider {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -4434127659799676913L;
private static final String TITLE = "Accumulo Table Cache Status", EMPTY = "";

@XmlElementWrapper(name = "TableCaches")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@XmlAccessorType(XmlAccessType.NONE)
public class Connection implements Serializable, Comparable<Connection> {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -2003281391380863328L;

@XmlAttribute
private String state = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL)
public class ConnectionFactoryResponse extends BaseResponse implements HtmlProvider {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 6113726446236223919L;
private static final String TITLE = "Accumulo Connection Factory Metrics", EMPTY = "";

@XmlElementWrapper(name = "ConnectionPools")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@XmlAccessorType(XmlAccessType.NONE)
public class ConnectionPool implements Serializable, Comparable<ConnectionPool> {

private static final long serialVersionUID = 2L;
private static final long serialVersionUID = -1080014568240669701L;

public enum Priority {
ADMIN, HIGH, NORMAL, LOW
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
@XmlAccessorType(XmlAccessType.NONE)
public class ConnectionProperty implements Serializable, Comparable<ConnectionProperty> {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -3008355929086673741L;

@XmlAttribute(required = true)
private String name = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
@XmlRootElement
@XmlAccessorType(XmlAccessType.NONE)
public class TableCacheDescription implements Serializable {
private static final long serialVersionUID = 1L;

private static final long serialVersionUID = -2832954010469120174L;
@XmlAttribute
private String tableName = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public interface EvictionCallback {
void evict(String dn);
}

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 849730389996326126L;
private static final String LIVE_SERVERS = "/liveServers";
private static final long EVICT_MESSAGE_TIMEOUT = 60 * 1000L;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
// used when a transformer gets a non-null empty object
// and the TransformIterator should call next instead of returning null
public class EmptyObjectException extends RuntimeException {
private static final long serialVersionUID = 1l;
private static final long serialVersionUID = 1545558691183965869L;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import datawave.webservice.query.exception.QueryException;

public class CompositeLogicException extends RuntimeException {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = -1365648791651294460L;

public CompositeLogicException(String message, String logicName, Exception exception) {
super(getMessage(message, Collections.singletonMap(logicName, exception)), getRaisedQueryException(exception));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import datawave.microservice.query.QueryImpl;

public class CompositeQueryConfiguration extends GenericQueryConfiguration implements Serializable {
private static final long serialVersionUID = 1l;
private static final long serialVersionUID = -1439235443475270042L;

private Map<String,GenericQueryConfiguration> configs = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface QueryPredictor<T extends BaseQueryMetric> {
Set<Prediction> predict(T query) throws PredictionException;

class PredictionException extends Exception implements Serializable {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = 61150377750239886L;

public PredictionException() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* Creats a transformable node from an AgeOffRuleLoader.RuleConfig
*/
public class RuleConfigDocument extends DocumentImpl {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = 8726547864456487943L;
private static final String FILTER_CLASS_ELEMENT_NAME = "filterClass";
private static final String MATCH_PATTERN_ELEMENT_NAME = "matchPattern";
private static final String TTL_ELEMENT_NAME = "ttl";
Expand Down
2 changes: 1 addition & 1 deletion warehouse/core/src/main/java/datawave/data/hash/UID.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public abstract class UID implements Comparable<UID>, Comparator<UID>, Writable,

private static final Logger LOGGER = Logger.getLogger(UID.class);

private static final long serialVersionUID = 0L;
private static final long serialVersionUID = 931768570469788255L;

protected static final String[] EMPTY_EXTRAS = {};
protected static final String NULL = "" + null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class EdgeModelFields implements Serializable {
/** A mapping of field names to field keys */
private Map<String,FieldKey> reverseMap = new HashMap<>();

private static final long serialVersionUID = 0l;
private static final long serialVersionUID = 6506817448338233545L;

public static String EQUALS = "==";
public static String EQUALS_REGEX = "=~";
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions warehouse/core/src/test/java/datawave/data/hash/UIDTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ public void testMiscellaneous() {
* Test subclass akin to the StringUID
*/
private static class CustomHashUID extends HashUID {
private static final long serialVersionUID = 0L;
private static final long serialVersionUID = 7205412670351903561L;

public CustomHashUID(HashUID template, String... extras) {
super(template, extras);
Expand All @@ -498,7 +498,7 @@ public static HashUID parse(String s) {
* Another test subclass akin to the StringUID
*/
private static class CustomSnowflakeUID extends SnowflakeUID {
private static final long serialVersionUID = 0L;
private static final long serialVersionUID = -5932468265046243486L;

public CustomSnowflakeUID(SnowflakeUID template, String... extras) {
super(template, extras);
Expand All @@ -516,7 +516,7 @@ public static SnowflakeUID parse(String s) {
}

private class TestUID extends UID {
private static final long serialVersionUID = 0L;
private static final long serialVersionUID = 3780105804452735276L;

public TestUID(String prefix, boolean isPrefixOptional, String... extras) {
super(prefix, isPrefixOptional, extras);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class TypeRegistry extends HashMap<String,Type> {

public static final String OUTPUT_NAME = ".output.name";

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -9186653395229072139L;

private static TypeRegistry registry = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
public class IngestFieldFilter {

private static final Logger logger = Logger.getLogger(IngestFieldFilter.class);
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = 8288835090777714924L;
@Deprecated
public static final String FILTER_FIELD_SUFFIX = ".data.field.filter";

Expand Down Expand Up @@ -309,7 +309,7 @@ public Object setValue(Object value) {
* A parsed field configuration
***************************************************************************/
class FieldConfiguration extends ArrayList<FieldFilter> implements List<FieldFilter> {
private static final long serialVersionUID = 0;
private static final long serialVersionUID = -6593828377509888969L;

public FieldConfiguration() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class StringUID extends HashUID {

protected String innerUid = null;
protected String shardedPortion = null;
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = 9221118066352445606L;

public StringUID(String uid) {
innerUid = uid;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ public void processEvent(K1 key, RawRecordContainer value, List<DataTypeHandler<
}

private static class FieldNormalizationError extends Exception {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 6106161010855162008L;

public FieldNormalizationError(String message, Throwable cause) {
super(message, cause);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public void check(Text table, byte[] visibility) throws ConstraintViolationExcep
* Thrown when a violation is encountered.
*/
public static class ConstraintViolationException extends RuntimeException {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = -9068071363548359998L;

public ConstraintViolationException(Text table, VisibilityConstraint constraint) {
super(String.format("Visibility constraint '%s' violated for table '%s'", constraint, table));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class TablePartitionerOffsets extends HashMap<Text,Integer> {
private final Configuration conf;
private final PartitionerCache partitionerCache;
private final int reduceTasks;
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = -1767994113482201024L;

public TablePartitionerOffsets(Configuration conf, List<Text> tableNames, PartitionerCache partitionerCache) throws ClassNotFoundException {
super();
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* The Accumulo table properties represented as a Map.
*/
public class TablePropertiesMap extends TreeMap<String,String> {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = -5825311588298970146L;

public TablePropertiesMap(TableOperations tops, String tableName) throws AccumuloException, TableNotFoundException {
for (Map.Entry<String,String> entry : tops.getProperties(tableName)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected Text getColumnStart() {
}

public static class ScanLimitReached extends RuntimeException {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = -4309625828059464853L;
private final Key lastKey;

public ScanLimitReached(Key key, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ protected void finalize() throws Throwable {
}

public static class ZookeeperLockException extends Exception {
private static final long serialVersionUID = 0l;
private static final long serialVersionUID = 3715643514712028373L;

public ZookeeperLockException() {
super();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

public abstract class AttributeBag<T extends Comparable<T>> extends Attribute<T> implements Serializable {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -5961455715747661898L;
private static final Logger log = Logger.getLogger(AttributeBag.class);
protected long shardTimestamp = Long.MAX_VALUE;
protected boolean validMetadata = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

public class Attributes extends AttributeBag<Attributes> implements Serializable {

private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 4677957768640489928L;
private static final Logger log = Logger.getLogger(Attributes.class);
private Set<Attribute<? extends Comparable<?>>> attributes;
private int _count = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import datawave.query.jexl.DatawaveJexlContext;

public class Content extends Attribute<Content> implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -642410227862723970L;

private static final Type<?> normalizer = new LcNoDiacriticsType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import datawave.webservice.query.data.ObjectSizeOf;

public class DateContent extends Attribute<DateContent> implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -5962661609272398909L;

private static final DateNormalizer normalizer = new DateNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import datawave.query.jexl.DatawaveJexlContext;

public class DiacriticContent extends Attribute<DiacriticContent> implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 570010612591254801L;

private static final LcNormalizer normalizer = new LcNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import datawave.util.time.DateHelper;

public class Document extends AttributeBag<Document> implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = -377226620954754934L;

private static final Logger log = Logger.getLogger(Document.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import datawave.util.StringUtils;

public class DocumentKey extends Attribute<DocumentKey> implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 5322007904914187326L;

private static final LcNoDiacriticsNormalizer normalizer = new LcNoDiacriticsNormalizer();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import datawave.query.jexl.DatawaveJexlContext;

public class GeoPoint extends Attribute<GeoPoint> implements Serializable {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 6706096621887672254L;

private static final GeoNormalizer normalizer = new GeoNormalizer();

Expand Down
Loading

0 comments on commit 35f3524

Please sign in to comment.