diff --git a/buildSrc/src/main/java/org/apache/lucene/gradle/ProfileResults.java b/buildSrc/src/main/java/org/apache/lucene/gradle/ProfileResults.java index 8e6ce1f2d8d..60def1a89d1 100644 --- a/buildSrc/src/main/java/org/apache/lucene/gradle/ProfileResults.java +++ b/buildSrc/src/main/java/org/apache/lucene/gradle/ProfileResults.java @@ -185,7 +185,7 @@ public static void printReport(List files, String mode, int stacksize, i stack.append(frameToString(trace.getFrames().get(i), lineNumbers)); } String line = stack.toString(); - SimpleEntry entry = histogram.computeIfAbsent(line, u -> new SimpleEntry(line, 0L)); + SimpleEntry entry = histogram.computeIfAbsent(line, u -> new SimpleEntry<>(line, 0L)); long value = getValue(event); entry.setValue(entry.getValue() + value); totalEvents++; diff --git a/solr/core/src/java/org/apache/solr/cloud/ConfigSetCmds.java b/solr/core/src/java/org/apache/solr/cloud/ConfigSetCmds.java index e3133a4120b..cb0e62fe29f 100644 --- a/solr/core/src/java/org/apache/solr/cloud/ConfigSetCmds.java +++ b/solr/core/src/java/org/apache/solr/cloud/ConfigSetCmds.java @@ -86,7 +86,7 @@ private static Map getNewProperties(ZkNodeProps message) { for (Map.Entry entry : message.getProperties().entrySet()) { if (entry.getKey().startsWith(CONFIG_SET_PROPERTY_PREFIX)) { if (properties == null) { - properties = new HashMap(); + properties = new HashMap<>(); } properties.put( entry.getKey().substring((CONFIG_SET_PROPERTY_PREFIX).length()), entry.getValue()); diff --git a/solr/core/src/java/org/apache/solr/cloud/Overseer.java b/solr/core/src/java/org/apache/solr/cloud/Overseer.java index 838ec5d24a7..aa1dd2253f7 100644 --- a/solr/core/src/java/org/apache/solr/cloud/Overseer.java +++ b/solr/core/src/java/org/apache/solr/cloud/Overseer.java @@ -759,7 +759,7 @@ public synchronized void start(String id) { ccThread.start(); systemCollectionCompatCheck( - new BiConsumer() { + new BiConsumer<>() { boolean firstPair = true; @Override diff --git a/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java b/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java index db57ea4980b..903fb7e8ebc 100644 --- a/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java +++ b/solr/core/src/java/org/apache/solr/cloud/SizeLimitedDistributedMap.java @@ -70,7 +70,7 @@ private void shrinkIfNeeded() throws KeeperException, InterruptedException { int cleanupSize = maxSize / 10; final PriorityQueue priorityQueue = - new PriorityQueue(cleanupSize) { + new PriorityQueue<>(cleanupSize) { @Override protected boolean lessThan(Long a, Long b) { return (a > b); diff --git a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java index 2a748fa9d30..9f082ec4521 100644 --- a/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java +++ b/solr/core/src/java/org/apache/solr/cloud/api/collections/CreateCollectionCmd.java @@ -456,7 +456,7 @@ public void call(ClusterState clusterState, ZkNodeProps message, NamedList(), ccc); + CollectionHandlingUtils.cleanupCollection(collectionName, new NamedList<>(), ccc); log.info("Cleaned up artifacts for failed create collection for [{}]", collectionName); throw new SolrException( ErrorCode.BAD_REQUEST, diff --git a/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java b/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java index 48353fde65c..f2be093e3e9 100644 --- a/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java +++ b/solr/core/src/java/org/apache/solr/core/CorePropertiesLocator.java @@ -144,7 +144,7 @@ public List discover(final CoreContainer cc) { this.rootDirectory, options, maxDepth, - new SimpleFileVisitor() { + new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { diff --git a/solr/core/src/java/org/apache/solr/core/NodeRoles.java b/solr/core/src/java/org/apache/solr/core/NodeRoles.java index 6bb1e1633f1..36bfe3ea262 100644 --- a/solr/core/src/java/org/apache/solr/core/NodeRoles.java +++ b/solr/core/src/java/org/apache/solr/core/NodeRoles.java @@ -36,7 +36,7 @@ public class NodeRoles { private Map nodeRoles; public NodeRoles(String rolesString) { - Map roles = new EnumMap(Role.class); + Map roles = new EnumMap<>(Role.class); if (StringUtils.isEmpty(rolesString)) { rolesString = DEFAULT_ROLES_STRING; } diff --git a/solr/core/src/java/org/apache/solr/core/PluginBag.java b/solr/core/src/java/org/apache/solr/core/PluginBag.java index a25af726b9c..bdf8bfeb307 100644 --- a/solr/core/src/java/org/apache/solr/core/PluginBag.java +++ b/solr/core/src/java/org/apache/solr/core/PluginBag.java @@ -137,7 +137,7 @@ public PluginHolder createPlugin(PluginInfo info) { if (log.isDebugEnabled()) { log.debug("{} : '{}' created with startup=lazy ", meta.getCleanTag(), info.name); } - return new LazyPluginHolder(meta, info, core, core.getResourceLoader()); + return new LazyPluginHolder<>(meta, info, core, core.getResourceLoader()); } else { if (info.pkgName != null) { PackagePluginHolder holder = new PackagePluginHolder<>(info, core, meta); @@ -329,7 +329,7 @@ void init(Map defaults, SolrCore solrCore, List infos) { } for (Map.Entry e : defaults.entrySet()) { if (!contains(e.getKey())) { - put(e.getKey(), new PluginHolder(null, e.getValue())); + put(e.getKey(), new PluginHolder<>(null, e.getValue())); } } } diff --git a/solr/core/src/java/org/apache/solr/core/snapshots/CollectionSnapshotMetaData.java b/solr/core/src/java/org/apache/solr/core/snapshots/CollectionSnapshotMetaData.java index fb2af5009dc..483170db598 100644 --- a/solr/core/src/java/org/apache/solr/core/snapshots/CollectionSnapshotMetaData.java +++ b/solr/core/src/java/org/apache/solr/core/snapshots/CollectionSnapshotMetaData.java @@ -91,7 +91,7 @@ public boolean isLeader() { @Override public void write(JSONWriter arg0) { - LinkedHashMap info = new LinkedHashMap(); + LinkedHashMap info = new LinkedHashMap<>(); info.put(CoreAdminParams.CORE, getCoreName()); info.put(SolrSnapshotManager.INDEX_DIR_PATH, getIndexDirPath()); info.put(SolrSnapshotManager.GENERATION_NUM, getGenerationNumber()); @@ -244,7 +244,7 @@ public NamedList toNamedList() { result.add(SolrSnapshotManager.SNAPSHOT_STATUS, this.status.toString()); result.add(SolrSnapshotManager.CREATION_DATE, this.getCreationDate().getTime()); - NamedList> replicas = new NamedList>(); + NamedList> replicas = new NamedList<>(); for (CoreSnapshotMetaData x : replicaSnapshots) { replicas.add(x.getCoreName(), x.toNamedList()); } diff --git a/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java b/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java index ca3f6dd4139..a54ba441e65 100644 --- a/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java +++ b/solr/core/src/java/org/apache/solr/handler/ClusterAPI.java @@ -135,7 +135,7 @@ public void nodesWithRole(SolrQueryRequest req, SolrQueryResponse rsp) throws Ex @SuppressWarnings("unchecked") public void rolesForNode(SolrQueryRequest req, SolrQueryResponse rsp) throws Exception { String node = req.getPathTemplateValues().get("node"); - Map ret = new HashMap(); + Map ret = new HashMap<>(); Map>> roles = (Map>>) readRecursive( diff --git a/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java b/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java index f97aba0c126..fe873084b2b 100644 --- a/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java +++ b/solr/core/src/java/org/apache/solr/handler/RequestHandlerUtils.java @@ -54,7 +54,7 @@ public static boolean handleCommit( SolrQueryRequest req, UpdateRequestProcessor processor, SolrParams params, boolean force) throws IOException { if (params == null) { - params = new MapSolrParams(new HashMap()); + params = new MapSolrParams(new HashMap<>()); } boolean optimize = params.getBool(UpdateParams.OPTIMIZE, false); @@ -115,7 +115,7 @@ public static boolean handleRollback( SolrQueryRequest req, UpdateRequestProcessor processor, SolrParams params, boolean force) throws IOException { if (params == null) { - params = new MapSolrParams(new HashMap()); + params = new MapSolrParams(new HashMap<>()); } boolean rollback = params.getBool(UpdateParams.ROLLBACK, false); diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java index eac72512df4..0b44aa85b9d 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CoreAdminHandler.java @@ -110,9 +110,9 @@ public CoreAdminHandler() { // should happen in the constructor... this.coreContainer = null; HashMap> map = new HashMap<>(3, 1.0f); - map.put(RUNNING, Collections.synchronizedMap(new LinkedHashMap())); - map.put(COMPLETED, Collections.synchronizedMap(new LinkedHashMap())); - map.put(FAILED, Collections.synchronizedMap(new LinkedHashMap())); + map.put(RUNNING, Collections.synchronizedMap(new LinkedHashMap<>())); + map.put(COMPLETED, Collections.synchronizedMap(new LinkedHashMap<>())); + map.put(FAILED, Collections.synchronizedMap(new LinkedHashMap<>())); requestStatusMap = Collections.unmodifiableMap(map); } @@ -124,9 +124,9 @@ public CoreAdminHandler() { public CoreAdminHandler(final CoreContainer coreContainer) { this.coreContainer = coreContainer; HashMap> map = new HashMap<>(3, 1.0f); - map.put(RUNNING, Collections.synchronizedMap(new LinkedHashMap())); - map.put(COMPLETED, Collections.synchronizedMap(new LinkedHashMap())); - map.put(FAILED, Collections.synchronizedMap(new LinkedHashMap())); + map.put(RUNNING, Collections.synchronizedMap(new LinkedHashMap<>())); + map.put(COMPLETED, Collections.synchronizedMap(new LinkedHashMap<>())); + map.put(FAILED, Collections.synchronizedMap(new LinkedHashMap<>())); requestStatusMap = Collections.unmodifiableMap(map); } diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java index f7e39c5d4b0..d781fb04969 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java +++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacet.java @@ -66,7 +66,7 @@ public PivotFacet(ResponseBuilder rb, String facetStr) { public void addRefinement(int shardNumber, PivotFacetValue value) { if (!queuedRefinements.containsKey(shardNumber)) { - queuedRefinements.put(shardNumber, new ArrayList()); + queuedRefinements.put(shardNumber, new ArrayList<>()); } queuedRefinements.get(shardNumber).add(value); diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java index fb8985184f0..9bec8533335 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java @@ -574,8 +574,8 @@ public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throw if (!rb.isDistrib && req.getParams().getBool(ShardParams.SHARDS_INFO, false) && rb.shortCircuitedURL != null) { - NamedList shardInfo = new SimpleOrderedMap(); - SimpleOrderedMap nl = new SimpleOrderedMap(); + NamedList shardInfo = new SimpleOrderedMap<>(); + SimpleOrderedMap nl = new SimpleOrderedMap<>(); if (rsp.getException() != null) { Throwable cause = rsp.getException(); if (cause instanceof SolrServerException) { diff --git a/solr/core/src/java/org/apache/solr/handler/component/StatsField.java b/solr/core/src/java/org/apache/solr/handler/component/StatsField.java index 1aeb16d5995..c58124edaa3 100644 --- a/solr/core/src/java/org/apache/solr/handler/component/StatsField.java +++ b/solr/core/src/java/org/apache/solr/handler/component/StatsField.java @@ -90,7 +90,7 @@ public static enum Stat { boolean parseParams(StatsField sf) { String percentileParas = sf.localParams.get(this.name()); if (percentileParas != null) { - List percentiles = new ArrayList(); + List percentiles = new ArrayList<>(); try { for (String percentile : StrUtils.splitSmart(percentileParas, ',')) { percentiles.add(Double.parseDouble(percentile)); @@ -149,7 +149,7 @@ boolean parseParams(StatsField sf) { * @see #getDistribDeps */ Stat(boolean selfDep, Stat... deps) { - distribDeps = new ArrayList(deps.length + 1); + distribDeps = new ArrayList<>(deps.length + 1); distribDeps.addAll(Arrays.asList(deps)); if (selfDep) { distribDeps.add(this); @@ -220,7 +220,7 @@ boolean parseParams(StatsField sf) { private final List excludeTagList; private final EnumSet statsToCalculate = EnumSet.noneOf(Stat.class); private final EnumSet statsInResponse = EnumSet.noneOf(Stat.class); - private final List percentilesList = new ArrayList(); + private final List percentilesList = new ArrayList<>(); private final boolean isShard; private double tdigestCompression = 100.0D; @@ -397,7 +397,7 @@ public DocSet computeBaseDocSet() throws IOException { return docs; } - IdentityHashMap excludeSet = new IdentityHashMap(); + IdentityHashMap excludeSet = new IdentityHashMap<>(); for (String excludeTag : excludeTagList) { Object olst = tagMap.get(excludeTag); // tagMap has entries of List>, but subject to change in the future @@ -419,7 +419,7 @@ public DocSet computeBaseDocSet() throws IOException { } if (excludeSet.size() == 0) return docs; - List qlist = new ArrayList(); + List qlist = new ArrayList<>(); // add the base query if (!excludeSet.containsKey(rb.getQuery())) { diff --git a/solr/core/src/java/org/apache/solr/handler/tagger/TaggerRequestHandler.java b/solr/core/src/java/org/apache/solr/handler/tagger/TaggerRequestHandler.java index 05b01f1800f..510be22e385 100644 --- a/solr/core/src/java/org/apache/solr/handler/tagger/TaggerRequestHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/tagger/TaggerRequestHandler.java @@ -324,7 +324,7 @@ private Bits computeDocCorpus(SolrQueryRequest req) throws SyntaxError, IOExcept final SolrIndexSearcher searcher = req.getSearcher(); final Bits docBits; if (corpusFilterQueries != null && corpusFilterQueries.length > 0) { - List filterQueries = new ArrayList(corpusFilterQueries.length); + List filterQueries = new ArrayList<>(corpusFilterQueries.length); for (String corpusFilterQuery : corpusFilterQueries) { QParser qParser = QParser.getParser(corpusFilterQuery, null, req); try { diff --git a/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java b/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java index 134175d0b02..9285804aa00 100644 --- a/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java +++ b/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java @@ -90,7 +90,7 @@ protected boolean emptyArray(String[] arr) { protected static String[] expandWildcardsInFields( Supplier> availableFieldNamesSupplier, String... inFields) { - Set expandedFields = new LinkedHashSet(); + Set expandedFields = new LinkedHashSet<>(); Collection availableFieldNames = null; for (String inField : inFields) { for (String field : SolrPluginUtils.split(inField)) { diff --git a/solr/core/src/java/org/apache/solr/logging/CircularList.java b/solr/core/src/java/org/apache/solr/logging/CircularList.java index 8031671b1e3..1c9909fb14d 100644 --- a/solr/core/src/java/org/apache/solr/logging/CircularList.java +++ b/solr/core/src/java/org/apache/solr/logging/CircularList.java @@ -126,7 +126,7 @@ public String toString() { @Override public Iterator iterator() { - return new Iterator() { + return new Iterator<>() { int idx = 0; @Override diff --git a/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java b/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java index d0826a30356..5b67b92c9d0 100644 --- a/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java +++ b/solr/core/src/java/org/apache/solr/packagemanager/RepositoryManager.java @@ -252,7 +252,7 @@ private List downloadPackageArtifacts(String packageName, String version) throws SolrException { try { SolrPackageRelease release = getPackageRelease(packageName, version); - List downloadedPaths = new ArrayList(release.artifacts.size()); + List downloadedPaths = new ArrayList<>(release.artifacts.size()); for (PackageRepository repo : getRepositories()) { if (repo.hasPackage(packageName)) { diff --git a/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java b/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java index 337bc6a330c..96bf3d51064 100644 --- a/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java +++ b/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java @@ -627,7 +627,7 @@ protected Query newGraphSynonymQuery(Iterator sidePathQueriesIterator) { protected Query newSynonymQuery(TermAndBoost[] terms) { switch (synonymQueryStyle) { case PICK_BEST: - List currPosnClauses = new ArrayList(terms.length); + List currPosnClauses = new ArrayList<>(terms.length); for (TermAndBoost term : terms) { currPosnClauses.add(newTermQuery(term.term, term.boost)); } diff --git a/solr/core/src/java/org/apache/solr/pkg/PackagePluginHolder.java b/solr/core/src/java/org/apache/solr/pkg/PackagePluginHolder.java index ccd28f7108d..ac5ed94d63c 100644 --- a/solr/core/src/java/org/apache/solr/pkg/PackagePluginHolder.java +++ b/solr/core/src/java/org/apache/solr/pkg/PackagePluginHolder.java @@ -79,15 +79,15 @@ public static PluginBag.PluginHolder createHolder(T inst, Class type) SolrConfig.SolrPluginInfo plugin = SolrConfig.classVsSolrPluginInfo.get(type.getName()); PluginInfo info = new PluginInfo(plugin.tag, Collections.singletonMap("class", inst.getClass().getName())); - return new PluginBag.PluginHolder(info, inst); + return new PluginBag.PluginHolder<>(info, inst); } public static PluginBag.PluginHolder createHolder( PluginInfo info, SolrCore core, Class type, String msg) { if (info.cName.pkg == null) { - return new PluginBag.PluginHolder(info, core.createInitInstance(info, type, msg, null)); + return new PluginBag.PluginHolder<>(info, core.createInitInstance(info, type, msg, null)); } else { - return new PackagePluginHolder( + return new PackagePluginHolder<>( info, core, SolrConfig.classVsSolrPluginInfo.get(type.getName())); } } diff --git a/solr/core/src/java/org/apache/solr/request/NumericFacets.java b/solr/core/src/java/org/apache/solr/request/NumericFacets.java index f7789f6c5d7..698f14fa3a8 100644 --- a/solr/core/src/java/org/apache/solr/request/NumericFacets.java +++ b/solr/core/src/java/org/apache/solr/request/NumericFacets.java @@ -272,7 +272,7 @@ public long longValue() throws IOException { if (FacetParams.FACET_SORT_COUNT.equals(sort) || FacetParams.FACET_SORT_COUNT_LEGACY.equals(sort)) { pq = - new PriorityQueue(pqSize) { + new PriorityQueue<>(pqSize) { @Override protected boolean lessThan(Entry a, Entry b) { if (a.count < b.count || (a.count == b.count && a.bits > b.bits)) { @@ -284,7 +284,7 @@ protected boolean lessThan(Entry a, Entry b) { }; } else { pq = - new PriorityQueue(pqSize) { + new PriorityQueue<>(pqSize) { @Override protected boolean lessThan(Entry a, Entry b) { return a.bits > b.bits; @@ -518,7 +518,7 @@ private static NamedList getCountsMultiValued( if (FacetParams.FACET_SORT_COUNT.equals(sort) || FacetParams.FACET_SORT_COUNT_LEGACY.equals(sort)) { pq = - new PriorityQueue(pqSize) { + new PriorityQueue<>(pqSize) { @Override protected boolean lessThan(Entry a, Entry b) { if (a.count < b.count || (a.count == b.count && a.bits > b.bits)) { @@ -531,7 +531,7 @@ protected boolean lessThan(Entry a, Entry b) { } else { // sort=index pq = - new PriorityQueue(pqSize) { + new PriorityQueue<>(pqSize) { @Override protected boolean lessThan(Entry a, Entry b) { return a.bits > b.bits; diff --git a/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java b/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java index 78158beaca7..ab602124137 100644 --- a/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java +++ b/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java @@ -146,7 +146,7 @@ NamedList getFacetCounts(Executor executor) throws IOException { // now merge the per-segment results PriorityQueue queue = - new PriorityQueue(leaves.size()) { + new PriorityQueue<>(leaves.size()) { @Override protected boolean lessThan(SegFacet a, SegFacet b) { return a.tempBR.compareTo(b.tempBR) < 0; diff --git a/solr/core/src/java/org/apache/solr/request/json/ObjectUtil.java b/solr/core/src/java/org/apache/solr/request/json/ObjectUtil.java index 3ec27488321..337ce85974b 100644 --- a/solr/core/src/java/org/apache/solr/request/json/ObjectUtil.java +++ b/solr/core/src/java/org/apache/solr/request/json/ObjectUtil.java @@ -104,7 +104,7 @@ public static void mergeObjects( @SuppressWarnings({"unchecked"}) Map sub = (Map) outer.get(path.get(i)); if (sub == null) { - sub = new LinkedHashMap(); + sub = new LinkedHashMap<>(); outer.put(path.get(i), sub); } outer = sub; diff --git a/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java b/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java index c22835dd743..74a1f4842ae 100644 --- a/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java +++ b/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java @@ -251,7 +251,7 @@ public Collection getRawFieldValues(String name) { @Override public Iterator> iterator() { Iterator> it = _fields.entrySet().iterator(); - return new Iterator>() { + return new Iterator<>() { @Override public boolean hasNext() { return it.hasNext(); diff --git a/solr/core/src/java/org/apache/solr/response/transform/SubQueryAugmenterFactory.java b/solr/core/src/java/org/apache/solr/response/transform/SubQueryAugmenterFactory.java index 8e6fcbf8059..12c96a2434f 100644 --- a/solr/core/src/java/org/apache/solr/response/transform/SubQueryAugmenterFactory.java +++ b/solr/core/src/java/org/apache/solr/response/transform/SubQueryAugmenterFactory.java @@ -281,7 +281,7 @@ protected String convertFieldValue(Object val) { @Override public Iterator getParameterNamesIterator() { final Iterator fieldNames = doc.getFieldNames().iterator(); - return new Iterator() { + return new Iterator<>() { @Override public boolean hasNext() { diff --git a/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java b/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java index c331a6b5c28..ff555d1e8bc 100644 --- a/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java +++ b/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java @@ -239,7 +239,7 @@ private Analyzer readAnalyzer(ConfigNode node) { final ArrayList charFilters = new ArrayList<>(); AbstractPluginLoader charFilterLoader = - new AbstractPluginLoader( + new AbstractPluginLoader<>( "[schema.xml] analyzer/charFilter", CharFilterFactory.class, false, false) { @Override @@ -303,7 +303,7 @@ protected CharFilterFactory register(String name, CharFilterFactory plugin) { final ArrayList tokenizers = new ArrayList<>(1); AbstractPluginLoader tokenizerLoader = - new AbstractPluginLoader( + new AbstractPluginLoader<>( "[schema.xml] analyzer/tokenizer", TokenizerFactory.class, false, false) { @Override @@ -375,7 +375,7 @@ protected TokenizerFactory register(String name, TokenizerFactory plugin) { final ArrayList filters = new ArrayList<>(); AbstractPluginLoader filterLoader = - new AbstractPluginLoader( + new AbstractPluginLoader<>( "[schema.xml] analyzer/filter", TokenFilterFactory.class, false, false) { @Override protected TokenFilterFactory create( diff --git a/solr/core/src/java/org/apache/solr/search/QueryContext.java b/solr/core/src/java/org/apache/solr/search/QueryContext.java index d542b14d6fb..2950aa73618 100644 --- a/solr/core/src/java/org/apache/solr/search/QueryContext.java +++ b/solr/core/src/java/org/apache/solr/search/QueryContext.java @@ -77,7 +77,7 @@ public Object put(Object key, Object val) { public void addCloseHook(Closeable closeable) { if (closeHooks == null) { - closeHooks = new IdentityHashMap(); + closeHooks = new IdentityHashMap<>(); // for now, defer closing until the end of the request SolrRequestInfo.getRequestInfo().addCloseHook(this); } diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetDebugInfo.java b/solr/core/src/java/org/apache/solr/search/facet/FacetDebugInfo.java index b35315148c8..189328b0c73 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetDebugInfo.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetDebugInfo.java @@ -32,8 +32,8 @@ public class FacetDebugInfo { Map reqDescription; public FacetDebugInfo() { - children = new ArrayList(); - info = new LinkedHashMap(); + children = new ArrayList<>(); + info = new LinkedHashMap<>(); } public void addChild(FacetDebugInfo child) { @@ -76,7 +76,7 @@ public SimpleOrderedMap getFacetDebugInfo() { info.addAll(this.info); if (children != null && children.size() > 0) { - List subfacet = new ArrayList(); + List subfacet = new ArrayList<>(); info.add("sub-facet", subfacet); for (FacetDebugInfo child : children) { subfacet.add(child.getFacetDebugInfo()); diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java b/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java index 322ecb4e8f1..d659562b862 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetHeatmap.java @@ -402,7 +402,7 @@ static int[] addPngToIntArray(byte[] pngBytes, int[] counts) { static List> asInts2D(final int columns, final int rows, final int[] counts) { // Returns a view versus returning a copy. This saves memory. // The data is oriented naturally for human/developer viewing: one row at a time top-down - return new AbstractList>() { + return new AbstractList<>() { @Override public List get(final int rowIdx) { // top-down remember; the heatmap.counts is bottom up check if all zeroes and return null if @@ -419,7 +419,7 @@ public List get(final int rowIdx) { return null; } - return new AbstractList() { + return new AbstractList<>() { @Override public Integer get(int columnIdx) { return counts[columnIdx * rows + y]; diff --git a/solr/core/src/java/org/apache/solr/search/facet/FacetQuery.java b/solr/core/src/java/org/apache/solr/search/facet/FacetQuery.java index 872cd8ef271..0c933725c6a 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/FacetQuery.java +++ b/solr/core/src/java/org/apache/solr/search/facet/FacetQuery.java @@ -38,7 +38,7 @@ public FacetMerger createFacetMerger(Object prototype) { @Override public Map getFacetDescription() { - Map descr = new HashMap(); + Map descr = new HashMap<>(); descr.put("query", q); return descr; } diff --git a/solr/core/src/java/org/apache/solr/search/facet/LegacyFacet.java b/solr/core/src/java/org/apache/solr/search/facet/LegacyFacet.java index 14d81f4a744..7ba90fc36d7 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/LegacyFacet.java +++ b/solr/core/src/java/org/apache/solr/search/facet/LegacyFacet.java @@ -121,8 +121,8 @@ protected static Map> parseSubFacets(SolrParams params) { protected void addQueryFacet(String q) { parseParams(FacetParams.FACET_QUERY, q); - Map cmd = new HashMap(2); - Map type = new HashMap(1); + Map cmd = new HashMap<>(2); + Map type = new HashMap<>(1); type.put("query", cmd); cmd.put("q", q); addSub(key, type); @@ -131,8 +131,8 @@ protected void addQueryFacet(String q) { protected void addRangeFacet(String field) { parseParams(FacetParams.FACET_RANGE, field); - Map cmd = new HashMap(5); - Map type = new HashMap(1); + Map cmd = new HashMap<>(5); + Map type = new HashMap<>(1); type.put("range", cmd); String f = key; diff --git a/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java b/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java index e8c24112fba..2a87adcc8fe 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java +++ b/solr/core/src/java/org/apache/solr/search/facet/RelatednessAgg.java @@ -150,7 +150,7 @@ public SlotAcc createSlotAcc(FacetContext fcontext, long numDocs, int numSlots) // How do we find our what key we have in the current context? // loop over all the stats in the current context until we find one that's '==' to this??? - List fgFilters = new ArrayList(3); + List fgFilters = new ArrayList<>(3); fgFilters.add(fgQ); for (FacetContext ctx = fcontext; ctx != null; ctx = ctx.parent) { if (null != ctx.filter) { diff --git a/solr/core/src/java/org/apache/solr/search/facet/UnionDISI.java b/solr/core/src/java/org/apache/solr/search/facet/UnionDISI.java index 51f40a9ee7f..eb568a359eb 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/UnionDISI.java +++ b/solr/core/src/java/org/apache/solr/search/facet/UnionDISI.java @@ -51,7 +51,7 @@ public void nextDoc() throws IOException { super(size, countAccs); this.maxIdx = size - 1; queue = - new PriorityQueue(size) { + new PriorityQueue<>(size) { @Override protected boolean lessThan(SubIterStruct a, SubIterStruct b) { return a.docId < b.docId; diff --git a/solr/core/src/java/org/apache/solr/search/facet/UnionDocIterator.java b/solr/core/src/java/org/apache/solr/search/facet/UnionDocIterator.java index 15fb0aa195e..69705c55015 100644 --- a/solr/core/src/java/org/apache/solr/search/facet/UnionDocIterator.java +++ b/solr/core/src/java/org/apache/solr/search/facet/UnionDocIterator.java @@ -50,7 +50,7 @@ public void nextDoc() { super(subIterators.length); this.maxIdx = size - 1; queue = - new PriorityQueue(size) { + new PriorityQueue<>(size) { @Override protected boolean lessThan(SubIterStruct a, SubIterStruct b) { return a.docId < b.docId; diff --git a/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java b/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java index 0a31d157241..9a5d8c73c60 100644 --- a/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java +++ b/solr/core/src/java/org/apache/solr/search/join/GraphEdgeCollector.java @@ -189,7 +189,7 @@ public Query getResultQuery(SchemaField matchField, boolean useAutomaton) { /** Build an automaton to represent the frontier query */ private Automaton buildAutomaton(BytesRefHash termBytesHash) { // need top pass a sorted set of terms to the autn builder (maybe a better way to avoid this?) - final TreeSet terms = new TreeSet(); + final TreeSet terms = new TreeSet<>(); for (int i = 0; i < termBytesHash.size(); i++) { BytesRef ref = new BytesRef(); termBytesHash.get(i, ref); diff --git a/solr/core/src/java/org/apache/solr/search/join/GraphQuery.java b/solr/core/src/java/org/apache/solr/search/join/GraphQuery.java index 433d0efd36f..6ee4ec44cb4 100644 --- a/solr/core/src/java/org/apache/solr/search/join/GraphQuery.java +++ b/solr/core/src/java/org/apache/solr/search/join/GraphQuery.java @@ -159,10 +159,10 @@ public Explanation explain(LeafReaderContext context, int doc) throws IOExceptio final Scorer cs = scorer(context); final boolean exists = (cs != null && cs.iterator().advance(doc) == doc); if (exists) { - List subs = new ArrayList(); + List subs = new ArrayList<>(); return Explanation.match(1.0F, "Graph Match", subs); } else { - List subs = new ArrayList(); + List subs = new ArrayList<>(); return Explanation.noMatch("No Graph Match.", subs); } } @@ -262,7 +262,7 @@ private DocSet resolveLeafNodes() throws IOException { /** Build an automaton to represent the frontier query */ private Automaton buildAutomaton(BytesRefHash termBytesHash) { // need top pass a sorted set of terms to the autn builder (maybe a better way to avoid this?) - final TreeSet terms = new TreeSet(); + final TreeSet terms = new TreeSet<>(); for (int i = 0; i < termBytesHash.size(); i++) { BytesRef ref = new BytesRef(); termBytesHash.get(i, ref); diff --git a/solr/core/src/java/org/apache/solr/search/join/ScoreModeParser.java b/solr/core/src/java/org/apache/solr/search/join/ScoreModeParser.java index a92a637908b..5a33c6740c5 100644 --- a/solr/core/src/java/org/apache/solr/search/join/ScoreModeParser.java +++ b/solr/core/src/java/org/apache/solr/search/join/ScoreModeParser.java @@ -27,7 +27,7 @@ class ScoreModeParser { @SuppressWarnings("serial") private static final Map lowerAndCapitalCase = Collections.unmodifiableMap( - new HashMap() { + new HashMap<>() { { for (ScoreMode s : ScoreMode.values()) { put(s.name().toLowerCase(Locale.ROOT), s); diff --git a/solr/core/src/java/org/apache/solr/search/stats/StatsUtil.java b/solr/core/src/java/org/apache/solr/search/stats/StatsUtil.java index fe4b1d8291c..0a61b94f63e 100644 --- a/solr/core/src/java/org/apache/solr/search/stats/StatsUtil.java +++ b/solr/core/src/java/org/apache/solr/search/stats/StatsUtil.java @@ -290,7 +290,7 @@ public static Map colStatsMapFromString(String data) { if (data == null || data.trim().length() == 0) { return null; } - Map map = new HashMap(); + Map map = new HashMap<>(); String[] entries = data.split(ENTRY_SEPARATOR); for (String es : entries) { CollectionStats stats = colStatsFromString(es); diff --git a/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java b/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java index ef0ac1e9f44..7cc7f798d57 100644 --- a/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java +++ b/solr/core/src/java/org/apache/solr/servlet/DirectSolrConnection.java @@ -68,7 +68,7 @@ public String request(String pathAndParams, String body) throws Exception { params = SolrRequestParsers.parseQueryString(pathAndParams.substring(idx + 1)); } else { path = pathAndParams; - params = new MapSolrParams(new HashMap()); + params = new MapSolrParams(new HashMap<>()); } return request(path, params, body); @@ -79,7 +79,7 @@ public String request(String path, SolrParams params, String body) throws Except SolrRequestHandler handler = core.getRequestHandler(path); if (handler == null) { if ("/select".equals(path) || "/select/".equalsIgnoreCase(path)) { - if (params == null) params = new MapSolrParams(new HashMap()); + if (params == null) params = new MapSolrParams(new HashMap<>()); String qt = params.get(CommonParams.QT); handler = core.getRequestHandler(qt); if (handler == null) { @@ -96,7 +96,7 @@ public String request(String path, SolrParams params, String body) throws Except public String request(SolrRequestHandler handler, SolrParams params, String body) throws Exception { - if (params == null) params = new MapSolrParams(new HashMap()); + if (params == null) params = new MapSolrParams(new HashMap<>()); // Make a stream for the 'body' content List streams = new ArrayList<>(1); diff --git a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java index 642a9b12a9f..7b5ddc2dce7 100644 --- a/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java +++ b/solr/core/src/java/org/apache/solr/update/SolrCmdDistributor.java @@ -65,7 +65,7 @@ public class SolrCmdDistributor implements Closeable { private int retryPause = 500; private final List allErrors = new ArrayList<>(); - private final List errors = Collections.synchronizedList(new ArrayList()); + private final List errors = Collections.synchronizedList(new ArrayList<>()); private final CompletionService completionService; private final Set> pending = new HashSet<>(); diff --git a/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java b/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java index 74a1fc4adc5..2d29e32dd00 100644 --- a/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java +++ b/solr/core/src/java/org/apache/solr/update/StreamingSolrClients.java @@ -44,7 +44,7 @@ public class StreamingSolrClients { private Http2SolrClient httpClient; private Map solrClients = new HashMap<>(); - private List errors = Collections.synchronizedList(new ArrayList()); + private List errors = Collections.synchronizedList(new ArrayList<>()); private ExecutorService updateExecutor; diff --git a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java index 8466f022368..6c75f8307f5 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java +++ b/solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java @@ -1280,7 +1280,7 @@ public DistributedUpdatesAsyncException(List errors) { this.errors = errors; // create a merged copy of the metadata from all wrapped exceptions - NamedList metadata = new NamedList(); + NamedList metadata = new NamedList<>(); for (Error error : errors) { if (error.e instanceof SolrException) { SolrException e = (SolrException) error.e; diff --git a/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java index be0c82cbeab..1899a10e31d 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/ParseDoubleFieldUpdateProcessorFactory.java @@ -71,7 +71,7 @@ private static final class ParseDoubleFieldUpdateProcessor private final Locale locale; // NumberFormat instances are not thread safe private final ThreadLocal numberFormat = - new ThreadLocal() { + new ThreadLocal<>() { @Override protected NumberFormat initialValue() { NumberFormat format = NumberFormat.getInstance(locale); diff --git a/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java index dc1462b2f56..599a5f32603 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/ParseFloatFieldUpdateProcessorFactory.java @@ -71,7 +71,7 @@ private static class ParseFloatFieldUpdateProcessor // NumberFormat instances are not thread safe private final ThreadLocal numberFormat = - new ThreadLocal() { + new ThreadLocal<>() { @Override protected NumberFormat initialValue() { NumberFormat format = NumberFormat.getInstance(locale); diff --git a/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java index 01b50ad5c9d..9d9204e39b9 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/ParseIntFieldUpdateProcessorFactory.java @@ -69,7 +69,7 @@ private static final class ParseIntFieldUpdateProcessor // NumberFormat instances are not thread safe private final ThreadLocal numberFormat = - new ThreadLocal() { + new ThreadLocal<>() { @Override protected NumberFormat initialValue() { NumberFormat format = NumberFormat.getInstance(locale); diff --git a/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java index 02134dfed00..01b683ae6f1 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java +++ b/solr/core/src/java/org/apache/solr/update/processor/ParseLongFieldUpdateProcessorFactory.java @@ -69,7 +69,7 @@ private static class ParseLongFieldUpdateProcessor // NumberFormat instances are not thread safe private final ThreadLocal numberFormat = - new ThreadLocal() { + new ThreadLocal<>() { @Override protected NumberFormat initialValue() { NumberFormat format = NumberFormat.getInstance(locale); diff --git a/solr/core/src/java/org/apache/solr/update/processor/TolerantUpdateProcessor.java b/solr/core/src/java/org/apache/solr/update/processor/TolerantUpdateProcessor.java index 77612ffdd92..73d4fd97faa 100644 --- a/solr/core/src/java/org/apache/solr/update/processor/TolerantUpdateProcessor.java +++ b/solr/core/src/java/org/apache/solr/update/processor/TolerantUpdateProcessor.java @@ -86,7 +86,7 @@ public class TolerantUpdateProcessor extends UpdateRequestProcessor { * Known errors that occurred in this batch, in order encountered (may not be the same as the * order the commands were originally executed in due to the async distributed updates). */ - private final List knownErrors = new ArrayList(); + private final List knownErrors = new ArrayList<>(); // Kludge: Because deleteByQuery updates are forwarded to every leader, we can get identical // errors reported by every leader for the same underlying problem. @@ -372,7 +372,7 @@ public void annotate(List errors) { NamedList firstErrMetadata = first.getMetadata(); if (null == firstErrMetadata) { // obnoxious - firstErrMetadata = new NamedList(); + firstErrMetadata = new NamedList<>(); first.setMetadata(firstErrMetadata); } else { // any existing metadata representing ToleratedUpdateErrors in this single exception needs diff --git a/solr/core/src/java/org/apache/solr/util/DistanceUnits.java b/solr/core/src/java/org/apache/solr/util/DistanceUnits.java index bd2feae292a..8c0bc91fd24 100644 --- a/solr/core/src/java/org/apache/solr/util/DistanceUnits.java +++ b/solr/core/src/java/org/apache/solr/util/DistanceUnits.java @@ -119,7 +119,7 @@ public String getStringIdentifier() { public static synchronized void addUnits( String strId, double earthRadius, double multiplierThisToDegrees) { // copy-on-write. - Map map = new HashMap(instances); + Map map = new HashMap<>(instances); map.put(strId, new DistanceUnits(strId, earthRadius, multiplierThisToDegrees)); instances = ImmutableMap.copyOf(map); } diff --git a/solr/core/src/java/org/apache/solr/util/TestInjection.java b/solr/core/src/java/org/apache/solr/util/TestInjection.java index 80f0cd7f56b..3bae33adf7d 100644 --- a/solr/core/src/java/org/apache/solr/util/TestInjection.java +++ b/solr/core/src/java/org/apache/solr/util/TestInjection.java @@ -141,7 +141,7 @@ static Random random() { // non-private for testing public static volatile String wrongIndexFingerprint = null; - private static volatile Set timers = Collections.synchronizedSet(new HashSet()); + private static volatile Set timers = Collections.synchronizedSet(new HashSet<>()); private static volatile AtomicInteger countPrepRecoveryOpPauseForever = new AtomicInteger(0); diff --git a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java index 806dd4f896c..de8505bc4d7 100644 --- a/solr/core/src/test/org/apache/solr/TestRandomFaceting.java +++ b/solr/core/src/test/org/apache/solr/TestRandomFaceting.java @@ -358,7 +358,7 @@ private String getExpectationForSortByCount(ModifiableSolrParams params, List { List facetSortedByIndex = (List) e.getValue(); Map> stratas = - new HashMap>() { + new HashMap<>() { @Override // poor man multimap, I won't do that anymore, I swear. public List get(Object key) { if (!containsKey(key)) { diff --git a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java index d27fbe00c1f..379345e5472 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ChaosMonkeyNothingIsSafeWithPullReplicasTest.java @@ -354,7 +354,7 @@ public void test() throws Exception { } private Set getAddFails(List threads) { - Set addFails = new HashSet(); + Set addFails = new HashSet<>(); for (StoppableIndexingThread thread : threads) { addFails.addAll(thread.getAddFails()); // addFails.addAll(thread.getAddFailsMinRf()); @@ -363,7 +363,7 @@ private Set getAddFails(List threads) { } private Set getDeleteFails(List threads) { - Set deleteFails = new HashSet(); + Set deleteFails = new HashSet<>(); for (StoppableIndexingThread thread : threads) { deleteFails.addAll(thread.getDeleteFails()); // deleteFails.addAll(thread.getDeleteFailsMinRf()); diff --git a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java index c7dcbc40e71..42cd7278909 100644 --- a/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/HttpPartitionTest.java @@ -522,7 +522,7 @@ protected List getActiveOrRecoveringReplicas(String testCollectionName, } } } - List replicas = new ArrayList(); + List replicas = new ArrayList<>(); replicas.addAll(activeReplicas.values()); return replicas; } @@ -538,7 +538,7 @@ protected void assertDocsExistInAllReplicas( Replica leader = ZkStateReader.from(cloudClient).getLeaderRetry(testCollectionName, "shard1", 10000); HttpSolrClient leaderSolr = getHttpSolrClient(leader, testCollectionName); - List replicas = new ArrayList(notLeaders.size()); + List replicas = new ArrayList<>(notLeaders.size()); for (Replica r : notLeaders) { replicas.add(getHttpSolrClient(r, testCollectionName)); diff --git a/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java b/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java index 59739a19066..73b5f47c765 100644 --- a/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/OutOfBoxZkACLAndCredentialsProvidersTest.java @@ -120,7 +120,7 @@ public void testOutOfBoxSolrZkClient() throws Exception { public void testOpenACLUnsafeAllover() throws Exception { SolrZkClient zkClient = new SolrZkClient(zkServer.getZkHost(), AbstractZkTestCase.TIMEOUT); try { - List verifiedList = new ArrayList(); + List verifiedList = new ArrayList<>(); assertOpenACLUnsafeAllover(zkClient, "/", verifiedList); assertTrue(verifiedList.contains("/solr")); assertTrue(verifiedList.contains("/solr/unprotectedCreateNode")); diff --git a/solr/core/src/test/org/apache/solr/cloud/OverseerSolrResponseTest.java b/solr/core/src/test/org/apache/solr/cloud/OverseerSolrResponseTest.java index 5caeeaef5e2..8dcdeeea8aa 100644 --- a/solr/core/src/test/org/apache/solr/cloud/OverseerSolrResponseTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/OverseerSolrResponseTest.java @@ -24,7 +24,7 @@ public class OverseerSolrResponseTest extends SolrTestCaseJ4 { public void testEmpty() { - assertSerializeDeserialize(new NamedList()); + assertSerializeDeserialize(new NamedList<>()); } public void testWithSingleObject() { diff --git a/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java b/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java index 3a20e85d6aa..042e7293cc2 100644 --- a/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java +++ b/solr/core/src/test/org/apache/solr/cloud/ReplicationFactorTest.java @@ -116,7 +116,7 @@ protected void testRf2NotUsingDirectUpdates() throws Exception { ensureAllReplicasAreActive(testCollectionName, shardId, numShards, replicationFactor, 30); assertTrue("Expected active 1 replicas for " + testCollectionName, replicas.size() == 1); - List batch = new ArrayList(10); + List batch = new ArrayList<>(10); for (int i = 0; i < 15; i++) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, String.valueOf(i)); @@ -227,7 +227,7 @@ protected void sendNonDirectDeletesRequestReplicaWithRetry( // First add the docs indicated List byIdsList = new ArrayList<>(); List byQueryList = new ArrayList<>(); - List batch = new ArrayList(10); + List batch = new ArrayList<>(10); for (int myId : byIdsSet) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, myId); @@ -322,7 +322,7 @@ protected void testRf3() throws Exception { doDBIdWithRetry(2, 5, "deletes should have propagated to 2 replicas", 1); // SOLR-13599 sanity check if problem is related to sending a batch - List batch = new ArrayList(15); + List batch = new ArrayList<>(15); for (int i = 30; i < 45; i++) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, String.valueOf(i)); @@ -360,7 +360,7 @@ protected void testRf3() throws Exception { doDBIdWithRetry(3, 5, "delete should have propagated to all 3 replicas", 1); // now send a batch - batch = new ArrayList(10); + batch = new ArrayList<>(10); for (int i = 5; i < 15; i++) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, String.valueOf(i)); @@ -386,7 +386,7 @@ protected void testRf3() throws Exception { assertRf(2, "doc should have succeeded, only one replica should be down", rf); // now send a batch (again) - batch = new ArrayList(10); + batch = new ArrayList<>(10); for (int i = 15; i < 30; i++) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, String.valueOf(i)); @@ -404,7 +404,7 @@ protected void testRf3() throws Exception { log.info("Closing second proxy port (again)"); getProxyForReplica(replicas.get(1)).close(); - batch = new ArrayList(10); + batch = new ArrayList<>(10); for (int i = 30; i < 45; i++) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, String.valueOf(i)); @@ -435,7 +435,7 @@ protected void addDocs(Set docIds, int expectedRf, int retries) throws sendDoc(idList[0]); return; } - List batch = new ArrayList(10); + List batch = new ArrayList<>(10); for (int docId : idList) { SolrInputDocument doc = new SolrInputDocument(); doc.addField(id, docId); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java index b6ff6344a91..eda82a06c84 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudInspectUtil.java @@ -53,8 +53,8 @@ public void testCheckIfDiffIsLegal() { // ################################ - addFails = new HashSet(); - deleteFails = new HashSet(); + addFails = new HashSet<>(); + deleteFails = new HashSet<>(); a = getDocList("2", "3", "4"); b = getDocList("2", "3"); @@ -66,8 +66,8 @@ public void testCheckIfDiffIsLegal() { // ################################ - addFails = new HashSet(); - deleteFails = new HashSet(); + addFails = new HashSet<>(); + deleteFails = new HashSet<>(); a = getDocList("2", "3", "4"); b = getDocList("2", "3", "5"); @@ -80,8 +80,8 @@ public void testCheckIfDiffIsLegal() { // ################################ - addFails = new HashSet(); - deleteFails = new HashSet(); + addFails = new HashSet<>(); + deleteFails = new HashSet<>(); a = getDocList("2", "3", "4"); b = getDocList("2", "3", "5"); @@ -94,8 +94,8 @@ public void testCheckIfDiffIsLegal() { // ################################ - final HashSet addFailsExpectEx = new HashSet(); - final HashSet deleteFailsExpectEx = new HashSet(); + final HashSet addFailsExpectEx = new HashSet<>(); + final HashSet deleteFailsExpectEx = new HashSet<>(); final SolrDocumentList aExpectEx = getDocList("2", "3", "4"); final SolrDocumentList bExpectEx = getDocList("2", "3", "4"); diff --git a/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java b/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java index babe1eac002..c4b372ceb99 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestCloudPivotFacet.java @@ -170,7 +170,7 @@ public void test() throws Exception { ModifiableSolrParams pivotP = params(FACET, "true"); // put our FACET_PIVOT params in a set in case we just happen to pick the same one twice - LinkedHashSet pivotParamValues = new LinkedHashSet(); + LinkedHashSet pivotParamValues = new LinkedHashSet<>(); pivotParamValues.add(buildPivotParamValue(buildRandomPivot(fieldNames))); if (random().nextBoolean()) { diff --git a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java index 26cf55b47a4..7a2b59f8c75 100644 --- a/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java +++ b/solr/core/src/test/org/apache/solr/cloud/TestConfigSetsAPIExclusivity.java @@ -81,7 +81,7 @@ public void testAPIExclusivity() throws Exception { for (ConfigSetsAPIThread thread : threads) { thread.join(); } - List exceptions = new LinkedList(); + List exceptions = new LinkedList<>(); for (ConfigSetsAPIThread thread : threads) { exceptions.addAll(thread.getUnexpectedExceptions()); } @@ -107,7 +107,7 @@ private Exception getFirstExceptionOrNull(List list) { private abstract static class ConfigSetsAPIThread extends Thread { private MiniSolrCloudCluster solrCluster; private int trials; - private List unexpectedExceptions = new LinkedList(); + private List unexpectedExceptions = new LinkedList<>(); private List allowedExceptions = Arrays.asList( new String[] { diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java index ffac0698973..a4f2e96b927 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedDebugComponentTest.java @@ -199,7 +199,7 @@ public void testRandom() throws Exception { } q.setQuery(qs); - Set shards = new HashSet(Arrays.asList(shard1, shard2)); + Set shards = new HashSet<>(Arrays.asList(shard1, shard2)); if (random().nextBoolean()) { shards.remove(shard1); } else if (random().nextBoolean()) { @@ -207,7 +207,7 @@ public void testRandom() throws Exception { } q.set("shards", String.join(",", shards)); - List debug = new ArrayList(10); + List debug = new ArrayList<>(10); boolean all = false; final boolean timing = random().nextBoolean(); diff --git a/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java b/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java index 38574cba64f..2d3fce4a44e 100644 --- a/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java +++ b/solr/core/src/test/org/apache/solr/handler/component/DistributedTermsComponentTest.java @@ -186,7 +186,7 @@ protected QueryResponse query(Object... q) throws Exception { // SOLR-9243 doesn't support max/min count for (int i = 0; i < q.length; i += 2) { if (q[i].equals("terms.sort") && q[i + 1].equals("index") || rarely()) { - List params = new ArrayList(Arrays.asList(q)); + List params = new ArrayList<>(Arrays.asList(q)); if (usually()) { params.add("terms.mincount"); params.add(random().nextInt(4) - 1); diff --git a/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java b/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java index 3d1e5c24085..73c47e14690 100644 --- a/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java +++ b/solr/core/src/test/org/apache/solr/highlight/HighlighterTest.java @@ -902,13 +902,13 @@ public void testGetHighlightFields() { // SOLR-5127 args.put("hl.fl", (random().nextBoolean() ? "foo_*,bar_*" : "bar_*,foo_*")); // hl.fl ordering need not be preserved in output - final Set highlightedSetExpected = new HashSet(); + final Set highlightedSetExpected = new HashSet<>(); highlightedSetExpected.add("foo_s"); highlightedSetExpected.add("bar_s"); try (var localRequest = req(args, "q", "test")) { highlighter = getHighlighter(); final Set highlightedSetActual = - new HashSet( + new HashSet<>( Arrays.asList(highlighter.getHighlightFields(null, localRequest, new String[] {}))); assertEquals(highlightedSetExpected, highlightedSetActual); } diff --git a/solr/core/src/test/org/apache/solr/request/macro/TestMacroExpander.java b/solr/core/src/test/org/apache/solr/request/macro/TestMacroExpander.java index 88e0b19efdf..680b85985b5 100644 --- a/solr/core/src/test/org/apache/solr/request/macro/TestMacroExpander.java +++ b/solr/core/src/test/org/apache/solr/request/macro/TestMacroExpander.java @@ -27,7 +27,7 @@ public class TestMacroExpander extends SolrTestCase { @Test public void testExamples() { - final Map testParams = new HashMap(); + final Map testParams = new HashMap<>(); final MacroExpander me; // example behavior unaffected by absence or value of failOnMissingParams if (random().nextBoolean()) { @@ -73,7 +73,7 @@ public void testExamples() { @Test public void testOnMissingParams() { - final Map testParams = new HashMap(); + final Map testParams = new HashMap<>(); final MacroExpander meSkipOnMissingParams = new MacroExpander(testParams); final MacroExpander meFailOnMissingParams = new MacroExpander(testParams, true); diff --git a/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java b/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java index b99555f42f3..c76a2afdbe1 100644 --- a/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java +++ b/solr/core/src/test/org/apache/solr/schema/SpatialRPTFieldTypeTest.java @@ -159,7 +159,7 @@ public void testMaxDistErrConversion() throws Exception { IndexSchema oldSchema = h.getCore().getLatestSchema(); SpatialRecursivePrefixTreeFieldType rptFieldType = new SpatialRecursivePrefixTreeFieldType(); - Map rptMap = new HashMap(); + Map rptMap = new HashMap<>(); rptFieldType.setTypeName("location_rpt"); rptMap.put("geo", "true"); @@ -282,7 +282,7 @@ private void setupRPTField(String distanceUnits, String format, FieldType fieldT if (fieldType == null) { fieldType = new SpatialRecursivePrefixTreeFieldType(); } - Map rptMap = new HashMap(); + Map rptMap = new HashMap<>(); if (distanceUnits != null) rptMap.put("distanceUnits", distanceUnits); rptMap.put("geo", "true"); if (format != null) { diff --git a/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java b/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java index 67c42a7e4c2..a68b5b332be 100644 --- a/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java +++ b/solr/core/src/test/org/apache/solr/search/ReturnFieldsTest.java @@ -440,7 +440,7 @@ public void testWhiteboxSolrDocumentConversion() { assertEquals(debug, 5, docOut.size()); assertEquals( debug, - new HashSet(Arrays.asList("id", "subword", "uniq", "foo_2_s1", "store")), + new HashSet<>(Arrays.asList("id", "subword", "uniq", "foo_2_s1", "store")), docOut.getFieldNames()); assertTrue(debug, docOut.get("id") instanceof StringField); assertTrue(debug, docOut.get("store") instanceof StringField); diff --git a/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java index 90f89b539dd..84d0060d9a8 100644 --- a/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java +++ b/solr/core/src/test/org/apache/solr/search/TestComplexPhraseQParserPlugin.java @@ -95,7 +95,7 @@ public void testDefaultField() { @Test public void test() { - HashMap args = new HashMap(); + HashMap args = new HashMap<>(); args.put(QueryParsing.DEFTYPE, ComplexPhraseQParserPlugin.NAME); args.put(CommonParams.FL, "id"); @@ -175,7 +175,7 @@ public void test() { @Test public void testPhraseHighlighter() { - HashMap args = new HashMap(); + HashMap args = new HashMap<>(); args.put(QueryParsing.DEFTYPE, ComplexPhraseQParserPlugin.NAME); args.put(CommonParams.FL, "id"); diff --git a/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java b/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java index 2bdf1d55373..b485f0a1055 100644 --- a/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java +++ b/solr/core/src/test/org/apache/solr/search/TestMissingGroups.java @@ -47,7 +47,7 @@ public void testGroupsOnMissingValues() { // setup some key values for some random docs in our index // every other doc will have no values for these fields // NOTE: special values may be randomly assigned to the *same* docs - final List specials = new ArrayList(7); + final List specials = new ArrayList<>(7); specials.add(new SpecialField(numDocs, "group_s1", "xxx", "yyy")); specials.add(new SpecialField(numDocs, "group_ti", "42", "24")); specials.add(new SpecialField(numDocs, "group_td", "34.56", "12.78")); diff --git a/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java b/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java index 72da402582f..62ac2b2b9b2 100644 --- a/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java +++ b/solr/core/src/test/org/apache/solr/search/TestRandomCollapseQParserPlugin.java @@ -70,7 +70,7 @@ public static void buildIndexAndClient() throws Exception { CursorPagingTest.pruneAndDeterministicallySort( h.getCore().getLatestSchema().getFields().keySet()); - ALL_COLLAPSE_FIELD_NAMES = new ArrayList(ALL_SORT_FIELD_NAMES.size()); + ALL_COLLAPSE_FIELD_NAMES = new ArrayList<>(ALL_SORT_FIELD_NAMES.size()); for (String candidate : ALL_SORT_FIELD_NAMES) { if (candidate.startsWith("str") || candidate.startsWith("float") diff --git a/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java b/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java index 02ef05727e4..68692e45ed7 100644 --- a/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java +++ b/solr/core/src/test/org/apache/solr/search/facet/TestCloudJSONFacetJoinDomain.java @@ -587,7 +587,7 @@ private static String buildRandomQuery() { return "*:*"; } final int numClauses = TestUtil.nextInt(random(), 3, 10); - List clauses = new ArrayList(numClauses); + List clauses = new ArrayList<>(numClauses); for (int c = 0; c < numClauses; c++) { final int fieldNum = random().nextInt(MAX_FIELD_NUM); // keep queries simple, just use str fields - not point of test diff --git a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java index 35c020625ea..374b2e510a6 100644 --- a/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java +++ b/solr/core/src/test/org/apache/solr/search/function/TestMinMaxOnMultiValuedField.java @@ -958,7 +958,7 @@ private void testExpectedSortOrdering( sf.sortMissingFirst() || sf.sortMissingLast()); // make a copy we can re-order later - final List vals = new ArrayList(sortedValues.length); + final List vals = new ArrayList<>(sortedValues.length); Collections.addAll(vals, sortedValues); String minFunc = "field(" + f + ",min)"; diff --git a/solr/core/src/test/org/apache/solr/security/MultiDestinationAuditLoggerTest.java b/solr/core/src/test/org/apache/solr/security/MultiDestinationAuditLoggerTest.java index da0c4ab286d..84f46717f51 100644 --- a/solr/core/src/test/org/apache/solr/security/MultiDestinationAuditLoggerTest.java +++ b/solr/core/src/test/org/apache/solr/security/MultiDestinationAuditLoggerTest.java @@ -34,7 +34,7 @@ public void init() throws IOException { config.put("class", "solr.MultiDestinationAuditLogger"); config.put("async", false); config.put("eventTypes", Arrays.asList(AuditEvent.EventType.COMPLETED.name())); - ArrayList> plugins = new ArrayList>(); + ArrayList> plugins = new ArrayList<>(); Map conf1 = new HashMap<>(); conf1.put("class", "solr.SolrLogAuditLoggerPlugin"); diff --git a/solr/core/src/test/org/apache/solr/uninverting/TestUninvertingReader.java b/solr/core/src/test/org/apache/solr/uninverting/TestUninvertingReader.java index 972ebacde65..50993bd1600 100644 --- a/solr/core/src/test/org/apache/solr/uninverting/TestUninvertingReader.java +++ b/solr/core/src/test/org/apache/solr/uninverting/TestUninvertingReader.java @@ -232,12 +232,12 @@ public void testSortedSetIntegerManyValues() throws IOException { final LegacyFieldType NO_TRIE_TYPE = new LegacyFieldType(LegacyIntField.TYPE_NOT_STORED); NO_TRIE_TYPE.setNumericPrecisionStep(Integer.MAX_VALUE); - final Map UNINVERT_MAP = new LinkedHashMap(); + final Map UNINVERT_MAP = new LinkedHashMap<>(); UNINVERT_MAP.put("notrie_single", Type.SORTED_SET_INTEGER); UNINVERT_MAP.put("notrie_multi", Type.SORTED_SET_INTEGER); UNINVERT_MAP.put("trie_single", Type.SORTED_SET_INTEGER); UNINVERT_MAP.put("trie_multi", Type.SORTED_SET_INTEGER); - final Set MULTI_VALUES = new LinkedHashSet(); + final Set MULTI_VALUES = new LinkedHashSet<>(); MULTI_VALUES.add("trie_multi"); MULTI_VALUES.add("notrie_multi"); @@ -331,7 +331,7 @@ public void testSortedSetEmptyIndex() throws IOException { final IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null)); iw.close(); - final Map UNINVERT_MAP = new LinkedHashMap(); + final Map UNINVERT_MAP = new LinkedHashMap<>(); for (Type t : EnumSet.allOf(Type.class)) { UNINVERT_MAP.put(t.name(), t); } diff --git a/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java b/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java index d0e5f10a1a2..4c87d0ad313 100644 --- a/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java +++ b/solr/core/src/test/org/apache/solr/update/UpdateParamsTest.java @@ -40,7 +40,7 @@ public void testUpdateProcessorParamDeprecationRemoved() { UpdateRequestHandler handler = new UpdateRequestHandler(); handler.init(null); - MapSolrParams params = new MapSolrParams(new HashMap()); + MapSolrParams params = new MapSolrParams(new HashMap<>()); params.getMap().put("update.processor", "nonexistent"); // Add a single document diff --git a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java index 1956db95684..48882ea7fd3 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/AtomicUpdatesTest.java @@ -79,7 +79,7 @@ public void testRemove() { doc = new SolrInputDocument(); doc.setField("id", "1"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add("bbb"); removeList.add("ccc"); doc.setField( @@ -95,7 +95,7 @@ public void testRemove() { doc = new SolrInputDocument(); doc.setField("id", "21"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add("bbb"); removeList.add("ccc"); doc.setField( @@ -150,7 +150,7 @@ public void testRemoveInteger() { doc = new SolrInputDocument(); doc.setField("id", "1001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(222L); removeList.add(333L); doc.setField( @@ -167,7 +167,7 @@ public void testRemoveInteger() { doc = new SolrInputDocument(); doc.setField("id", "1021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(222L); removeList.add(333L); doc.setField( @@ -241,7 +241,7 @@ public void testRemoveIntegerInDocSavedWithInteger() { doc = new SolrInputDocument(); doc.setField("id", "1001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(222L); removeList.add(333L); doc.setField( @@ -258,7 +258,7 @@ public void testRemoveIntegerInDocSavedWithInteger() { doc = new SolrInputDocument(); doc.setField("id", "1021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(222L); removeList.add(333L); doc.setField( @@ -330,7 +330,7 @@ public void testRemoveIntegerUsingStringType() { doc = new SolrInputDocument(); doc.setField("id", "1001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add("222"); removeList.add("333"); doc.setField( @@ -347,7 +347,7 @@ public void testRemoveIntegerUsingStringType() { doc = new SolrInputDocument(); doc.setField("id", "1021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add("222"); removeList.add("333"); doc.setField( @@ -403,7 +403,7 @@ public void testRemoveIntegerUsingLongType() { doc = new SolrInputDocument(); doc.setField("id", "1001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(222L); removeList.add(333L); doc.setField( @@ -420,7 +420,7 @@ public void testRemoveIntegerUsingLongType() { doc = new SolrInputDocument(); doc.setField("id", "1021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(222L); removeList.add(333L); doc.setField( @@ -495,7 +495,7 @@ public void testRemoveIntegerUsingFloatType() { doc = new SolrInputDocument(); doc.setField("id", "1001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(222.20F); removeList.add(333.30F); doc.setField( @@ -512,7 +512,7 @@ public void testRemoveIntegerUsingFloatType() { doc = new SolrInputDocument(); doc.setField("id", "1021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(222.20F); removeList.add(333.30F); doc.setField( @@ -570,7 +570,7 @@ public void testRemoveIntegerUsingDoubleType() { doc = new SolrInputDocument(); doc.setField("id", "1001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(22222222D); removeList.add(33333333D); doc.setField( @@ -587,7 +587,7 @@ public void testRemoveIntegerUsingDoubleType() { doc = new SolrInputDocument(); doc.setField("id", "1021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(22222222D); removeList.add(33333333D); doc.setField( @@ -673,7 +673,7 @@ public void testRemoveDateUsingStringType() { doc = new SolrInputDocument(); doc.setField("id", "10001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add("2014-09-02T12:00:00Z"); removeList.add("2014-09-03T12:00:00Z"); @@ -694,7 +694,7 @@ public void testRemoveDateUsingStringType() { doc = new SolrInputDocument(); doc.setField("id", "10021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add("2014-09-02T12:00:00Z"); removeList.add("2014-09-03T12:00:00Z"); doc.setField( @@ -801,7 +801,7 @@ public void testRemoveDateUsingDateType() { doc = new SolrInputDocument(); doc.setField("id", "10001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(DateMathParser.parseMath(null, "2014-09-02T12:00:00Z")); removeList.add(DateMathParser.parseMath(null, "2014-09-03T12:00:00Z")); @@ -821,7 +821,7 @@ public void testRemoveDateUsingDateType() { doc = new SolrInputDocument(); doc.setField("id", "10021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(DateMathParser.parseMath(null, "2014-09-02T12:00:00Z")); removeList.add(DateMathParser.parseMath(null, "2014-09-03T12:00:00Z")); doc.setField( @@ -885,7 +885,7 @@ public void testRemoveFloatUsingFloatType() { doc = new SolrInputDocument(); doc.setField("id", "10001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add(222.222F); removeList.add(333.333F); @@ -900,7 +900,7 @@ public void testRemoveFloatUsingFloatType() { doc = new SolrInputDocument(); doc.setField("id", "10021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add(222.222F); removeList.add(333.333F); doc.setField( @@ -959,7 +959,7 @@ public void testRemoveFloatUsingStringType() { doc = new SolrInputDocument(); doc.setField("id", "10001"); - List removeList = new ArrayList(); + List removeList = new ArrayList<>(); removeList.add("222.222"); removeList.add("333.333"); @@ -977,7 +977,7 @@ public void testRemoveFloatUsingStringType() { doc = new SolrInputDocument(); doc.setField("id", "10021"); - removeList = new ArrayList(); + removeList = new ArrayList<>(); removeList.add("222.222"); removeList.add("333.333"); doc.setField( diff --git a/solr/core/src/test/org/apache/solr/update/processor/IgnoreLargeDocumentProcessorFactoryTest.java b/solr/core/src/test/org/apache/solr/update/processor/IgnoreLargeDocumentProcessorFactoryTest.java index c84da2a84e3..e99cb770f69 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/IgnoreLargeDocumentProcessorFactoryTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/IgnoreLargeDocumentProcessorFactoryTest.java @@ -171,7 +171,7 @@ public void testEstimateObjectSizeWithChildList() { childDocument.addField(entry.getKey(), entry.getValue()); } List childList = - new ArrayList() { + new ArrayList<>() { { add(childDocument); add(new SolrInputDocument(childDocument)); diff --git a/solr/core/src/test/org/apache/solr/update/processor/RecordingUpdateProcessorFactory.java b/solr/core/src/test/org/apache/solr/update/processor/RecordingUpdateProcessorFactory.java index 41b3e121d07..3bac27571d2 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/RecordingUpdateProcessorFactory.java +++ b/solr/core/src/test/org/apache/solr/update/processor/RecordingUpdateProcessorFactory.java @@ -43,7 +43,7 @@ public final class RecordingUpdateProcessorFactory extends UpdateRequestProcesso * * @see #startRecording */ - public final BlockingQueue commandQueue = new LinkedBlockingQueue(); + public final BlockingQueue commandQueue = new LinkedBlockingQueue<>(); /** * @see #stopRecording diff --git a/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java b/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java index b3da9faf00f..7b73f9c3937 100644 --- a/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java +++ b/solr/core/src/test/org/apache/solr/update/processor/TolerantUpdateProcessorTest.java @@ -407,7 +407,7 @@ private void assertAddsSucceedWithErrors( assertEquals("number of errors", idsShouldFail.length, errors.size()); - Set addErrorIdsExpected = new HashSet(Arrays.asList(idsShouldFail)); + Set addErrorIdsExpected = new HashSet<>(Arrays.asList(idsShouldFail)); for (SimpleOrderedMap err : errors) { assertEquals("this method only expects 'add' errors", "ADD", err.get("type")); @@ -432,7 +432,7 @@ protected SolrQueryResponse add( assertNotNull("No Chain named: " + chain, pc); SolrQueryResponse rsp = new SolrQueryResponse(); - rsp.add("responseHeader", new SimpleOrderedMap()); + rsp.add("responseHeader", new SimpleOrderedMap<>()); if (requestParams == null) { requestParams = new ModifiableSolrParams(); diff --git a/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java b/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java index c7995fe4a66..c4696721433 100644 --- a/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java +++ b/solr/core/src/test/org/apache/solr/util/hll/ExplicitHLLTest.java @@ -157,7 +157,7 @@ public void toFromBytesTest() { @Test public void randomValuesTest() { final int explicitThreshold = 4096; - final HashSet canonical = new HashSet(); + final HashSet canonical = new HashSet<>(); final HLL hll = newHLL(explicitThreshold); for (int i = 0; i < explicitThreshold; i++) { diff --git a/solr/core/src/test/org/apache/solr/util/hll/HLLSerializationTest.java b/solr/core/src/test/org/apache/solr/util/hll/HLLSerializationTest.java index 0f0de77aa97..89f30a9083d 100644 --- a/solr/core/src/test/org/apache/solr/util/hll/HLLSerializationTest.java +++ b/solr/core/src/test/org/apache/solr/util/hll/HLLSerializationTest.java @@ -46,7 +46,7 @@ public class HLLSerializationTest extends SolrTestCase { public void serializationSmokeTest() throws Exception { final Random random = new Random(randomLong()); final int randomCount = 250; - final List randoms = new ArrayList(randomCount); + final List randoms = new ArrayList<>(randomCount); for (int i = 0; i < randomCount; i++) { randoms.add(random.nextLong()); } @@ -71,7 +71,7 @@ public void serializationSmokeTest() throws Exception { public void monsterHLLSerializationTest() throws Exception { final Random random = new Random(randomLong()); final int randomCount = 250; - final List randoms = new ArrayList(randomCount); + final List randoms = new ArrayList<>(randomCount); for (int i = 0; i < randomCount; i++) { randoms.add(random.nextLong()); } diff --git a/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetCloudTest.java b/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetCloudTest.java index 1febad1f926..99e7ac11187 100644 --- a/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetCloudTest.java +++ b/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetCloudTest.java @@ -50,17 +50,17 @@ public void afterTest() throws Exception { public void beforeTest() throws Exception { // INT - int1TestStart.add(new ArrayList()); - int2TestStart.add(new ArrayList()); + int1TestStart.add(new ArrayList<>()); + int2TestStart.add(new ArrayList<>()); // LONG - longTestStart.add(new ArrayList()); - longTestStart.add(new ArrayList()); + longTestStart.add(new ArrayList<>()); + longTestStart.add(new ArrayList<>()); // FLOAT - floatTestStart.add(new ArrayList()); - floatTestStart.add(new ArrayList()); - floatTestStart.add(new ArrayList()); + floatTestStart.add(new ArrayList<>()); + floatTestStart.add(new ArrayList<>()); + floatTestStart.add(new ArrayList<>()); UpdateRequest req = new UpdateRequest(); diff --git a/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetTest.java b/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetTest.java index 464df571726..d665638ec9a 100644 --- a/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetTest.java +++ b/solr/modules/analytics/src/test/org/apache/solr/analytics/legacy/facet/LegacyQueryFacetTest.java @@ -42,20 +42,20 @@ public void queryTest() throws Exception { h.update("*:*"); // INT ArrayList> int1TestStart = new ArrayList<>(); - int1TestStart.add(new ArrayList()); + int1TestStart.add(new ArrayList<>()); ArrayList> int2TestStart = new ArrayList<>(); - int2TestStart.add(new ArrayList()); + int2TestStart.add(new ArrayList<>()); // LONG ArrayList> longTestStart = new ArrayList<>(); - longTestStart.add(new ArrayList()); - longTestStart.add(new ArrayList()); + longTestStart.add(new ArrayList<>()); + longTestStart.add(new ArrayList<>()); // FLOAT ArrayList> floatTestStart = new ArrayList<>(); - floatTestStart.add(new ArrayList()); - floatTestStart.add(new ArrayList()); - floatTestStart.add(new ArrayList()); + floatTestStart.add(new ArrayList<>()); + floatTestStart.add(new ArrayList<>()); + floatTestStart.add(new ArrayList<>()); for (int j = 0; j < NUM_LOOPS; ++j) { int i = j % INT; diff --git a/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/AttributeOnlyServletContext.java b/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/AttributeOnlyServletContext.java index d4f10ab1ee7..63018f76141 100644 --- a/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/AttributeOnlyServletContext.java +++ b/solr/modules/hadoop-auth/src/java/org/apache/solr/security/hadoop/AttributeOnlyServletContext.java @@ -39,7 +39,7 @@ /** A concrete implementation of {@linkplain ServletContext} which support only attributes. */ class AttributeOnlyServletContext implements ServletContext { - private Map attributes = new HashMap(); + private Map attributes = new HashMap<>(); @Override public void setSessionTrackingModes(Set sessionTrackingModes) {} diff --git a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/HdfsLocalityReporter.java b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/HdfsLocalityReporter.java index 3080817b31b..c70675187ec 100644 --- a/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/HdfsLocalityReporter.java +++ b/solr/modules/hdfs/src/java/org/apache/solr/hdfs/store/HdfsLocalityReporter.java @@ -156,7 +156,7 @@ public void registerDirectory(HdfsDirectory dir) { log.info("Registering direcotry {} for locality metrics.", dir.getHdfsDirPath()); } } - cache.put(dir, new ConcurrentHashMap()); + cache.put(dir, new ConcurrentHashMap<>()); } /** diff --git a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java index d73414b3cf3..71a16a006cd 100644 --- a/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java +++ b/solr/modules/hdfs/src/test/org/apache/solr/hdfs/cloud/SharedFileSystemAutoReplicaFailoverTest.java @@ -95,7 +95,7 @@ public class SharedFileSystemAutoReplicaFailoverTest extends AbstractFullDistrib Integer.MAX_VALUE, 5, TimeUnit.SECONDS, - new SynchronousQueue(), + new SynchronousQueue<>(), new SolrNamedThreadFactory("testExecutor")); CompletionService completionService; diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java index 145e757c7d5..2162dfd3ecb 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/feature/SolrFeature.java @@ -205,7 +205,7 @@ public SolrFeatureWeight( private LocalSolrQueryRequest makeRequest( SolrCore core, String solrQuery, List fqs, String df) { - final NamedList returnList = new NamedList(); + final NamedList returnList = new NamedList<>(); if ((solrQuery != null) && !solrQuery.isEmpty()) { returnList.add(CommonParams.Q, solrQuery); } diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/model/LinearModel.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/model/LinearModel.java index 6b030f2d71a..ce63fed6e7d 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/model/LinearModel.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/model/LinearModel.java @@ -108,7 +108,7 @@ public LinearModel( protected void validate() throws ModelException { super.validate(); - final ArrayList missingWeightFeatureNames = new ArrayList(); + final ArrayList missingWeightFeatureNames = new ArrayList<>(); for (int i = 0; i < features.size(); ++i) { if (featureToWeight[i] == null) { missingWeightFeatureNames.add(features.get(i).getName()); diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/store/FeatureStore.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/store/FeatureStore.java index f554d63e37f..1e9f522c277 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/store/FeatureStore.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/store/FeatureStore.java @@ -55,7 +55,7 @@ public void add(Feature feature) { } public List getFeatures() { - final List storeValues = new ArrayList(store.values()); + final List storeValues = new ArrayList<>(store.values()); return Collections.unmodifiableList(storeValues); } diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java index 6242f932b23..ab2cb5b3592 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedFeatureStore.java @@ -171,7 +171,7 @@ public void doGet(BaseSolrResource endpoint, String childId) { private static List featuresAsManagedResources(FeatureStore store) { final List storedFeatures = store.getFeatures(); - final List features = new ArrayList(storedFeatures.size()); + final List features = new ArrayList<>(storedFeatures.size()); for (final Feature f : storedFeatures) { final LinkedHashMap m = toFeatureMap(f); m.put(FEATURE_STORE_NAME_KEY, store.getName()); diff --git a/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedModelStore.java b/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedModelStore.java index a0f0b989dbe..37a0735e15e 100644 --- a/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedModelStore.java +++ b/solr/modules/ltr/src/java/org/apache/solr/ltr/store/rest/ManagedModelStore.java @@ -315,7 +315,7 @@ private static Normalizer createNormalizerFromFeatureMap( } private static LinkedHashMap toFeatureMap(Feature feature, Normalizer norm) { - final LinkedHashMap map = new LinkedHashMap(2, 1.0f); + final LinkedHashMap map = new LinkedHashMap<>(2, 1.0f); map.put(NAME_KEY, feature.getName()); map.put(NORM_KEY, toNormalizerMap(norm)); return map; diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldLengthFeature.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldLengthFeature.java index efafdcb4a0a..77792e12ced 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldLengthFeature.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldLengthFeature.java @@ -156,7 +156,7 @@ public void testRanking() throws Exception { @Test public void testParamsToMap() throws Exception { - final LinkedHashMap params = new LinkedHashMap(); + final LinkedHashMap params = new LinkedHashMap<>(); params.put("field", "field" + random().nextInt(10)); doTestParamsToMap(FieldLengthFeature.class.getName(), params); } diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldValueFeature.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldValueFeature.java index cae28a25b0a..8123d8ce382 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldValueFeature.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestFieldValueFeature.java @@ -530,7 +530,7 @@ public void testThatCorrectFieldValueFeatureIsUsedForDocValueTypes() throws Exce @Test public void testParamsToMap() throws Exception { - final LinkedHashMap params = new LinkedHashMap(); + final LinkedHashMap params = new LinkedHashMap<>(); params.put("field", "field" + random().nextInt(10)); doTestParamsToMap(FieldValueFeature.class.getName(), params); } diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestOriginalScoreFeature.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestOriginalScoreFeature.java index 7d046e0c499..2a020664ac4 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestOriginalScoreFeature.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestOriginalScoreFeature.java @@ -248,7 +248,7 @@ private static void implTestOriginalScoreResponseDocsCheck( @Test public void testParamsToMap() throws Exception { - final LinkedHashMap params = new LinkedHashMap(); + final LinkedHashMap params = new LinkedHashMap<>(); doTestParamsToMap(OriginalScoreFeature.class.getName(), params); } } diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestRankingFeature.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestRankingFeature.java index b47929fbf27..69e610ddf57 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestRankingFeature.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestRankingFeature.java @@ -150,7 +150,7 @@ public void testRankingSolrFeature() throws Exception { @Test public void testParamsToMap() throws Exception { - final LinkedHashMap params = new LinkedHashMap(); + final LinkedHashMap params = new LinkedHashMap<>(); params.put("q", "{!func}pow(popularity,2)"); doTestParamsToMap(SolrFeature.class.getName(), params); } diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java index 03e57c29008..101c09fa862 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/feature/TestValueFeature.java @@ -144,7 +144,7 @@ public void testValueFeatureRequiredShouldReturn400StatusCode() throws Exception @Test public void testParamsToMap() throws Exception { - final LinkedHashMap params = new LinkedHashMap(); + final LinkedHashMap params = new LinkedHashMap<>(); params.put("value", "${val" + random().nextInt(10) + "}"); if (random().nextBoolean()) { params.put("required", random().nextBoolean()); diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java index 33ca6fb9445..aae619161f7 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestMinMaxNormalizer.java @@ -46,26 +46,26 @@ private Normalizer implTestMinMax( @Test public void testInvalidMinMaxNoParams() { - implTestMinMax(new HashMap(), Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY); + implTestMinMax(new HashMap<>(), Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY); } @Test public void testInvalidMinMaxMissingMax() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("min", "0.0f"); implTestMinMax(params, 0.0f, Float.POSITIVE_INFINITY); } @Test public void testInvalidMinMaxMissingMin() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("max", "0.0f"); implTestMinMax(params, Float.NEGATIVE_INFINITY, 0.0f); } @Test public void testMinMaxNormalizerMinLargerThanMax() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("min", "10.0f"); params.put("max", "0.0f"); implTestMinMax(params, 10.0f, 0.0f); @@ -73,7 +73,7 @@ public void testMinMaxNormalizerMinLargerThanMax() { @Test public void testMinMaxNormalizerMinEqualToMax() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("min", "10.0f"); params.put("max", "10.0f"); final NormalizerException expectedException = @@ -87,7 +87,7 @@ public void testMinMaxNormalizerMinEqualToMax() { @Test public void testNormalizer() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("min", "5.0f"); params.put("max", "10.0f"); final Normalizer n = implTestMinMax(params, 5.0f, 10.0f); diff --git a/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java b/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java index 5342cb58ccb..dee5aab4f3f 100644 --- a/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java +++ b/solr/modules/ltr/src/test/org/apache/solr/ltr/norm/TestStandardNormalizer.java @@ -45,12 +45,12 @@ private Normalizer implTestStandard( @Test public void testNormalizerNoParams() { - implTestStandard(new HashMap(), 0.0f, 1.0f); + implTestStandard(new HashMap<>(), 0.0f, 1.0f); } @Test public void testInvalidSTD() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("std", "0f"); final NormalizerException expectedException = new NormalizerException( @@ -63,7 +63,7 @@ public void testInvalidSTD() { @Test public void testInvalidSTD2() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("std", "-1f"); final NormalizerException expectedException = new NormalizerException( @@ -77,7 +77,7 @@ public void testInvalidSTD2() { @Test public void testInvalidSTD3() { - final Map params = new HashMap(); + final Map params = new HashMap<>(); params.put("avg", "1f"); params.put("std", "0f"); final NormalizerException expectedException = @@ -92,7 +92,7 @@ public void testInvalidSTD3() { @Test public void testNormalizer() { - Map params = new HashMap(); + Map params = new HashMap<>(); params.put("avg", "0f"); params.put("std", "1f"); final Normalizer identity = implTestStandard(params, 0f, 1f); @@ -101,7 +101,7 @@ public void testNormalizer() { assertEquals(value, identity.normalize(value), 0.0001); value = 150; assertEquals(value, identity.normalize(value), 0.0001); - params = new HashMap(); + params = new HashMap<>(); params.put("avg", "10f"); params.put("std", "1.5f"); final Normalizer norm = diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java index a0b585af077..5b6dac64584 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrRules.java @@ -51,7 +51,7 @@ class SolrRules { static List solrFieldNames(final RelDataType rowType) { return SqlValidatorUtil.uniquify( - new AbstractList() { + new AbstractList<>() { @Override public String get(int index) { return rowType.getFieldList().get(index).getName(); diff --git a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java index b0602d4d6ed..577585d80d6 100644 --- a/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java +++ b/solr/modules/sql/src/java/org/apache/solr/handler/sql/SolrTable.java @@ -209,7 +209,7 @@ private Enumerable query( final TupleStream finalStream = tupleStream; - return new AbstractEnumerable() { + return new AbstractEnumerable<>() { // Use original fields list to make sure only the fields specified are enumerated public Enumerator enumerator() { return new SolrEnumerator(finalStream, fields); diff --git a/solr/solr-ref-guide/modules/deployment-guide/examples/UsingSolrJRefGuideExamplesTest.java b/solr/solr-ref-guide/modules/deployment-guide/examples/UsingSolrJRefGuideExamplesTest.java index fee64cef9df..7c09d4596c5 100644 --- a/solr/solr-ref-guide/modules/deployment-guide/examples/UsingSolrJRefGuideExamplesTest.java +++ b/solr/solr-ref-guide/modules/deployment-guide/examples/UsingSolrJRefGuideExamplesTest.java @@ -82,7 +82,7 @@ public void setUp() throws Exception { expectedLines.clear(); final SolrClient client = getSolrClient(); - final List products = new ArrayList(); + final List products = new ArrayList<>(); products.add(new TechProduct("1", "Fitbit Alta")); products.add(new TechProduct("2", "Sony Walkman")); products.add(new TechProduct("3", "Garmin GPS")); @@ -112,7 +112,7 @@ public void queryWithRawSolrParamsExample() throws Exception { // tag::solrj-query-with-raw-solrparams[] final SolrClient client = getSolrClient(); - final Map queryParamMap = new HashMap(); + final Map queryParamMap = new HashMap<>(); queryParamMap.put("q", "*:*"); queryParamMap.put("fl", "id, name"); queryParamMap.put("sort", "id asc"); diff --git a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistribStateManager.java b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistribStateManager.java index e664e38355a..09be10c73c9 100644 --- a/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistribStateManager.java +++ b/solr/solrj-zookeeper/src/java/org/apache/solr/client/solrj/cloud/DistribStateManager.java @@ -96,8 +96,8 @@ List multi(final Iterable ops) */ default List listTree(String root) throws NoSuchElementException, IOException, KeeperException, InterruptedException { - Deque queue = new LinkedList(); - List tree = new ArrayList(); + Deque queue = new LinkedList<>(); + List tree = new ArrayList<>(); if (!root.startsWith("/")) { root = "/" + root; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java index 7e0b480f612..bbab01b835c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/cloud/SocketProxy.java @@ -58,7 +58,7 @@ public class SocketProxy { private CountDownLatch closed = new CountDownLatch(1); - public List connections = new LinkedList(); + public List connections = new LinkedList<>(); private final int listenPort; @@ -146,7 +146,7 @@ public URI getUrl() { public void close() { List connections; synchronized (this.connections) { - connections = new ArrayList(this.connections); + connections = new ArrayList<>(this.connections); } log.warn("Closing {} connections to: {}, target: {}", connections.size(), getUrl(), target); for (Bridge con : connections) { @@ -162,7 +162,7 @@ public void close() { public void halfClose() { List connections; synchronized (this.connections) { - connections = new ArrayList(this.connections); + connections = new ArrayList<>(this.connections); } if (log.isInfoEnabled()) { log.info("halfClose, numConnections= {}", connections.size()); @@ -333,7 +333,7 @@ public class Pump extends Thread { protected Socket src; private Socket destination; - private AtomicReference pause = new AtomicReference(); + private AtomicReference pause = new AtomicReference<>(); public Pump(String kind, Socket source, Socket dest) { super("SocketProxy-" + kind + "-" + source.getPort() + ":" + dest.getPort()); @@ -420,7 +420,7 @@ public class Acceptor implements Runnable { private ServerSocket socket; private URI target; - private AtomicReference pause = new AtomicReference(); + private AtomicReference pause = new AtomicReference<>(); public Acceptor(ServerSocket serverSocket, URI uri) throws SocketException { socket = serverSocket; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java index 4351b490d6c..72132c597d1 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/DelegationTokenHttpSolrClient.java @@ -54,7 +54,7 @@ protected HttpRequestBase createMethod(final SolrRequest request, String coll public void setQueryParams(Set queryParams) { queryParams = queryParams == null ? Set.of(DELEGATION_TOKEN_PARAM) : queryParams; if (!queryParams.contains(DELEGATION_TOKEN_PARAM)) { - queryParams = new HashSet(queryParams); + queryParams = new HashSet<>(queryParams); queryParams.add(DELEGATION_TOKEN_PARAM); queryParams = Collections.unmodifiableSet(queryParams); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java index d07e549a24b..3cab721a583 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/SolrClientCache.java @@ -81,7 +81,7 @@ public synchronized CloudSolrClient getCloudSolrClient(String zkHost) { if (solrClients.containsKey(zkHost)) { client = (CloudSolrClient) solrClients.get(zkHost); } else { - final List hosts = new ArrayList(); + final List hosts = new ArrayList<>(); hosts.add(zkHost); var builder = new CloudLegacySolrClient.Builder(hosts, Optional.empty()) diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/FieldValueEvaluator.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/FieldValueEvaluator.java index 2a5632f576e..7eb2182b3b9 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/FieldValueEvaluator.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/eval/FieldValueEvaluator.java @@ -65,7 +65,7 @@ public Object evaluate(Tuple tuple) throws IOException { if (null != value) { if (value instanceof Object[]) { Object[] array = (Object[]) value; - List list = new ArrayList(array.length); + List list = new ArrayList<>(array.length); for (Object obj : array) { list.add(obj); } @@ -76,7 +76,7 @@ public Object evaluate(Tuple tuple) throws IOException { return value; } else if (value instanceof Iterable && !(value instanceof List)) { Iterable iter = (Iterable) value; - List list = new ArrayList(); + List list = new ArrayList<>(); for (Object obj : iter) { list.add(obj); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java index 72d16a58e7b..5a3f21fa83a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CalculatorStream.java @@ -66,7 +66,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { public void setStreamContext(StreamContext context) {} public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java index 2b2177579f9..6a0b10eb1bb 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CellStream.java @@ -106,7 +106,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java index 77aacacee37..1121ab12421 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CommitStream.java @@ -204,7 +204,7 @@ public StreamComparator getStreamSort() { @Override public List children() { - ArrayList sourceList = new ArrayList(1); + ArrayList sourceList = new ArrayList<>(1); sourceList.add(tupleSource); return sourceList; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java index de28d7c1e8a..3c6ff68703f 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ComplementStream.java @@ -162,7 +162,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(streamA); l.add(streamB); return l; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java index 3098ae103c1..452d3afd275 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CsvStream.java @@ -111,7 +111,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(originalStream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java index 72abbe366bc..002170a0bb2 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/EchoStream.java @@ -80,7 +80,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { public void setStreamContext(StreamContext context) {} public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java index 6d8ebd01862..e1172f1fbb7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashJoinStream.java @@ -105,7 +105,7 @@ public HashJoinStream(StreamExpression expression, StreamFactory factory) throws String hashOnValue = ((StreamExpressionValue) onExpression.getParameter()).getValue(); String[] parts = hashOnValue.split(","); - List hashOn = new ArrayList(parts.length); + List hashOn = new ArrayList<>(parts.length); for (String part : parts) { hashOn.add(part.trim()); } @@ -213,7 +213,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(hashStream); l.add(fullStream); return l; @@ -230,7 +230,7 @@ public void open() throws IOException { if (hashedTuples.containsKey(hash)) { hashedTuples.get(hash).add(tuple); } else { - ArrayList set = new ArrayList(); + ArrayList set = new ArrayList<>(); set.add(tuple); hashedTuples.put(hash, set); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java index 79992a870e5..2c6089d7e25 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HashRollupStream.java @@ -191,7 +191,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(tupleStream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java index be01780ff9e..3de48f678ad 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/HavingStream.java @@ -141,7 +141,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java index a10a0ef65ac..8d6ec56a5aa 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/InnerJoinStream.java @@ -33,9 +33,9 @@ */ public class InnerJoinStream extends BiJoinStream implements Expressible { - private LinkedList joinedTuples = new LinkedList(); - private LinkedList leftTupleGroup = new LinkedList(); - private LinkedList rightTupleGroup = new LinkedList(); + private LinkedList joinedTuples = new LinkedList<>(); + private LinkedList leftTupleGroup = new LinkedList<>(); + private LinkedList rightTupleGroup = new LinkedList<>(); public InnerJoinStream(TupleStream leftStream, TupleStream rightStream, StreamEqualitor eq) throws IOException { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java index 6836f17a7ec..bea9ef01634 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/IntersectStream.java @@ -162,7 +162,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(streamA); l.add(streamB); return l; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java index 3fdec4dc56e..320a0850e71 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/JoinStream.java @@ -47,7 +47,7 @@ public abstract class JoinStream extends TupleStream implements Expressible { public JoinStream( StreamEqualitor eq, TupleStream first, TupleStream second, TupleStream... others) { - this.streams = new ArrayList(); + this.streams = new ArrayList<>(); this.eq = eq; @@ -83,7 +83,7 @@ public JoinStream(StreamExpression expression, StreamFactory factory) throws IOE streamExpressions.size())); } - this.streams = new ArrayList(); + this.streams = new ArrayList<>(); for (StreamExpression streamExpression : streamExpressions) { this.streams.add(new PushBackStream(factory.constructStream(streamExpression))); } @@ -168,7 +168,7 @@ public void close() throws IOException { } public List children() { - List list = new ArrayList(); + List list = new ArrayList<>(); for (TupleStream stream : streams) { list.add(stream); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java index 76f761017dc..2a2150c1a57 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/KnnStream.java @@ -97,7 +97,7 @@ public KnnStream(StreamExpression expression, StreamFactory factory) throws IOEx } // pull out known named params - Map params = new HashMap(); + Map params = new HashMap<>(); for (StreamExpressionNamedParameter namedParam : namedParams) { if (!namedParam.getName().equals("zkHost") && !namedParam.getName().equals("id")) { params.put(namedParam.getName(), namedParam.getParameter().toString().trim()); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java index 3de338c9bc8..1d1ba66366d 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LeftOuterJoinStream.java @@ -33,9 +33,9 @@ */ public class LeftOuterJoinStream extends BiJoinStream implements Expressible { - private LinkedList joinedTuples = new LinkedList(); - private LinkedList leftTupleGroup = new LinkedList(); - private LinkedList rightTupleGroup = new LinkedList(); + private LinkedList joinedTuples = new LinkedList<>(); + private LinkedList leftTupleGroup = new LinkedList<>(); + private LinkedList rightTupleGroup = new LinkedList<>(); public LeftOuterJoinStream(TupleStream leftStream, TupleStream rightStream, StreamEqualitor eq) throws IOException { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java index da5e8e248d9..74057a9da4e 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/LetStream.java @@ -146,7 +146,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java index 7414ef632a1..13b24129892 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ListStream.java @@ -97,7 +97,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); for (TupleStream stream : streams) { l.add(stream); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java index f91686164ba..82d97b86a0f 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/MergeStream.java @@ -163,7 +163,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); for (PushBackStream stream : streams) { l.add(stream); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java index b5970ae8dd4..e716628b4c7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ModelStream.java @@ -87,7 +87,7 @@ public ModelStream(StreamExpression expression, StreamFactory factory) throws IO expression)); } - Map params = new HashMap(); + Map params = new HashMap<>(); for (StreamExpressionNamedParameter namedParam : namedParams) { if (!namedParam.getName().equals("zkHost")) { params.put(namedParam.getName(), namedParam.getParameter().toString().trim()); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java index 3b68f5b734a..300595c7e78 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NoOpStream.java @@ -69,7 +69,7 @@ public Explanation toExplanation(StreamFactory factory) throws IOException { public void setStreamContext(StreamContext context) {} public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java index f203fb3e739..b43f7dfc7d0 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/NullStream.java @@ -104,7 +104,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java index 7cae9d92e67..607c3932939 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PlotStream.java @@ -151,7 +151,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java index b623762588c..07280543d4e 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/PushBackStream.java @@ -62,7 +62,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java index 6fb1024a834..963ed9940d0 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomFacadeStream.java @@ -56,7 +56,7 @@ public RandomFacadeStream(StreamExpression expression, StreamFactory factory) th } // pull out known named params - Map params = new HashMap(); + Map params = new HashMap<>(); for (StreamExpressionNamedParameter namedParam : namedParams) { if (!namedParam.getName().equals("zkHost") && !namedParam.getName().equals("buckets") diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java index 7f121061ae1..49cc065aaa7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RandomStream.java @@ -94,7 +94,7 @@ public RandomStream(StreamExpression expression, StreamFactory factory) throws I } // pull out known named params - Map params = new HashMap(); + Map params = new HashMap<>(); for (StreamExpressionNamedParameter namedParam : namedParams) { if (!namedParam.getName().equals("zkHost") && !namedParam.getName().equals("buckets") diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java index 8b8f91599d0..d6284b533dd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RankStream.java @@ -184,14 +184,14 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; } public void open() throws IOException { - this.top = new PriorityQueue(size, new ReverseComp(comp)); - this.topList = new LinkedList(); + this.top = new PriorityQueue<>(size, new ReverseComp(comp)); + this.topList = new LinkedList<>(); stream.open(); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java index 0fbef566cfe..285ee8a69be 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ReducerStream.java @@ -204,7 +204,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java index 8def535d26c..afa5a587bb9 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/RollupStream.java @@ -193,7 +193,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(tupleStream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java index ec9d3ed910d..edbb22f3d67 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SelectStream.java @@ -122,7 +122,7 @@ public SelectStream(StreamExpression expression, StreamFactory factory) throws I stream = factory.constructStream(streamExpressions.get(0)); - selectedFields = new HashMap(); + selectedFields = new HashMap<>(); selectedEvaluators = new LinkedHashMap<>(); for (StreamExpressionParameter parameter : selectAsFieldsExpressions) { StreamExpressionValue selectField = (StreamExpressionValue) parameter; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java index 7d5bbe27496..4960006ce2f 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/SortStream.java @@ -95,7 +95,7 @@ private void init(TupleStream stream, StreamComparator comp) throws IOException worker = new Worker() { - private LinkedList tuples = new LinkedList(); + private LinkedList tuples = new LinkedList<>(); private Tuple eofTuple; public void readStream(TupleStream stream) throws IOException { @@ -172,7 +172,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(stream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StreamContext.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StreamContext.java index cbd90ab7a88..5feb15e46fa 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StreamContext.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/StreamContext.java @@ -35,7 +35,7 @@ */ public class StreamContext implements Serializable { - private Map entries = new HashMap(); + private Map entries = new HashMap<>(); private Map tupleContext = new HashMap<>(); private Map lets = new HashMap<>(); private ConcurrentMap> objectCache; diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java index 7e02fc76059..bb9a7f22228 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TextLogitStream.java @@ -158,7 +158,7 @@ public TextLogitStream(StreamExpression expression, StreamFactory factory) throw expression)); } - Map params = new HashMap(); + Map params = new HashMap<>(); for (StreamExpressionNamedParameter namedParam : namedParams) { if (!namedParam.getName().equals("zkHost")) { params.put(namedParam.getName(), namedParam.getParameter().toString().trim()); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java index 48b7ab6cf68..b625d38ec7c 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TopicStream.java @@ -316,7 +316,7 @@ public void open() throws IOException { if (streamContext.getSolrClientCache() != null) { cloudSolrClient = streamContext.getSolrClientCache().getCloudSolrClient(zkHost); } else { - final List hosts = new ArrayList(); + final List hosts = new ArrayList<>(); hosts.add(zkHost); cloudSolrClient = new CloudLegacySolrClient.Builder(hosts, Optional.empty()).build(); this.cloudSolrClient.connect(); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java index 11b7c8d783c..feecd952c99 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/TupStream.java @@ -150,7 +150,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java index 35272f22584..e8d29eef7bf 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UniqueStream.java @@ -161,7 +161,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); l.add(originalStream); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UpdateStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UpdateStream.java index 362ea2c67a5..6dc1ab475e7 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UpdateStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/UpdateStream.java @@ -166,7 +166,7 @@ public StreamComparator getStreamSort() { @Override public List children() { - ArrayList sourceList = new ArrayList(1); + ArrayList sourceList = new ArrayList<>(1); sourceList.add(tupleSource); return sourceList; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java index c0da9a6e889..37a62180336 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/ZplotStream.java @@ -106,7 +106,7 @@ public void setStreamContext(StreamContext context) { } public List children() { - List l = new ArrayList(); + List l = new ArrayList<>(); return l; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/Explanation.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/Explanation.java index 9074751f0a1..259c02ab5e5 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/Explanation.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/Explanation.java @@ -133,7 +133,7 @@ public Explanation withHelper(Explanation helper) { public void addHelper(Explanation helper) { if (null == helpers) { - helpers = new ArrayList(1); + helpers = new ArrayList<>(1); } helpers.add(helper); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java index 638e6b52f72..521e107024a 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExplanation.java @@ -52,7 +52,7 @@ public StreamExplanation withChildren(Explanation[] children) { public void addChild(Explanation child) { if (null == children) { - children = new ArrayList(1); + children = new ArrayList<>(1); } children.add(child); } @@ -61,7 +61,7 @@ public Map toMap(Map map) { map = super.toMap(map); if (null != children && 0 != children.size()) { - List> childrenMaps = new ArrayList>(); + List> childrenMaps = new ArrayList<>(); for (Explanation child : children) { childrenMaps.add(child.toMap(new LinkedHashMap<>())); } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpression.java b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpression.java index 32abec78d16..f2bf0fc7006 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpression.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/expr/StreamExpression.java @@ -27,7 +27,7 @@ public class StreamExpression implements StreamExpressionParameter { public StreamExpression(String functionName) { this.functionName = functionName; - parameters = new ArrayList(); + parameters = new ArrayList<>(); } public String getFunctionName() { diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/request/DelegationTokenRequest.java b/solr/solrj/src/java/org/apache/solr/client/solrj/request/DelegationTokenRequest.java index f53daebacf1..0e61e028bdd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/request/DelegationTokenRequest.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/request/DelegationTokenRequest.java @@ -62,7 +62,7 @@ public Get(String renewer) { super(METHOD.GET); this.renewer = renewer; setResponseParser(new DelegationTokenResponse.JsonMapResponseParser()); - setQueryParams(new TreeSet(Arrays.asList(OP_KEY))); + setQueryParams(new TreeSet<>(Arrays.asList(OP_KEY))); } @Override @@ -101,7 +101,7 @@ public Renew(String token) { super(METHOD.PUT); this.token = token; setResponseParser(new DelegationTokenResponse.JsonMapResponseParser()); - setQueryParams(new TreeSet(Arrays.asList(OP_KEY, TOKEN_KEY))); + setQueryParams(new TreeSet<>(Arrays.asList(OP_KEY, TOKEN_KEY))); } @Override @@ -131,8 +131,8 @@ public Cancel(String token) { super(METHOD.PUT); this.token = token; setResponseParser(new NoOpResponseParser()); - Set queryParams = new TreeSet(); - setQueryParams(new TreeSet(Arrays.asList(OP_KEY, TOKEN_KEY))); + Set queryParams = new TreeSet<>(); + setQueryParams(new TreeSet<>(Arrays.asList(OP_KEY, TOKEN_KEY))); } @Override diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/ClusteringResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/ClusteringResponse.java index f00b268bd74..0700ff8d269 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/ClusteringResponse.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/ClusteringResponse.java @@ -34,7 +34,7 @@ public class ClusteringResponse { @SuppressWarnings("unchecked") public ClusteringResponse(List> clusterInfo) { - clusters = new ArrayList(); + clusters = new ArrayList<>(); for (NamedList clusterNode : clusterInfo) { List labelList, docIdList; List subclusters = Collections.emptyList(); diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java index 441df1d8079..225fbe6b366 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/DelegationTokenResponse.java @@ -79,7 +79,7 @@ public NamedList processResponse(InputStream body, String encoding) { } catch (IOException | JSONParser.ParseException e) { throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, "parsing error", e); } - NamedList list = new NamedList(); + NamedList list = new NamedList<>(); list.addAll(map); return list; } diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SuggesterResponse.java b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SuggesterResponse.java index 6fac639ee09..a5ba9b926bd 100644 --- a/solr/solrj/src/java/org/apache/solr/client/solrj/response/SuggesterResponse.java +++ b/solr/solrj/src/java/org/apache/solr/client/solrj/response/SuggesterResponse.java @@ -77,7 +77,7 @@ public Map> getSuggestedTerms() { Map> suggestedTermsPerDictionary = new LinkedHashMap<>(); for (Map.Entry> entry : suggestionsPerDictionary.entrySet()) { List suggestions = entry.getValue(); - List suggestionTerms = new LinkedList(); + List suggestionTerms = new LinkedList<>(); for (Suggestion s : suggestions) { suggestionTerms.add(s.getTerm()); } diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java b/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java index 2753fe3c06c..b5488afc4bd 100644 --- a/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java +++ b/solr/solrj/src/java/org/apache/solr/common/SolrDocument.java @@ -239,7 +239,7 @@ public void visitSelfAndNestedDocs(BiConsumer consumer) { /** Expose a Map interface to the solr field value collection. */ public Map> getFieldValuesMap() { - return new Map>() { + return new Map<>() { /** Get the field Value */ @Override public Collection get(Object key) { @@ -312,7 +312,7 @@ public String toString() { /** Expose a Map interface to the solr fields. This function is useful for JSTL */ public Map getFieldValueMap() { - return new Map() { + return new Map<>() { /** Get the field Value */ @Override public Object get(Object key) { diff --git a/solr/solrj/src/java/org/apache/solr/common/SolrException.java b/solr/solrj/src/java/org/apache/solr/common/SolrException.java index c4d98d90e34..6b99259fc8c 100644 --- a/solr/solrj/src/java/org/apache/solr/common/SolrException.java +++ b/solr/solrj/src/java/org/apache/solr/common/SolrException.java @@ -120,7 +120,7 @@ public void setMetadata(String key, String value) { if (key == null || value == null) throw new IllegalArgumentException("Exception metadata cannot be null!"); - if (metadata == null) metadata = new NamedList(); + if (metadata == null) metadata = new NamedList<>(); metadata.add(key, value); } diff --git a/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java b/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java index 16b12ffe734..fa8ec2e8807 100644 --- a/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java +++ b/solr/solrj/src/java/org/apache/solr/common/ToleratedUpdateError.java @@ -170,7 +170,7 @@ public String getMetadataValue() { * @see #parseMap */ public SimpleOrderedMap getSimpleMap() { - SimpleOrderedMap entry = new SimpleOrderedMap(); + SimpleOrderedMap entry = new SimpleOrderedMap<>(); entry.add("type", type.toString()); entry.add(ID, id); entry.add("message", message); diff --git a/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java b/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java index 55f4c708637..3eed8d0fa4d 100644 --- a/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java +++ b/solr/solrj/src/java/org/apache/solr/common/cloud/Slice.java @@ -146,7 +146,7 @@ public static State getState(String stateStr) { @SuppressWarnings({"unchecked", "rawtypes"}) public Slice( String name, Map replicas, Map props, String collection) { - super(props == null ? new LinkedHashMap(2) : new LinkedHashMap<>(props)); + super(props == null ? new LinkedHashMap<>(2) : new LinkedHashMap<>(props)); this.name = name; this.collection = collection; diff --git a/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java b/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java index a575a8d2f4e..3074ddd5e9e 100644 --- a/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java +++ b/solr/solrj/src/java/org/apache/solr/common/params/SolrParams.java @@ -91,7 +91,7 @@ public void writeMap(EntryWriter ew) throws IOException { @Override public Iterator> iterator() { Iterator it = getParameterNamesIterator(); - return new Iterator>() { + return new Iterator<>() { @Override public boolean hasNext() { return it.hasNext(); @@ -100,7 +100,7 @@ public boolean hasNext() { @Override public Map.Entry next() { String key = it.next(); - return new Map.Entry() { + return new Map.Entry<>() { @Override public String getKey() { return key; diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java index 41b64e06af8..323a8c959ef 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestBatchUpdate.java @@ -104,7 +104,7 @@ private void doIt(HttpSolrClient client) throws SolrServerException, IOException final int[] counter = new int[1]; counter[0] = 0; client.add( - new Iterator() { + new Iterator<>() { @Override public boolean hasNext() { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java b/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java index 3df1cd7b2e8..52249b35ac3 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/TestSolrJErrorHandling.java @@ -117,7 +117,7 @@ public void testWithBinary() throws Exception { } Iterator manyDocs(final int base, final int numDocs) { - return new Iterator() { + return new Iterator<>() { int count = 0; @Override diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java index 85062638463..266d05377bf 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudHttp2SolrClientBuilderTest.java @@ -71,7 +71,7 @@ public void testSeveralZkHostsSpecifiedSingly() throws IOException { @Test public void testSeveralZkHostsSpecifiedTogether() throws IOException { - final ArrayList zkHosts = new ArrayList(); + final ArrayList zkHosts = new ArrayList<>(); zkHosts.add(ANY_ZK_HOST); zkHosts.add(ANY_OTHER_ZK_HOST); try (CloudHttp2SolrClient createdClient = diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientBuilderTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientBuilderTest.java index d4d90ae211e..e2f6c743fdb 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientBuilderTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrClientBuilderTest.java @@ -60,7 +60,7 @@ public void testSeveralZkHostsSpecifiedSingly() throws IOException { @Test public void testSeveralZkHostsSpecifiedTogether() throws IOException { - final ArrayList zkHosts = new ArrayList(); + final ArrayList zkHosts = new ArrayList<>(); zkHosts.add(ANY_ZK_HOST); zkHosts.add(ANY_OTHER_ZK_HOST); try (CloudSolrClient createdClient = new Builder(zkHosts, Optional.of(ANY_CHROOT)).build()) { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java index d748a642bf2..b4b85eea095 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java @@ -301,7 +301,7 @@ public void testJDBCSolrMerge() throws Exception { TupleStream selectStream = new SelectStream( jdbcStream, - new HashMap() { + new HashMap<>() { { put("CODE", "code_s"); put("COUNTRY_NAME", "name_s"); @@ -768,7 +768,7 @@ public void testUnsupportedColumns() throws Exception { protected List getTuples(TupleStream tupleStream) throws IOException { tupleStream.open(); - List tuples = new ArrayList(); + List tuples = new ArrayList<>(); for (Tuple t = tupleStream.read(); !t.EOF; t = tupleStream.read()) { tuples.add(t); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java index e20871dc3fa..db4d4cc2b22 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java @@ -138,7 +138,7 @@ public void testSelectWithEvaluatorsStream() throws Exception { protected List getTuples(TupleStream tupleStream) throws IOException { tupleStream.open(); - List tuples = new ArrayList(); + List tuples = new ArrayList<>(); for (Tuple t = tupleStream.read(); !t.EOF; t = tupleStream.read()) { tuples.add(t); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AbsoluteValueEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AbsoluteValueEvaluatorTest.java index 4a782d478c9..dcbb3e67b76 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AbsoluteValueEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AbsoluteValueEvaluatorTest.java @@ -41,7 +41,7 @@ public AbsoluteValueEvaluatorTest() { new StreamFactory() .withFunctionName("abs", AbsoluteValueEvaluator.class) .withFunctionName("add", AddEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AddEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AddEvaluatorTest.java index bafae7dd5af..c77d44bb28b 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AddEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AddEvaluatorTest.java @@ -35,7 +35,7 @@ public AddEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("add", AddEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AndEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AndEvaluatorTest.java index 45d4461d99f..e4d98bc5364 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AndEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AndEvaluatorTest.java @@ -35,7 +35,7 @@ public AndEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("and", AndEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcCosineEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcCosineEvaluatorTest.java index 9e2321051f1..6f7df301815 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcCosineEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcCosineEvaluatorTest.java @@ -36,7 +36,7 @@ public ArcCosineEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("acos", ArcCosineEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcSineEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcSineEvaluatorTest.java index 39fabdb7617..178384bc4ba 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcSineEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcSineEvaluatorTest.java @@ -36,7 +36,7 @@ public ArcSineEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("asin", ArcSineEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcTangentEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcTangentEvaluatorTest.java index 4bb56afabdd..450a7925679 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcTangentEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArcTangentEvaluatorTest.java @@ -36,7 +36,7 @@ public ArcTangentEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("atan", ArcTangentEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArrayEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArrayEvaluatorTest.java index aab978a91a1..8184e3b4ede 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArrayEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ArrayEvaluatorTest.java @@ -38,7 +38,7 @@ public ArrayEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("array", ArrayEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java index 4e489954fbc..0a1230123d1 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/AscEvaluatorTest.java @@ -37,7 +37,7 @@ public AscEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("asc", AscEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CeilingEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CeilingEvaluatorTest.java index 5c284eaad1b..43f9b115c8c 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CeilingEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CeilingEvaluatorTest.java @@ -36,7 +36,7 @@ public CeilingEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("ceil", CeilingEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java index 7f7144d5f19..2c84da89981 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CoalesceEvaluatorTest.java @@ -35,7 +35,7 @@ public CoalesceEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("coalesce", CoalesceEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } /* @Test(expected = IOException.class) diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CorrelationEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CorrelationEvaluatorTest.java index 641c6cb347c..3d8c728174f 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CorrelationEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CorrelationEvaluatorTest.java @@ -35,7 +35,7 @@ public class CorrelationEvaluatorTest extends SolrTestCase { public CorrelationEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("corr", CorrelationEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CosineEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CosineEvaluatorTest.java index 6de3678a09b..e93dc57f3f6 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CosineEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CosineEvaluatorTest.java @@ -36,7 +36,7 @@ public CosineEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("cos", CosineEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CubedRootEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CubedRootEvaluatorTest.java index 8ed75b699d1..2bdc4cfe414 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CubedRootEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CubedRootEvaluatorTest.java @@ -36,7 +36,7 @@ public CubedRootEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("cbrt", CubedRootEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CumulativeProbabilityEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CumulativeProbabilityEvaluatorTest.java index e56bf61129c..a5d393a2236 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CumulativeProbabilityEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/CumulativeProbabilityEvaluatorTest.java @@ -39,7 +39,7 @@ public CumulativeProbabilityEvaluatorTest() { new StreamFactory() .withFunctionName("prob", CumulativeProbabilityEvaluator.class) .withFunctionName("norm", NormalDistributionEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java index 3986fc49d45..c98fbf4172a 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/DivideEvaluatorTest.java @@ -36,7 +36,7 @@ public DivideEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("div", DivideEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EmpiricalDistributionEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EmpiricalDistributionEvaluatorTest.java index af0659fbac5..f784950a133 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EmpiricalDistributionEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EmpiricalDistributionEvaluatorTest.java @@ -35,7 +35,7 @@ public class EmpiricalDistributionEvaluatorTest extends SolrTestCase { public EmpiricalDistributionEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("emp", EmpiricalDistributionEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EqualToEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EqualToEvaluatorTest.java index 7c85b76cf59..7d14ba8d5c3 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EqualToEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/EqualToEvaluatorTest.java @@ -40,7 +40,7 @@ public EqualToEvaluatorTest() { new StreamFactory() .withFunctionName("eq", EqualToEvaluator.class) .withFunctionName("val", RawValueEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ExclusiveOrEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ExclusiveOrEvaluatorTest.java index bd44b26c3f4..955fa99b8bb 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ExclusiveOrEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ExclusiveOrEvaluatorTest.java @@ -35,7 +35,7 @@ public ExclusiveOrEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("eor", ExclusiveOrEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java index 12189faba86..690ebab6326 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FieldValueEvaluatorTest.java @@ -34,7 +34,7 @@ public class FieldValueEvaluatorTest extends SolrTestCase { public FieldValueEvaluatorTest() { super(); - values = new HashMap(); + values = new HashMap<>(); } @SuppressWarnings("serial") diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FloorEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FloorEvaluatorTest.java index 0146367fd85..d7b4c46d440 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FloorEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/FloorEvaluatorTest.java @@ -36,7 +36,7 @@ public FloorEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("floor", FloorEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEqualToEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEqualToEvaluatorTest.java index 9296032c1ba..502ab928044 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEqualToEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEqualToEvaluatorTest.java @@ -36,7 +36,7 @@ public GreaterThanEqualToEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("gte", GreaterThanEqualToEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEvaluatorTest.java index f5161a64446..3255174a494 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/GreaterThanEvaluatorTest.java @@ -36,7 +36,7 @@ public GreaterThanEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("gt", GreaterThanEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicCosineEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicCosineEvaluatorTest.java index 4b69b4edd4b..37e9f244145 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicCosineEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicCosineEvaluatorTest.java @@ -36,7 +36,7 @@ public HyperbolicCosineEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("cosh", HyperbolicCosineEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicSineEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicSineEvaluatorTest.java index 6c9184e4823..404eba74171 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicSineEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicSineEvaluatorTest.java @@ -36,7 +36,7 @@ public HyperbolicSineEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("sinh", HyperbolicSineEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicTangentEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicTangentEvaluatorTest.java index 63bc90f60f8..5957afe709a 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicTangentEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/HyperbolicTangentEvaluatorTest.java @@ -36,7 +36,7 @@ public HyperbolicTangentEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("tanh", HyperbolicTangentEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LengthEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LengthEvaluatorTest.java index 64f1f206ac8..91a4d731714 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LengthEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LengthEvaluatorTest.java @@ -41,7 +41,7 @@ public LengthEvaluatorTest() { new StreamFactory() .withFunctionName("length", LengthEvaluator.class) .withFunctionName("sequence", SequenceEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEqualToEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEqualToEvaluatorTest.java index 6b41b51746e..5c6a5e9ea70 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEqualToEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEqualToEvaluatorTest.java @@ -36,7 +36,7 @@ public LessThanEqualToEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("lte", LessThanEqualToEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEvaluatorTest.java index 588660919b5..c74945a6df6 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/LessThanEvaluatorTest.java @@ -36,7 +36,7 @@ public LessThanEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("lt", LessThanEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java index 01c53bc288c..a0b0e1ce317 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ModuloEvaluatorTest.java @@ -36,7 +36,7 @@ public ModuloEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("mod", ModuloEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java index ecd732cfd05..6b895dc6cbf 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/MultiplyEvaluatorTest.java @@ -35,7 +35,7 @@ public MultiplyEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("mult", MultiplyEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NaturalLogEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NaturalLogEvaluatorTest.java index 8fa908724fc..097b4a86ec8 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NaturalLogEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NaturalLogEvaluatorTest.java @@ -40,7 +40,7 @@ public NaturalLogEvaluatorTest() { new StreamFactory() .withFunctionName("log", NaturalLogEvaluator.class) .withFunctionName("add", AddEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalDistributionEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalDistributionEvaluatorTest.java index 105ba83ffe9..c2a6e963055 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalDistributionEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalDistributionEvaluatorTest.java @@ -35,7 +35,7 @@ public class NormalDistributionEvaluatorTest extends SolrTestCase { public NormalDistributionEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("norm", NormalDistributionEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalizeEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalizeEvaluatorTest.java index 49ed455af56..daca21ab3ff 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalizeEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NormalizeEvaluatorTest.java @@ -37,7 +37,7 @@ public class NormalizeEvaluatorTest extends SolrTestCase { public NormalizeEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("norm", NormalizeEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NotEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NotEvaluatorTest.java index d66100359bb..2b8ce6ae525 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NotEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/NotEvaluatorTest.java @@ -35,7 +35,7 @@ public NotEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("not", NotEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/OrEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/OrEvaluatorTest.java index 3e72cdc19af..546086fc4c5 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/OrEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/OrEvaluatorTest.java @@ -35,7 +35,7 @@ public OrEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("or", OrEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java index a2fd0112841..7c52653b3a8 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/PowerEvaluatorTest.java @@ -37,7 +37,7 @@ public PowerEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("pow", PowerEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RawValueEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RawValueEvaluatorTest.java index d08ce4cf230..d88654014e2 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RawValueEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RawValueEvaluatorTest.java @@ -40,7 +40,7 @@ public RawValueEvaluatorTest() { .withFunctionName("val", RawValueEvaluator.class) .withFunctionName("add", AddEvaluator.class) .withFunctionName("and", AndEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RecursiveEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RecursiveEvaluatorTest.java index e57647f3935..c6c1577c82b 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RecursiveEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RecursiveEvaluatorTest.java @@ -49,7 +49,7 @@ public RecursiveEvaluatorTest() { .withFunctionName("sub", SubtractEvaluator.class) .withFunctionName("mult", MultiplyEvaluator.class) .withFunctionName("if", IfThenElseEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RegressionEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RegressionEvaluatorTest.java index bc2241b5167..4a18d0848c9 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RegressionEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RegressionEvaluatorTest.java @@ -35,7 +35,7 @@ public class RegressionEvaluatorTest extends SolrTestCase { public RegressionEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("regress", RegressionEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ReverseEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ReverseEvaluatorTest.java index 29a3805286c..fcbc551918e 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ReverseEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/ReverseEvaluatorTest.java @@ -35,7 +35,7 @@ public class ReverseEvaluatorTest extends SolrTestCase { public ReverseEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("reverse", ReverseEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RoundEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RoundEvaluatorTest.java index 1d2cec2aa04..f960bfead28 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RoundEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/RoundEvaluatorTest.java @@ -36,7 +36,7 @@ public RoundEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("round", RoundEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SineEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SineEvaluatorTest.java index bc013f5c239..1295de1f468 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SineEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SineEvaluatorTest.java @@ -36,7 +36,7 @@ public SineEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("sin", SineEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SquareRootEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SquareRootEvaluatorTest.java index c71eeaf3221..a2178832d5f 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SquareRootEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SquareRootEvaluatorTest.java @@ -36,7 +36,7 @@ public SquareRootEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("sqrt", SquareRootEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java index 9384afaf14e..97bbbc83640 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/SubtractEvaluatorTest.java @@ -36,7 +36,7 @@ public SubtractEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("sub", SubtractEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TangentEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TangentEvaluatorTest.java index 47669a1eecc..c298a8900d1 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TangentEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/TangentEvaluatorTest.java @@ -36,7 +36,7 @@ public TangentEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("tan", TangentEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } private void test(Double value) throws IOException { diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UniformDistributionEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UniformDistributionEvaluatorTest.java index 06298d20381..69a0927d027 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UniformDistributionEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UniformDistributionEvaluatorTest.java @@ -35,7 +35,7 @@ public class UniformDistributionEvaluatorTest extends SolrTestCase { public UniformDistributionEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("unif", UniformDistributionEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UuidEvaluatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UuidEvaluatorTest.java index 2010bf25aae..8d8176bae31 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UuidEvaluatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/io/stream/eval/UuidEvaluatorTest.java @@ -35,7 +35,7 @@ public UuidEvaluatorTest() { super(); factory = new StreamFactory().withFunctionName("uuid", UuidEvaluator.class); - values = new HashMap(); + values = new HashMap<>(); } @Test diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/response/NestableJsonFacetTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/response/NestableJsonFacetTest.java index 4eee3df8f93..9a3d32d3186 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/response/NestableJsonFacetTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/response/NestableJsonFacetTest.java @@ -30,39 +30,39 @@ public void testParsing() { NamedList list = new NamedList<>(); list.add("count", 12); NamedList buckets = - new NamedList() { + new NamedList<>() { { add("val", "Nike"); } }; NamedList vals = - new NamedList() { + new NamedList<>() { { add("numBuckets", 10); add( "allBuckets", - new NamedList() { + new NamedList<>() { { add("count", 12); } }); add( "before", - new NamedList() { + new NamedList<>() { { add("count", 1); } }); add( "after", - new NamedList() { + new NamedList<>() { { add("count", 2); } }); add( "between", - new NamedList() { + new NamedList<>() { { add("count", 9); } @@ -79,39 +79,39 @@ public void testParsing() { list.add("count", 12L); buckets = - new NamedList() { + new NamedList<>() { { add("val", "Nike"); } }; vals = - new NamedList() { + new NamedList<>() { { add("numBuckets", 10L); add( "allBuckets", - new NamedList() { + new NamedList<>() { { add("count", 12L); } }); add( "before", - new NamedList() { + new NamedList<>() { { add("count", 1L); } }); add( "after", - new NamedList() { + new NamedList<>() { { add("count", 2L); } }); add( "between", - new NamedList() { + new NamedList<>() { { add("count", 9L); } diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/response/TestDelegationTokenResponse.java b/solr/solrj/src/test/org/apache/solr/client/solrj/response/TestDelegationTokenResponse.java index caa9cd1d95e..5bb812a413f 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/response/TestDelegationTokenResponse.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/response/TestDelegationTokenResponse.java @@ -41,9 +41,9 @@ private void delegationTokenResponse( private String getNestedMapJson(String outerKey, String innerKey, Object innerValue) { CharArr out = new CharArr(); JSONWriter w = new JSONWriter(out, 2); - Map innerMap = new HashMap(); + Map innerMap = new HashMap<>(); innerMap.put(innerKey, innerValue); - Map> outerMap = new HashMap>(); + Map> outerMap = new HashMap<>(); outerMap.put(outerKey, innerMap); w.write(outerMap); return out.toString(); @@ -52,7 +52,7 @@ private String getNestedMapJson(String outerKey, String innerKey, Object innerVa private String getMapJson(String key, Object value) { CharArr out = new CharArr(); JSONWriter w = new JSONWriter(out, 2); - Map map = new HashMap(); + Map map = new HashMap<>(); map.put(key, value); w.write(map); return out.toString(); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/NodePreferenceRulesComparatorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/NodePreferenceRulesComparatorTest.java index 3663d161757..1fa85e4981f 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/NodePreferenceRulesComparatorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/NodePreferenceRulesComparatorTest.java @@ -203,7 +203,7 @@ public void unknownRuleTest() { } private static List getBasicReplicaList() { - List replicas = new ArrayList(); + List replicas = new ArrayList<>(); replicas.add( new Replica( "node1", diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java index 61e4150e28e..6d257edcd18 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/ReplicaListTransformerTest.java @@ -110,7 +110,7 @@ protected ReplicaListTransformer getReplicaListTransformer(final SolrQueryReques final String name = "replica" + (ii + 1); final String url = urls.get(ii); - final Map propMap = new HashMap(); + final Map propMap = new HashMap<>(); propMap.put("base_url", url); propMap.put("core", "test_core"); propMap.put("node_name", "test_node:80_"); diff --git a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java index f134cc23d17..ae6d2459382 100644 --- a/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java +++ b/solr/solrj/src/test/org/apache/solr/client/solrj/routing/RequestReplicaListTransformerGeneratorTest.java @@ -142,7 +142,7 @@ public void replicaTypeAndReplicaBase() { } private static List getBasicReplicaList() { - List replicas = new ArrayList(); + List replicas = new ArrayList<>(); replicas.add( new Replica( "node1", diff --git a/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java b/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java index da6cac631ce..020ff6a1398 100644 --- a/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java +++ b/solr/solrj/src/test/org/apache/solr/common/TestToleratedUpdateError.java @@ -85,7 +85,7 @@ public void testParseMap() { // randomized int numIters = atLeast(5000); for (int i = 0; i < numIters; i++) { - valid = new SimpleOrderedMap(); + valid = new SimpleOrderedMap<>(); valid.add("type", ALL_TYPES[TestUtil.nextInt(random(), 0, ALL_TYPES.length - 1)].toString()); valid.add("id", TestUtil.randomUnicodeString(random())); valid.add("message", TestUtil.randomUnicodeString(random())); diff --git a/solr/solrj/src/test/org/noggit/TestJSONWriter.java b/solr/solrj/src/test/org/noggit/TestJSONWriter.java index a75c947322a..ff6c7fe336f 100644 --- a/solr/solrj/src/test/org/noggit/TestJSONWriter.java +++ b/solr/solrj/src/test/org/noggit/TestJSONWriter.java @@ -44,7 +44,7 @@ public static Object[] A(Object... lst) { } public static Map O(Object... lst) { - LinkedHashMap map = new LinkedHashMap(); + LinkedHashMap map = new LinkedHashMap<>(); for (int i = 0; i < lst.length; i += 2) { map.put(lst[i].toString(), lst[i + 1]); } @@ -72,7 +72,7 @@ public String toString() { public static class Custom implements JSONWriter.Writable { @Override public void write(JSONWriter writer) { - Map val = new LinkedHashMap(); + Map val = new LinkedHashMap<>(); val.put("a", 1); val.put("b", 2); writer.write(val); diff --git a/solr/solrj/src/test/org/noggit/TestObjectBuilder.java b/solr/solrj/src/test/org/noggit/TestObjectBuilder.java index db156b5a454..e226969ad03 100644 --- a/solr/solrj/src/test/org/noggit/TestObjectBuilder.java +++ b/solr/solrj/src/test/org/noggit/TestObjectBuilder.java @@ -54,7 +54,7 @@ public static Object[] A(Object... lst) { } public static Map O(Object... lst) { - LinkedHashMap map = new LinkedHashMap(); + LinkedHashMap map = new LinkedHashMap<>(); for (int i = 0; i < lst.length; i += 2) { map.put(lst[i].toString(), lst[i + 1]); } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java index 8b819e1fd34..8f3b5540887 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/AbstractChaosMonkeyNothingIsSafeTestBase.java @@ -313,7 +313,7 @@ public void test() throws Exception { } private Set getAddFails(List threads) { - Set addFails = new HashSet(); + Set addFails = new HashSet<>(); for (StoppableIndexingThread thread : threads) { addFails.addAll(thread.getAddFails()); } @@ -321,7 +321,7 @@ private Set getAddFails(List threads) { } private Set getDeleteFails(List threads) { - Set deleteFails = new HashSet(); + Set deleteFails = new HashSet<>(); for (StoppableIndexingThread thread : threads) { deleteFails.addAll(thread.getDeleteFails()); } diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/StoppableIndexingThread.java b/solr/test-framework/src/java/org/apache/solr/cloud/StoppableIndexingThread.java index 9126d5a2b47..3b100cf1245 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/StoppableIndexingThread.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/StoppableIndexingThread.java @@ -40,7 +40,7 @@ public class StoppableIndexingThread extends AbstractFullDistribZkTestBase.Stopp private SolrClient cloudClient; private int numDeletes; private int numAdds; - private List docs = new ArrayList(); + private List docs = new ArrayList<>(); private int batchSize; private boolean pauseBetweenUpdates; diff --git a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java index 1271baa9009..a83b95178ba 100644 --- a/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java +++ b/solr/test-framework/src/java/org/apache/solr/cloud/ZkTestServer.java @@ -191,7 +191,7 @@ private String reportLimitViolations() { String[] maxKeys = maxCounters.keySet().toArray(new String[maxCounters.size()]); Arrays.sort( maxKeys, - new Comparator() { + new Comparator<>() { private final Comparator valComp = Comparator.naturalOrder().reversed(); @Override diff --git a/solr/test-framework/src/java/org/apache/solr/util/QueryMatchers.java b/solr/test-framework/src/java/org/apache/solr/util/QueryMatchers.java index 10b8db2c066..e2f6c8c49f5 100644 --- a/solr/test-framework/src/java/org/apache/solr/util/QueryMatchers.java +++ b/solr/test-framework/src/java/org/apache/solr/util/QueryMatchers.java @@ -66,7 +66,7 @@ private QueryMatchers() {} * @param query the query string to match against */ public static Matcher stringQuery(String query) { - return new TypeSafeDiagnosingMatcher() { + return new TypeSafeDiagnosingMatcher<>() { @Override protected boolean matchesSafely(Query item, Description mismatchDescription) { return is(query).matches(item.toString()); @@ -133,7 +133,7 @@ private static Matcher mustClause(Matcher query) public static Matcher booleanClause( Matcher query, BooleanClause.Occur occur) { - return new TypeSafeDiagnosingMatcher() { + return new TypeSafeDiagnosingMatcher<>() { @Override protected boolean matchesSafely(BooleanClause item, Description mismatchDescription) { boolean match = true;