diff --git a/core/common-util/src/main/java/datawave/security/authorization/DatawavePrincipal.java b/core/common-util/src/main/java/datawave/security/authorization/DatawavePrincipal.java index 1c43eb931da..0a151843b62 100644 --- a/core/common-util/src/main/java/datawave/security/authorization/DatawavePrincipal.java +++ b/core/common-util/src/main/java/datawave/security/authorization/DatawavePrincipal.java @@ -27,6 +27,8 @@ @XmlType(factoryMethod = "anonymousPrincipal", propOrder = {"name", "proxiedUsers", "creationTime"}) @XmlAccessorType(XmlAccessType.NONE) public class DatawavePrincipal implements ProxiedUserDetails, Principal, Serializable { + + private static final long serialVersionUID = -4882226447158615343L; private final String username; private final DatawaveUser primaryUser; @XmlElement diff --git a/core/common/src/main/java/datawave/core/common/extjs/ExtJsResponse.java b/core/common/src/main/java/datawave/core/common/extjs/ExtJsResponse.java index d92feee8cbb..1cefabf535a 100644 --- a/core/common/src/main/java/datawave/core/common/extjs/ExtJsResponse.java +++ b/core/common/src/main/java/datawave/core/common/extjs/ExtJsResponse.java @@ -13,7 +13,7 @@ @XmlAccessorType(XmlAccessType.FIELD) public class ExtJsResponse extends BaseQueryResponse { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2957709211965763347L; private List data; private int total; diff --git a/core/connection-pool/src/main/java/datawave/core/common/cache/BaseTableCache.java b/core/connection-pool/src/main/java/datawave/core/common/cache/BaseTableCache.java index e662b70f4fb..dfaf71a603c 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/cache/BaseTableCache.java +++ b/core/connection-pool/src/main/java/datawave/core/common/cache/BaseTableCache.java @@ -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()); diff --git a/core/connection-pool/src/main/java/datawave/core/common/cache/SharedCacheCoordinator.java b/core/connection-pool/src/main/java/datawave/core/common/cache/SharedCacheCoordinator.java index ac322004e26..43679f9898b 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/cache/SharedCacheCoordinator.java +++ b/core/connection-pool/src/main/java/datawave/core/common/cache/SharedCacheCoordinator.java @@ -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; diff --git a/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactory.java b/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactory.java index 80d67e6184d..eb6f9ef2f99 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactory.java +++ b/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactory.java @@ -37,6 +37,10 @@ enum State { * * Deprecated in 2.2.3, use {@link #getClient(String, Collection, String, Priority, Map)} * + * @param userDN + * the user's DN + * @param proxyServers + * thecollectiuon of proxy servers * @param priority * the connection's Priority * @param trackingMap @@ -50,6 +54,10 @@ enum State { /** * Gets a connection from the named pool with the assigned priority * + * @param userDN + * the user's DN + * @param proxyServers + * collection of proxy servers * @param poolName * the name of the pool to retrieve the connection from * @param priority @@ -75,6 +83,8 @@ AccumuloClient getClient(String userDN, Collection proxyServers, String /** * Return a report of the current connection factory usage + * + * @return the report */ String report(); diff --git a/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactoryImpl.java b/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactoryImpl.java index 8c77dd34688..11776b179be 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactoryImpl.java +++ b/core/connection-pool/src/main/java/datawave/core/common/connection/AccumuloConnectionFactoryImpl.java @@ -178,6 +178,7 @@ public void close() { * the connection's Priority * @return accumulo connection * @throws Exception + * when error encountered getting client */ @Override public AccumuloClient getClient(final String userDN, final Collection proxyServers, Priority priority, Map trackingMap) @@ -196,6 +197,7 @@ public AccumuloClient getClient(final String userDN, final Collection pr * the tracking map * @return Accumulo connection * @throws Exception + * when error encountered getting client */ @Override public AccumuloClient getClient(final String userDN, final Collection proxyServers, final String cpn, final Priority priority, @@ -236,6 +238,7 @@ public AccumuloClient getClient(final String userDN, final Collection pr * @param client * The connection to return * @throws Exception + * when error encountered getting client */ @Override public void returnClient(AccumuloClient client) throws Exception { diff --git a/core/connection-pool/src/main/java/datawave/core/common/result/AccumuloTableCacheStatus.java b/core/connection-pool/src/main/java/datawave/core/common/result/AccumuloTableCacheStatus.java index ac7a0f52798..d4987278248 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/result/AccumuloTableCacheStatus.java +++ b/core/connection-pool/src/main/java/datawave/core/common/result/AccumuloTableCacheStatus.java @@ -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") diff --git a/core/connection-pool/src/main/java/datawave/core/common/result/Connection.java b/core/connection-pool/src/main/java/datawave/core/common/result/Connection.java index ad234db4cb1..f5d66fd948f 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/result/Connection.java +++ b/core/connection-pool/src/main/java/datawave/core/common/result/Connection.java @@ -19,7 +19,7 @@ @XmlAccessorType(XmlAccessType.NONE) public class Connection implements Serializable, Comparable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -2003281391380863328L; @XmlAttribute private String state = null; diff --git a/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionFactoryResponse.java b/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionFactoryResponse.java index 613d79697f8..bf409385b69 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionFactoryResponse.java +++ b/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionFactoryResponse.java @@ -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") diff --git a/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionPool.java b/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionPool.java index fc453a9ef8d..c1383d6ffa4 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionPool.java +++ b/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionPool.java @@ -17,7 +17,7 @@ @XmlAccessorType(XmlAccessType.NONE) public class ConnectionPool implements Serializable, Comparable { - private static final long serialVersionUID = 2L; + private static final long serialVersionUID = -1080014568240669701L; public enum Priority { ADMIN, HIGH, NORMAL, LOW diff --git a/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionProperty.java b/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionProperty.java index 937aeea7e07..5f79b544751 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionProperty.java +++ b/core/connection-pool/src/main/java/datawave/core/common/result/ConnectionProperty.java @@ -13,7 +13,7 @@ @XmlAccessorType(XmlAccessType.NONE) public class ConnectionProperty implements Serializable, Comparable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -3008355929086673741L; @XmlAttribute(required = true) private String name = null; diff --git a/core/connection-pool/src/main/java/datawave/core/common/result/TableCacheDescription.java b/core/connection-pool/src/main/java/datawave/core/common/result/TableCacheDescription.java index ced34faed6c..e8acd3e988b 100644 --- a/core/connection-pool/src/main/java/datawave/core/common/result/TableCacheDescription.java +++ b/core/connection-pool/src/main/java/datawave/core/common/result/TableCacheDescription.java @@ -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; diff --git a/core/connection-pool/src/test/java/datawave/core/common/curator/TestSharedCacheCoordinator.java b/core/connection-pool/src/test/java/datawave/core/common/curator/TestSharedCacheCoordinator.java index 8d7a7d7dea6..019b875dd15 100644 --- a/core/connection-pool/src/test/java/datawave/core/common/curator/TestSharedCacheCoordinator.java +++ b/core/connection-pool/src/test/java/datawave/core/common/curator/TestSharedCacheCoordinator.java @@ -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; diff --git a/core/map-reduce/src/main/java/datawave/core/mapreduce/bulkresults/map/BulkResultsFileOutputMapper.java b/core/map-reduce/src/main/java/datawave/core/mapreduce/bulkresults/map/BulkResultsFileOutputMapper.java index 1ce75bf2cd1..1b685b4eca0 100644 --- a/core/map-reduce/src/main/java/datawave/core/mapreduce/bulkresults/map/BulkResultsFileOutputMapper.java +++ b/core/map-reduce/src/main/java/datawave/core/mapreduce/bulkresults/map/BulkResultsFileOutputMapper.java @@ -57,7 +57,7 @@ public class BulkResultsFileOutputMapper extends ApplicationContextAwareMapper t = null; private Map entries = new HashMap<>(); private Map> responseClassMap = new HashMap<>(); private SerializationFormat format = SerializationFormat.XML; @@ -98,7 +98,7 @@ protected void map(Key key, Value value, org.apache.hadoop.mapreduce.Mapper entry : entries.entrySet()) { try { - Object o = t.transform(entry); + Object o = t.transform(entry.getKey()); BaseQueryResponse response = t.createResponse(new ResultsPage(Collections.singletonList(o))); Class responseClass = null; try { diff --git a/core/modification/src/main/java/datawave/modification/MutableMetadataHandler.java b/core/modification/src/main/java/datawave/modification/MutableMetadataHandler.java index 1a2bd92fce6..01ced91dd12 100644 --- a/core/modification/src/main/java/datawave/modification/MutableMetadataHandler.java +++ b/core/modification/src/main/java/datawave/modification/MutableMetadataHandler.java @@ -989,6 +989,8 @@ public AccumuloConnectionFactory.Priority getPriority() { * operation * @param userAuths * set of user auths + * @param userDetails + * proxied user details * @return Event * @throws Exception * if there are issues diff --git a/core/modification/src/main/java/datawave/modification/cache/ModificationCache.java b/core/modification/src/main/java/datawave/modification/cache/ModificationCache.java index 2258be9e061..161c05a84ce 100644 --- a/core/modification/src/main/java/datawave/modification/cache/ModificationCache.java +++ b/core/modification/src/main/java/datawave/modification/cache/ModificationCache.java @@ -91,6 +91,8 @@ public void reloadMutableFieldCache() { /** * List the mutable fields in the cache + * + * @return list of mutable fields */ public String listMutableFields() { return cache.toString(); @@ -100,6 +102,7 @@ public String listMutableFields() { * Check to see if field for specified datatype is mutable * * @param datatype + * the data type * @param field * name of field * @return true if field is mutable for the given datatype diff --git a/core/modification/src/main/java/datawave/modification/configuration/ModificationServiceConfiguration.java b/core/modification/src/main/java/datawave/modification/configuration/ModificationServiceConfiguration.java index ccc5acf828a..7672e73245d 100644 --- a/core/modification/src/main/java/datawave/modification/configuration/ModificationServiceConfiguration.java +++ b/core/modification/src/main/java/datawave/modification/configuration/ModificationServiceConfiguration.java @@ -48,6 +48,8 @@ public void setSecurityMarkingExemptFields(List securityMarkingExemptFie /** * Handle to query service in case the modification service needs to run queries. * + * @param userDetails + * proxied user details * @return ModificationQueryService */ public ModificationQueryService getQueryService(ProxiedUserDetails userDetails) { diff --git a/core/query/src/main/java/datawave/core/query/exception/EmptyObjectException.java b/core/query/src/main/java/datawave/core/query/exception/EmptyObjectException.java index 4aba8872adf..f065daeda62 100644 --- a/core/query/src/main/java/datawave/core/query/exception/EmptyObjectException.java +++ b/core/query/src/main/java/datawave/core/query/exception/EmptyObjectException.java @@ -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 = 1545558691183965869L; } diff --git a/core/query/src/main/java/datawave/core/query/logic/CheckpointableQueryLogic.java b/core/query/src/main/java/datawave/core/query/logic/CheckpointableQueryLogic.java index 3fefb160178..5fae93d4d43 100644 --- a/core/query/src/main/java/datawave/core/query/logic/CheckpointableQueryLogic.java +++ b/core/query/src/main/java/datawave/core/query/logic/CheckpointableQueryLogic.java @@ -38,6 +38,7 @@ public interface CheckpointableQueryLogic { * handling a previously returned checkpoint. * * @param checkpoint + * the checkpoint * @return The updated checkpoint */ QueryCheckpoint updateCheckpoint(QueryCheckpoint checkpoint); diff --git a/core/query/src/main/java/datawave/core/query/logic/QueryLogic.java b/core/query/src/main/java/datawave/core/query/logic/QueryLogic.java index a85ddfb3f29..f4012f1f6ae 100644 --- a/core/query/src/main/java/datawave/core/query/logic/QueryLogic.java +++ b/core/query/src/main/java/datawave/core/query/logic/QueryLogic.java @@ -110,7 +110,7 @@ default ResultPostprocessor getResultPostprocessor(GenericQueryConfiguration con default String getResponseClass(Query query) throws QueryException { try { - QueryLogicTransformer t = this.getEnrichedTransformer(query); + QueryLogicTransformer t = this.getEnrichedTransformer(query); BaseResponse refResponse = t.createResponse(new ResultsPage()); return refResponse.getClass().getCanonicalName(); } catch (RuntimeException e) { @@ -463,6 +463,7 @@ default void preInitialize(Query settings, Set userAuthorization * Set a client configuration for scanner hints and consistency. * * @param config + * the client configuration */ void setClientConfig(AccumuloClientConfiguration config); diff --git a/core/query/src/main/java/datawave/core/query/logic/composite/CompositeLogicException.java b/core/query/src/main/java/datawave/core/query/logic/composite/CompositeLogicException.java index 97db9d0f61c..80aaf24b3aa 100644 --- a/core/query/src/main/java/datawave/core/query/logic/composite/CompositeLogicException.java +++ b/core/query/src/main/java/datawave/core/query/logic/composite/CompositeLogicException.java @@ -7,6 +7,7 @@ import datawave.webservice.query.exception.QueryException; public class CompositeLogicException extends RuntimeException { + private static final long serialVersionUID = -1365648791651294460L; public CompositeLogicException(String message, String logicName, Exception exception) { super(getMessage(message, Collections.singletonMap(logicName, exception)), getRaisedQueryException(exception)); diff --git a/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryConfiguration.java b/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryConfiguration.java index 3931adc67a5..1495ec11a6d 100644 --- a/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryConfiguration.java +++ b/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryConfiguration.java @@ -9,6 +9,7 @@ import datawave.microservice.query.QueryImpl; public class CompositeQueryConfiguration extends GenericQueryConfiguration implements Serializable { + private static final long serialVersionUID = -1439235443475270042L; private Map configs = new HashMap<>(); diff --git a/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryLogic.java b/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryLogic.java index 950cddef817..6f85e854afa 100644 --- a/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryLogic.java +++ b/core/query/src/main/java/datawave/core/query/logic/composite/CompositeQueryLogic.java @@ -701,6 +701,7 @@ public SelectorExtractor getSelectorExtractor() { * Setting the current user is called after the logic is created. Pass this on to the children. * * @param user + * the proxied user */ @Override public void setCurrentUser(ProxiedUserDetails user) { @@ -714,6 +715,7 @@ public void setCurrentUser(ProxiedUserDetails user) { * /** Setting the server user is called after the logic is created. Pass this on to the children. * * @param user + * the proxied user */ @Override public void setServerUser(ProxiedUserDetails user) { diff --git a/core/query/src/main/java/datawave/core/query/predict/QueryPredictor.java b/core/query/src/main/java/datawave/core/query/predict/QueryPredictor.java index 6bdc525e300..c308b6cf6dc 100644 --- a/core/query/src/main/java/datawave/core/query/predict/QueryPredictor.java +++ b/core/query/src/main/java/datawave/core/query/predict/QueryPredictor.java @@ -14,6 +14,7 @@ public interface QueryPredictor { Set predict(T query) throws PredictionException; class PredictionException extends Exception implements Serializable { + private static final long serialVersionUID = 61150377750239886L; public PredictionException() { super(); diff --git a/core/query/src/main/java/datawave/core/query/remote/RemoteQueryService.java b/core/query/src/main/java/datawave/core/query/remote/RemoteQueryService.java index f996f9c83c6..4516d0eb263 100644 --- a/core/query/src/main/java/datawave/core/query/remote/RemoteQueryService.java +++ b/core/query/src/main/java/datawave/core/query/remote/RemoteQueryService.java @@ -25,6 +25,8 @@ public interface RemoteQueryService { * @param callerObject * the caller * @return the generic response + * @throws QueryException + * on error when creating query */ GenericResponse createQuery(String queryLogicName, Map> queryParameters, ProxiedUserDetails callerObject) throws QueryException; @@ -44,6 +46,8 @@ public interface RemoteQueryService { * @param callerObject * the caller * @return the base query response + * @throws QueryException + * on error with query */ BaseQueryResponse next(String id, ProxiedUserDetails callerObject) throws QueryException; @@ -55,6 +59,8 @@ public interface RemoteQueryService { * @param callerObject * the caller * @return the void response + * @throws QueryException + * on error closing query */ VoidResponse close(String id, ProxiedUserDetails callerObject) throws QueryException; @@ -68,6 +74,8 @@ public interface RemoteQueryService { * @param callerObject * the caller * @return the generic response + * @throws QueryException + * on error planning query */ GenericResponse planQuery(String queryLogicName, Map> queryParameters, ProxiedUserDetails callerObject) throws QueryException; @@ -79,6 +87,8 @@ public interface RemoteQueryService { * @param callerObject * the caller * @return a generic response + * @throws QueryException + * on error planning query */ GenericResponse planQuery(String id, ProxiedUserDetails callerObject) throws QueryException; diff --git a/docs/pom.xml b/docs/pom.xml index 43983c0b8b3..0937e8e0949 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -242,12 +242,6 @@ 2.28.2 provided - - org.mockito - mockito-core - 2.28.2 - provided - org.picketbox picketbox diff --git a/warehouse/accumulo-extensions/pom.xml b/warehouse/accumulo-extensions/pom.xml index bef5dea6e05..f8c99255142 100644 --- a/warehouse/accumulo-extensions/pom.xml +++ b/warehouse/accumulo-extensions/pom.xml @@ -60,7 +60,7 @@ clover - com.cenqua.clover + org.openclover clover diff --git a/warehouse/age-off-utils/src/main/java/datawave/age/off/util/AgeOffFileGenerator.java b/warehouse/age-off-utils/src/main/java/datawave/age/off/util/AgeOffFileGenerator.java index b10723f6a5e..f11736408d8 100644 --- a/warehouse/age-off-utils/src/main/java/datawave/age/off/util/AgeOffFileGenerator.java +++ b/warehouse/age-off-utils/src/main/java/datawave/age/off/util/AgeOffFileGenerator.java @@ -24,6 +24,9 @@ public AgeOffFileGenerator(AgeOffFileConfiguration configuration) { /** * Writes the file to the writer. * + * @param writer + * the writer + * * @throws IOException * i/o exception with writer */ diff --git a/warehouse/age-off-utils/src/main/java/datawave/age/off/util/RuleConfigDocument.java b/warehouse/age-off-utils/src/main/java/datawave/age/off/util/RuleConfigDocument.java index ad4eef2600c..630062554a3 100644 --- a/warehouse/age-off-utils/src/main/java/datawave/age/off/util/RuleConfigDocument.java +++ b/warehouse/age-off-utils/src/main/java/datawave/age/off/util/RuleConfigDocument.java @@ -13,6 +13,7 @@ * Creats a transformable node from an AgeOffRuleLoader.RuleConfig */ public class RuleConfigDocument extends DocumentImpl { + 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"; diff --git a/warehouse/age-off/src/main/java/datawave/iterators/filter/TokenSpecParser.java b/warehouse/age-off/src/main/java/datawave/iterators/filter/TokenSpecParser.java index a46c0893109..923c901a907 100644 --- a/warehouse/age-off/src/main/java/datawave/iterators/filter/TokenSpecParser.java +++ b/warehouse/age-off/src/main/java/datawave/iterators/filter/TokenSpecParser.java @@ -28,6 +28,7 @@ public abstract class TokenSpecParser { * * @return TokenSpecParser child object */ + @SuppressWarnings("unchecked") public B parse(String configuration) { ParserState parser = new ParserState(configuration); parser.parseTo(this); @@ -176,7 +177,7 @@ protected String expect(ParseTokenType type) { * @param builder * token spec parser */ - protected void parseTo(TokenSpecParser builder) { + protected void parseTo(TokenSpecParser builder) { ParseToken initialToken; while ((initialToken = peek()) != null) { String tokenStr = parseStrliteral(); diff --git a/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/AppliedRule.java b/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/AppliedRule.java index d123f7d5104..ac1a8c3f868 100644 --- a/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/AppliedRule.java +++ b/warehouse/age-off/src/main/java/datawave/iterators/filter/ageoff/AppliedRule.java @@ -132,7 +132,7 @@ public FilterRule deepCopy(AgeOffPeriod period, IteratorEnvironment iterEnv) { public FilterRule deepCopy(long scanStart, IteratorEnvironment iterEnv) { AppliedRule newFilter; try { - newFilter = (AppliedRule) super.getClass().newInstance(); + newFilter = (AppliedRule) super.getClass().getDeclaredConstructor().newInstance(); FilterOptions newOptions = new FilterOptions(currentOptions); newOptions.setOption(AgeOffConfigParams.SCAN_START_TIMESTAMP, Long.toString(scanStart)); newFilter.iterEnv = iterEnv; @@ -143,7 +143,7 @@ public FilterRule deepCopy(long scanStart, IteratorEnvironment iterEnv) { log.trace("Age off is " + newFilter.ageOffPeriod.getCutOffMilliseconds()); } return newFilter; - } catch (InstantiationException | IllegalAccessException e) { + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { log.error(e); } return null; diff --git a/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleDataTypeMergeTest.java b/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleDataTypeMergeTest.java index 03845eaa3aa..5443811e607 100644 --- a/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleDataTypeMergeTest.java +++ b/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleDataTypeMergeTest.java @@ -52,23 +52,23 @@ public void verifyOverridenValues() throws IOException { // // verify original values - assertThat(parentFilter.options.getOption("foo.ttl"), is("600")); - assertThat(parentFilter.options.getOption("bar.ttl"), is("500")); - assertThat(parentFilter.options.getOption("baz.ttl"), is("400")); + assertEquals(parentFilter.options.getOption("foo.ttl"), "600"); + assertEquals(parentFilter.options.getOption("bar.ttl"), "500"); + assertEquals(parentFilter.options.getOption("baz.ttl"), "400"); // check overrides - assertThat(childFilter.options.getOption("bar.ttl"), is("500")); - assertThat(childFilter.options.getOption("baz.ttl"), is("400")); + assertEquals(childFilter.options.getOption("bar.ttl"), "500"); + assertEquals(childFilter.options.getOption("baz.ttl"), "400"); // these are overridden - assertThat(childFilter.options.getOption("foo.ttl"), is("123")); - assertThat(childFilter.options.getOption("zip.ttl"), is("123")); + assertEquals(childFilter.options.getOption("foo.ttl"), "123"); + assertEquals(childFilter.options.getOption("zip.ttl"), "123"); } private static FilterRule loadRulesFromFile(FileSystem fs, Path filePath) throws IOException { FileRuleCacheValue ruleValue = new FileRuleCacheValue(fs, filePath, 1); Collection rules = ruleValue.loadFilterRules(null); // should only have the single rule - assertThat(rules.size(), is(1)); + assertEquals(rules.size(), 1); for (FilterRule rule : rules) { assertEquals(TestDataTypeFilter.class, rule.getClass()); } diff --git a/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleFieldMergeTest.java b/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleFieldMergeTest.java index 41a331f550b..3848ac9d683 100644 --- a/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleFieldMergeTest.java +++ b/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleFieldMergeTest.java @@ -39,9 +39,9 @@ public void before() throws IOException { @Test public void verifyIsIndexOnlyForChild() throws IOException { - assertThat(isIndexTable(parentFilter), is(false)); + assertEquals(isIndexTable(parentFilter), false); - assertThat(isIndexTable(childFilter), is(true)); + assertEquals(isIndexTable(childFilter), true); } @Test @@ -50,10 +50,10 @@ public void verifyInheritedParentConfigs() throws IOException { // alpha,beta,gamma,delta // since child is index config, field should be in the column family Key key = new Key("row", "alpha", "cq", "vis", 0); - assertThat(childFilter.accept(key, new Value()), is(false)); + assertEquals(childFilter.accept(key, new Value()), false); key = new Key("row", "beta", "cq", "vis", Long.MAX_VALUE); - assertThat(childFilter.accept(key, new Value()), is(true)); + assertEquals(childFilter.accept(key, new Value()), true); } private Boolean isIndexTable(TestFieldFilter filter) { @@ -64,7 +64,7 @@ private static FilterRule loadRulesFromFile(FileSystem fs, Path filePath) throws FileRuleCacheValue cacheValue = new FileRuleCacheValue(fs, filePath, 1); Collection rules = cacheValue.loadFilterRules(null); // should only have the single rule - assertThat(rules.size(), is(1)); + assertEquals(rules.size(), 1); for (FilterRule rule : rules) { assertEquals(TestFieldFilter.class, rule.getClass()); } diff --git a/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleLoadContentsMergeFiltersTest.java b/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleLoadContentsMergeFiltersTest.java index 7fd7a325c70..deb3baea27b 100644 --- a/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleLoadContentsMergeFiltersTest.java +++ b/warehouse/age-off/src/test/java/datawave/ingest/util/cache/watch/FileRuleLoadContentsMergeFiltersTest.java @@ -1,8 +1,6 @@ package datawave.ingest.util.cache.watch; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -104,30 +102,30 @@ public void testNewConfigMaintainsOrder() throws Exception { List childRules = (List) childValue.loadFilterRules(null); // should have one extra rule in child - assertThat(childRules.size(), is(equalTo(parentRules.size() + 1))); + assertEquals(childRules.size(), parentRules.size() + 1); // parent classes are // TestTrieFilter // TestFieldFilter // TestFilter // This order should be maintained!!!!! - assertThat(simpleName(parentRules, 0), is("TestTrieFilter")); - assertThat(simpleName(parentRules, 1), is("TestFieldFilter")); - assertThat(simpleName(parentRules, 2), is("TestFilter")); + assertEquals(simpleName(parentRules, 0), "TestTrieFilter"); + assertEquals(simpleName(parentRules, 1), "TestFieldFilter"); + assertEquals(simpleName(parentRules, 2), "TestFilter"); // verify order of filters in child matches parent for (int i = 0; i < parentRules.size(); i++) { FilterRule parent = parentRules.get(i); FilterRule child = childRules.get(i); - assertThat(child.getClass().getSimpleName(), is(equalTo(parent.getClass().getSimpleName()))); + assertEquals(child.getClass().getSimpleName(), parent.getClass().getSimpleName()); } // also verify that child inherited ttl from parent TestTrieFilter mergedParent = (TestTrieFilter) parentRules.get(0); TestTrieFilter mergedChild = (TestTrieFilter) childRules.get(0); - assertThat(mergedChild.options.getTTL(), is(equalTo(mergedParent.options.getTTL()))); - assertThat(mergedChild.options.getTTLUnits(), is(equalTo(mergedParent.options.getTTLUnits()))); + assertEquals(mergedChild.options.getTTL(), mergedParent.options.getTTL()); + assertEquals(mergedChild.options.getTTLUnits(), mergedParent.options.getTTLUnits()); } private String simpleName(List parentRules, int i) { @@ -159,8 +157,8 @@ private void verifyAppliedRule(AppliedRule filter, String data, long offsetInDay long timestamp = anchorTime - (offsetInDays * MILLIS_IN_DAY) + 1; Key key = TestTrieFilter.create(data, timestamp); // @formatter:off - assertThat(failedExpectationMessage(data, offsetInDays, expectation), - filter.accept(filterOptions.getAgeOffPeriod(anchorTime), key, value), is(expectation)); + assertEquals(failedExpectationMessage(data, offsetInDays, expectation), + filter.accept(filterOptions.getAgeOffPeriod(anchorTime), key, value), expectation); // @formatter:on } @@ -189,7 +187,7 @@ public void testTtl() { private static FilterRule loadRulesFromFile(FileSystem fs, Path filePath, int expectedNumRules) throws IOException { FileRuleCacheValue cacheValue = new FileRuleCacheValue(fs, filePath, 1); Collection rules = cacheValue.loadFilterRules(null); - assertThat(rules.size(), is(expectedNumRules)); + assertEquals(rules.size(), expectedNumRules); // only return the TestTrieFilter for this test Optional first = rules.stream().filter(r -> r instanceof TestTrieFilter).findFirst(); return first.get(); diff --git a/warehouse/age-off/src/test/java/datawave/iterators/filter/ConfigurableAgeOffFilterTest.java b/warehouse/age-off/src/test/java/datawave/iterators/filter/ConfigurableAgeOffFilterTest.java index b35f976f4bf..54a05ae29b3 100644 --- a/warehouse/age-off/src/test/java/datawave/iterators/filter/ConfigurableAgeOffFilterTest.java +++ b/warehouse/age-off/src/test/java/datawave/iterators/filter/ConfigurableAgeOffFilterTest.java @@ -2,6 +2,7 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertSame; @@ -59,9 +60,9 @@ public void testAcceptKeyValue_OnlyUserMajc() throws Exception { filter.init(source, options, env); - assertThat(filter.accept(new Key(), VALUE), is(true)); + assertEquals(filter.accept(new Key(), VALUE), true); // 1970 is older than 30 days, but filter is disable so should be true - assertThat(filter.accept(getKey(0), VALUE), is(true)); + assertEquals(filter.accept(getKey(0), VALUE), true); } @Test @@ -72,9 +73,9 @@ public void testAcceptKeyValue_DisabledFullMajc() throws Exception { filter.init(source, options, env); - assertThat(filter.accept(new Key(), VALUE), is(true)); + assertEquals(filter.accept(new Key(), VALUE), true); // 1970 is older than 30 days, but filter is disable so should be true - assertThat(filter.accept(getKey(0), VALUE), is(true)); + assertEquals(filter.accept(getKey(0), VALUE), true); } @Test @@ -85,9 +86,9 @@ public void testAcceptKeyValue_OnlyTtlNoInnerFilters() throws Exception { // no file or other delegate filters configured, so only the ttl are used filter.init(source, options, env); - assertThat(filter.accept(getKey(daysAgo(10)), VALUE), is(true)); + assertEquals(filter.accept(getKey(daysAgo(10)), VALUE), true); // 100 is older than 30 days - assertThat(filter.accept(getKey(daysAgo(100)), VALUE), is(false)); + assertEquals(filter.accept(getKey(daysAgo(100)), VALUE), false); } @Test @@ -99,8 +100,8 @@ public void testAcceptKeyValue_WithFile() throws Exception { // the file uses TestFilter which always returns false for accept and filter applied // so only ttl is uses for acceptance - assertThat(filter.accept(getKey(daysAgo(15)), VALUE), is(true)); - assertThat(filter.accept(getKey(daysAgo(123)), VALUE), is(false)); + assertEquals(filter.accept(getKey(daysAgo(15)), VALUE), true); + assertEquals(filter.accept(getKey(daysAgo(123)), VALUE), false); } @Test @@ -139,22 +140,22 @@ public void testAcceptKeyValue_TtlSet() throws Exception { filter.initialize(wrapper); // brand new key should be good - assertThat(filter.accept(new Key(), VALUE), is(true)); + assertEquals(filter.accept(new Key(), VALUE), true); // first five will hit the ttl short circuit - assertThat(filter.accept(getKey(daysAgo(1)), VALUE), is(true)); - assertThat(filter.accept(getKey(daysAgo(2)), VALUE), is(true)); - assertThat(filter.accept(getKey(daysAgo(3)), VALUE), is(true)); - assertThat(filter.accept(getKey(daysAgo(4)), VALUE), is(true)); - assertThat("If this fails it may be an edge case due to date rollover, try again in a minute", // - filter.accept(getKey(daysAgo(5)), VALUE), is(true)); + assertEquals(filter.accept(getKey(daysAgo(1)), VALUE), true); + assertEquals(filter.accept(getKey(daysAgo(2)), VALUE), true); + assertEquals(filter.accept(getKey(daysAgo(3)), VALUE), true); + assertEquals(filter.accept(getKey(daysAgo(4)), VALUE), true); + assertEquals("If this fails it may be an edge case due to date rollover, try again in a minute", // + filter.accept(getKey(daysAgo(5)), VALUE), true); // these will not hit the ttl short circuit and the single applied rule - assertThat(filter.accept(getKey("foo", daysAgo(6)), VALUE), is(true)); + assertEquals(filter.accept(getKey("foo", daysAgo(6)), VALUE), true); // will not match so should be true - assertThat(filter.accept(getKey("bar", daysAgo(7)), VALUE), is(true)); - assertThat(filter.accept(getKey("foo", daysAgo(8)), VALUE), is(true)); + assertEquals(filter.accept(getKey("bar", daysAgo(7)), VALUE), true); + assertEquals(filter.accept(getKey("foo", daysAgo(8)), VALUE), true); // this is really old and matches so should not be accepted - assertThat(filter.accept(getKey("foo", daysAgo(365)), VALUE), is(false)); + assertEquals(filter.accept(getKey("foo", daysAgo(365)), VALUE), false); } @@ -192,10 +193,10 @@ public void testAcceptKeyValue_MultipleFilters() throws Exception { Key oldBarTab = getKey("bar", "tab", daysAgo(100)); Key lowBar = getKey("low", "bar", daysAgo(32)); - assertThat(filter.accept(fooWee, VALUE), is(true)); - assertThat(filter.accept(newBarTab, VALUE), is(true)); - assertThat(filter.accept(oldBarTab, VALUE), is(false)); - assertThat(filter.accept(lowBar, VALUE), is(false)); + assertEquals(filter.accept(fooWee, VALUE), true); + assertEquals(filter.accept(newBarTab, VALUE), true); + assertEquals(filter.accept(oldBarTab, VALUE), false); + assertEquals(filter.accept(lowBar, VALUE), false); } @Test(expected = NullPointerException.class) @@ -223,14 +224,14 @@ public void testValidateOptions() { // @formatter:on for (String unit : allUnits) { options.put(AgeOffConfigParams.TTL_UNITS, unit); - assertThat(filter.validateOptions(options), is(true)); + assertEquals(filter.validateOptions(options), true); } options.put(AgeOffConfigParams.TTL_UNITS, "parsecs"); - assertThat(filter.validateOptions(options), is(false)); + assertEquals(filter.validateOptions(options), false); options.put(AgeOffConfigParams.TTL, "0x143"); options.put(AgeOffConfigParams.TTL_UNITS, AgeOffTtlUnits.DAYS); - assertThat(filter.validateOptions(options), is(false)); + assertEquals(filter.validateOptions(options), false); } // -------------------------------------------- diff --git a/warehouse/common/src/main/java/datawave/common/util/MultiComparator.java b/warehouse/common/src/main/java/datawave/common/util/MultiComparator.java index 30df7836a6d..22716abf13d 100644 --- a/warehouse/common/src/main/java/datawave/common/util/MultiComparator.java +++ b/warehouse/common/src/main/java/datawave/common/util/MultiComparator.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Comparator; public class MultiComparator implements Comparator, Serializable { @@ -15,6 +16,8 @@ public MultiComparator(Collection> comparators) { this.comparators = comparators; } + @SafeVarargs + @SuppressWarnings("varargs") public MultiComparator(Comparator... comparators) { this((comparators != null && comparators.length > 0) ? Arrays.asList(comparators) : new ArrayList<>()); } diff --git a/warehouse/core/src/main/java/datawave/data/hash/AbstractUIDBuilder.java b/warehouse/core/src/main/java/datawave/data/hash/AbstractUIDBuilder.java index 00263d6fe1d..e3c057f71cd 100644 --- a/warehouse/core/src/main/java/datawave/data/hash/AbstractUIDBuilder.java +++ b/warehouse/core/src/main/java/datawave/data/hash/AbstractUIDBuilder.java @@ -130,7 +130,7 @@ public UID_TYPE newId(final UID template, final String... extras) { } else if (template.getClass() == SnowflakeUID.class) { validatedTemplate = template; } else { - validatedTemplate = template.parse(template.toString()); + validatedTemplate = UID.parse(template.toString()); } } else { validatedTemplate = null; diff --git a/warehouse/core/src/main/java/datawave/data/hash/SnowflakeUID.java b/warehouse/core/src/main/java/datawave/data/hash/SnowflakeUID.java index b5df2904da2..0b4fe9af872 100644 --- a/warehouse/core/src/main/java/datawave/data/hash/SnowflakeUID.java +++ b/warehouse/core/src/main/java/datawave/data/hash/SnowflakeUID.java @@ -5,7 +5,6 @@ import java.io.DataInput; import java.io.IOException; -import java.io.Serializable; import java.math.BigInteger; import org.apache.commons.lang.builder.CompareToBuilder; diff --git a/warehouse/core/src/main/java/datawave/data/hash/UID.java b/warehouse/core/src/main/java/datawave/data/hash/UID.java index 6782f4a8616..956791ccc51 100644 --- a/warehouse/core/src/main/java/datawave/data/hash/UID.java +++ b/warehouse/core/src/main/java/datawave/data/hash/UID.java @@ -43,6 +43,8 @@ public abstract class UID implements Comparable, Comparator, Writable, private static final Logger LOGGER = Logger.getLogger(UID.class); + private static final long serialVersionUID = 931768570469788255L; + protected static final String[] EMPTY_EXTRAS = {}; protected static final String NULL = "" + null; protected static final int RADIX = Character.MAX_RADIX; diff --git a/warehouse/core/src/main/java/datawave/edge/model/EdgeModelFields.java b/warehouse/core/src/main/java/datawave/edge/model/EdgeModelFields.java index a554cedcf2f..636a3c3bf4d 100644 --- a/warehouse/core/src/main/java/datawave/edge/model/EdgeModelFields.java +++ b/warehouse/core/src/main/java/datawave/edge/model/EdgeModelFields.java @@ -30,6 +30,8 @@ public class EdgeModelFields implements Serializable { /** A mapping of field names to field keys */ private Map reverseMap = new HashMap<>(); + private static final long serialVersionUID = 6506817448338233545L; + public static String EQUALS = "=="; public static String EQUALS_REGEX = "=~"; public static String NOT_EQUALS = "!="; @@ -146,6 +148,11 @@ public enum FieldKey { /** * Returns the FieldKey associated with the actual (ie, configured) edge field name, ie, reverse lookup... + * + * @param internalFieldName + * the internal field name + * + * @return the FieldKey parsed from the internalFieldName provided */ public FieldKey parse(String internalFieldName) { FieldKey key = reverseMap.get(internalFieldName); @@ -239,7 +246,7 @@ public String getBadActivityDateFieldName() { /** * Returns the subset of all edge-related field names which are common to all application tiers. * - * @return + * @return the collection of base field names */ public Collection getBaseFieldNames() { return Collections.unmodifiableCollection(baseFieldMap.values()); @@ -249,7 +256,7 @@ public Collection getBaseFieldNames() { * Returns the field names associated with key manipulation and processing, a superset of the fields given by the {@link EdgeModelFields#getBaseFieldNames} * method * - * @return + * @return the collection of key processing field names */ public Collection getKeyProcessingFieldNames() { HashSet fields = new HashSet<>(); @@ -262,7 +269,7 @@ public Collection getKeyProcessingFieldNames() { * Returns the field names associated with query result transformation, a superset of the fields given by the {@link EdgeModelFields#getBaseFieldNames} * method * - * @return + * @return collection of transform field names */ public Collection getTransformFieldNames() { HashSet fields = new HashSet<>(); @@ -274,7 +281,7 @@ public Collection getTransformFieldNames() { /** * Returns the mapped fields associated with edge key manipulation and processing, where the keys are represented as FieldKey.name() * - * @return + * @return key processing field map */ public Map getKeyProcessingFieldMap() { HashMap all = new HashMap<>(); @@ -286,7 +293,7 @@ public Map getKeyProcessingFieldMap() { /** * Returns the mapping for fields associated with query result transformation, where the keys are represented as FieldKey.name() * - * @return + * @return the transform field map */ public Map getTransformFieldMap() { HashMap all = new HashMap<>(); @@ -298,7 +305,7 @@ public Map getTransformFieldMap() { /** * Returns all mapped field names, where the keys are represented as FieldKey.name() * - * @return + * @return all the mapped field names */ public Map getAllFieldsMap() { HashMap all = new HashMap<>(); @@ -312,7 +319,8 @@ public Map getAllFieldsMap() { * Returns the field name mapped to the specified FieldKey * * @param key - * @return + * the key + * @return the field name mapped to the key */ public String getFieldName(FieldKey key) { String name = getAllFieldsMap().get(key.name()); diff --git a/warehouse/core/src/main/java/datawave/edge/protobuf/EdgeData.java b/warehouse/core/src/main/java/datawave/edge/protobuf/EdgeData.java index c354aa8c834..616af793873 100644 --- a/warehouse/core/src/main/java/datawave/edge/protobuf/EdgeData.java +++ b/warehouse/core/src/main/java/datawave/edge/protobuf/EdgeData.java @@ -694,7 +694,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 780014719499307692L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { @@ -1466,15 +1466,15 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io output.writeInt64(1, count_); } if (getHoursList().size() > 0) { - output.writeRawVarint32(18); - output.writeRawVarint32(hoursMemoizedSerializedSize); + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(hoursMemoizedSerializedSize); } for (int i = 0; i < hours_.size(); i++) { output.writeInt64NoTag(hours_.get(i)); } if (getDurationList().size() > 0) { - output.writeRawVarint32(26); - output.writeRawVarint32(durationMemoizedSerializedSize); + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(durationMemoizedSerializedSize); } for (int i = 0; i < duration_.size(); i++) { output.writeInt64NoTag(duration_.get(i)); @@ -1564,7 +1564,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 5507263779623468977L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { diff --git a/warehouse/core/src/main/java/datawave/ingest/protobuf/TermWeight.java b/warehouse/core/src/main/java/datawave/ingest/protobuf/TermWeight.java index 5313274d3e1..8668ac7ede5 100644 --- a/warehouse/core/src/main/java/datawave/ingest/protobuf/TermWeight.java +++ b/warehouse/core/src/main/java/datawave/ingest/protobuf/TermWeight.java @@ -459,7 +459,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 7724463626444394328L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { diff --git a/warehouse/core/src/main/java/datawave/ingest/protobuf/Uid.java b/warehouse/core/src/main/java/datawave/ingest/protobuf/Uid.java index d1c3e42f2be..37ab9aa9456 100644 --- a/warehouse/core/src/main/java/datawave/ingest/protobuf/Uid.java +++ b/warehouse/core/src/main/java/datawave/ingest/protobuf/Uid.java @@ -441,7 +441,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 6738742719412472702L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { diff --git a/warehouse/core/src/main/java/datawave/ingest/util/cache/ReloadableCacheBuilder.java b/warehouse/core/src/main/java/datawave/ingest/util/cache/ReloadableCacheBuilder.java index b91eb838983..c75bef74e79 100644 --- a/warehouse/core/src/main/java/datawave/ingest/util/cache/ReloadableCacheBuilder.java +++ b/warehouse/core/src/main/java/datawave/ingest/util/cache/ReloadableCacheBuilder.java @@ -16,9 +16,9 @@ * Description: Keys consist of objects that are Reloadable, which identify if their underlying value has changed and enable it to reload the value * * Justification: Based upon Loader, which is further based upon CacheLoader. This enables us to have customized techniques for loading GUAVA caches, and - * reloading this elements when necessary + * reloading these elements when necessary */ -public class ReloadableCacheBuilder extends Loader { +public class ReloadableCacheBuilder,V> extends Loader { private static final Logger log = Logger.getLogger(ReloadableCacheBuilder.class); @@ -62,6 +62,7 @@ public ListenableFuture reload(K key, V oldValue) { * @see datawave.ingest.util.cache.Loader#build(java.lang.Object) */ @Override + @SuppressWarnings("unchecked") protected void build(K key) throws Exception { if (null == key) { @@ -69,7 +70,7 @@ protected void build(K key) throws Exception { log.trace("Rebuild all"); Collection watchers = entryCache.keySet(); for (K keyWatcher : watchers) { - Reloadable watcher = Reloadable.class.cast(keyWatcher); + Reloadable watcher = (Reloadable) keyWatcher; if (log.isTraceEnabled()) log.trace("rebuild " + watcher + " ? " + watcher.hasChanged()); @@ -78,13 +79,13 @@ protected void build(K key) throws Exception { if (log.isTraceEnabled()) log.trace("rebuild " + watcher + " ? " + watcher.hasChanged() + " " + watcher.reload()); - entryCache.put(keyWatcher, (V) watcher.reload()); + entryCache.put(keyWatcher, watcher.reload()); } } } } else { - Reloadable watcher = Reloadable.class.cast(key); + Reloadable watcher = (Reloadable) key; synchronized (entryCache) { entryCache.put(key, (V) watcher.reload()); } diff --git a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java index 67fef0102d2..c3e5437660e 100644 --- a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java +++ b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java @@ -1066,8 +1066,8 @@ protected static LocationStrategy getLocationStrategy(Configuration conf) { try { Class clazz = Class.forName(conf.get(RACKSTRATEGY, DefaultLocationStrategy.class.getCanonicalName())) .asSubclass(LocationStrategy.class); - return clazz.newInstance(); - } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { + return clazz.getDeclaredConstructor().newInstance(); + } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) { log.error(e); } return new DefaultLocationStrategy(); diff --git a/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java b/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java index e053efc798a..372224b2844 100644 --- a/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java +++ b/warehouse/core/src/main/java/datawave/mr/bulk/BulkIteratorEnvironment.java @@ -26,6 +26,7 @@ public BulkIteratorEnvironment(IteratorScope scope) { } @Override + @Deprecated public AccumuloConfiguration getConfig() { return conf; } @@ -46,6 +47,7 @@ public boolean isUserCompaction() { } @Override + @Deprecated public void registerSideChannel(SortedKeyValueIterator iter) { throw new UnsupportedOperationException(); } @@ -71,12 +73,14 @@ public SamplerConfiguration getSamplerConfiguration() { } @Override + @Deprecated public SortedKeyValueIterator reserveMapFileReader(String mapFileName) throws IOException { // TODO Auto-generated method stub return null; } @Override + @Deprecated public ServiceEnvironment getServiceEnv() { return null; } diff --git a/warehouse/core/src/main/java/datawave/util/ObjectFactory.java b/warehouse/core/src/main/java/datawave/util/ObjectFactory.java index db8e2bfc982..0800a4653db 100644 --- a/warehouse/core/src/main/java/datawave/util/ObjectFactory.java +++ b/warehouse/core/src/main/java/datawave/util/ObjectFactory.java @@ -49,7 +49,7 @@ public static Object create(String className, Object... args) { // Look for exact match try { - constructor = clazz.getConstructor(types.toArray(new Class[0])); + constructor = clazz.getConstructor(types.toArray(new Class[0])); } catch (NoSuchMethodException e) { logger.debug("No constructor for [" + className + "] in ObjectFactory.create())"); } @@ -59,7 +59,7 @@ public static Object create(String className, Object... args) { Constructor[] constructors = clazz.getConstructors(); for (int i = 0; i < constructors.length && constructor == null; i++) { Constructor c = constructors[i]; - Class ctypes[] = c.getParameterTypes(); + Class[] ctypes = c.getParameterTypes(); if (logger.isDebugEnabled()) { logger.debug("Checking:" + className + ", " + clazz); diff --git a/warehouse/core/src/test/java/datawave/data/hash/SnowflakeUIDTest.java b/warehouse/core/src/test/java/datawave/data/hash/SnowflakeUIDTest.java index 5e729ee1bc4..f7a638a77f0 100644 --- a/warehouse/core/src/test/java/datawave/data/hash/SnowflakeUIDTest.java +++ b/warehouse/core/src/test/java/datawave/data/hash/SnowflakeUIDTest.java @@ -74,7 +74,7 @@ public void testBuilder() throws ParseException { SnowflakeUIDBuilder result1 = (SnowflakeUIDBuilder) ((UIDBuilder) SnowflakeUID.builder()); assertNotNull(result1); assertNotNull(result1.toString()); - assertNull(((SnowflakeUID) result1.newId()).getSnowflake()); + assertNull((result1.newId()).getSnowflake()); assertNull(result1.newId(0).getSnowflake()); assertNull(result1.newId(System.currentTimeMillis(), 0).getSnowflake()); assertNull(result1.newId(System.currentTimeMillis()).getSnowflake()); diff --git a/warehouse/core/src/test/java/datawave/data/hash/UIDTest.java b/warehouse/core/src/test/java/datawave/data/hash/UIDTest.java index 70a3a7fecbe..bb86fe7f57b 100644 --- a/warehouse/core/src/test/java/datawave/data/hash/UIDTest.java +++ b/warehouse/core/src/test/java/datawave/data/hash/UIDTest.java @@ -477,10 +477,13 @@ public void testMiscellaneous() { * Test subclass akin to the StringUID */ private static class CustomHashUID extends HashUID { + private static final long serialVersionUID = 7205412670351903561L; + public CustomHashUID(HashUID template, String... extras) { super(template, extras); } + @SuppressWarnings("unchecked") public static HashUID parse(String s) { HashUID hashUid = HashUID.parse(s); if (null != hashUid) { @@ -495,10 +498,13 @@ public static HashUID parse(String s) { * Another test subclass akin to the StringUID */ private static class CustomSnowflakeUID extends SnowflakeUID { + private static final long serialVersionUID = -5932468265046243486L; + public CustomSnowflakeUID(SnowflakeUID template, String... extras) { super(template, extras); } + @SuppressWarnings("unchecked") public static SnowflakeUID parse(String s) { SnowflakeUID hashUid = SnowflakeUID.parse(s); if (null != hashUid) { @@ -510,6 +516,8 @@ public static SnowflakeUID parse(String s) { } private class TestUID extends UID { + private static final long serialVersionUID = 3780105804452735276L; + public TestUID(String prefix, boolean isPrefixOptional, String... extras) { super(prefix, isPrefixOptional, extras); } diff --git a/warehouse/core/src/test/java/datawave/edge/util/EdgeValueHelperTest.java b/warehouse/core/src/test/java/datawave/edge/util/EdgeValueHelperTest.java index 3db11340345..5dd691e1408 100644 --- a/warehouse/core/src/test/java/datawave/edge/util/EdgeValueHelperTest.java +++ b/warehouse/core/src/test/java/datawave/edge/util/EdgeValueHelperTest.java @@ -256,7 +256,7 @@ public void testReadOldActivity() { fail("Failed to encode variable length long array: " + e.getMessage()); } List oldAsList = EdgeValueHelper.decodeActivityHistogram(new Value(oldBytes)); - assertEquals(new Long(1l), oldAsList.get(6)); + assertEquals(Long.valueOf(1l), oldAsList.get(6)); } private static final Value NULL_VALUE = new Value(new byte[0]); diff --git a/warehouse/core/src/test/java/datawave/ingest/protobuf/TermWeightPositionTest.java b/warehouse/core/src/test/java/datawave/ingest/protobuf/TermWeightPositionTest.java index 6a8d3b48b77..88605cd799a 100644 --- a/warehouse/core/src/test/java/datawave/ingest/protobuf/TermWeightPositionTest.java +++ b/warehouse/core/src/test/java/datawave/ingest/protobuf/TermWeightPositionTest.java @@ -123,7 +123,7 @@ public void testBuilderReset() { @Test public void testPositionScoreToTermWeightScore() { - Float positionScore = new Float(-.0552721); + Float positionScore = Float.valueOf(-.0552721F); Integer twScore = TermWeightPosition.positionScoreToTermWeightScore(positionScore); Float result = TermWeightPosition.termWeightScoreToPositionScore(twScore); diff --git a/warehouse/core/src/test/java/datawave/util/cli/AccumuloArgsTest.java b/warehouse/core/src/test/java/datawave/util/cli/AccumuloArgsTest.java index 1c6634b59bb..02060611030 100644 --- a/warehouse/core/src/test/java/datawave/util/cli/AccumuloArgsTest.java +++ b/warehouse/core/src/test/java/datawave/util/cli/AccumuloArgsTest.java @@ -1,7 +1,6 @@ package datawave.util.cli; -import static org.hamcrest.CoreMatchers.is; -import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertEquals; import org.junit.Test; @@ -29,11 +28,11 @@ public void testNewBuilder() { .parse(argv); // @formatter:on - assertThat(args.user(), is("Bob")); - assertThat(args.password(), is("zekret")); - assertThat(args.instance(), is("instance")); - assertThat(args.zookeepers(), is("localhost:2181")); - assertThat(args.table(), is("testTable")); + assertEquals(args.user(), "Bob"); + assertEquals(args.password(), "zekret"); + assertEquals(args.instance(), "instance"); + assertEquals(args.zookeepers(), "localhost:2181"); + assertEquals(args.table(), "testTable"); } @Test @@ -58,13 +57,13 @@ public void testNewBuilder_WithExtraOpts() { .parse(argv); // @formatter:on - assertThat(args.user(), is("Steve")); - assertThat(args.password(), is("zekret")); - assertThat(args.instance(), is("instance")); - assertThat(args.zookeepers(), is("localhost:2181")); - assertThat(args.table(), is("testTable")); + assertEquals(args.user(), "Steve"); + assertEquals(args.password(), "zekret"); + assertEquals(args.instance(), "instance"); + assertEquals(args.zookeepers(), "localhost:2181"); + assertEquals(args.table(), "testTable"); // make sure extra args are available - assertThat(other.color, is("magenta")); + assertEquals(other.color, "magenta"); } private static class TestArg { diff --git a/warehouse/core/src/test/java/datawave/util/cli/PasswordConverterTest.java b/warehouse/core/src/test/java/datawave/util/cli/PasswordConverterTest.java index 65473776177..a473c14feb1 100644 --- a/warehouse/core/src/test/java/datawave/util/cli/PasswordConverterTest.java +++ b/warehouse/core/src/test/java/datawave/util/cli/PasswordConverterTest.java @@ -1,9 +1,6 @@ package datawave.util.cli; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.CoreMatchers.nullValue; -import static org.junit.Assert.assertThat; +import static org.junit.Assert.assertEquals; import org.junit.Before; import org.junit.Test; @@ -33,7 +30,7 @@ public void testConvertEnvPrefixed() { String name = System.getenv().keySet().iterator().next(); argv[1] = "env:" + name; new JCommander(password).parse(argv); - assertThat(password.password, is(equalTo(System.getenv(name)))); + assertEquals(password.password, System.getenv(name)); } @Test @@ -41,7 +38,7 @@ public void testConvertEnvPrefixedEmpty() { // prefix with no var defined should return null argv[1] = "env:"; new JCommander(password).parse(argv); - assertThat(password.password, is(nullValue())); + assertEquals(password.password, null); } @Test @@ -49,12 +46,12 @@ public void testConvertEnvPrefixedUndefinedEnvironmentVar() { // prefix with env var not defined should return null String name = "HighlyUnlikelyThisWillBeDefined"; // make sure it is not defined - assertThat("Expected " + name + " to not be defined but it was!", System.getenv(name), is(nullValue())); + assertEquals("Expected " + name + " to not be defined but it was!", null, System.getenv(name)); argv[1] = "env:" + name; new JCommander(password).parse(argv); - assertThat(password.password, is(nullValue())); + assertEquals(password.password, null); } @Test @@ -62,7 +59,7 @@ public void testConvertNonEnvPrefixed() { String expected = "behavior"; argv[1] = expected; new JCommander(password).parse(argv); - assertThat(password.password, is(equalTo(expected))); + assertEquals(password.password, expected); } } diff --git a/warehouse/index-stats/src/test/java/datawave/mapreduce/shardStats/MockMapDriver.java b/warehouse/index-stats/src/test/java/datawave/mapreduce/shardStats/MockMapDriver.java index aa9b24b1164..213a9a2d491 100644 --- a/warehouse/index-stats/src/test/java/datawave/mapreduce/shardStats/MockMapDriver.java +++ b/warehouse/index-stats/src/test/java/datawave/mapreduce/shardStats/MockMapDriver.java @@ -37,7 +37,7 @@ Configuration getConfiguration() { } void addInput(KEYIN key, VALUEIN value) { - MRPair pair = new MRPair(key, value); + MRPair pair = new MRPair<>(key, value); this.input.add(pair); } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/data/Type.java b/warehouse/ingest-core/src/main/java/datawave/ingest/data/Type.java index 1fc026f1445..81d7dffd857 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/data/Type.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/data/Type.java @@ -104,6 +104,7 @@ public void clearIngestHelper() { * - configuration to set * @return helper interface */ + @Deprecated public IngestHelperInterface newIngestHelper(Configuration conf) { IngestHelperInterface helper = newIngestHelper(); if (helper != null) { @@ -118,6 +119,7 @@ public IngestHelperInterface newIngestHelper(Configuration conf) { * @deprecated * @return helper interface */ + @Deprecated public IngestHelperInterface newIngestHelper() { IngestHelperInterface helper = null; if (helperClass != null) { @@ -134,8 +136,8 @@ public RecordReader newRecordReader() { RecordReader reader = null; if (readerClass != null) { try { - reader = readerClass.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + reader = readerClass.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { // ignore for now } } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/data/TypeRegistry.java b/warehouse/ingest-core/src/main/java/datawave/ingest/data/TypeRegistry.java index 98537561123..80503ff94df 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/data/TypeRegistry.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/data/TypeRegistry.java @@ -53,7 +53,7 @@ public class TypeRegistry extends HashMap { 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; diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/data/config/ingest/IngestFieldFilter.java b/warehouse/ingest-core/src/main/java/datawave/ingest/data/config/ingest/IngestFieldFilter.java index 06f637925cd..0f6654344ac 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/data/config/ingest/IngestFieldFilter.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/data/config/ingest/IngestFieldFilter.java @@ -47,7 +47,7 @@ public class IngestFieldFilter { private static final Logger logger = Logger.getLogger(IngestFieldFilter.class); - + private static final long serialVersionUID = 8288835090777714924L; @Deprecated public static final String FILTER_FIELD_SUFFIX = ".data.field.filter"; @@ -309,6 +309,7 @@ public Object setValue(Object value) { * A parsed field configuration ***************************************************************************/ class FieldConfiguration extends ArrayList implements List { + private static final long serialVersionUID = -6593828377509888969L; public FieldConfiguration() { diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/data/hash/StringUID.java b/warehouse/ingest-core/src/main/java/datawave/ingest/data/hash/StringUID.java index 390977cf820..25b8d3e1d21 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/data/hash/StringUID.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/data/hash/StringUID.java @@ -15,6 +15,7 @@ public class StringUID extends HashUID { protected String innerUid = null; protected String shardedPortion = null; + private static final long serialVersionUID = 9221118066352445606L; public StringUID(String uid) { innerUid = uid; diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/data/tokenize/TokenizationHelper.java b/warehouse/ingest-core/src/main/java/datawave/ingest/data/tokenize/TokenizationHelper.java index 931b2efa40e..dac97f1c4a6 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/data/tokenize/TokenizationHelper.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/data/tokenize/TokenizationHelper.java @@ -6,6 +6,7 @@ import org.apache.log4j.Logger; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.CharArraySet; +import org.apache.lucene.analysis.en.EnglishAnalyzer; import datawave.ingest.data.config.DataTypeHelper; import datawave.util.ObjectFactory; @@ -373,7 +374,7 @@ public static final CharArraySet getStopWords(DataTypeHelper helper, Configurati } } else { log.warn("Utilizing default stopword set. Tokenization and indexing may generate unwanted data"); - stopWords = org.apache.lucene.analysis.core.StopAnalyzer.ENGLISH_STOP_WORDS_SET; + stopWords = EnglishAnalyzer.ENGLISH_STOP_WORDS_SET; } return stopWords; } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/EventMapper.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/EventMapper.java index edce34ef644..7c554139f55 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/EventMapper.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/EventMapper.java @@ -243,7 +243,7 @@ public void setup(Context context) throws IOException, InterruptedException { if (lastFilter != null) { try { - KeyValueFilter filter = lastFilter.newInstance(); + KeyValueFilter filter = lastFilter.getDeclaredConstructor().newInstance(); filter.configureChainedContextWriter(filterConf, contextWriterClass); } catch (Exception e) { throw new IOException("Unable to configure " + contextWriterClass + " on " + lastFilter, e); @@ -321,12 +321,12 @@ private List> loadDataType(String typeStr, Context context) for (String validatorClass : validatorClasses) { try { Class clazz = Class.forName(validatorClass).asSubclass(FieldValidator.class); - FieldValidator validator = clazz.newInstance(); + FieldValidator validator = clazz.getDeclaredConstructor().newInstance(); validator.init(t, context.getConfiguration()); validators.put(typeStr, validator); } catch (ClassNotFoundException e) { log.error("Error finding validator " + validatorClass, e); - } catch (InstantiationException | IllegalAccessException e) { + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { log.error("Error creating validator " + validatorClass, e); } } @@ -776,7 +776,7 @@ public void processEvent(K1 key, RawRecordContainer value, List @SuppressWarnings("unchecked") Class> projClazz = (Class>) Class.forName(predClazzStr).asSubclass(Predicate.class); - fieldFilterPredicate = projClazz.newInstance(); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + fieldFilterPredicate = projClazz.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { throw new RuntimeException(e); } } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/ConstraintChecker.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/ConstraintChecker.java index 7805bd98e74..a3d61ed8972 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/ConstraintChecker.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/ConstraintChecker.java @@ -38,7 +38,8 @@ public static ConstraintChecker create(Configuration conf) { } try { - ConstraintInitializer initializer = Class.forName(initializerClass).asSubclass(ConstraintInitializer.class).newInstance(); + ConstraintInitializer initializer = Class.forName(initializerClass).asSubclass(ConstraintInitializer.class).getDeclaredConstructor() + .newInstance(); initializer.addConstraints(conf, constraints); } catch (Exception e) { @@ -99,6 +100,8 @@ 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 = -9068071363548359998L; + public ConstraintViolationException(Text table, VisibilityConstraint constraint) { super(String.format("Visibility constraint '%s' violated for table '%s'", constraint, table)); } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/IngestJob.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/IngestJob.java index 1ce144bfa49..9d78b0441d5 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/IngestJob.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/IngestJob.java @@ -753,10 +753,10 @@ protected Configuration parseArguments(String[] args, Configuration conf) throws for (String jobObserverClass : classes) { log.info("Adding job observer: " + jobObserverClass); Class clazz = Class.forName(jobObserverClass); - Observer o = (Observer) clazz.newInstance(); + Observer o = (Observer) clazz.getDeclaredConstructor().newInstance(); jobObservers.add(o); } - } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) { + } catch (ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e) { log.error("cannot instantiate job observer class '" + jobObserverClasses + "'", e); System.exit(-2); } catch (ClassCastException e) { diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/MultiRFileOutputFormatter.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/MultiRFileOutputFormatter.java index 1495bf78b82..a146fbcb737 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/MultiRFileOutputFormatter.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/MultiRFileOutputFormatter.java @@ -146,7 +146,7 @@ public static void setCompressionTableDisallowList(Configuration conf, Set getCompressionTableDisallowList(Configuration conf) { String tableListString = conf.get(COMPRESSION_DISALLOWLIST); if (tableListString == null) { - return Collections.EMPTY_SET; + return Collections.emptySet(); } else { String[] tables = StringUtils.split(tableListString, ','); return new HashSet<>(Arrays.asList(tables)); @@ -398,7 +398,7 @@ protected void setTableIdsAndConfigs() throws IOException { TableConfigurationUtil tcu = new TableConfigurationUtil(conf); - tableIds = tcu.getJobOutputTableNames(conf); + tableIds = TableConfigurationUtil.getJobOutputTableNames(conf); Set compressionTableDisallowList = getCompressionTableDisallowList(conf); String compressionType = getCompressionType(conf); for (String tableName : tableIds) { diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/PartitionerCache.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/PartitionerCache.java index 77dc7017560..b2119c575d5 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/PartitionerCache.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/PartitionerCache.java @@ -240,7 +240,7 @@ private Class> getPartitionerClass(St // that private Partitioner createConfiguredPartitioner(Class> clazz, String prefix) { try { - Partitioner partitioner = clazz.newInstance(); + Partitioner partitioner = clazz.getDeclaredConstructor().newInstance(); if (partitioner instanceof Configurable) { ((Configurable) partitioner).setConf(conf); } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TableConfigurationUtil.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TableConfigurationUtil.java index b9fa2c2f980..ba9d6d5e7f5 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TableConfigurationUtil.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TableConfigurationUtil.java @@ -147,8 +147,8 @@ public static Set extractTableNames(Configuration conf) throws IllegalAr } DataTypeHandler handler; try { - handler = handlerClass.newInstance(); - } catch (InstantiationException e) { + handler = handlerClass.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | NoSuchMethodException | InvocationTargetException e) { throw new IllegalArgumentException("Unable to instantiate " + handlerClassName, e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Unable to access default constructor for " + handlerClassName, e); @@ -374,8 +374,8 @@ public static Map getTablePriorities(Configuration conf) { } DataTypeHandler handler; try { - handler = handlerClass.newInstance(); - } catch (InstantiationException e) { + handler = handlerClass.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | NoSuchMethodException | InvocationTargetException e) { throw new IllegalArgumentException("Unable to instantiate " + handlerClassName, e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Unable to access default constructor for " + handlerClassName, e); diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TablePartitionerOffsets.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TablePartitionerOffsets.java index 580aa31930b..667f3d44650 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TablePartitionerOffsets.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/TablePartitionerOffsets.java @@ -19,6 +19,7 @@ public class TablePartitionerOffsets extends HashMap { private final Configuration conf; private final PartitionerCache partitionerCache; private final int reduceTasks; + private static final long serialVersionUID = -1767994113482201024L; public TablePartitionerOffsets(Configuration conf, List tableNames, PartitionerCache partitionerCache) throws ClassNotFoundException { super(); diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/metrics/MetricsConfiguration.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/metrics/MetricsConfiguration.java index 9f343a0d45f..df1a25b8dfa 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/metrics/MetricsConfiguration.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/metrics/MetricsConfiguration.java @@ -65,7 +65,7 @@ public static Collection getReceivers(Configuration conf) { try { receiverClass = receiverClass.trim(); Class clazz = (Class) Class.forName(receiverClass); - receivers.add(clazz.newInstance()); + receivers.add(clazz.getDeclaredConstructor().newInstance()); } catch (Exception e) { logger.error("Could not instantiate receiver: " + receiverClass + ", skipping...", e); } diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/writer/AbstractChainedContextWriter.java b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/writer/AbstractChainedContextWriter.java index 842c028da10..adfe8429a8a 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/writer/AbstractChainedContextWriter.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/mapreduce/job/writer/AbstractChainedContextWriter.java @@ -42,7 +42,7 @@ public void setup(Configuration conf, boolean outputTableCounters) throws IOExce + getChainedContextWriterOption()); } try { - contextWriter = contextWriterClass.newInstance(); + contextWriter = contextWriterClass.getDeclaredConstructor().newInstance(); contextWriter.setup(conf, outputTableCounters); } catch (Exception e) { throw new IOException("Failed to initialized " + contextWriterClass + " from property " + getChainedContextWriterOption(), e); diff --git a/warehouse/ingest-core/src/main/java/datawave/ingest/protobuf/RawRecordContainer.java b/warehouse/ingest-core/src/main/java/datawave/ingest/protobuf/RawRecordContainer.java index ab4b53314c9..cd40770f698 100644 --- a/warehouse/ingest-core/src/main/java/datawave/ingest/protobuf/RawRecordContainer.java +++ b/warehouse/ingest-core/src/main/java/datawave/ingest/protobuf/RawRecordContainer.java @@ -875,7 +875,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 1837305830954470331L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { diff --git a/warehouse/ingest-core/src/main/java/datawave/iterators/StatsLinksEdgeCombiner.java b/warehouse/ingest-core/src/main/java/datawave/iterators/StatsLinksEdgeCombiner.java index 7b02b0c1d11..b48b3376d01 100644 --- a/warehouse/ingest-core/src/main/java/datawave/iterators/StatsLinksEdgeCombiner.java +++ b/warehouse/ingest-core/src/main/java/datawave/iterators/StatsLinksEdgeCombiner.java @@ -154,7 +154,7 @@ public void seek(final Range range, final Collection columnFamilie @Override public SortedKeyValueIterator deepCopy(final IteratorEnvironment env) { try { - final StatsLinksEdgeCombiner newInstance = this.getClass().newInstance(); + final StatsLinksEdgeCombiner newInstance = this.getClass().getDeclaredConstructor().newInstance(); newInstance.setSource(getSource().deepCopy(env)); return (newInstance); diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/EventMapperTest.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/EventMapperTest.java index b0248906afa..4f5b783a675 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/EventMapperTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/EventMapperTest.java @@ -110,7 +110,7 @@ record = new SimpleRawRecord(); TaskAttemptID id = new TaskAttemptID(); expect(mapContext.getTaskAttemptID()).andReturn(id).anyTimes(); - StandaloneTaskAttemptContext standaloneContext = new StandaloneTaskAttemptContext(conf, new StandaloneStatusReporter()); + StandaloneTaskAttemptContext standaloneContext = new StandaloneTaskAttemptContext<>(conf, new StandaloneStatusReporter()); expect(mapContext.getCounter(anyObject())).andDelegateTo(standaloneContext).anyTimes(); expect(mapContext.getCounter(anyString(), anyString())).andDelegateTo(standaloneContext).anyTimes(); diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/SimpleDataTypeHelper.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/SimpleDataTypeHelper.java index 6dfd7758664..a5dbe4bdd1a 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/SimpleDataTypeHelper.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/SimpleDataTypeHelper.java @@ -38,7 +38,7 @@ public static void registerFields(Multimap f) */ public static IngestHelperInterface create() { ClassLoader cl = SimpleDataTypeHelper.class.getClassLoader(); - return (IngestHelperInterface) Proxy.newProxyInstance(cl, new Class[] {IngestHelperInterface.class}, new SimpleDataTypeHelper()); + return (IngestHelperInterface) Proxy.newProxyInstance(cl, new Class[] {IngestHelperInterface.class}, new SimpleDataTypeHelper()); } @Override diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/TablePropertiesMap.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/TablePropertiesMap.java index 10d4638b34f..3bbb6d86d6b 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/TablePropertiesMap.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/TablePropertiesMap.java @@ -11,6 +11,8 @@ * The Accumulo table properties represented as a Map. */ public class TablePropertiesMap extends TreeMap { + private static final long serialVersionUID = -5825311588298970146L; + public TablePropertiesMap(TableOperations tops, String tableName) throws AccumuloException, TableNotFoundException { for (Map.Entry entry : tops.getProperties(tableName)) { put(entry.getKey(), entry.getValue()); diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/job/statsd/CounterToStatsDConfigurationTest.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/job/statsd/CounterToStatsDConfigurationTest.java index fffa0467cf9..01c207b180d 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/job/statsd/CounterToStatsDConfigurationTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/job/statsd/CounterToStatsDConfigurationTest.java @@ -163,6 +163,7 @@ public TestCounter(String name) { } @Override + @Deprecated public void setDisplayName(String displayName) { } diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LimitedKeyPartitionerTest.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LimitedKeyPartitionerTest.java index ce1714b39cc..52ac8ec4222 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LimitedKeyPartitionerTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LimitedKeyPartitionerTest.java @@ -15,11 +15,11 @@ public class LimitedKeyPartitionerTest { private static final int NUM_REDUCERS = 1000; @Test - public void testLimitedRangeSetViaGenericConfig() throws IllegalAccessException, InstantiationException { + public void testLimitedRangeSetViaGenericConfig() throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { Configuration conf = new Configuration(); conf.setInt(PartitionLimiter.MAX_PARTITIONS_PROPERTY, 8); - LimitedKeyPartitioner partitioner = LimitedKeyPartitioner.class.newInstance(); + LimitedKeyPartitioner partitioner = LimitedKeyPartitioner.class.getDeclaredConstructor().newInstance(); partitioner.setConf(conf); assertPartitionsUnderMax(partitioner, 8); @@ -47,11 +47,11 @@ private void assertPartitionsUnderMax(LimitedKeyPartitioner partitioner, int exp } @Test - public void testHigherMaxThanReducers() throws IllegalAccessException, InstantiationException { + public void testHigherMaxThanReducers() throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { Configuration conf = new Configuration(); conf.setInt(PartitionLimiter.MAX_PARTITIONS_PROPERTY, NUM_REDUCERS + 1); - LimitedKeyPartitioner partitioner = LimitedKeyPartitioner.class.newInstance(); + LimitedKeyPartitioner partitioner = LimitedKeyPartitioner.class.getDeclaredConstructor().newInstance(); partitioner.setConf(conf); assertPartitionsUnderMax(partitioner, NUM_REDUCERS); } diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LocalityGroupPartitionerTest.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LocalityGroupPartitionerTest.java index 0a7a932c14c..5d14164c164 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LocalityGroupPartitionerTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/LocalityGroupPartitionerTest.java @@ -42,7 +42,7 @@ public void testGetPartitionNewColFam() throws Exception { String tableName = "tableX"; conf.set(tableName + "." + LocalityGroupPartitioner.COLUMN_FAMILIES, "CITY,STATE"); - LocalityGroupPartitioner partitioner = LocalityGroupPartitioner.class.newInstance(); + LocalityGroupPartitioner partitioner = LocalityGroupPartitioner.class.getDeclaredConstructor().newInstance(); partitioner.setConf(conf); partitioner.configureWithPrefix(tableName); diff --git a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/RowHashingPartitionerTest.java b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/RowHashingPartitionerTest.java index bbd7e2f0a5d..63c80b7b624 100644 --- a/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/RowHashingPartitionerTest.java +++ b/warehouse/ingest-core/src/test/java/datawave/ingest/mapreduce/partition/RowHashingPartitionerTest.java @@ -67,12 +67,12 @@ public void testConfigureByTable() throws IllegalAccessException, InstantiationE } @Test - public void testMultipleColFamiliesPerRow() throws IllegalAccessException, InstantiationException { + public void testMultipleColFamiliesPerRow() throws IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { Configuration conf = new Configuration(); String tableName = "tableX"; conf.set(tableName + "." + RowHashingPartitioner.COLUMN_FAMILIES, "CITY,STATE"); - RowHashingPartitioner partitioner = RowHashingPartitioner.class.newInstance(); + RowHashingPartitioner partitioner = RowHashingPartitioner.class.getDeclaredConstructor().newInstance(); partitioner.setConf(conf); partitioner.configureWithPrefix(tableName); diff --git a/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/TableConfigurationUtilTest.java b/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/TableConfigurationUtilTest.java index 8c6afcf9d63..3d79e5d41ab 100644 --- a/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/TableConfigurationUtilTest.java +++ b/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/TableConfigurationUtilTest.java @@ -178,9 +178,9 @@ public void testDeserializeOutputTableNotInCache() throws AccumuloSecurityExcept tcu.serializeTableConfgurationIntoConf(conf); TableConfigCache.getCurrentCache(conf).clear(); - tcu.addOutputTables("audit", conf); + TableConfigurationUtil.addOutputTables("audit", conf); - tcu.deserializeTableConfigs(conf); + TableConfigurationUtil.deserializeTableConfigs(conf); } @@ -196,7 +196,7 @@ public void testOutputTableNotInCache() throws AccumuloSecurityException, Accumu tcu.updateCacheFile(); - tcu.addOutputTables("nonexistent_table", conf); + TableConfigurationUtil.addOutputTables("nonexistent_table", conf); try { tcu.serializeTableConfgurationIntoConf(conf); } finally { diff --git a/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/mr/handler/ContentCSVIndexingColumnBasedHandlerTest.java b/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/mr/handler/ContentCSVIndexingColumnBasedHandlerTest.java index 323b8045559..426fdf7ec77 100644 --- a/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/mr/handler/ContentCSVIndexingColumnBasedHandlerTest.java +++ b/warehouse/ingest-csv/src/test/java/datawave/ingest/csv/mr/handler/ContentCSVIndexingColumnBasedHandlerTest.java @@ -41,9 +41,9 @@ public class ContentCSVIndexingColumnBasedHandlerTest { private Configuration conf; - private static Path edgeKeyVersionCachePath = Paths.get(System.getProperty("user.dir"), "edge-key-version.txt"); + private static final Path edgeKeyVersionCachePath = Paths.get(System.getProperty("user.dir"), "edge-key-version.txt"); private static Logger log = Logger.getLogger(ContentCSVIndexingColumnBasedHandlerTest.class); - private static Enumeration rootAppenders = Logger.getRootLogger().getAllAppenders(); + private static final Enumeration rootAppenders = Logger.getRootLogger().getAllAppenders(); @BeforeClass public static void setupSystemSettings() throws Exception { diff --git a/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonDataTypeHelper.java b/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonDataTypeHelper.java index c9e55e94227..a131e6a0107 100644 --- a/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonDataTypeHelper.java +++ b/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonDataTypeHelper.java @@ -73,13 +73,13 @@ public JsonObjectFlattener newFlattener() { } else if (null != this.getFieldAllowlist()) { allowlistFields = this.getFieldAllowlist(); } else { - allowlistFields = Collections.EMPTY_SET; + allowlistFields = Collections.emptySet(); } if (null != this.getFieldDisallowlist()) { disallowlistFields = this.getFieldDisallowlist(); } else { - disallowlistFields = Collections.EMPTY_SET; + disallowlistFields = Collections.emptySet(); } return new JsonIngestFlattener.Builder().jsonDataTypeHelper(this).mapKeyAllowlist(allowlistFields).mapKeyDisallowlist(disallowlistFields) diff --git a/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestFlattener.java b/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestFlattener.java index a38b8e21580..1d6dad7daf3 100644 --- a/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestFlattener.java +++ b/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestFlattener.java @@ -287,8 +287,7 @@ private void flattenAndPrint(JsonObject jsonObject) { } private void setupIterator(JsonReader reader) { - JsonParser parser = new JsonParser(); - JsonElement root = parser.parse(reader); + JsonElement root = JsonParser.parseReader(reader); if (root.isJsonArray()) { // Currently positioned to read a set of objects diff --git a/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestHelper.java b/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestHelper.java index d85b211f075..7089e742a58 100644 --- a/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestHelper.java +++ b/warehouse/ingest-json/src/main/java/datawave/ingest/json/config/helper/JsonIngestHelper.java @@ -47,8 +47,7 @@ public Multimap getEventFields(RawRecordConta HashMultimap fields = HashMultimap.create(); String jsonString = new String(event.getRawData()); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(jsonString); + JsonElement jsonElement = JsonParser.parseString(jsonString); flattener.flatten(jsonElement.getAsJsonObject(), fields); return normalizeMap(getGroupNormalizedMap(fields)); diff --git a/warehouse/ingest-json/src/main/java/datawave/ingest/json/mr/input/JsonRecordReader.java b/warehouse/ingest-json/src/main/java/datawave/ingest/json/mr/input/JsonRecordReader.java index 520b8f55337..ac8962b5ed3 100644 --- a/warehouse/ingest-json/src/main/java/datawave/ingest/json/mr/input/JsonRecordReader.java +++ b/warehouse/ingest-json/src/main/java/datawave/ingest/json/mr/input/JsonRecordReader.java @@ -155,8 +155,7 @@ protected void setupReader(InputStream is) { } protected void setupIterator(JsonReader reader) { - JsonParser parser = new JsonParser(); - JsonElement root = parser.parse(reader); + JsonElement root = JsonParser.parseReader(reader); if (root.isJsonArray()) { // Currently positioned to read a set of objects diff --git a/warehouse/ingest-json/src/test/java/datawave/ingest/json/config/helper/JsonIngestFlattenerTest.java b/warehouse/ingest-json/src/test/java/datawave/ingest/json/config/helper/JsonIngestFlattenerTest.java index fd808e0c60e..8e5bcbd9782 100644 --- a/warehouse/ingest-json/src/test/java/datawave/ingest/json/config/helper/JsonIngestFlattenerTest.java +++ b/warehouse/ingest-json/src/test/java/datawave/ingest/json/config/helper/JsonIngestFlattenerTest.java @@ -35,8 +35,7 @@ public static void setup() throws URISyntaxException, IOException { public void testFlattenGROUPED() throws Exception { JsonObjectFlattener flattener = new JsonIngestFlattener.Builder().flattenMode(FlattenMode.GROUPED).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -55,8 +54,7 @@ public void testFlattenGROUPED() throws Exception { public void testFlattenGROUPED_AND_NORMAL() throws Exception { JsonObjectFlattener flattener = new JsonIngestFlattener.Builder().flattenMode(FlattenMode.GROUPED_AND_NORMAL).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); diff --git a/warehouse/ingest-json/src/test/java/datawave/ingest/json/mr/handler/ContentJsonColumnBasedHandlerTest.java b/warehouse/ingest-json/src/test/java/datawave/ingest/json/mr/handler/ContentJsonColumnBasedHandlerTest.java index 0b199c5da57..555eddaeb53 100644 --- a/warehouse/ingest-json/src/test/java/datawave/ingest/json/mr/handler/ContentJsonColumnBasedHandlerTest.java +++ b/warehouse/ingest-json/src/test/java/datawave/ingest/json/mr/handler/ContentJsonColumnBasedHandlerTest.java @@ -46,9 +46,9 @@ public class ContentJsonColumnBasedHandlerTest { private static final boolean PRINT_GENERATED_KEYS_ONLY_ON_FAIL = true; private Configuration conf; - private static Path edgeKeyVersionCachePath = Paths.get(System.getProperty("user.dir"), "edge-key-version.txt"); + private static final Path edgeKeyVersionCachePath = Paths.get(System.getProperty("user.dir"), "edge-key-version.txt"); private static Logger log = Logger.getLogger(ContentJsonColumnBasedHandlerTest.class); - private static Enumeration rootAppenders = Logger.getRootLogger().getAllAppenders(); + private static final Enumeration rootAppenders = Logger.getRootLogger().getAllAppenders(); @BeforeClass public static void setupSystemSettings() throws Exception { diff --git a/warehouse/ingest-json/src/test/java/datawave/ingest/json/util/JsonObjectFlattenerImplTest.java b/warehouse/ingest-json/src/test/java/datawave/ingest/json/util/JsonObjectFlattenerImplTest.java index c5c7f7b0112..e4233d58ee6 100644 --- a/warehouse/ingest-json/src/test/java/datawave/ingest/json/util/JsonObjectFlattenerImplTest.java +++ b/warehouse/ingest-json/src/test/java/datawave/ingest/json/util/JsonObjectFlattenerImplTest.java @@ -63,8 +63,7 @@ public static void setup() throws URISyntaxException, IOException { public void testFlattenAndForceUpperCaseKeys() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().pathDelimiter(".").mapKeyValueNormalizer(toUpperCaseNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -80,8 +79,7 @@ public void testFlattenAndForceLowerCaseKeys() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().pathDelimiter(".").mapKeyValueNormalizer(toLowerCaseNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -99,8 +97,7 @@ public void testFlattenWithDisallowlist() throws Exception { .mapKeyDisallowlist(new HashSet<>(Arrays.asList("ROOTOBJECT.NUMBER2", "ROOTOBJECT.STRING2"))).pathDelimiter(".") .mapKeyValueNormalizer(toUpperCaseNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -118,8 +115,7 @@ public void testFlattenWithAllowlist() throws Exception { .mapKeyAllowlist(new HashSet<>(Arrays.asList("ROOTOBJECT.NUMBER2", "ROOTOBJECT.STRING2"))).pathDelimiter(".") .mapKeyValueNormalizer(toUpperCaseNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -137,8 +133,7 @@ public void testFlattenWithAllowlistDisallowlistConflict() throws Exception { .mapKeyDisallowlist(new HashSet<>(Arrays.asList("ROOTOBJECT.NUMBER2"))).pathDelimiter(".").mapKeyValueNormalizer(toUpperCaseNormalizer) .build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -151,8 +146,7 @@ public void testFlattenWithAllowlistDisallowlistConflict() throws Exception { public void testFlattenPreserveCaseIncludingPrefix() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().pathDelimiter("_").mapKeyValueNormalizer(noOpNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -167,8 +161,7 @@ public void testFlattenPreserveCaseIncludingPrefix() throws Exception { public void testFlattenModeSIMPLE() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().flattenMode(FlattenMode.SIMPLE).mapKeyValueNormalizer(noOpNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -188,8 +181,7 @@ public void testFlattenWithGroupingContext() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().flattenMode(FlattenMode.GROUPED).occurrenceInGroupDelimiter("#") .mapKeyValueNormalizer(noOpNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -209,8 +201,7 @@ public void testFlattenGROUPED_AND_NORMAL() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().flattenMode(FlattenMode.GROUPED_AND_NORMAL).occurrenceInGroupDelimiter("_") .pathDelimiter(".").mapKeyValueNormalizer(noOpNormalizer).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); Multimap fieldMap = flattener.flatten(jsonElement.getAsJsonObject()); // printJson(json); @@ -237,8 +228,7 @@ public void testFlattenGROUPED_AND_NORMAL() throws Exception { public void testGroupingContextWithBadJson() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().flattenMode(FlattenMode.GROUPED).occurrenceInGroupDelimiter("#").build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); JsonObject job = jsonElement.getAsJsonObject(); job.addProperty("illegal.key.format", "key name already has our path delimiter!"); @@ -255,8 +245,7 @@ public void testGroupingContextWithBadDelimiterConfig() throws Exception { JsonObjectFlattener flattener = new JsonObjectFlattenerImpl.Builder().pathDelimiter(".").occurrenceInGroupDelimiter(".") .flattenMode(FlattenMode.GROUPED).build(); - JsonParser parser = new JsonParser(); - JsonElement jsonElement = parser.parse(json); + JsonElement jsonElement = JsonParser.parseString(json); JsonObject job = jsonElement.getAsJsonObject(); try { diff --git a/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaDataTypeHandler.java b/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaDataTypeHandler.java index 7acfa9ddc6e..41ad90dbabb 100644 --- a/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaDataTypeHandler.java +++ b/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaDataTypeHandler.java @@ -472,7 +472,7 @@ protected void processTerm(RawRecordContainer event, int position, String term, // Now add the offset to the token offset queue, and if we overflow then output the overflow if (tokenOffsetCache != null) { - OffsetList overflow = tokenOffsetCache.addOffset(indexedTermAndZone, position); + OffsetList overflow = tokenOffsetCache.addOffset(indexedTermAndZone, position); if (overflow != null) { // no need to normalize as that was already done upon insertion into the token offset cache NormalizedFieldAndValue overflowNfv = new NormalizedFieldAndValue(overflow.termAndZone.zone, overflow.termAndZone.term); diff --git a/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaIngestHelper.java b/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaIngestHelper.java index e989eecee48..b50d2963317 100644 --- a/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaIngestHelper.java +++ b/warehouse/ingest-wikipedia/src/main/java/datawave/ingest/wikipedia/WikipediaIngestHelper.java @@ -20,7 +20,6 @@ import datawave.ingest.data.RawDataErrorNames; import datawave.ingest.data.RawRecordContainer; import datawave.ingest.data.config.NormalizedContentInterface; -import datawave.ingest.data.config.ingest.BaseIngestHelper; import datawave.ingest.data.config.ingest.IndexOnlyIngestHelperInterface; import datawave.ingest.data.config.ingest.TermFrequencyIngestHelperInterface; import datawave.ingest.mapreduce.handler.tokenize.ExtendedContentIngestHelper; diff --git a/warehouse/ops-tools/index-validation/src/main/java/datawave/index/validation/AccumuloIndexAgeDisplay.java b/warehouse/ops-tools/index-validation/src/main/java/datawave/index/validation/AccumuloIndexAgeDisplay.java index 6172d9dbae9..b368387c2cf 100644 --- a/warehouse/ops-tools/index-validation/src/main/java/datawave/index/validation/AccumuloIndexAgeDisplay.java +++ b/warehouse/ops-tools/index-validation/src/main/java/datawave/index/validation/AccumuloIndexAgeDisplay.java @@ -44,7 +44,7 @@ public class AccumuloIndexAgeDisplay implements AutoCloseable { private Integer buckets[] = {180, 90, 60, 30, 14, 7, 2}; - private ArrayList[] dataBuckets; + private ArrayList> dataBuckets; public AccumuloIndexAgeDisplay(AccumuloClient accumuloClient, String tableName, String columns, Integer[] buckets) { this.tableName = tableName; @@ -163,9 +163,10 @@ private Scanner addColumnsToScanner(Scanner scanner) { * Pull data from accumulo, create a collection of delete cmds for th accumulo script for {@code indexes > 1 day} */ public void extractDataFromAccumulo() { - dataBuckets = new ArrayList[buckets.length]; - for (int ii = 0; ii < dataBuckets.length; ii++) { - dataBuckets[ii] = new ArrayList<>(); + dataBuckets = new ArrayList<>(); + + for (int ii = 0; ii < buckets.length; ii++) { + dataBuckets.add(new ArrayList<>()); } Scanner scanner = null; @@ -187,7 +188,7 @@ public void extractDataFromAccumulo() { // separate the data according to the bucket they will be dropped into for (int age : buckets) { if (rowAge <= (currentTime - (age * MILLIS_IN_DAY))) { // don't delete indexes < 1 day old - dataBuckets[bucketIndex].add((deleteCommand.toString()).replace("\0", "\\x00")); + dataBuckets.get(bucketIndex).add((deleteCommand.toString()).replace("\0", "\\x00")); break; } bucketIndex++; @@ -236,7 +237,7 @@ public String logAgeSummary() { StringBuilder sb = new StringBuilder(); for (int ii = buckets.length - 1; ii >= 0; --ii) { - sb.append(String.format("\nIndexes older than %1$-3d %2$-6s %3$10d", buckets[ii], "days:", dataBuckets[ii].size())); + sb.append(String.format("\nIndexes older than %1$-3d %2$-6s %3$10d", buckets[ii], "days:", dataBuckets.get(ii).size())); } sb.append("\n"); @@ -263,7 +264,7 @@ public void createAccumuloShellScript(String fileName) { for (int ii = 0; ii < buckets.length; ii++) { pw.println("# Indexes older than " + buckets[ii] + " days:"); - ArrayList al = dataBuckets[ii]; + ArrayList al = dataBuckets.get(ii); for (String row : al) { pw.println(row); } diff --git a/warehouse/pom.xml b/warehouse/pom.xml index 028b013d820..f3dae919d66 100644 --- a/warehouse/pom.xml +++ b/warehouse/pom.xml @@ -56,12 +56,6 @@ - - com.cenqua.clover - clover - 3.1.4 - compile - com.clearspring.analytics stream @@ -382,6 +376,12 @@ jetty ${version.jetty} + + org.openclover + clover + 4.5.1 + compile + org.ow2.asm asm diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/ColumnRangeIterator.java b/warehouse/query-core/src/main/java/datawave/core/iterators/ColumnRangeIterator.java index 530cd278b81..868f5df2dab 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/ColumnRangeIterator.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/ColumnRangeIterator.java @@ -190,6 +190,7 @@ protected Text getColumnStart() { } public static class ScanLimitReached extends RuntimeException { + private static final long serialVersionUID = -4309625828059464853L; private final Key lastKey; public ScanLimitReached(Key key, String message) { diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexListIteratorJexl.java b/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexListIteratorJexl.java index fa232bb83b4..a3c541b5c04 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexListIteratorJexl.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/DatawaveFieldIndexListIteratorJexl.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -247,11 +248,15 @@ public static FST loadFSTFromFile(Path filename, String compressionCodec throw new IllegalArgumentException("Compression codec " + compressionCodec + " in not a subclass of CompressionCodec.", e); } try { - codec = codecClass.newInstance(); + codec = codecClass.getDeclaredConstructor().newInstance(); } catch (InstantiationException e) { throw new IllegalArgumentException("Compression codec " + compressionCodec + " could not be instantiated.", e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Compression codec " + compressionCodec + " could not be accessed.", e); + } catch (InvocationTargetException e) { + throw new IllegalArgumentException("Compression code " + compressionCodec + " could not be invoked.", e); + } catch (NoSuchMethodException e) { + throw new IllegalArgumentException("Comporession code " + compressionCodec + " method not found. ", e); } } diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/EnrichingIterator.java b/warehouse/query-core/src/main/java/datawave/core/iterators/EnrichingIterator.java index a49f129e765..7a383ad9c0f 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/EnrichingIterator.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/EnrichingIterator.java @@ -128,13 +128,17 @@ public void init(SortedKeyValueIterator source, Map op try { @SuppressWarnings("unchecked") Class> iterClz = (Class>) Class.forName(subClass); - subIter = iterClz.newInstance(); + subIter = iterClz.getDeclaredConstructor().newInstance(); } catch (ClassNotFoundException e) { log.error("ClassNotFoundException when trying to instantiate the sub iterator.", e); } catch (InstantiationException e) { log.error("InstantiationException when trying to instantiate the sub iterator.", e); } catch (IllegalAccessException e) { log.error("IllegalAccessException when trying to instantiate the sub iterator.", e); + } catch (InvocationTargetException e) { + log.error("InvocationTargetException when trying to instantiate the sub iterator.", e); + } catch (NoSuchMethodException e) { + log.error("NoSuchMethodException when trying to instantiate the sub iterator", e); } if (subIter == null) { diff --git a/warehouse/query-core/src/main/java/datawave/core/iterators/querylock/ZookeeperQueryLock.java b/warehouse/query-core/src/main/java/datawave/core/iterators/querylock/ZookeeperQueryLock.java index 6fcd2ed4131..d270b6b2087 100644 --- a/warehouse/query-core/src/main/java/datawave/core/iterators/querylock/ZookeeperQueryLock.java +++ b/warehouse/query-core/src/main/java/datawave/core/iterators/querylock/ZookeeperQueryLock.java @@ -233,6 +233,7 @@ protected void finalize() throws Throwable { } public static class ZookeeperLockException extends Exception { + private static final long serialVersionUID = 3715643514712028373L; public ZookeeperLockException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeBag.java b/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeBag.java index 4278f2235f9..9ba8a2b11f9 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeBag.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeBag.java @@ -16,7 +16,7 @@ public abstract class AttributeBag> extends Attribute 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; diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeFactory.java b/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeFactory.java index 49b74b3c194..01b7f3026bf 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeFactory.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/AttributeFactory.java @@ -133,7 +133,7 @@ public Class apply(@Nullable String s) { } protected Attribute getAttribute(Class dataTypeClass, String fieldName, String data, Key key, boolean toKeep) throws Exception { - Type type = (Type) dataTypeClass.newInstance(); + Type type = (Type) dataTypeClass.getDeclaredConstructor().newInstance(); try { type.setDelegateFromString(data); return new TypeAttribute(type, key, toKeep); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Attributes.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Attributes.java index 50a2e5ea684..c4d54bb8906 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Attributes.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Attributes.java @@ -26,7 +26,7 @@ public class Attributes extends AttributeBag 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>> attributes; private int _count = 0; @@ -329,8 +329,8 @@ public void read(Kryo kryo, Input input) { // Get the Class for the name of the class of the concrete Attribute Attribute attr; try { - attr = (Attribute) clz.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + attr = (Attribute) clz.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new RuntimeException(e); } diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Content.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Content.java index 4f31949b33c..988e0944017 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Content.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Content.java @@ -20,7 +20,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class Content extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -642410227862723970L; private static final Type normalizer = new LcNoDiacriticsType(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/DateContent.java b/warehouse/query-core/src/main/java/datawave/query/attributes/DateContent.java index a548dffa102..51be53557c6 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/DateContent.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/DateContent.java @@ -22,7 +22,7 @@ import datawave.webservice.query.data.ObjectSizeOf; public class DateContent extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -5962661609272398909L; private static final DateNormalizer normalizer = new DateNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/DiacriticContent.java b/warehouse/query-core/src/main/java/datawave/query/attributes/DiacriticContent.java index 3d41f494456..6fecf7420a3 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/DiacriticContent.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/DiacriticContent.java @@ -19,7 +19,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class DiacriticContent extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 570010612591254801L; private static final LcNormalizer normalizer = new LcNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Document.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Document.java index 8bb3d146589..3ed87110d08 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Document.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Document.java @@ -40,7 +40,7 @@ import datawave.util.time.DateHelper; public class Document extends AttributeBag implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -377226620954754934L; private static final Logger log = Logger.getLogger(Document.class); @@ -836,8 +836,8 @@ public void read(Kryo kryo, Input input) { if (Attribute.class.isAssignableFrom(clz)) { // Get an instance of the concrete Attribute try { - attr = (Attribute) clz.newInstance(); - } catch (InstantiationException | IllegalAccessException e) { + attr = (Attribute) clz.getDeclaredConstructor().newInstance(); + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { throw new RuntimeException(e); } diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/DocumentKey.java b/warehouse/query-core/src/main/java/datawave/query/attributes/DocumentKey.java index ebf06d7cbd9..d4faeef78e5 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/DocumentKey.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/DocumentKey.java @@ -19,7 +19,7 @@ import datawave.util.StringUtils; public class DocumentKey extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5322007904914187326L; private static final LcNoDiacriticsNormalizer normalizer = new LcNoDiacriticsNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/ExcerptFields.java b/warehouse/query-core/src/main/java/datawave/query/attributes/ExcerptFields.java index a2f763fb222..ec9f41af503 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/ExcerptFields.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/ExcerptFields.java @@ -162,7 +162,9 @@ public void put(String field, Integer offset, String direction) { * Replace a field mapping with another field * * @param field + * the field * @param replacement + * the replacement field */ public void replace(String field, String replacement) { SortedMap value = fieldMap.remove(field); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/GeoPoint.java b/warehouse/query-core/src/main/java/datawave/query/attributes/GeoPoint.java index c1eae1841ae..f678cdd5bd4 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/GeoPoint.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/GeoPoint.java @@ -19,7 +19,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class GeoPoint extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 6706096621887672254L; private static final GeoNormalizer normalizer = new GeoNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Geometry.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Geometry.java index 705278d6212..51f550df060 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Geometry.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Geometry.java @@ -25,7 +25,7 @@ import datawave.webservice.query.data.ObjectSizeOf; public class Geometry extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2655645012559296781L; private org.locationtech.jts.geom.Geometry geometry; diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/IpAddress.java b/warehouse/query-core/src/main/java/datawave/query/attributes/IpAddress.java index 01550a48341..49b84f9be95 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/IpAddress.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/IpAddress.java @@ -18,7 +18,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class IpAddress extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 7099603124284651752L; private datawave.data.type.util.IpAddress value; private String normalizedValue; diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Latitude.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Latitude.java index be7f1ecade3..487d4e56af2 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Latitude.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Latitude.java @@ -19,7 +19,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class Latitude extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1398690419181662732L; private static final GeoLatNormalizer normalizer = new GeoLatNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Longitude.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Longitude.java index 1f0960fc62b..1aa48f3e8a7 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Longitude.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Longitude.java @@ -19,7 +19,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class Longitude extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -5925043913098866868L; private static final GeoLonNormalizer normalizer = new GeoLonNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Metadata.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Metadata.java index 32766ba9dc3..cd5e2076486 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Metadata.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Metadata.java @@ -1,3 +1,5 @@ package datawave.query.attributes; -public class Metadata extends Document {} +public class Metadata extends Document { + private static final long serialVersionUID = -3653320314620034501L; +} diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/Numeric.java b/warehouse/query-core/src/main/java/datawave/query/attributes/Numeric.java index f18e17d861e..3f2c39fa9d8 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/Numeric.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/Numeric.java @@ -22,7 +22,7 @@ import datawave.query.jexl.DatawaveJexlContext; public class Numeric extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5823344312405439698L; private static final NumberNormalizer normalizer = new NumberNormalizer(); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/PreNormalizedAttribute.java b/warehouse/query-core/src/main/java/datawave/query/attributes/PreNormalizedAttribute.java index 1858ac6e6a5..4565c69164d 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/PreNormalizedAttribute.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/PreNormalizedAttribute.java @@ -22,7 +22,7 @@ * */ public class PreNormalizedAttribute extends Attribute implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -15927664283551620L; protected String value; public String getValue() { diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/TimingMetadata.java b/warehouse/query-core/src/main/java/datawave/query/attributes/TimingMetadata.java index 97d851bbaad..b78f5ecfbe2 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/TimingMetadata.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/TimingMetadata.java @@ -7,6 +7,7 @@ * Holds timing information for query iterator next, source, seek, and yield counts. */ public class TimingMetadata extends Metadata { + private static final long serialVersionUID = 359279777575969654L; private static final String NEXT_COUNT = "NEXT_COUNT"; private static final String SOURCE_COUNT = "SOURCE_COUNT"; diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/TypeAttribute.java b/warehouse/query-core/src/main/java/datawave/query/attributes/TypeAttribute.java index 6dd0c7185bd..1ddd867792a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/TypeAttribute.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/TypeAttribute.java @@ -26,7 +26,7 @@ public class TypeAttribute> extends Attribute> implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 7264249641813898860L; private static final Logger log = Logger.getLogger(TypeAttribute.class); diff --git a/warehouse/query-core/src/main/java/datawave/query/attributes/UniqueFields.java b/warehouse/query-core/src/main/java/datawave/query/attributes/UniqueFields.java index 0fab5c560ce..5657a329964 100644 --- a/warehouse/query-core/src/main/java/datawave/query/attributes/UniqueFields.java +++ b/warehouse/query-core/src/main/java/datawave/query/attributes/UniqueFields.java @@ -26,6 +26,7 @@ * {@link UniqueFields#from(String)}. */ public class UniqueFields implements Serializable { + private static final long serialVersionUID = 2269249452109902433L; private Multimap fieldMap; @@ -185,7 +186,9 @@ public void putAll(Multimap fieldMap) { * Replace a field mapping with another field * * @param field + * the field * @param replacement + * the replacement field */ public void replace(String field, String replacement) { Collection value = fieldMap.removeAll(field); diff --git a/warehouse/query-core/src/main/java/datawave/query/cardinality/CardinalityRecord.java b/warehouse/query-core/src/main/java/datawave/query/cardinality/CardinalityRecord.java index 2b9d971d84c..7937de7ae43 100644 --- a/warehouse/query-core/src/main/java/datawave/query/cardinality/CardinalityRecord.java +++ b/warehouse/query-core/src/main/java/datawave/query/cardinality/CardinalityRecord.java @@ -25,7 +25,7 @@ import com.google.common.collect.Sets; public class CardinalityRecord implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -8860541286933451615L; private Set resultCardinalityValueFields = null; private HashMultimap cardinalityMap = HashMultimap.create(); private static Logger log = Logger.getLogger(CardinalityRecord.class); diff --git a/warehouse/query-core/src/main/java/datawave/query/cardinality/DateFieldValueCardinalityRecord.java b/warehouse/query-core/src/main/java/datawave/query/cardinality/DateFieldValueCardinalityRecord.java index 89f097cd67f..9230161c371 100644 --- a/warehouse/query-core/src/main/java/datawave/query/cardinality/DateFieldValueCardinalityRecord.java +++ b/warehouse/query-core/src/main/java/datawave/query/cardinality/DateFieldValueCardinalityRecord.java @@ -9,7 +9,7 @@ import com.clearspring.analytics.stream.cardinality.HyperLogLogPlus; public class DateFieldValueCardinalityRecord implements Comparable, Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1271188645113911936L; private String eventDate = null; private String fieldName = null; private String fieldValue = null; diff --git a/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupFields.java b/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupFields.java index d51f64cd65c..01751187c75 100644 --- a/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupFields.java +++ b/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupFields.java @@ -27,6 +27,7 @@ * {@link GroupFields#from(String)}. */ public class GroupFields implements Serializable { + private static final long serialVersionUID = -5206581051889027175L; private static final String GROUP = "GROUP"; private static final String SUM = "SUM"; diff --git a/warehouse/query-core/src/main/java/datawave/query/common/grouping/Grouping.java b/warehouse/query-core/src/main/java/datawave/query/common/grouping/Grouping.java index 736dbb4c0da..377f2649061 100644 --- a/warehouse/query-core/src/main/java/datawave/query/common/grouping/Grouping.java +++ b/warehouse/query-core/src/main/java/datawave/query/common/grouping/Grouping.java @@ -11,6 +11,7 @@ * calculating the hashcode each time a search operation is performed on the keys of the maps. */ public class Grouping extends HashSet> { + private static final long serialVersionUID = -1820281938223279240L; public static final Grouping EMPTY_GROUPING = new Grouping(Collections.emptySet()); diff --git a/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupingAttribute.java b/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupingAttribute.java index 54db8ddf715..005def31edc 100644 --- a/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupingAttribute.java +++ b/warehouse/query-core/src/main/java/datawave/query/common/grouping/GroupingAttribute.java @@ -15,6 +15,7 @@ * the delegate type */ public class GroupingAttribute> extends TypeAttribute { + private static final long serialVersionUID = 1685645033880633567L; public GroupingAttribute(Type type, Key key, boolean toKeep) { super(type, key, toKeep); diff --git a/warehouse/query-core/src/main/java/datawave/query/common/grouping/ImmutableGrouping.java b/warehouse/query-core/src/main/java/datawave/query/common/grouping/ImmutableGrouping.java index a66a9e634de..babd72bb79a 100644 --- a/warehouse/query-core/src/main/java/datawave/query/common/grouping/ImmutableGrouping.java +++ b/warehouse/query-core/src/main/java/datawave/query/common/grouping/ImmutableGrouping.java @@ -7,6 +7,7 @@ * This class represents an immutable version of {@link Grouping} that cannot be modified. */ public class ImmutableGrouping extends Grouping { + private static final long serialVersionUID = -2915413060454488378L; public ImmutableGrouping(Collection> collection) { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/composite/CompositeUtils.java b/warehouse/query-core/src/main/java/datawave/query/composite/CompositeUtils.java index 2a6abee4a78..746b78ee08e 100644 --- a/warehouse/query-core/src/main/java/datawave/query/composite/CompositeUtils.java +++ b/warehouse/query-core/src/main/java/datawave/query/composite/CompositeUtils.java @@ -36,7 +36,7 @@ public static Map> getFieldToDiscreteIndexTypeMap(Mu type = (Type) typeObj; } else if (typeObj instanceof String) { try { - type = Class.forName(typeObj.toString()).asSubclass(Type.class).newInstance(); + type = Class.forName(typeObj.toString()).asSubclass(Type.class).getDeclaredConstructor().newInstance(); } catch (Exception e) { if (log.isTraceEnabled()) log.trace("Could not instantiate object for class [" + typeObj.toString() + "]"); diff --git a/warehouse/query-core/src/main/java/datawave/query/config/EdgeExtendedSummaryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/EdgeExtendedSummaryConfiguration.java index 41deac5f782..70ab0d7eef4 100644 --- a/warehouse/query-core/src/main/java/datawave/query/config/EdgeExtendedSummaryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/config/EdgeExtendedSummaryConfiguration.java @@ -64,7 +64,9 @@ public EdgeExtendedSummaryConfiguration(EdgeExtendedSummaryConfiguration other) * needs to be copied over here. * * @param other + * the other configuration * @param queries + * the collection of queries */ public EdgeExtendedSummaryConfiguration(EdgeExtendedSummaryConfiguration other, Collection queries) { this(other); diff --git a/warehouse/query-core/src/main/java/datawave/query/config/EdgeQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/EdgeQueryConfiguration.java index 6fab3abc41c..e936f883b18 100644 --- a/warehouse/query-core/src/main/java/datawave/query/config/EdgeQueryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/config/EdgeQueryConfiguration.java @@ -109,7 +109,9 @@ public EdgeQueryConfiguration(EdgeQueryConfiguration other) { * needs to be copied over here. * * @param other + * the other edge query configuration * @param queries + * the collection of queries */ public EdgeQueryConfiguration(EdgeQueryConfiguration other, Collection queries) { this(other); diff --git a/warehouse/query-core/src/main/java/datawave/query/config/RemoteQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/RemoteQueryConfiguration.java index 88bb1166b2b..d4917c31d2b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/config/RemoteQueryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/config/RemoteQueryConfiguration.java @@ -54,7 +54,9 @@ public RemoteQueryConfiguration(RemoteQueryConfiguration other) { * needs to be copied over here. * * @param other + * another RemoteQueryConfiguration instance * @param queries + * collection of queries */ public RemoteQueryConfiguration(RemoteQueryConfiguration other, Collection queries) { this(other); diff --git a/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java index 1dcbf7583cd..cf801f6e4c3 100644 --- a/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/config/ShardQueryConfiguration.java @@ -760,7 +760,9 @@ public void copyFrom(ShardQueryConfiguration other) { * needs to be copied over here. * * @param other + * another ShardQueryConfiguration * @param queries + * collection of queries */ public ShardQueryConfiguration(ShardQueryConfiguration other, Collection queries) { super(other); diff --git a/warehouse/query-core/src/main/java/datawave/query/config/TermFrequencyQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/config/TermFrequencyQueryConfiguration.java index 892f947ed89..e556114a786 100644 --- a/warehouse/query-core/src/main/java/datawave/query/config/TermFrequencyQueryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/config/TermFrequencyQueryConfiguration.java @@ -12,7 +12,7 @@ public class TermFrequencyQueryConfiguration extends GenericQueryConfiguration implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -8057446751976710918L; private transient Range range = null; diff --git a/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryLogic.java b/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryLogic.java index 91424b1afb1..785814bc5cd 100644 --- a/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryLogic.java +++ b/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryLogic.java @@ -359,7 +359,9 @@ public ShardIndexQueryTable clone() { * * @param scanner * a batch scanner - * @return iterator for discoveredthings + * @param queryData + * the query data + * @return iterator for discovered things */ public static Iterator transformScanner(final BatchScanner scanner, final QueryData queryData) { return concat(transform(scanner.iterator(), new Function,Iterator>() { diff --git a/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryQueryConfiguration.java b/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryQueryConfiguration.java index 13c8fa25d75..17f33f01282 100644 --- a/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryQueryConfiguration.java +++ b/warehouse/query-core/src/main/java/datawave/query/discovery/DiscoveryQueryConfiguration.java @@ -15,6 +15,7 @@ * Adds the ability to hold on to two multimaps. They map literals and patterns to the fields they were associated with in the query. */ public class DiscoveryQueryConfiguration extends ShardIndexQueryConfiguration implements Serializable { + private static final long serialVersionUID = -2349167549098253860L; private Multimap literals, patterns; private Multimap> ranges; private Boolean separateCountsByColVis = false; diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/BooleanLogicFatalQueryException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/BooleanLogicFatalQueryException.java index e906c806a10..f29d5676f86 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/BooleanLogicFatalQueryException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/BooleanLogicFatalQueryException.java @@ -5,6 +5,7 @@ * */ public class BooleanLogicFatalQueryException extends Exception { + private static final long serialVersionUID = 318700258115575237L; private String query = ""; private String reason = ""; diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/DoNotPerformOptimizedQueryException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/DoNotPerformOptimizedQueryException.java index 95d1838e399..5bbc7c97c77 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/DoNotPerformOptimizedQueryException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/DoNotPerformOptimizedQueryException.java @@ -1,7 +1,7 @@ package datawave.query.exceptions; public class DoNotPerformOptimizedQueryException extends DatawaveFatalQueryException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 8550522292180353602L; public DoNotPerformOptimizedQueryException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/EmptySetComparisonException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/EmptySetComparisonException.java index 67d1f540467..9fabea42754 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/EmptySetComparisonException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/EmptySetComparisonException.java @@ -1,7 +1,7 @@ package datawave.query.exceptions; public class EmptySetComparisonException extends Exception { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -663078244115260736L; public EmptySetComparisonException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/FieldNotMutableException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/FieldNotMutableException.java index 75420d4162c..5a4b476547c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/FieldNotMutableException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/FieldNotMutableException.java @@ -5,6 +5,7 @@ * */ public class FieldNotMutableException extends Exception { + private static final long serialVersionUID = 3399452938172451608L; private String fieldName = ""; private String dataType = ""; diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/FullTableScansDisallowedException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/FullTableScansDisallowedException.java index ae9191f91b8..0ccdb853fa6 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/FullTableScansDisallowedException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/FullTableScansDisallowedException.java @@ -5,7 +5,7 @@ */ public class FullTableScansDisallowedException extends DatawaveQueryException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -8671244431369372767L; public FullTableScansDisallowedException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/IllegalRangeArgumentException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/IllegalRangeArgumentException.java index 95a7d90a983..bce7123c2e0 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/IllegalRangeArgumentException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/IllegalRangeArgumentException.java @@ -5,7 +5,7 @@ */ public class IllegalRangeArgumentException extends RuntimeException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5913184625604622415L; public IllegalRangeArgumentException(Exception other) { super(other); diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/InvalidQueryTreeException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/InvalidQueryTreeException.java index 54f66db58cf..873cddf833f 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/InvalidQueryTreeException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/InvalidQueryTreeException.java @@ -4,6 +4,7 @@ * Thrown when an invalid query tree is encountered */ public class InvalidQueryTreeException extends Exception { + private static final long serialVersionUID = 3961878219004179463L; public InvalidQueryTreeException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/LoadAverageWatchException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/LoadAverageWatchException.java index 7e04364aa2f..3f72f24a37b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/LoadAverageWatchException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/LoadAverageWatchException.java @@ -3,5 +3,5 @@ import java.io.IOException; public class LoadAverageWatchException extends IOException { - + private static final long serialVersionUID = 8898455947562104940L; } diff --git a/warehouse/query-core/src/main/java/datawave/query/exceptions/TooManyTermsException.java b/warehouse/query-core/src/main/java/datawave/query/exceptions/TooManyTermsException.java index ca82b052faa..f7b284e79cc 100644 --- a/warehouse/query-core/src/main/java/datawave/query/exceptions/TooManyTermsException.java +++ b/warehouse/query-core/src/main/java/datawave/query/exceptions/TooManyTermsException.java @@ -6,7 +6,7 @@ */ public class TooManyTermsException extends DatawaveQueryException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5287047531989089903L; public TooManyTermsException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/function/LimitFields.java b/warehouse/query-core/src/main/java/datawave/query/function/LimitFields.java index 9a7e9aaa941..9ab49b62843 100644 --- a/warehouse/query-core/src/main/java/datawave/query/function/LimitFields.java +++ b/warehouse/query-core/src/main/java/datawave/query/function/LimitFields.java @@ -388,6 +388,7 @@ protected String removeGrouping(String key) { * A map that assumes a value for missing keys. */ public static class CountMap extends HashMap { + private static final long serialVersionUID = -736880224574416162L; private static final Integer ZERO = Integer.valueOf(0); @Override diff --git a/warehouse/query-core/src/main/java/datawave/query/function/deserializer/KryoDocumentDeserializer.java b/warehouse/query-core/src/main/java/datawave/query/function/deserializer/KryoDocumentDeserializer.java index 5b7e9eb6773..fa2a822cef7 100644 --- a/warehouse/query-core/src/main/java/datawave/query/function/deserializer/KryoDocumentDeserializer.java +++ b/warehouse/query-core/src/main/java/datawave/query/function/deserializer/KryoDocumentDeserializer.java @@ -17,7 +17,7 @@ * */ public class KryoDocumentDeserializer extends DocumentDeserializer implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -657326925013465794L; final transient Kryo kryo = new Kryo(); diff --git a/warehouse/query-core/src/main/java/datawave/query/function/deserializer/WritableDocumentDeserializer.java b/warehouse/query-core/src/main/java/datawave/query/function/deserializer/WritableDocumentDeserializer.java index a0470b93f39..05a62622ef5 100644 --- a/warehouse/query-core/src/main/java/datawave/query/function/deserializer/WritableDocumentDeserializer.java +++ b/warehouse/query-core/src/main/java/datawave/query/function/deserializer/WritableDocumentDeserializer.java @@ -15,7 +15,7 @@ */ public class WritableDocumentDeserializer extends DocumentDeserializer implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 1058220297462817713L; @Override public Document deserialize(InputStream data) { diff --git a/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java b/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java index db8fd9a2beb..b830642ef6b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java +++ b/warehouse/query-core/src/main/java/datawave/query/index/lookup/TupleToRange.java @@ -30,6 +30,10 @@ public class TupleToRange implements Function,Iterator< protected ShardQueryConfiguration config; /** + * TupleToRange constructor + * + * @param tableName + * the table name * @param currentNode * the jexl node * @param config @@ -83,6 +87,7 @@ public static boolean isDocumentRange(IndexInfo indexInfo) { } /** + * Determine if this is a shard range * * @param shard * a shard string @@ -93,8 +98,10 @@ public static boolean isShardRange(String shard) { } /** + * Create Document ranges * - * + * @param tableName + * the name of the table * @param queryNode * a query node * @param shard diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/CloseableListIterable.java b/warehouse/query-core/src/main/java/datawave/query/iterator/CloseableListIterable.java index 4d9c79d94aa..c5089288359 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/CloseableListIterable.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/CloseableListIterable.java @@ -7,6 +7,7 @@ import datawave.query.CloseableIterable; public class CloseableListIterable extends ArrayList implements CloseableIterable { + private static final long serialVersionUID = -1823550314634951180L; public CloseableListIterable(Collection iter) { super(iter); diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/QueryOptions.java b/warehouse/query-core/src/main/java/datawave/query/iterator/QueryOptions.java index 7cef4932a25..e69d01e2ef4 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/QueryOptions.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/QueryOptions.java @@ -728,8 +728,8 @@ public List getDocumentPermutations() { throw new IllegalArgumentException("Unable to construct " + classname + " as a DocumentPermutation", e); } catch (NoSuchMethodException e) { try { - list.add(clazz.newInstance()); - } catch (InstantiationException | IllegalAccessException e2) { + list.add(clazz.getDeclaredConstructor().newInstance()); + } catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e2) { log.error("Unable to construct " + classname + " as a DocumentPermutation", e2); throw new IllegalArgumentException("Unable to construct " + classname + " as a DocumentPermutation", e2); } diff --git a/warehouse/query-core/src/main/java/datawave/query/iterator/ivarator/IvaratorCacheDirConfig.java b/warehouse/query-core/src/main/java/datawave/query/iterator/ivarator/IvaratorCacheDirConfig.java index d861280cc4d..b7df50d6430 100644 --- a/warehouse/query-core/src/main/java/datawave/query/iterator/ivarator/IvaratorCacheDirConfig.java +++ b/warehouse/query-core/src/main/java/datawave/query/iterator/ivarator/IvaratorCacheDirConfig.java @@ -17,6 +17,7 @@ public class IvaratorCacheDirConfig implements Serializable { private static final Logger log = Logger.getLogger(IvaratorCacheDir.class); + private static final long serialVersionUID = 7028134765339988371L; public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE; public static final long DEFAULT_MIN_AVAILABLE_STORAGE_MiB = 0L; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/DatawaveInterpreter.java b/warehouse/query-core/src/main/java/datawave/query/jexl/DatawaveInterpreter.java index 27d8461dcac..7456aa6cac2 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/DatawaveInterpreter.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/DatawaveInterpreter.java @@ -148,7 +148,8 @@ public Object visit(ASTFunctionNode node, Object data) { * the variable name * @param undef * whether the variable is undefined or null - * @return + * + * @return null if it cannot be solved */ @Override protected Object unsolvableVariable(JexlNode node, String var, boolean undef) { @@ -168,7 +169,7 @@ protected Object unsolvableVariable(JexlNode node, String var, boolean undef) { * the method/function name * @param xany * the cause - * @return + * @return the JexlException */ @Override protected JexlException invocationException(JexlNode node, String methodName, Throwable xany) { diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/JexlFunctionNamespaceRegistry.java b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/JexlFunctionNamespaceRegistry.java index d67fcdc60a3..f1a15d5a8b4 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/functions/JexlFunctionNamespaceRegistry.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/functions/JexlFunctionNamespaceRegistry.java @@ -1,5 +1,6 @@ package datawave.query.jexl.functions; +import java.lang.reflect.InvocationTargetException; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -72,10 +73,10 @@ public static Map getConfiguredFunctions() { log.debug(JEXL_FUNCTION_NAMESPACE_PROPERTY + "=" + className); if (className != null) { try { - JexlFunctionNamespaceRegistry base = (JexlFunctionNamespaceRegistry) Class.forName(className).newInstance(); + JexlFunctionNamespaceRegistry base = (JexlFunctionNamespaceRegistry) Class.forName(className).getDeclaredConstructor().newInstance(); return base.getRegisteredFunctions(); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { log.warn("unable to create " + className + " with property " + JEXL_FUNCTION_NAMESPACE_PROPERTY, e); throw new RuntimeException("Could not create Jexl Function Registry object"); } diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookupMap.java b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookupMap.java index 9b7eafc5e89..eb1135d0da3 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookupMap.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/lookups/IndexLookupMap.java @@ -12,6 +12,7 @@ */ @SuppressWarnings("serial") public class IndexLookupMap implements Map, Serializable { + private static final long serialVersionUID = -8726073464553222628L; private Set patterns = new HashSet<>(); private Map index = new HashMap<>(); private boolean exceededKeyThreshold = false; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java index c969eafdb26..dc5e7f27d0b 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/BaseIndexExpansionVisitor.java @@ -195,6 +195,7 @@ protected void rebuildFutureJexlNodes() { * Serves as a placeholder Jexl node which can eventually be replaced with an expanded Jexl node once the Index Lookup has finished */ protected static class FutureJexlNode extends JexlNode { + private static final long serialVersionUID = -6505517654708569236L; private final JexlNode origNode; private final IndexLookup lookup; private final boolean ignoreComposites; diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PrintingVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PrintingVisitor.java index d043c39f94c..83295f00415 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PrintingVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/PrintingVisitor.java @@ -92,7 +92,6 @@ import org.apache.commons.jexl3.parser.ASTUnaryPlusNode; import org.apache.commons.jexl3.parser.ASTVar; import org.apache.commons.jexl3.parser.ASTWhileStatement; -import org.apache.commons.jexl3.parser.JexlLexicalNode; import org.apache.commons.jexl3.parser.JexlNode; import org.apache.commons.jexl3.parser.JexlNodes; import org.apache.commons.jexl3.parser.ParseException; @@ -255,6 +254,8 @@ public static String formattedQueryString(String query) throws ParseException { * a query node * @param maxChildNodes * maximum number of child nodes + * @param maxTermsToPrint + * maximum number of terms to print * @return formatted string * @throws ParseException * for parsing issues @@ -289,6 +290,8 @@ public static String formattedQueryString(JexlNode query) { * a query node * @param maxChildNodes * maximum number of child nodes + * @param maxTermsToPrint + * maximum number of terms to print * @return a formatted string */ public static String formattedQueryString(JexlNode query, int maxChildNodes, int maxTermsToPrint) { @@ -323,6 +326,8 @@ public static List formattedQueryStringList(JexlNode query) { * a query node * @param maxChildNodes * maximum number of child nodes + * @param maxTermsToPrint + * maximum number of terms to print * @return list of the formatted strings */ public static List formattedQueryStringList(JexlNode query, int maxChildNodes, int maxTermsToPrint) { diff --git a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/DistributeAndedNodesVisitor.java b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/DistributeAndedNodesVisitor.java index f2f7b6455e6..f734e4d0f51 100644 --- a/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/DistributeAndedNodesVisitor.java +++ b/warehouse/query-core/src/main/java/datawave/query/jexl/visitors/whindex/DistributeAndedNodesVisitor.java @@ -56,6 +56,7 @@ private DistributeAndedNodesVisitor(List andedNodes, Map candidates = p.findCandidateComponents("datawave.query.language.functions.jexl"); DEFAULT_ALLOWED_FUNCTION_LIST = candidates.stream().map(b -> { try { - return (JexlQueryFunction) (Class.forName(b.getBeanClassName()).newInstance()); + return (JexlQueryFunction) (Class.forName(b.getBeanClassName()).getDeclaredConstructor().newInstance()); } catch (Exception e) { return null; } diff --git a/warehouse/query-core/src/main/java/datawave/query/language/parser/ParseException.java b/warehouse/query-core/src/main/java/datawave/query/language/parser/ParseException.java index 0393fc3462a..bcd5e3f134d 100644 --- a/warehouse/query-core/src/main/java/datawave/query/language/parser/ParseException.java +++ b/warehouse/query-core/src/main/java/datawave/query/language/parser/ParseException.java @@ -1,7 +1,7 @@ package datawave.query.language.parser; public class ParseException extends Exception { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5692694102770151342L; public ParseException(String s) { super(s); diff --git a/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/AccumuloSyntaxParser.java b/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/AccumuloSyntaxParser.java index b9dd081637c..3b5d0abc630 100644 --- a/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/AccumuloSyntaxParser.java +++ b/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/AccumuloSyntaxParser.java @@ -725,7 +725,9 @@ final private Token jj_consume_token(int kind) throws ParseException { throw generateParseException(); } - static private final class LookaheadSuccess extends java.lang.Error {} + static private final class LookaheadSuccess extends java.lang.Error { + private static final long serialVersionUID = -4371149864858129526L; + } final private LookaheadSuccess jj_ls = new LookaheadSuccess(); diff --git a/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/ParseException.java b/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/ParseException.java index b5277de798b..cf1f8ac9340 100644 --- a/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/ParseException.java +++ b/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/ParseException.java @@ -18,7 +18,7 @@ public class ParseException extends QueryNodeParseException { /** * The version identifier for this Serializable class. Increment only if the serialized form of the class changes. */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1162628601053710719L; /** * This constructor is used by the method "generateParseException" in the generated parser. Calling this constructor generates a new object of this type diff --git a/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/TokenMgrError.java b/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/TokenMgrError.java index 075b6c29095..6e1981f1ffe 100644 --- a/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/TokenMgrError.java +++ b/warehouse/query-core/src/main/java/datawave/query/language/parser/lucene/TokenMgrError.java @@ -2,6 +2,8 @@ package datawave.query.language.parser.lucene; public class TokenMgrError extends Error { + private static final long serialVersionUID = -4429645198105082676L; + /* * Ordinals for various reasons why an Error of this type can be thrown. */ diff --git a/warehouse/query-core/src/main/java/datawave/query/model/edge/EdgeQueryModel.java b/warehouse/query-core/src/main/java/datawave/query/model/edge/EdgeQueryModel.java index 98ea410b2c8..202388948bd 100644 --- a/warehouse/query-core/src/main/java/datawave/query/model/edge/EdgeQueryModel.java +++ b/warehouse/query-core/src/main/java/datawave/query/model/edge/EdgeQueryModel.java @@ -29,6 +29,7 @@ * (3) Additionally, index-only/unevaluated fields are ignored, as this concept is not applicable to edges. */ public class EdgeQueryModel extends QueryModel { + private static final long serialVersionUID = -590763583662768646L; private final EdgeModelFields fields; @@ -37,6 +38,8 @@ public class EdgeQueryModel extends QueryModel { * * @param other * the other model + * @param fields + * the edge model fields * @throws InvalidModelException * if the model is invalid */ @@ -55,6 +58,8 @@ public EdgeModelFields getFields() { * * @param queryModelXml * the model xml + * @param fields + * the edge model fields * @return EdgeQueryModel instance * @throws Exception * if there is an issue @@ -66,7 +71,13 @@ public static EdgeQueryModel loadModel(String queryModelXml, EdgeModelFields fie /** * Simple factory method to load a query model from the specified classpath resource. * + * @param queryModelXml + * the query model + * @param fieldsFactory + * the fields factory * @return EdgeQueryModel instance + * @throws Exception + * if there is an issue */ public static EdgeQueryModel loadModel(String queryModelXml, EdgeModelFieldsFactory fieldsFactory) throws Exception { return loadModel(queryModelXml, fieldsFactory.createFields()); @@ -75,7 +86,11 @@ public static EdgeQueryModel loadModel(String queryModelXml, EdgeModelFieldsFact /** * Simple factory method to load a query model from the specified classpath resource. * + * @param queryModelXml + * the query model * @return EdgeQueryModel instance + * @throws Exception + * if there is an issue */ public static EdgeQueryModel loadModel(String queryModelXml) throws Exception { return loadModel(queryModelXml, new DefaultEdgeModelFieldsFactory()); @@ -85,7 +100,7 @@ public static EdgeQueryModel loadModel(String queryModelXml) throws Exception { * Thrown whenever an invalid edge query model is detected. */ public static class InvalidModelException extends Exception { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -312834628767055149L; public InvalidModelException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/planner/QueryPlan.java b/warehouse/query-core/src/main/java/datawave/query/planner/QueryPlan.java index 2484f4e600d..5211d27f4aa 100644 --- a/warehouse/query-core/src/main/java/datawave/query/planner/QueryPlan.java +++ b/warehouse/query-core/src/main/java/datawave/query/planner/QueryPlan.java @@ -282,7 +282,7 @@ public void setTableName(String tableName) { } /** - * @return + * @return list of iterator settings */ public List getSettings() { return settings; diff --git a/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java b/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java index 4fd5e59e004..2c83b256c7e 100644 --- a/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java +++ b/warehouse/query-core/src/main/java/datawave/query/scheduler/PushdownScheduler.java @@ -136,11 +136,15 @@ public Iterator iterator() { } /** - * @return + * @return iterator of results * @throws ParseException + * if there is an error parsing * @throws TableNotFoundException + * if the table is not found * @throws AccumuloSecurityException + * if there is a security issue * @throws AccumuloException + * if there is an accumulo issue */ protected Iterator concatIterators() throws AccumuloException, AccumuloSecurityException, TableNotFoundException, ParseException { boolean hasNext = config.getQueriesIter().hasNext(); diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/ShardIndexQueryTable.java b/warehouse/query-core/src/main/java/datawave/query/tables/ShardIndexQueryTable.java index dc17a735467..2220d1b6e8d 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/ShardIndexQueryTable.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/ShardIndexQueryTable.java @@ -420,6 +420,7 @@ public Iterator apply(Entry from) { * @param baseConfig * The shard query configuration * @param checkpoint + * The query checkpoint */ @Override public void setupQuery(AccumuloClient client, GenericQueryConfiguration baseConfig, QueryCheckpoint checkpoint) throws Exception { diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java b/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java index 5b7ab11f61d..d4ea1e6de26 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/ShardQueryLogic.java @@ -2792,6 +2792,9 @@ public Set getEvaluationOnlyFields() { * @param baseConfig * The shard query configuration * @param checkpoint + * The query checkpoint + * @throws Exception + * when unable to set up query */ @Override public void setupQuery(AccumuloClient client, GenericQueryConfiguration baseConfig, QueryCheckpoint checkpoint) throws Exception { diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/edge/EdgeQueryLogic.java b/warehouse/query-core/src/main/java/datawave/query/tables/edge/EdgeQueryLogic.java index 432d4eff4e7..53db4240b9c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/edge/EdgeQueryLogic.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/edge/EdgeQueryLogic.java @@ -713,7 +713,10 @@ public void setupQuery(GenericQueryConfiguration configuration) throws Exception * Takes in a batch scanner and returns an iterator over the DiscoveredThing objects contained in the value. * * @param scanner - * @return + * a batch scanner + * @param queryData + * the query data + * @return iterator for discovered things */ public static Iterator> transformScanner(final BatchScanner scanner, final QueryData queryData) { return transform(scanner.iterator(), new Function,Entry>() { @@ -795,6 +798,8 @@ public void close() { * the QueryData for the query logic to be configured * @param priority * the priority for the first of iterator filters + * @throws Exception + * when unable to add custom filter */ protected void addCustomFilters(QueryData data, int priority) throws Exception {} diff --git a/warehouse/query-core/src/main/java/datawave/query/tables/ssdeep/ScoredSSDeepPair.java b/warehouse/query-core/src/main/java/datawave/query/tables/ssdeep/ScoredSSDeepPair.java index 7b7c03aa8dd..e8f9d3f0b7c 100644 --- a/warehouse/query-core/src/main/java/datawave/query/tables/ssdeep/ScoredSSDeepPair.java +++ b/warehouse/query-core/src/main/java/datawave/query/tables/ssdeep/ScoredSSDeepPair.java @@ -48,7 +48,11 @@ public Set getOverlappingNgrams() { return overlappingNgrams; } - /** Return a String representing the sorted list of ngrams that are shared by both the query and the matching ssdeep */ + /** + * Return a String representing the sorted list of ngrams that are shared by both the query and the matching ssdeep + * + * @return string of ngrams + */ public String getOverlapsAsString() { return String.join(", ", getOverlappingNgrams().stream().map(NGramTuple::toString).collect(Collectors.toCollection(TreeSet::new))); } diff --git a/warehouse/query-core/src/main/java/datawave/query/util/SortedKeyValueIteratorToIterator.java b/warehouse/query-core/src/main/java/datawave/query/util/SortedKeyValueIteratorToIterator.java index f5d5aeae046..fcd6105badc 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/SortedKeyValueIteratorToIterator.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/SortedKeyValueIteratorToIterator.java @@ -81,6 +81,7 @@ private Map.Entry findNext() { } public static class IteratorException extends RuntimeException implements Serializable { + private static final long serialVersionUID = 619736246732484920L; public IteratorException() { super(); diff --git a/warehouse/query-core/src/main/java/datawave/query/util/cache/DatatypeLoader.java b/warehouse/query-core/src/main/java/datawave/query/util/cache/DatatypeLoader.java index 34752b15c94..130eed48c23 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/cache/DatatypeLoader.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/cache/DatatypeLoader.java @@ -130,7 +130,7 @@ protected boolean store(String storeKey, Key key, Value value) { @SuppressWarnings("unchecked") Class> clazz = (Class>) Class.forName(colq.substring(idx + 1)); - Type normalizer = clazz.newInstance(); + Type normalizer = clazz.getDeclaredConstructor().newInstance(); typedNormalizers.put(type, normalizer); diff --git a/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerConfigLoader.java b/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerConfigLoader.java index c202ed628fc..bab4910b169 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerConfigLoader.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerConfigLoader.java @@ -7,6 +7,7 @@ import java.io.DataOutput; import java.io.DataOutputStream; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Collection; import java.util.Map.Entry; @@ -138,8 +139,8 @@ protected void readFields(DataInput in) throws IOException { Class> clazz = (Class>) Class.forName(className); - normalizerMap.put(dataType, clazz.newInstance()); - } catch (InstantiationException | ClassNotFoundException | IllegalAccessException e) { + normalizerMap.put(dataType, clazz.getDeclaredConstructor().newInstance()); + } catch (InstantiationException | ClassNotFoundException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { log.error(e); } } diff --git a/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerLoader.java b/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerLoader.java index 3c65f6c5fb6..9a7a8d1f6f4 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerLoader.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/cache/NormalizerLoader.java @@ -133,7 +133,7 @@ protected boolean store(String storeKey, Key key, Value value) { @SuppressWarnings("unchecked") Class> clazz = (Class>) Class.forName(colq.substring(idx + 1)); - Type normalizer = clazz.newInstance(); + Type normalizer = clazz.getDeclaredConstructor().newInstance(); typedNormalizers.put(type, normalizer); diff --git a/warehouse/query-core/src/main/java/datawave/query/util/ssdeep/NGramScoreTuple.java b/warehouse/query-core/src/main/java/datawave/query/util/ssdeep/NGramScoreTuple.java index b6de2e012cf..8732474991f 100644 --- a/warehouse/query-core/src/main/java/datawave/query/util/ssdeep/NGramScoreTuple.java +++ b/warehouse/query-core/src/main/java/datawave/query/util/ssdeep/NGramScoreTuple.java @@ -5,6 +5,7 @@ import datawave.util.ssdeep.SSDeepHash; public class NGramScoreTuple implements Serializable, Comparable { + private static final long serialVersionUID = -2598090706928950908L; final SSDeepHash ssDeepHash; final float baseScore; final int weightedScore; diff --git a/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleEvent.java b/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleEvent.java index c52ee902b41..fa2b205ef8e 100644 --- a/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleEvent.java +++ b/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleEvent.java @@ -27,7 +27,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class SimpleEvent extends EventBase implements Serializable, Message, ObjectSizeOf { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -1963967131747306439L; @XmlElementWrapper(name = "Markings") private Map markings; diff --git a/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleField.java b/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleField.java index ce1b340cd23..8363d8805cf 100644 --- a/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleField.java +++ b/warehouse/query-core/src/main/java/datawave/webservice/query/result/event/SimpleField.java @@ -33,7 +33,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class SimpleField extends FieldBase implements Serializable, Message { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -7551833653666011136L; @XmlAttribute(name = "columnVisibility") private String columnVisibility; diff --git a/warehouse/query-core/src/main/java/org/apache/lucene/queryparser/flexible/core/nodes/NotBooleanQueryNode.java b/warehouse/query-core/src/main/java/org/apache/lucene/queryparser/flexible/core/nodes/NotBooleanQueryNode.java index 941c5be18f7..c24d8a56acf 100644 --- a/warehouse/query-core/src/main/java/org/apache/lucene/queryparser/flexible/core/nodes/NotBooleanQueryNode.java +++ b/warehouse/query-core/src/main/java/org/apache/lucene/queryparser/flexible/core/nodes/NotBooleanQueryNode.java @@ -7,7 +7,7 @@ public class NotBooleanQueryNode extends BooleanQueryNode { /** * */ - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2522926105910498582L; public NotBooleanQueryNode(List clauses) { super(clauses); diff --git a/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java b/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java index 2e60d169f37..f627603924e 100644 --- a/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java +++ b/warehouse/query-core/src/test/java/datawave/query/RebuildingScannerTestHelper.java @@ -1,6 +1,7 @@ package datawave.query; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; import java.util.Collection; import java.util.Iterator; @@ -86,11 +87,15 @@ public enum INTERRUPT { public InterruptListener instance() { try { - return iclass.newInstance(); + return iclass.getDeclaredConstructor().newInstance(); } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InstantiationException e) { throw new RuntimeException(e); + } catch (InvocationTargetException e) { + throw new RuntimeException(e); + } catch (NoSuchMethodException e) { + throw new RuntimeException(e); } } } diff --git a/warehouse/query-core/src/test/java/datawave/query/edge/ExtendedEdgeQueryLogicTest.java b/warehouse/query-core/src/test/java/datawave/query/edge/ExtendedEdgeQueryLogicTest.java index 702e4210079..f80a5d2b54a 100644 --- a/warehouse/query-core/src/test/java/datawave/query/edge/ExtendedEdgeQueryLogicTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/edge/ExtendedEdgeQueryLogicTest.java @@ -176,7 +176,7 @@ public void testSelectorExtractor() throws Exception { q.addParameter("delimiter", ","); q.addParameter("query.syntax", "LIST"); - List expected = new ArrayList(); + List expected = new ArrayList<>(); expected.add("MARS"); expected.add("JUPITER"); expected.add("VENUS"); diff --git a/warehouse/query-core/src/test/java/datawave/query/iterator/CommaFreeType.java b/warehouse/query-core/src/test/java/datawave/query/iterator/CommaFreeType.java index 4e336e954b9..6825a451475 100644 --- a/warehouse/query-core/src/test/java/datawave/query/iterator/CommaFreeType.java +++ b/warehouse/query-core/src/test/java/datawave/query/iterator/CommaFreeType.java @@ -7,11 +7,14 @@ * Purely testing type to remove all commas from a string. */ public class CommaFreeType extends BaseType { + private static final long serialVersionUID = -8183805795495756459L; + public CommaFreeType() { super(new CommaNormalizer()); } public static class CommaNormalizer extends AbstractNormalizer { + private static final long serialVersionUID = -5731092165340522114L; @Override public String normalize(String s) { diff --git a/warehouse/query-core/src/test/java/datawave/query/jexl/visitors/ExpandCompositeTermsTest.java b/warehouse/query-core/src/test/java/datawave/query/jexl/visitors/ExpandCompositeTermsTest.java index f7ac5d0e1fe..55bc43158ba 100644 --- a/warehouse/query-core/src/test/java/datawave/query/jexl/visitors/ExpandCompositeTermsTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/jexl/visitors/ExpandCompositeTermsTest.java @@ -1253,6 +1253,7 @@ void showIt(String message, ASTJexlScript script) { } private static class MockDiscreteIndexType extends BaseType implements DiscreteIndexType { + private static final long serialVersionUID = 7461882834132475497L; public MockDiscreteIndexType() { super(new NoOpNormalizer()); diff --git a/warehouse/query-core/src/test/java/datawave/query/predicate/DocumentKeyToFieldNameTest.java b/warehouse/query-core/src/test/java/datawave/query/predicate/DocumentKeyToFieldNameTest.java index 5fdae865767..96795eca1ea 100644 --- a/warehouse/query-core/src/test/java/datawave/query/predicate/DocumentKeyToFieldNameTest.java +++ b/warehouse/query-core/src/test/java/datawave/query/predicate/DocumentKeyToFieldNameTest.java @@ -122,6 +122,7 @@ private Iterator>>>> tr } private static class TestDatatype extends BaseType { + private static final long serialVersionUID = 3822654660554167058L; public TestDatatype(String delegateString, Normalizer normalizer) { super(delegateString, normalizer); diff --git a/warehouse/query-core/src/test/java/datawave/query/testframework/AbstractFunctionalQuery.java b/warehouse/query-core/src/test/java/datawave/query/testframework/AbstractFunctionalQuery.java index f7ce338487f..58c496d3dbe 100644 --- a/warehouse/query-core/src/test/java/datawave/query/testframework/AbstractFunctionalQuery.java +++ b/warehouse/query-core/src/test/java/datawave/query/testframework/AbstractFunctionalQuery.java @@ -548,7 +548,7 @@ protected void runCountTest(String query) throws Exception { RunningQuery runner = new RunningQuery(client, AccumuloConnectionFactory.Priority.NORMAL, this.countLogic, q, "", principal, new QueryMetricFactoryImpl()); - TransformIterator it = runner.getTransformIterator(); + TransformIterator it = runner.getTransformIterator(); ShardQueryCountTableTransformer ctt = (ShardQueryCountTableTransformer) it.getTransformer(); EventQueryResponseBase resp = (EventQueryResponseBase) ctt.createResponse(runner.next()); @@ -559,7 +559,7 @@ protected void runCountTest(String query) throws Exception { EventBase event = events.get(0); List fields = event.getFields(); Assert.assertEquals(1, fields.size()); - FieldBase count = (FieldBase) fields.get(0); + FieldBase count = (FieldBase) fields.get(0); String val = count.getValueString(); if (log.isDebugEnabled()) { log.debug("expected count(" + expect.size() + ") actual count(" + val + ")"); diff --git a/warehouse/query-core/src/test/java/datawave/query/testframework/RawDataManager.java b/warehouse/query-core/src/test/java/datawave/query/testframework/RawDataManager.java index 373e8e5cfc7..d833a0cfdfb 100644 --- a/warehouse/query-core/src/test/java/datawave/query/testframework/RawDataManager.java +++ b/warehouse/query-core/src/test/java/datawave/query/testframework/RawDataManager.java @@ -88,7 +88,7 @@ public interface RawDataManager { * name of header field * @return normalizer for valid field name */ - Normalizer getNormalizer(String field); + Normalizer getNormalizer(String field); /** * Converts part of a query using ANY_FIELD into an equivalent string that includes all of the indexed fields. This is performed before the JEXL expression diff --git a/warehouse/query-core/src/test/java/datawave/query/util/CompositeTestingIngest.java b/warehouse/query-core/src/test/java/datawave/query/util/CompositeTestingIngest.java index c3905ac2eba..9254968e4ca 100644 --- a/warehouse/query-core/src/test/java/datawave/query/util/CompositeTestingIngest.java +++ b/warehouse/query-core/src/test/java/datawave/query/util/CompositeTestingIngest.java @@ -391,6 +391,7 @@ private static Value getValueForNuthinAndYourHitsForFree() { } public static class PigLatinNormalizer extends AbstractNormalizer { + private static final long serialVersionUID = 4004492504906689561L; final String vowels = "aeiou"; @@ -446,6 +447,7 @@ public PigLatinType(String delegateString) { } public static class UcNormalizer extends AbstractNormalizer { + private static final long serialVersionUID = -6729701168202629715L; public String normalize(String fieldValue) { return fieldValue.toUpperCase(Locale.ENGLISH); diff --git a/warehouse/query-core/src/test/java/datawave/query/util/MockMetadataHelper.java b/warehouse/query-core/src/test/java/datawave/query/util/MockMetadataHelper.java index 7814c0b87f7..2a90f15561d 100644 --- a/warehouse/query-core/src/test/java/datawave/query/util/MockMetadataHelper.java +++ b/warehouse/query-core/src/test/java/datawave/query/util/MockMetadataHelper.java @@ -128,8 +128,8 @@ public void addFieldsToDatatypes(Multimap fieldsToDatatype) { getMetadata().allFields.addAll(fieldsToDatatype.keySet()); for (Map.Entry field : fieldsToDatatype.entries()) { try { - this.dataTypes.put(field.getKey(), Class.forName(field.getValue()).asSubclass(Type.class).newInstance()); - } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { + this.dataTypes.put(field.getKey(), Class.forName(field.getValue()).asSubclass(Type.class).getDeclaredConstructor().newInstance()); + } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | NoSuchMethodException | InvocationTargetException e) { this.fieldsToDatatype.putAll(fieldsToDatatype); } } diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/ChunkSizeEncoding.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/ChunkSizeEncoding.java index b3d46b7d226..b41a06b1b38 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/ChunkSizeEncoding.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/ChunkSizeEncoding.java @@ -27,6 +27,8 @@ //@formatter:on public class ChunkSizeEncoding implements Serializable { + private static final long serialVersionUID = -3959340489340249949L; + public static final int SPAMSUM_LENGTH = 64; public static final int MIN_CHUNK_SIZE = 3; diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/IntegerEncoding.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/IntegerEncoding.java index f3ff4393e1b..809f54061f6 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/IntegerEncoding.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/IntegerEncoding.java @@ -8,6 +8,8 @@ */ public class IntegerEncoding implements Serializable { + private static final long serialVersionUID = -1535142886955396037L; + // The number of distinct characters used for encoding final int base; // the target length of the encoding diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramGenerator.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramGenerator.java index b90f5054c34..a74b63cf41e 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramGenerator.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramGenerator.java @@ -26,6 +26,8 @@ public class NGramGenerator implements Serializable { */ public static final int DEFAULT_MIN_HASH_SIZE = 64; + private static final long serialVersionUID = 8930666415965604405L; + private static final Logger log = LoggerFactory.getLogger(NGramGenerator.class); final int ngramSize; diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramTuple.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramTuple.java index 3dbab4b2f70..255b79d5ef3 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramTuple.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/NGramTuple.java @@ -11,6 +11,8 @@ */ public class NGramTuple implements Serializable, Comparable { + private static final long serialVersionUID = -1604968128862519452L; + public static final String CHUNK_DELIMITER = ":"; final int chunkSize; diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepEncoding.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepEncoding.java index 9ca7a1fe5bb..bcc2af956a0 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepEncoding.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepEncoding.java @@ -8,6 +8,8 @@ * characters here. As a result this implementation is more performant than alternatives built into java like 'String.getBytes()'. */ public class SSDeepEncoding implements Serializable { + private static final long serialVersionUID = -1307680264498524837L; + public byte[] encode(String ngram) { return encodeToBytes(ngram, new byte[ngram.length()], 0); } diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHash.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHash.java index bb00e6eb3d0..01dc8642fbf 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHash.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHash.java @@ -9,6 +9,8 @@ /** An Immutable SSDeepHash object */ public final class SSDeepHash implements Serializable, Comparable { + private static final long serialVersionUID = -4470665039274696957L; + /** * The paper on Optimizing ssDeep for use at Scale" suggested that any hash with more than this many repeated characters should have that run of characters * reduced to this number of characters and suggested that 3 was a good number. This works well for our purposes as well. diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashEditDistanceScorer.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashEditDistanceScorer.java index ac207314e1d..59e87f46da4 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashEditDistanceScorer.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashEditDistanceScorer.java @@ -76,6 +76,15 @@ public Integer apply(SSDeepHash signature1, SSDeepHash signature2) { /** * This is the low level chunk scoring algorithm. It takes two chunks and scores them on a scale of 0-100 where 0 is a terrible match and 100 is a great * match. The chunkSize is used to cope with very small messages. + * + * @param s1 + * the first chunk + * @param s2 + * the second chunk + * @param chunkSize + * size of the chunk + * + * @return the new score */ private static int scoreChunks(final String s1, final String s2, final int chunkSize) { final int len1 = s1.length(); @@ -113,7 +122,7 @@ private static int scoreChunks(final String s1, final String s2, final int chunk score = 100 - score; // When the chunk size is small we don't want to exaggerate the match. - final int threshold = (int) (chunkSize / SSDeepHash.MIN_CHUNK_SIZE * Math.min(len1, len2)); + final int threshold = (chunkSize / SSDeepHash.MIN_CHUNK_SIZE * Math.min(len1, len2)); if (score > threshold) { score = threshold; } diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashScorer.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashScorer.java index eb86e9629c3..374c62b7adf 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashScorer.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepHashScorer.java @@ -4,6 +4,7 @@ * An interface for things that take two hashes and compare them to produce some sort of result. * * @param + * class type for hashes */ public interface SSDeepHashScorer { public T apply(SSDeepHash signature1, SSDeepHash signature2); diff --git a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepParseException.java b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepParseException.java index 49602d5a511..c2299c0585a 100644 --- a/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepParseException.java +++ b/warehouse/ssdeep-common/src/main/java/datawave/util/ssdeep/SSDeepParseException.java @@ -3,6 +3,9 @@ import java.nio.charset.StandardCharsets; public class SSDeepParseException extends RuntimeException { + + private static final long serialVersionUID = 96156228318650642L; + final String message; final String input; diff --git a/web-services/atom/src/test/java/datawave/webservice/atom/AtomKeyValueParserTest.java b/web-services/atom/src/test/java/datawave/webservice/atom/AtomKeyValueParserTest.java index 305671a4b47..849e6f82f97 100644 --- a/web-services/atom/src/test/java/datawave/webservice/atom/AtomKeyValueParserTest.java +++ b/web-services/atom/src/test/java/datawave/webservice/atom/AtomKeyValueParserTest.java @@ -1,5 +1,8 @@ package datawave.webservice.atom; +import static org.junit.Assert.assertThrows; +import static org.junit.Assert.assertTrue; + import java.io.IOException; import org.apache.abdera.Abdera; @@ -11,17 +14,12 @@ import org.apache.hadoop.io.Text; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; public class AtomKeyValueParserTest { public AtomKeyValueParser kv; - @Rule - public ExpectedException thrown = ExpectedException.none(); - @Before public void before() { kv = new AtomKeyValueParser(); @@ -43,8 +41,8 @@ public void testGettersAndSetters() { @Test public void testIDEncodeDecode() throws IOException { String id = "idForTests"; - String encodedID = kv.encodeId(id); - String decodedID = kv.decodeId(encodedID); + String encodedID = AtomKeyValueParser.encodeId(id); + String decodedID = AtomKeyValueParser.decodeId(encodedID); Assert.assertNotEquals(id, encodedID); Assert.assertNotEquals(decodedID, encodedID); @@ -72,10 +70,10 @@ public void testGoodParse() throws IOException { byte[] vals = new byte[4]; Value value = new Value(vals); - AtomKeyValueParser resultKV = kv.parse(key, value); + AtomKeyValueParser resultKV = AtomKeyValueParser.parse(key, value); Assert.assertEquals("row1", resultKV.getCollectionName()); - Assert.assertNotEquals(resultKV.getId(), kv.decodeId(resultKV.getId())); + Assert.assertNotEquals(resultKV.getId(), AtomKeyValueParser.decodeId(resultKV.getId())); Assert.assertEquals("color", resultKV.getUuid()); Assert.assertEquals("fi", resultKV.getValue()); } @@ -86,13 +84,8 @@ public void testMissingRowParts() { Key key = new Key(new Text("row1"), new Text("fi\0color"), new Text("red\0truck\0t-uid001")); byte[] vals = new byte[4]; Value value = new Value(vals); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("Atom entry is missing row parts: row1 fi%00;color:red%00;truck%00;t-uid001 [] 9223372036854775807 false"); - try { - kv.parse(key, value); - } catch (IOException e) { - // Empty on purpose - } + Exception expectedEx = assertThrows(IllegalArgumentException.class, () -> AtomKeyValueParser.parse(key, value)); + assertTrue(expectedEx.getMessage().equals("Atom entry is missing row parts: row1 fi%00;color:red%00;truck%00;t-uid001 [] 9223372036854775807 false")); } @SuppressWarnings("static-access") @@ -102,7 +95,7 @@ public void testTooManyRowParts() { byte[] vals = new byte[4]; Value value = new Value(vals); try { - kv.parse(key, value); + AtomKeyValueParser.parse(key, value); } catch (IOException e) { // Empty on purpose } @@ -114,13 +107,8 @@ public void testDelimiterAtEnd() { Key key = new Key(new Text("row1\0"), new Text("fi\0color"), new Text("red\0truck\0t-uid001")); byte[] vals = new byte[4]; Value value = new Value(vals); - thrown.expect(ValueFormatException.class); - thrown.expectMessage("trying to convert to long, but byte array isn't long enough, wanted 8 found 0"); - try { - kv.parse(key, value); - } catch (IOException e) { - // Empty on purpose - } + Exception expectedEx = assertThrows(ValueFormatException.class, () -> AtomKeyValueParser.parse(key, value)); + assertTrue(expectedEx.getMessage().equals("trying to convert to long, but byte array isn't long enough, wanted 8 found 0")); } @SuppressWarnings("static-access") @@ -129,13 +117,8 @@ public void testMissingColQual() { Key key = new Key(new Text("row1\0row2and3"), new Text("fi"), new Text("red\0truck\0t-uid001")); byte[] vals = new byte[4]; Value value = new Value(vals); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("Atom entry is missing column qualifier parts: "); - try { - kv.parse(key, value); - } catch (IOException e) { - // Empty catch because of ExpectedException - } + Exception expectedEx = assertThrows(IllegalArgumentException.class, () -> AtomKeyValueParser.parse(key, value)); + assertTrue(expectedEx.getMessage().contains("Atom entry is missing column qualifier parts: ")); } @SuppressWarnings("static-access") @@ -144,12 +127,7 @@ public void testBadDelimColQual() { Key key = new Key(new Text("row1\0row2and3"), new Text("fi\0"), new Text("red\0truck\0t-uid001")); byte[] vals = new byte[4]; Value value = new Value(vals); - thrown.expect(IllegalArgumentException.class); - thrown.expectMessage("Atom entry is missing column qualifier parts: "); - try { - kv.parse(key, value); - } catch (IOException e) { - // Empty catch because of ExpectedException - } + Exception excpectedEx = assertThrows(IllegalArgumentException.class, () -> AtomKeyValueParser.parse(key, value)); + assertTrue(excpectedEx.getMessage().contains("Atom entry is missing column qualifier parts: ")); } } diff --git a/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedResultsBean.java b/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedResultsBean.java index f9324e1f756..6494c877bee 100644 --- a/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedResultsBean.java +++ b/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedResultsBean.java @@ -333,6 +333,7 @@ protected void loadBatch(PreparedStatement ps, String owner, String queryId, Str } + @SuppressWarnings("unchecked") protected GenericResponse load(@Required("queryId") String queryId, String alias, String nameBase) { GenericResponse response = new GenericResponse<>(); @@ -370,7 +371,7 @@ protected GenericResponse load(@Required("queryId") String queryId, Stri // This RunningQuery may be in use. Make a copy using the defined Query. RunningQuery rq = null; - QueryLogic logic = null; + QueryLogic logic = null; Query q = null; BaseQueryMetric queryMetric = null; try { @@ -437,7 +438,7 @@ protected GenericResponse load(@Required("queryId") String queryId, Stri } CacheableLogic cacheableLogic; - Transformer t = logic.getTransformer(q); + Transformer t = logic.getTransformer(q); // Audit the query. This may be duplicative if the caller called // QueryExecutorBean.create() or QueryExecutorBean.reset() first. @@ -2475,11 +2476,11 @@ protected boolean createView(String tableName, String viewName, Connection con, return viewCreated; } - public QueryPredictor getPredictor() { + public QueryPredictor getPredictor() { return predictor; } - public void setPredictor(QueryPredictor predictor) { + public void setPredictor(QueryPredictor predictor) { this.predictor = predictor; } diff --git a/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedRunningQuery.java b/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedRunningQuery.java index b2a4658acd8..7a76c5d1b65 100644 --- a/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedRunningQuery.java +++ b/web-services/cached-results/src/main/java/datawave/webservice/results/cached/CachedRunningQuery.java @@ -58,7 +58,7 @@ public class CachedRunningQuery extends AbstractRunningQuery { private static DataSource datasource = null; - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 9093679062966451008L; private static ResponseObjectFactory responseObjectFactory; private transient Connection connection = null; @@ -67,7 +67,7 @@ public class CachedRunningQuery extends AbstractRunningQuery { private transient CacheableLogic cacheableLogic = null; private transient QueryLogic queryLogic = null; - private transient QueryLogicTransformer transformer = null; + private transient QueryLogicTransformer transformer = null; // gets set in previous and next private transient int lastPageNumber = 0; @@ -922,7 +922,7 @@ public int getTotalRows() { return totalRows; } - public QueryLogicTransformer getTransformer() { + public QueryLogicTransformer getTransformer() { return transformer; } @@ -1118,6 +1118,7 @@ public static void removeFromDatabase(String id) { } } + @SuppressWarnings("unchecked") public static CachedRunningQuery retrieveFromDatabase(String id, Principal principal, QueryMetricFactory metricFactory) { verifyCrqTableExists(); @@ -1170,7 +1171,7 @@ public static CachedRunningQuery retrieveFromDatabase(String id, Principal princ crq.variableFields.addAll(Arrays.asList(varFields.split(" "))); } - Query query = crq.responseObjectFactory.getQueryImpl(); + Query query = CachedRunningQuery.responseObjectFactory.getQueryImpl(); query.setQuery(resultSet.getString(x++)); Timestamp bDate = resultSet.getTimestamp(x++); diff --git a/web-services/client/src/main/java/datawave/webservice/modification/DefaultModificationRequest.java b/web-services/client/src/main/java/datawave/webservice/modification/DefaultModificationRequest.java index 92d2a176bc8..d1933578cbe 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/DefaultModificationRequest.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/DefaultModificationRequest.java @@ -31,7 +31,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultModificationRequest extends ModificationRequestBase implements Serializable { - private static final long serialVersionUID = 2L; + private static final long serialVersionUID = 7141501104717795992L; @XmlElementWrapper(name = "Events", required = true) @XmlElement(name = "Event", required = true) diff --git a/web-services/client/src/main/java/datawave/webservice/modification/DefaultUUIDModificationRequest.java b/web-services/client/src/main/java/datawave/webservice/modification/DefaultUUIDModificationRequest.java index 615b4854ea2..4e7da2045c2 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/DefaultUUIDModificationRequest.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/DefaultUUIDModificationRequest.java @@ -21,7 +21,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultUUIDModificationRequest extends ModificationRequestBase implements Serializable { - private static final long serialVersionUID = 3L; + private static final long serialVersionUID = -1993315218692972415L; @XmlElementWrapper(name = "Events", required = true) @XmlElement(name = "Event", required = true) diff --git a/web-services/client/src/main/java/datawave/webservice/modification/EventIdentifier.java b/web-services/client/src/main/java/datawave/webservice/modification/EventIdentifier.java index ad96f328d89..20e4f12004a 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/EventIdentifier.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/EventIdentifier.java @@ -16,7 +16,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class EventIdentifier implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 3868831591782636261L; @XmlElement(name = "shardId", required = true) private String shardId = null; diff --git a/web-services/client/src/main/java/datawave/webservice/modification/ModificationEvent.java b/web-services/client/src/main/java/datawave/webservice/modification/ModificationEvent.java index cb2995805e5..caee702060a 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/ModificationEvent.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/ModificationEvent.java @@ -18,7 +18,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class ModificationEvent extends ModificationEventBase implements Serializable { - private static final long serialVersionUID = 6L; + private static final long serialVersionUID = -2624449421249547670L; @XmlElement(name = "user", required = true) private String user = null; diff --git a/web-services/client/src/main/java/datawave/webservice/modification/ModificationEventBase.java b/web-services/client/src/main/java/datawave/webservice/modification/ModificationEventBase.java index e5446ea0492..2d6ca72b7ef 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/ModificationEventBase.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/ModificationEventBase.java @@ -10,7 +10,7 @@ @XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) -public abstract class ModificationEventBase { +public abstract class ModificationEventBase> { @XmlElement(name = "id", required = true) protected String id = null; diff --git a/web-services/client/src/main/java/datawave/webservice/modification/ModificationOperationImpl.java b/web-services/client/src/main/java/datawave/webservice/modification/ModificationOperationImpl.java index 01703ca6289..09de7c3e36d 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/ModificationOperationImpl.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/ModificationOperationImpl.java @@ -16,7 +16,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class ModificationOperationImpl extends ModificationOperation implements Serializable { - private static final long serialVersionUID = 5L; + private static final long serialVersionUID = -7059742973817272572L; @XmlElement(name = "operationMode", required = true) protected OPERATIONMODE operationMode = null; diff --git a/web-services/client/src/main/java/datawave/webservice/modification/ModificationRequestBase.java b/web-services/client/src/main/java/datawave/webservice/modification/ModificationRequestBase.java index e2ac1bd6064..d52c9e16201 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/ModificationRequestBase.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/ModificationRequestBase.java @@ -25,7 +25,7 @@ public class ModificationRequestBase implements Serializable { private static String COLUMN_VISIBILITY = "columnVisibility"; - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 4312291034126058550L; @XmlEnum(String.class) public enum MODE { diff --git a/web-services/client/src/main/java/datawave/webservice/modification/UUIDEventIdentifier.java b/web-services/client/src/main/java/datawave/webservice/modification/UUIDEventIdentifier.java index 7975f822ba1..beb66c5a012 100644 --- a/web-services/client/src/main/java/datawave/webservice/modification/UUIDEventIdentifier.java +++ b/web-services/client/src/main/java/datawave/webservice/modification/UUIDEventIdentifier.java @@ -16,7 +16,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class UUIDEventIdentifier implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2397215231763015746L; @XmlElement(name = "uuid", required = true) private String uuid = null; diff --git a/web-services/client/src/main/java/datawave/webservice/query/QueryMessages.java b/web-services/client/src/main/java/datawave/webservice/query/QueryMessages.java index e9e69f40b92..dc18ebd5e33 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/QueryMessages.java +++ b/web-services/client/src/main/java/datawave/webservice/query/QueryMessages.java @@ -255,7 +255,7 @@ public interface QueryImplOrBuilder extends com.google.protobuf.MessageLiteOrBui */ public static final class QueryImpl extends com.google.protobuf.GeneratedMessageLite implements QueryImplOrBuilder { // Use QueryImpl.newBuilder() to construct. - private QueryImpl(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private QueryImpl(com.google.protobuf.GeneratedMessageLite.Builder builder) { super(builder); } @@ -431,7 +431,7 @@ public interface ParameterOrBuilder extends com.google.protobuf.MessageLiteOrBui */ public static final class Parameter extends com.google.protobuf.GeneratedMessageLite implements ParameterOrBuilder { // Use Parameter.newBuilder() to construct. - private Parameter(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private Parameter(com.google.protobuf.GeneratedMessageLite.Builder builder) { super(builder); } @@ -648,7 +648,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = 7775810273121957009L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { @@ -1650,7 +1650,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = -8624669227387781661L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { @@ -2953,7 +2953,7 @@ public Builder addParameters(int index, datawave.webservice.query.QueryMessages. */ public Builder addAllParameters(java.lang.Iterable values) { ensureParametersIsMutable(); - super.addAll(values, parameters_); + Builder.addAll(values, parameters_); return this; } diff --git a/web-services/client/src/main/java/datawave/webservice/query/exception/ExceptionMessages.java b/web-services/client/src/main/java/datawave/webservice/query/exception/ExceptionMessages.java index 9f5d0a788b7..35c9c0e9116 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/exception/ExceptionMessages.java +++ b/web-services/client/src/main/java/datawave/webservice/query/exception/ExceptionMessages.java @@ -60,7 +60,7 @@ public interface QueryExceptionTypeOrBuilder extends com.google.protobuf.Message */ public static final class QueryExceptionType extends com.google.protobuf.GeneratedMessageLite implements QueryExceptionTypeOrBuilder { // Use QueryExceptionType.newBuilder() to construct. - private QueryExceptionType(com.google.protobuf.GeneratedMessageLite.Builder builder) { + private QueryExceptionType(com.google.protobuf.GeneratedMessageLite.Builder builder) { super(builder); } @@ -269,7 +269,7 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; + private static final long serialVersionUID = -5415438289429744565L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/EdgeQueryResponseBase.java b/web-services/client/src/main/java/datawave/webservice/query/result/EdgeQueryResponseBase.java index 3eb93f761d9..ac2c03acbe9 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/EdgeQueryResponseBase.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/EdgeQueryResponseBase.java @@ -15,6 +15,8 @@ public abstract class EdgeQueryResponseBase extends BaseQueryResponse implements protected Map markings; + private static final long serialVersionUID = 5957852042933196910L; + public abstract void addEdge(EdgeBase edge); public abstract void setEdges(List edges); diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultEvent.java b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultEvent.java index 65fe18277d0..5b535e044be 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultEvent.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultEvent.java @@ -29,7 +29,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultEvent extends EventBase implements Serializable, Message, ObjectSizeOf { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 2390592143914560317L; @XmlElement(name = "Markings") @XmlJavaTypeAdapter(StringMapAdapter.class) diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFacets.java b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFacets.java index 93b35e911eb..b0a1416b85b 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFacets.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFacets.java @@ -22,7 +22,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultFacets extends FacetsBase implements Serializable, Message, ObjectSizeOf { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -836236435709294127L; public void setMarkings(Map markings) { this.markings = markings; diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultField.java b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultField.java index e059c49e7e0..ac00d2c0c4e 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultField.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultField.java @@ -37,7 +37,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultField extends FieldBase implements Serializable, Message { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -3982566563059126017L; @XmlElement(name = "Markings") @XmlJavaTypeAdapter(StringMapAdapter.class) diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFieldCardinality.java b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFieldCardinality.java index fba55407d5c..acb724af967 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFieldCardinality.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/event/DefaultFieldCardinality.java @@ -30,7 +30,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultFieldCardinality extends FieldCardinalityBase implements Serializable, Message { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 6744306517869679531L; @XmlAttribute(name = "field") private String field; diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/event/FacetsBase.java b/web-services/client/src/main/java/datawave/webservice/query/result/event/FacetsBase.java index 4b75c95241a..d5f6423dc4d 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/event/FacetsBase.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/event/FacetsBase.java @@ -28,6 +28,7 @@ public abstract class FacetsBase implements HasMarkings { @XmlTransient protected ColumnVisibility columnVisibility; + @SuppressWarnings("unchecked") public void setFields(List fields) { this.fields = (List) fields; } diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/event/Metadata.java b/web-services/client/src/main/java/datawave/webservice/query/result/event/Metadata.java index da0aa8a18c3..b7311a12162 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/event/Metadata.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/event/Metadata.java @@ -22,7 +22,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class Metadata implements Serializable, Message { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 3078086696168705239L; @XmlElement(name = "DataType") private String dataType = null; diff --git a/web-services/client/src/main/java/datawave/webservice/query/result/logic/QueryLogicDescription.java b/web-services/client/src/main/java/datawave/webservice/query/result/logic/QueryLogicDescription.java index e7fb218d0a6..6df196ddda4 100644 --- a/web-services/client/src/main/java/datawave/webservice/query/result/logic/QueryLogicDescription.java +++ b/web-services/client/src/main/java/datawave/webservice/query/result/logic/QueryLogicDescription.java @@ -16,7 +16,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class QueryLogicDescription implements Serializable { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 4592004897609293243L; public QueryLogicDescription() {} diff --git a/web-services/client/src/main/java/datawave/webservice/result/BaseQueryResponse.java b/web-services/client/src/main/java/datawave/webservice/result/BaseQueryResponse.java index f1a385b7a77..76451078123 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/BaseQueryResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/BaseQueryResponse.java @@ -10,7 +10,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public abstract class BaseQueryResponse extends BaseResponse { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -4080703202287062795L; @XmlElement(name = "LogicName") private String logicName = null; diff --git a/web-services/client/src/main/java/datawave/webservice/result/CachedResultsDescribeResponse.java b/web-services/client/src/main/java/datawave/webservice/result/CachedResultsDescribeResponse.java index 5bee0eb1b96..7f84259dd71 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/CachedResultsDescribeResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/CachedResultsDescribeResponse.java @@ -15,7 +15,7 @@ @XmlAccessorType(XmlAccessType.NONE) public class CachedResultsDescribeResponse extends BaseResponse { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 8907385255869520517L; @XmlElement(name = "View") private String view = null; diff --git a/web-services/client/src/main/java/datawave/webservice/result/CachedResultsResponse.java b/web-services/client/src/main/java/datawave/webservice/result/CachedResultsResponse.java index 1adb5262505..b024321caf2 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/CachedResultsResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/CachedResultsResponse.java @@ -12,7 +12,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class CachedResultsResponse extends BaseResponse { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -6229367579974681065L; @XmlElement(name = "OriginalQueryId") private String originalQueryId = null; diff --git a/web-services/client/src/main/java/datawave/webservice/result/DefaultEventQueryResponse.java b/web-services/client/src/main/java/datawave/webservice/result/DefaultEventQueryResponse.java index 3cf1856a431..98290eb0e61 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/DefaultEventQueryResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/DefaultEventQueryResponse.java @@ -28,7 +28,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class DefaultEventQueryResponse extends EventQueryResponseBase implements TotalResultsAware, Serializable, Message { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 7770211210912829217L; @XmlElement(name = "TotalEvents") private Long totalEvents = null; diff --git a/web-services/client/src/main/java/datawave/webservice/result/EventQueryResponseBase.java b/web-services/client/src/main/java/datawave/webservice/result/EventQueryResponseBase.java index 082362242fb..1bc562b2a99 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/EventQueryResponseBase.java +++ b/web-services/client/src/main/java/datawave/webservice/result/EventQueryResponseBase.java @@ -6,6 +6,8 @@ public abstract class EventQueryResponseBase extends BaseQueryResponse { + private static final long serialVersionUID = -8404343960387980525L; + public abstract Long getTotalEvents(); public abstract long getTotalResults(); diff --git a/web-services/client/src/main/java/datawave/webservice/result/FacetQueryResponseBase.java b/web-services/client/src/main/java/datawave/webservice/result/FacetQueryResponseBase.java index 1d3e92b645f..27426102282 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/FacetQueryResponseBase.java +++ b/web-services/client/src/main/java/datawave/webservice/result/FacetQueryResponseBase.java @@ -14,6 +14,7 @@ */ @XmlAccessorType(XmlAccessType.NONE) public abstract class FacetQueryResponseBase extends BaseQueryResponse implements HasMarkings { + private static final long serialVersionUID = -3483112784845232037L; protected transient Map markings; diff --git a/web-services/client/src/main/java/datawave/webservice/result/MetadataQueryResponseBase.java b/web-services/client/src/main/java/datawave/webservice/result/MetadataQueryResponseBase.java index 597382cd5d2..68b48127541 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/MetadataQueryResponseBase.java +++ b/web-services/client/src/main/java/datawave/webservice/result/MetadataQueryResponseBase.java @@ -7,6 +7,7 @@ import io.protostuff.Message; public abstract class MetadataQueryResponseBase extends BaseQueryResponse implements Serializable, TotalResultsAware, Message { + private static final long serialVersionUID = 1937054629579713080L; public abstract List getFields(); diff --git a/web-services/client/src/main/java/datawave/webservice/result/QueryImplListResponse.java b/web-services/client/src/main/java/datawave/webservice/result/QueryImplListResponse.java index 007c8bf8e93..332d9568c03 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/QueryImplListResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/QueryImplListResponse.java @@ -25,7 +25,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class QueryImplListResponse extends BaseResponse implements Message { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -2118945918588194332L; @XmlElement private List query = null; @@ -76,25 +76,25 @@ public boolean isInitialized(QueryImplListResponse message) { return true; } + @SuppressWarnings("unchecked") public void writeTo(Output output, QueryImplListResponse message) throws IOException { - Class clazz = null; Schema schema = null; if (message.numResults != 0) output.writeUInt32(1, message.numResults, false); if (message.query != null) { - for (Query query : message.query) { - if (query != null) { + for (Query messageQuery : message.query) { + if (messageQuery != null) { if (null == clazz) { - clazz = (Class) query.getClass(); + clazz = messageQuery.getClass(); output.writeString(6, clazz.getName(), false); } - if ((null == schema) && (query instanceof Message)) { - Message m = (Message) query; + if ((null == schema) && (messageQuery instanceof Message)) { + Message m = (Message) messageQuery; schema = m.cachedSchema(); } - output.writeObject(2, query, schema, true); + output.writeObject(2, messageQuery, schema, true); } } } @@ -118,6 +118,7 @@ public void writeTo(Output output, QueryImplListResponse message) throws IOExcep } } + @SuppressWarnings("unchecked") public void mergeFrom(Input input, QueryImplListResponse message) throws IOException { LinkedList exceptions = null; int number; @@ -130,7 +131,7 @@ public void mergeFrom(Input input, QueryImplListResponse message) throws IOExcep break; case 2: if (message.query == null) { - message.query = new ArrayList(); + message.query = new ArrayList<>(); } if (null == schema) { Class clazz = null; @@ -155,7 +156,7 @@ public void mergeFrom(Input input, QueryImplListResponse message) throws IOExcep break; case 5: if (exceptions == null) - exceptions = new LinkedList(); + exceptions = new LinkedList<>(); exceptions.add(input.mergeObject(null, QueryExceptionType.getSchema())); break; case 6: @@ -190,10 +191,10 @@ public String getFieldName(int number) { public int getFieldNumber(String name) { final Integer number = fieldMap.get(name); - return number == null ? 0 : number.intValue(); + return number == null ? 0 : number; } - final java.util.HashMap fieldMap = new java.util.HashMap(); + final java.util.HashMap fieldMap = new java.util.HashMap<>(); { fieldMap.put("numResults", 1); fieldMap.put("query", 2); diff --git a/web-services/client/src/main/java/datawave/webservice/result/QueryLogicResponse.java b/web-services/client/src/main/java/datawave/webservice/result/QueryLogicResponse.java index fe14d7ca5b3..785c51df36f 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/QueryLogicResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/QueryLogicResponse.java @@ -19,7 +19,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class QueryLogicResponse extends BaseResponse implements HtmlProvider { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = -5187717039580274354L; private static final String TITLE = "Deployed Query Logic", EMPTY = ""; @XmlElement(name = "QueryLogic") diff --git a/web-services/client/src/main/java/datawave/webservice/result/QueryWizardResultResponse.java b/web-services/client/src/main/java/datawave/webservice/result/QueryWizardResultResponse.java index a1cbff09953..8a6320ae105 100644 --- a/web-services/client/src/main/java/datawave/webservice/result/QueryWizardResultResponse.java +++ b/web-services/client/src/main/java/datawave/webservice/result/QueryWizardResultResponse.java @@ -26,7 +26,7 @@ @XmlAccessorOrder(XmlAccessOrder.ALPHABETICAL) public class QueryWizardResultResponse extends BaseResponse implements HtmlProvider { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 5015858130286649476L; private static final String TITLE = "DataWave Query Results", EMPTY = ""; private static final String DATA_TABLES_TEMPLATE = "\n" + "\n" + "