Skip to content

Apache Lucene open-source search software

Fixed typos and used diamond operator

Shalin Shekhar Mangara94083c06b22
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 a823a8f12a4..3006a579cfc 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
@@ -38,8 +38,8 @@ import org.apache.solr.handler.component.FacetComponent.FacetBase;
public class PivotFacet extends FacetBase {
/**
- * Local param used to indicate that refinements are requried on a pivot. Should
- * also be used as the prefix for contatenanting with the value to determine the
+ * Local param used to indicate that refinements are required on a pivot. Should
+ * also be used as the prefix for concatenating with the value to determine the
* name of the multi-valued param that will contain all of the values needed for
* refinement.
*/
@@ -89,7 +89,7 @@ public class PivotFacet extends FacetBase {
if (null == raw) {
raw = Collections.<PivotFacetValue>emptyList();
}
- return Collections.<PivotFacetValue>unmodifiableList(raw);
+ return Collections.unmodifiableList(raw);
}
/**
diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetHelper.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetHelper.java
index 4123a0754b5..c1730072c0f 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetHelper.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetHelper.java
@@ -65,7 +65,7 @@ public class PivotFacetHelper {
}
out.append(',');
}
- out.deleteCharAt(out.length()-1); // prune the last seperator
+ out.deleteCharAt(out.length()-1); // prune the last separator
return out.toString();
// return StrUtils.join(values, ',');
}
@@ -80,7 +80,7 @@ public class PivotFacetHelper {
// special case: empty list => empty string
if (rawvals.isEmpty()) return rawvals;
- List<String> out = new ArrayList<String>(rawvals.size());
+ List<String> out = new ArrayList<>(rawvals.size());
for (String raw : rawvals) {
assert 0 < raw.length();
if ('^' == raw.charAt(0)) {
@@ -124,7 +124,7 @@ public class PivotFacetHelper {
* Given a mapping of keys to {@link StatsValues} representing the currently
* known "merged" stats (which may be null if none exist yet), and a
* {@link NamedList} containing the "stats" response block returned by an individual
- * shard, this method accumulates the stasts for each {@link StatsField} found in
+ * shard, this method accumulates the stats for each {@link StatsField} found in
* the shard response with the existing mergeStats
*
* @return the original <code>merged</code> Map after modifying, or a new Map if the <code>merged</code> param was originally null.
@@ -137,18 +137,18 @@ public class PivotFacetHelper {
NamedList<NamedList<NamedList<?>>> remoteWrapper,
StatsInfo statsInfo) {
- if (null == merged) merged = new LinkedHashMap<String,StatsValues>();
+ if (null == merged) merged = new LinkedHashMap<>();
NamedList<NamedList<?>> remoteStats = StatsComponent.unwrapStats(remoteWrapper);
for (Entry<String,NamedList<?>> entry : remoteStats) {
StatsValues receivingStatsValues = merged.get(entry.getKey());
if (receivingStatsValues == null) {
- StatsField recievingStatsField = statsInfo.getStatsField(entry.getKey());
- if (null == recievingStatsField) {
- throw new SolrException(ErrorCode.SERVER_ERROR , "No stats.field found corrisponding to pivot stats recieved from shard: "+entry.getKey());
+ StatsField receivingStatsField = statsInfo.getStatsField(entry.getKey());
+ if (null == receivingStatsField) {
+ throw new SolrException(ErrorCode.SERVER_ERROR , "No stats.field found corresponding to pivot stats received from shard: "+entry.getKey());
}
- receivingStatsValues = StatsValuesFactory.createStatsValues(recievingStatsField);
+ receivingStatsValues = StatsValuesFactory.createStatsValues(receivingStatsField);
merged.put(entry.getKey(), receivingStatsValues);
}
receivingStatsValues.accumulate(entry.getValue());
diff --git a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetProcessor.java b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetProcessor.java
index 14385a84357..a9834289acf 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/PivotFacetProcessor.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/PivotFacetProcessor.java
@@ -168,7 +168,7 @@ public class PivotFacetProcessor extends SimpleFacets
String firstFieldsValues = refinementValuesByField.get(0);
- facetCounts = new NamedList<Integer>();
+ facetCounts = new NamedList<>();
facetCounts.add(firstFieldsValues,
getSubsetSize(this.docs, sfield, firstFieldsValues));
} else {
@@ -261,7 +261,7 @@ public class PivotFacetProcessor extends SimpleFacets
NamedList<Integer> facetCounts;
if(!vnames.isEmpty()){
String val = vnames.pop();
- facetCounts = new NamedList<Integer>();
+ facetCounts = new NamedList<>();
facetCounts.add(val, getSubsetSize(subset,
searcher.getSchema().getField(subField),
val));
@@ -293,7 +293,7 @@ public class PivotFacetProcessor extends SimpleFacets
/**
* Given a base docset, computes the size of the subset of documents corresponding to the specified pivotValue
*
- * @param base the set of documents to evalute relative to
+ * @param base the set of documents to evaluate relative to
* @param field the field type used by the pivotValue
* @param pivotValue String representation of the value, may be null (ie: "missing")
*/