Fixed typos and used diamond operator

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1659164 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2015-02-12 08:10:04 +00:00
parent 90584151cd
commit a94083c06b
3 changed files with 14 additions and 14 deletions

View File

@ -38,8 +38,8 @@ import org.apache.solr.handler.component.FacetComponent.FacetBase;
public class PivotFacet extends FacetBase { public class PivotFacet extends FacetBase {
/** /**
* Local param used to indicate that refinements are requried on a pivot. Should * Local param used to indicate that refinements are required on a pivot. Should
* also be used as the prefix for contatenanting with the value to determine the * 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 * name of the multi-valued param that will contain all of the values needed for
* refinement. * refinement.
*/ */
@ -89,7 +89,7 @@ public class PivotFacet extends FacetBase {
if (null == raw) { if (null == raw) {
raw = Collections.<PivotFacetValue>emptyList(); raw = Collections.<PivotFacetValue>emptyList();
} }
return Collections.<PivotFacetValue>unmodifiableList(raw); return Collections.unmodifiableList(raw);
} }
/** /**

View File

@ -65,7 +65,7 @@ public class PivotFacetHelper {
} }
out.append(','); out.append(',');
} }
out.deleteCharAt(out.length()-1); // prune the last seperator out.deleteCharAt(out.length()-1); // prune the last separator
return out.toString(); return out.toString();
// return StrUtils.join(values, ','); // return StrUtils.join(values, ',');
} }
@ -80,7 +80,7 @@ public class PivotFacetHelper {
// special case: empty list => empty string // special case: empty list => empty string
if (rawvals.isEmpty()) return rawvals; if (rawvals.isEmpty()) return rawvals;
List<String> out = new ArrayList<String>(rawvals.size()); List<String> out = new ArrayList<>(rawvals.size());
for (String raw : rawvals) { for (String raw : rawvals) {
assert 0 < raw.length(); assert 0 < raw.length();
if ('^' == raw.charAt(0)) { if ('^' == raw.charAt(0)) {
@ -124,7 +124,7 @@ public class PivotFacetHelper {
* Given a mapping of keys to {@link StatsValues} representing the currently * Given a mapping of keys to {@link StatsValues} representing the currently
* known "merged" stats (which may be null if none exist yet), and a * known "merged" stats (which may be null if none exist yet), and a
* {@link NamedList} containing the "stats" response block returned by an individual * {@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 * 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. * @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, NamedList<NamedList<NamedList<?>>> remoteWrapper,
StatsInfo statsInfo) { StatsInfo statsInfo) {
if (null == merged) merged = new LinkedHashMap<String,StatsValues>(); if (null == merged) merged = new LinkedHashMap<>();
NamedList<NamedList<?>> remoteStats = StatsComponent.unwrapStats(remoteWrapper); NamedList<NamedList<?>> remoteStats = StatsComponent.unwrapStats(remoteWrapper);
for (Entry<String,NamedList<?>> entry : remoteStats) { for (Entry<String,NamedList<?>> entry : remoteStats) {
StatsValues receivingStatsValues = merged.get(entry.getKey()); StatsValues receivingStatsValues = merged.get(entry.getKey());
if (receivingStatsValues == null) { if (receivingStatsValues == null) {
StatsField recievingStatsField = statsInfo.getStatsField(entry.getKey()); StatsField receivingStatsField = statsInfo.getStatsField(entry.getKey());
if (null == recievingStatsField) { if (null == receivingStatsField) {
throw new SolrException(ErrorCode.SERVER_ERROR , "No stats.field found corrisponding to pivot stats recieved from shard: "+entry.getKey()); 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); merged.put(entry.getKey(), receivingStatsValues);
} }
receivingStatsValues.accumulate(entry.getValue()); receivingStatsValues.accumulate(entry.getValue());

View File

@ -168,7 +168,7 @@ public class PivotFacetProcessor extends SimpleFacets
String firstFieldsValues = refinementValuesByField.get(0); String firstFieldsValues = refinementValuesByField.get(0);
facetCounts = new NamedList<Integer>(); facetCounts = new NamedList<>();
facetCounts.add(firstFieldsValues, facetCounts.add(firstFieldsValues,
getSubsetSize(this.docs, sfield, firstFieldsValues)); getSubsetSize(this.docs, sfield, firstFieldsValues));
} else { } else {
@ -261,7 +261,7 @@ public class PivotFacetProcessor extends SimpleFacets
NamedList<Integer> facetCounts; NamedList<Integer> facetCounts;
if(!vnames.isEmpty()){ if(!vnames.isEmpty()){
String val = vnames.pop(); String val = vnames.pop();
facetCounts = new NamedList<Integer>(); facetCounts = new NamedList<>();
facetCounts.add(val, getSubsetSize(subset, facetCounts.add(val, getSubsetSize(subset,
searcher.getSchema().getField(subField), searcher.getSchema().getField(subField),
val)); 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 * 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 field the field type used by the pivotValue
* @param pivotValue String representation of the value, may be null (ie: "missing") * @param pivotValue String representation of the value, may be null (ie: "missing")
*/ */