You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2014/03/12 19:14:27 UTC
svn commit: r1576837 [22/29] - in /lucene/dev/branches/branch_4x: ./ lucene/
lucene/analysis/
lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/
lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/
lucene/analysis/co...
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/FieldTypePluginLoader.java Wed Mar 12 18:14:05 2014
@@ -185,7 +185,7 @@ public final class FieldTypePluginLoader
static final KeywordTokenizerFactory keyFactory = new KeywordTokenizerFactory(new HashMap<String,String>());
ArrayList<CharFilterFactory> charFilters = null;
- ArrayList<TokenFilterFactory> filters = new ArrayList<TokenFilterFactory>(2);
+ ArrayList<TokenFilterFactory> filters = new ArrayList<>(2);
TokenizerFactory tokenizer = keyFactory;
public void add(Object current) {
@@ -193,14 +193,14 @@ public final class FieldTypePluginLoader
AbstractAnalysisFactory newComponent = ((MultiTermAwareComponent)current).getMultiTermComponent();
if (newComponent instanceof TokenFilterFactory) {
if (filters == null) {
- filters = new ArrayList<TokenFilterFactory>(2);
+ filters = new ArrayList<>(2);
}
filters.add((TokenFilterFactory)newComponent);
} else if (newComponent instanceof TokenizerFactory) {
tokenizer = (TokenizerFactory)newComponent;
} else if (newComponent instanceof CharFilterFactory) {
if (charFilters == null) {
- charFilters = new ArrayList<CharFilterFactory>(1);
+ charFilters = new ArrayList<>(1);
}
charFilters.add( (CharFilterFactory)newComponent);
@@ -293,7 +293,7 @@ public final class FieldTypePluginLoader
// Load the CharFilters
final ArrayList<CharFilterFactory> charFilters
- = new ArrayList<CharFilterFactory>();
+ = new ArrayList<>();
AbstractPluginLoader<CharFilterFactory> charFilterLoader =
new AbstractPluginLoader<CharFilterFactory>
("[schema.xml] analyzer/charFilter", CharFilterFactory.class, false, false) {
@@ -329,7 +329,7 @@ public final class FieldTypePluginLoader
// the configuration is ok
final ArrayList<TokenizerFactory> tokenizers
- = new ArrayList<TokenizerFactory>(1);
+ = new ArrayList<>(1);
AbstractPluginLoader<TokenizerFactory> tokenizerLoader =
new AbstractPluginLoader<TokenizerFactory>
("[schema.xml] analyzer/tokenizer", TokenizerFactory.class, false, false) {
@@ -369,7 +369,7 @@ public final class FieldTypePluginLoader
// Load the Filters
final ArrayList<TokenFilterFactory> filters
- = new ArrayList<TokenFilterFactory>();
+ = new ArrayList<>();
AbstractPluginLoader<TokenFilterFactory> filterLoader =
new AbstractPluginLoader<TokenFilterFactory>("[schema.xml] analyzer/filter", TokenFilterFactory.class, false, false)
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/IndexSchema.java Wed Mar 12 18:14:05 2014
@@ -118,25 +118,25 @@ public class IndexSchema {
protected float version;
protected final SolrResourceLoader loader;
- protected Map<String,SchemaField> fields = new HashMap<String,SchemaField>();
- protected Map<String,FieldType> fieldTypes = new HashMap<String,FieldType>();
+ protected Map<String,SchemaField> fields = new HashMap<>();
+ protected Map<String,FieldType> fieldTypes = new HashMap<>();
- protected List<SchemaField> fieldsWithDefaultValue = new ArrayList<SchemaField>();
- protected Collection<SchemaField> requiredFields = new HashSet<SchemaField>();
+ protected List<SchemaField> fieldsWithDefaultValue = new ArrayList<>();
+ protected Collection<SchemaField> requiredFields = new HashSet<>();
protected volatile DynamicField[] dynamicFields;
public DynamicField[] getDynamicFields() { return dynamicFields; }
private Analyzer analyzer;
private Analyzer queryAnalyzer;
- protected List<SchemaAware> schemaAware = new ArrayList<SchemaAware>();
+ protected List<SchemaAware> schemaAware = new ArrayList<>();
protected String defaultSearchFieldName=null;
protected String queryParserDefaultOperator = "OR";
protected boolean isExplicitQueryParserDefaultOperator = false;
- protected Map<String, List<CopyField>> copyFieldsMap = new HashMap<String, List<CopyField>>();
+ protected Map<String, List<CopyField>> copyFieldsMap = new HashMap<>();
public Map<String,List<CopyField>> getCopyFieldsMap() { return Collections.unmodifiableMap(copyFieldsMap); }
protected DynamicCopy[] dynamicCopyFields;
@@ -146,7 +146,7 @@ public class IndexSchema {
* keys are all fields copied to, count is num of copyField
* directives that target them.
*/
- protected Map<SchemaField, Integer> copyFieldTargetCounts = new HashMap<SchemaField, Integer>();
+ protected Map<SchemaField, Integer> copyFieldTargetCounts = new HashMap<>();
/**
* Constructs a schema using the specified resource name and stream.
@@ -384,7 +384,7 @@ public class IndexSchema {
}
protected HashMap<String, Analyzer> analyzerCache() {
- HashMap<String, Analyzer> cache = new HashMap<String, Analyzer>();
+ HashMap<String, Analyzer> cache = new HashMap<>();
for (SchemaField f : getFields().values()) {
Analyzer analyzer = f.getType().getAnalyzer();
cache.put(f.getName(), analyzer);
@@ -405,7 +405,7 @@ public class IndexSchema {
@Override
protected HashMap<String, Analyzer> analyzerCache() {
- HashMap<String, Analyzer> cache = new HashMap<String, Analyzer>();
+ HashMap<String, Analyzer> cache = new HashMap<>();
for (SchemaField f : getFields().values()) {
Analyzer analyzer = f.getType().getQueryAnalyzer();
cache.put(f.getName(), analyzer);
@@ -631,9 +631,9 @@ public class IndexSchema {
*/
protected synchronized Map<String,Boolean> loadFields(Document document, XPath xpath) throws XPathExpressionException {
// Hang on to the fields that say if they are required -- this lets us set a reasonable default for the unique key
- Map<String,Boolean> explicitRequiredProp = new HashMap<String,Boolean>();
+ Map<String,Boolean> explicitRequiredProp = new HashMap<>();
- ArrayList<DynamicField> dFields = new ArrayList<DynamicField>();
+ ArrayList<DynamicField> dFields = new ArrayList<>();
// /schema/fields/field | /schema/fields/dynamicField
String expression = stepsToPath(SCHEMA, FIELDS, FIELD)
@@ -754,7 +754,7 @@ public class IndexSchema {
* @param fields The sequence of {@link org.apache.solr.schema.SchemaField}
*/
public void registerDynamicFields(SchemaField... fields) {
- List<DynamicField> dynFields = new ArrayList<DynamicField>(Arrays.asList(dynamicFields));
+ List<DynamicField> dynFields = new ArrayList<>(Arrays.asList(dynamicFields));
for (SchemaField field : fields) {
if (isDuplicateDynField(dynFields, field)) {
log.debug("dynamic field already exists: dynamic field: [" + field.getName() + "]");
@@ -887,7 +887,7 @@ public class IndexSchema {
} else { // source & dest: explicit fields
List<CopyField> copyFieldList = copyFieldsMap.get(source);
if (copyFieldList == null) {
- copyFieldList = new ArrayList<CopyField>();
+ copyFieldList = new ArrayList<>();
copyFieldsMap.put(source, copyFieldList);
}
copyFieldList.add(new CopyField(sourceSchemaField, destSchemaField, maxChars));
@@ -1259,7 +1259,7 @@ public class IndexSchema {
if (!isCopyFieldTarget(f)) {
return Collections.emptyList();
}
- List<String> fieldNames = new ArrayList<String>();
+ List<String> fieldNames = new ArrayList<>();
for (Map.Entry<String, List<CopyField>> cfs : copyFieldsMap.entrySet()) {
for (CopyField copyField : cfs.getValue()) {
if (copyField.getDestination().getName().equals(destField)) {
@@ -1283,7 +1283,7 @@ public class IndexSchema {
*/
// This is useful when we need the maxSize param of each CopyField
public List<CopyField> getCopyFieldsList(final String sourceField){
- final List<CopyField> result = new ArrayList<CopyField>();
+ final List<CopyField> result = new ArrayList<>();
for (DynamicCopy dynamicCopy : dynamicCopyFields) {
if (dynamicCopy.matches(sourceField)) {
result.add(new CopyField(getField(sourceField), dynamicCopy.getTargetField(sourceField), dynamicCopy.maxChars));
@@ -1310,7 +1310,7 @@ public class IndexSchema {
* Get a map of property name -> value for the whole schema.
*/
public SimpleOrderedMap<Object> getNamedPropertyValues() {
- SimpleOrderedMap<Object> topLevel = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> topLevel = new SimpleOrderedMap<>();
topLevel.add(NAME, getSchemaName());
topLevel.add(VERSION, getVersion());
if (null != uniqueKeyFieldName) {
@@ -1320,26 +1320,26 @@ public class IndexSchema {
topLevel.add(DEFAULT_SEARCH_FIELD, defaultSearchFieldName);
}
if (isExplicitQueryParserDefaultOperator) {
- SimpleOrderedMap<Object> solrQueryParserProperties = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> solrQueryParserProperties = new SimpleOrderedMap<>();
solrQueryParserProperties.add(DEFAULT_OPERATOR, queryParserDefaultOperator);
topLevel.add(SOLR_QUERY_PARSER, solrQueryParserProperties);
}
if (isExplicitSimilarity) {
topLevel.add(SIMILARITY, similarityFactory.getNamedPropertyValues());
}
- List<SimpleOrderedMap<Object>> fieldTypeProperties = new ArrayList<SimpleOrderedMap<Object>>();
- SortedMap<String,FieldType> sortedFieldTypes = new TreeMap<String,FieldType>(fieldTypes);
+ List<SimpleOrderedMap<Object>> fieldTypeProperties = new ArrayList<>();
+ SortedMap<String,FieldType> sortedFieldTypes = new TreeMap<>(fieldTypes);
for (FieldType fieldType : sortedFieldTypes.values()) {
fieldTypeProperties.add(fieldType.getNamedPropertyValues(false));
}
topLevel.add(FIELD_TYPES, fieldTypeProperties);
- List<SimpleOrderedMap<Object>> fieldProperties = new ArrayList<SimpleOrderedMap<Object>>();
- SortedSet<String> fieldNames = new TreeSet<String>(fields.keySet());
+ List<SimpleOrderedMap<Object>> fieldProperties = new ArrayList<>();
+ SortedSet<String> fieldNames = new TreeSet<>(fields.keySet());
for (String fieldName : fieldNames) {
fieldProperties.add(fields.get(fieldName).getNamedPropertyValues(false));
}
topLevel.add(FIELDS, fieldProperties);
- List<SimpleOrderedMap<Object>> dynamicFieldProperties = new ArrayList<SimpleOrderedMap<Object>>();
+ List<SimpleOrderedMap<Object>> dynamicFieldProperties = new ArrayList<>();
for (IndexSchema.DynamicField dynamicField : dynamicFields) {
if ( ! dynamicField.getRegex().startsWith(INTERNAL_POLY_FIELD_PREFIX)) { // omit internal polyfields
dynamicFieldProperties.add(dynamicField.getPrototype().getNamedPropertyValues(false));
@@ -1364,8 +1364,8 @@ public class IndexSchema {
*/
public List<SimpleOrderedMap<Object>> getCopyFieldProperties
(boolean showDetails, Set<String> requestedSourceFields, Set<String> requestedDestinationFields) {
- List<SimpleOrderedMap<Object>> copyFieldProperties = new ArrayList<SimpleOrderedMap<Object>>();
- SortedMap<String,List<CopyField>> sortedCopyFields = new TreeMap<String,List<CopyField>>(copyFieldsMap);
+ List<SimpleOrderedMap<Object>> copyFieldProperties = new ArrayList<>();
+ SortedMap<String,List<CopyField>> sortedCopyFields = new TreeMap<>(copyFieldsMap);
for (List<CopyField> copyFields : sortedCopyFields.values()) {
Collections.sort(copyFields, new Comparator<CopyField>() {
@Override
@@ -1379,7 +1379,7 @@ public class IndexSchema {
final String destination = copyField.getDestination().getName();
if ( (null == requestedSourceFields || requestedSourceFields.contains(source))
&& (null == requestedDestinationFields || requestedDestinationFields.contains(destination))) {
- SimpleOrderedMap<Object> props = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> props = new SimpleOrderedMap<>();
props.add(SOURCE, source);
props.add(DESTINATION, destination);
if (0 != copyField.getMaxChars()) {
@@ -1394,7 +1394,7 @@ public class IndexSchema {
final String destination = dynamicCopy.getDestFieldName();
if ( (null == requestedSourceFields || requestedSourceFields.contains(source))
&& (null == requestedDestinationFields || requestedDestinationFields.contains(destination))) {
- SimpleOrderedMap<Object> dynamicCopyProps = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> dynamicCopyProps = new SimpleOrderedMap<>();
dynamicCopyProps.add(SOURCE, dynamicCopy.getRegex());
if (showDetails) {
@@ -1402,7 +1402,7 @@ public class IndexSchema {
if (null != sourceDynamicBase) {
dynamicCopyProps.add(SOURCE_DYNAMIC_BASE, sourceDynamicBase.getRegex());
} else if (source.contains("*")) {
- List<String> sourceExplicitFields = new ArrayList<String>();
+ List<String> sourceExplicitFields = new ArrayList<>();
Pattern pattern = Pattern.compile(source.replace("*", ".*")); // glob->regex
for (String field : fields.keySet()) {
if (pattern.matcher(field).matches()) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/JsonPreAnalyzedParser.java Wed Mar 12 18:14:05 2014
@@ -208,7 +208,7 @@ public class JsonPreAnalyzedParser imple
@Override
public String toFormattedString(Field f) throws IOException {
- Map<String,Object> map = new LinkedHashMap<String,Object>();
+ Map<String,Object> map = new LinkedHashMap<>();
map.put(VERSION_KEY, VERSION);
if (f.fieldType().stored()) {
String stringValue = f.stringValue();
@@ -222,12 +222,12 @@ public class JsonPreAnalyzedParser imple
}
TokenStream ts = f.tokenStreamValue();
if (ts != null) {
- List<Map<String,Object>> tokens = new LinkedList<Map<String,Object>>();
+ List<Map<String,Object>> tokens = new LinkedList<>();
while (ts.incrementToken()) {
Iterator<Class<? extends Attribute>> it = ts.getAttributeClassesIterator();
String cTerm = null;
String tTerm = null;
- Map<String,Object> tok = new TreeMap<String,Object>();
+ Map<String,Object> tok = new TreeMap<>();
while (it.hasNext()) {
Class<? extends Attribute> cl = it.next();
if (!ts.hasAttribute(cl)) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/LatLonType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/LatLonType.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/LatLonType.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/LatLonType.java Wed Mar 12 18:14:05 2014
@@ -72,7 +72,7 @@ public class LatLonType extends Abstract
public List<IndexableField> createFields(SchemaField field, Object value, float boost) {
String externalVal = value.toString();
//we could have 3 fields (two for the lat & lon, one for storage)
- List<IndexableField> f = new ArrayList<IndexableField>(3);
+ List<IndexableField> f = new ArrayList<>(3);
if (field.indexed()) {
Point point = SpatialUtils.parsePointSolrException(externalVal, SpatialContext.GEO);
//latitude
@@ -216,7 +216,7 @@ public class LatLonType extends Abstract
@Override
public ValueSource getValueSource(SchemaField field, QParser parser) {
- ArrayList<ValueSource> vs = new ArrayList<ValueSource>(2);
+ ArrayList<ValueSource> vs = new ArrayList<>(2);
for (int i = 0; i < 2; i++) {
SchemaField sub = subField(field, i, parser.getReq().getSchema());
vs.add(sub.getType().getValueSource(sub, parser));
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/OpenExchangeRatesOrgProvider.java Wed Mar 12 18:14:05 2014
@@ -203,7 +203,7 @@ public class OpenExchangeRatesOrgProvide
public OpenExchangeRates(InputStream ratesStream) throws IOException {
parser = new JSONParser(new InputStreamReader(ratesStream, IOUtils.CHARSET_UTF_8));
- rates = new HashMap<String, Double>();
+ rates = new HashMap<>();
int ev;
do {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PointType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PointType.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PointType.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PointType.java Wed Mar 12 18:14:05 2014
@@ -70,7 +70,7 @@ public class PointType extends Coordinat
String[] point = parseCommaSeparatedList(externalVal, dimension);
// TODO: this doesn't currently support polyFields as sub-field types
- List<IndexableField> f = new ArrayList<IndexableField>(dimension+1);
+ List<IndexableField> f = new ArrayList<>(dimension+1);
if (field.indexed()) {
for (int i=0; i<dimension; i++) {
@@ -91,7 +91,7 @@ public class PointType extends Coordinat
@Override
public ValueSource getValueSource(SchemaField field, QParser parser) {
- ArrayList<ValueSource> vs = new ArrayList<ValueSource>(dimension);
+ ArrayList<ValueSource> vs = new ArrayList<>(dimension);
for (int i=0; i<dimension; i++) {
SchemaField sub = subField(field, i, schema);
vs.add(sub.getType().getValueSource(sub, parser));
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/PreAnalyzedField.java Wed Mar 12 18:14:05 2014
@@ -168,7 +168,7 @@ public class PreAnalyzedField extends Fi
public static class ParseResult {
public String str;
public byte[] bin;
- public List<State> states = new LinkedList<State>();
+ public List<State> states = new LinkedList<>();
}
/**
@@ -246,7 +246,7 @@ public class PreAnalyzedField extends Fi
* Token stream that works from a list of saved states.
*/
private static class PreAnalyzedTokenizer extends Tokenizer {
- private final List<AttributeSource.State> cachedStates = new LinkedList<AttributeSource.State>();
+ private final List<AttributeSource.State> cachedStates = new LinkedList<>();
private Iterator<AttributeSource.State> it = null;
private String stringValue = null;
private byte[] binaryValue = null;
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SchemaField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SchemaField.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SchemaField.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SchemaField.java Wed Mar 12 18:14:05 2014
@@ -201,7 +201,7 @@ public final class SchemaField extends F
defaultValue = (String)props.get(DEFAULT_VALUE);
}
SchemaField field = new SchemaField(name, ft, calcProps(name, ft, props), defaultValue);
- field.args = new HashMap<String,Object>(props);
+ field.args = new HashMap<>(props);
return field;
}
@@ -313,7 +313,7 @@ public final class SchemaField extends F
* not overridden in the field declaration).
*/
public SimpleOrderedMap<Object> getNamedPropertyValues(boolean showDefaults) {
- SimpleOrderedMap<Object> properties = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> properties = new SimpleOrderedMap<>();
properties.add(FIELD_NAME, getName());
properties.add(TYPE_NAME, getType().getTypeName());
if (showDefaults) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimilarityFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimilarityFactory.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimilarityFactory.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimilarityFactory.java Wed Mar 12 18:14:05 2014
@@ -51,7 +51,7 @@ public abstract class SimilarityFactory
/** Returns a serializable description of this similarity(factory) */
public SimpleOrderedMap<Object> getNamedPropertyValues() {
- SimpleOrderedMap<Object> props = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> props = new SimpleOrderedMap<>();
props.add(CLASS_NAME, getClassArg());
if (null != params) {
Iterator<String> iter = params.getParameterNamesIterator();
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SimplePreAnalyzedParser.java Wed Mar 12 18:14:05 2014
@@ -141,7 +141,7 @@ public final class SimplePreAnalyzedPars
private static class Tok {
StringBuilder token = new StringBuilder();
- Map<String, String> attr = new HashMap<String, String>();
+ Map<String, String> attr = new HashMap<>();
public boolean isEmpty() {
return token.length() == 0 && attr.size() == 0;
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/SpatialPointVectorFieldType.java Wed Mar 12 18:14:05 2014
@@ -65,7 +65,7 @@ public class SpatialPointVectorFieldType
//Just set these, delegate everything else to the field type
final int p = (INDEXED | TOKENIZED | OMIT_NORMS | OMIT_TF_POSITIONS);
- List<SchemaField> newFields = new ArrayList<SchemaField>();
+ List<SchemaField> newFields = new ArrayList<>();
for( SchemaField sf : schema.getFields().values() ) {
if( sf.getType() == this ) {
String name = sf.getName();
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/StrField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/StrField.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/StrField.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/StrField.java Wed Mar 12 18:14:05 2014
@@ -45,7 +45,7 @@ public class StrField extends PrimitiveF
public List<IndexableField> createFields(SchemaField field, Object value,
float boost) {
if (field.hasDocValues()) {
- List<IndexableField> fields = new ArrayList<IndexableField>();
+ List<IndexableField> fields = new ArrayList<>();
fields.add(createField(field, value, boost));
final BytesRef bytes = new BytesRef(value.toString());
if (field.multiValued()) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/TrieField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/TrieField.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/TrieField.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/schema/TrieField.java Wed Mar 12 18:14:05 2014
@@ -634,7 +634,7 @@ public class TrieField extends Primitive
@Override
public List<IndexableField> createFields(SchemaField sf, Object value, float boost) {
if (sf.hasDocValues()) {
- List<IndexableField> fields = new ArrayList<IndexableField>();
+ List<IndexableField> fields = new ArrayList<>();
final IndexableField field = createField(sf, value, boost);
fields.add(field);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/CursorMark.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/CursorMark.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/CursorMark.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/CursorMark.java Wed Mar 12 18:14:05 2014
@@ -160,7 +160,7 @@ public final class CursorMark {
} else {
assert input.size() == sortSpec.getSort().getSort().length;
// defensive copy
- this.values = new ArrayList<Object>(input);
+ this.values = new ArrayList<>(input);
}
}
@@ -170,7 +170,7 @@ public final class CursorMark {
*/
public List<Object> getSortValues() {
// defensive copy
- return null == this.values ? null : new ArrayList<Object>(this.values);
+ return null == this.values ? null : new ArrayList<>(this.values);
}
/**
@@ -218,7 +218,7 @@ public final class CursorMark {
}
- this.values = new ArrayList<Object>(sortFields.length);
+ this.values = new ArrayList<>(sortFields.length);
final BytesRef tmpBytes = new BytesRef();
for (int i = 0; i < sortFields.length; i++) {
@@ -248,7 +248,7 @@ public final class CursorMark {
}
final List<SchemaField> schemaFields = sortSpec.getSchemaFields();
- final ArrayList<Object> marshalledValues = new ArrayList<Object>(values.size()+1);
+ final ArrayList<Object> marshalledValues = new ArrayList<>(values.size()+1);
for (int i = 0; i < schemaFields.size(); i++) {
SchemaField fld = schemaFields.get(i);
Object safeValue = values.get(i);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/DisMaxQParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/DisMaxQParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/DisMaxQParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/DisMaxQParser.java Wed Mar 12 18:14:05 2014
@@ -137,7 +137,7 @@ public class DisMaxQParser extends QPars
//List<Query> boostQueries = SolrPluginUtils.parseQueryStrings(req, boostParams);
boostQueries = null;
if (boostParams != null && boostParams.length > 0) {
- boostQueries = new ArrayList<Query>();
+ boostQueries = new ArrayList<>();
for (String qs : boostParams) {
if (qs.trim().length() == 0) continue;
Query q = subQuery(qs, null).getQuery();
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ExtendedDismaxQParser.java Wed Mar 12 18:14:05 2014
@@ -204,7 +204,7 @@ public class ExtendedDismaxQParser exten
if (allPhraseFields.size() > 0) {
// find non-field clauses
- List<Clause> normalClauses = new ArrayList<Clause>(clauses.size());
+ List<Clause> normalClauses = new ArrayList<>(clauses.size());
for (Clause clause : clauses) {
if (clause.field != null || clause.isPhrase) continue;
// check for keywords "AND,OR,TO"
@@ -218,7 +218,7 @@ public class ExtendedDismaxQParser exten
// full phrase and shingles
for (FieldParams phraseField: allPhraseFields) {
- Map<String,Float> pf = new HashMap<String,Float>(1);
+ Map<String,Float> pf = new HashMap<>(1);
pf.put(phraseField.getField(),phraseField.getBoost());
addShingledPhraseQueries(query, normalClauses, pf,
phraseField.getWordGrams(),config.tiebreaker, phraseField.getSlop());
@@ -407,7 +407,7 @@ public class ExtendedDismaxQParser exten
* Parses all multiplicative boosts
*/
protected List<ValueSource> getMultiplicativeBoosts() throws SyntaxError {
- List<ValueSource> boosts = new ArrayList<ValueSource>();
+ List<ValueSource> boosts = new ArrayList<>();
if (config.hasMultiplicativeBoosts()) {
for (String boostStr : config.multBoosts) {
if (boostStr==null || boostStr.length()==0) continue;
@@ -428,7 +428,7 @@ public class ExtendedDismaxQParser exten
* Parses all function queries
*/
protected List<Query> getBoostFunctions() throws SyntaxError {
- List<Query> boostFunctions = new LinkedList<Query>();
+ List<Query> boostFunctions = new LinkedList<>();
if (config.hasBoostFunctions()) {
for (String boostFunc : config.boostFuncs) {
if(null == boostFunc || "".equals(boostFunc)) continue;
@@ -450,7 +450,7 @@ public class ExtendedDismaxQParser exten
* Parses all boost queries
*/
protected List<Query> getBoostQueries() throws SyntaxError {
- List<Query> boostQueries = new LinkedList<Query>();
+ List<Query> boostQueries = new LinkedList<>();
if (config.hasBoostParams()) {
for (String qs : config.boostParams) {
if (qs.trim().length()==0) continue;
@@ -676,7 +676,7 @@ public class ExtendedDismaxQParser exten
}
public List<Clause> splitIntoClauses(String s, boolean ignoreQuote) {
- ArrayList<Clause> lst = new ArrayList<Clause>(4);
+ ArrayList<Clause> lst = new ArrayList<>(4);
Clause clause;
int pos=0;
@@ -859,7 +859,7 @@ public class ExtendedDismaxQParser exten
}
public static List<String> split(String s, boolean ignoreQuote) {
- ArrayList<String> lst = new ArrayList<String>(4);
+ ArrayList<String> lst = new ArrayList<>(4);
int pos=0, start=0, end=s.length();
char inString=0;
char ch=0;
@@ -937,7 +937,7 @@ public class ExtendedDismaxQParser exten
* string, to Alias object containing the fields to use in our
* DisjunctionMaxQuery and the tiebreaker to use.
*/
- protected Map<String,Alias> aliases = new HashMap<String,Alias>(3);
+ protected Map<String,Alias> aliases = new HashMap<>(3);
private QType type;
private String field;
@@ -1029,7 +1029,7 @@ public class ExtendedDismaxQParser exten
Analyzer actualAnalyzer;
if (removeStopFilter) {
if (nonStopFilterAnalyzerPerField == null) {
- nonStopFilterAnalyzerPerField = new HashMap<String, Analyzer>();
+ nonStopFilterAnalyzerPerField = new HashMap<>();
}
actualAnalyzer = nonStopFilterAnalyzerPerField.get(field);
if (actualAnalyzer == null) {
@@ -1127,7 +1127,7 @@ public class ExtendedDismaxQParser exten
* Validate there is no cyclic referencing in the aliasing
*/
private void validateCyclicAliasing(String field) throws SyntaxError {
- Set<String> set = new HashSet<String>();
+ Set<String> set = new HashSet<>();
set.add(field);
if(validateField(field, set)) {
throw new SyntaxError("Field aliases lead to a cycle");
@@ -1155,7 +1155,7 @@ public class ExtendedDismaxQParser exten
protected List<Query> getQueries(Alias a) throws SyntaxError {
if (a == null) return null;
if (a.fields.size()==0) return null;
- List<Query> lst= new ArrayList<Query>(4);
+ List<Query> lst= new ArrayList<>(4);
for (String f : a.fields.keySet()) {
this.field = f;
@@ -1289,8 +1289,8 @@ public class ExtendedDismaxQParser exten
}
// Process dynamic patterns in userFields
- ArrayList<DynamicField> dynUserFields = new ArrayList<DynamicField>();
- ArrayList<DynamicField> negDynUserFields = new ArrayList<DynamicField>();
+ ArrayList<DynamicField> dynUserFields = new ArrayList<>();
+ ArrayList<DynamicField> negDynUserFields = new ArrayList<>();
for(String f : userFieldsMap.keySet()) {
if(f.contains("*")) {
if(f.startsWith("-"))
@@ -1459,7 +1459,7 @@ public class ExtendedDismaxQParser exten
List<FieldParams> phraseFields2 = U.parseFieldBoostsAndSlop(solrParams.getParams(DMP.PF2),2,pslop[2]);
List<FieldParams> phraseFields3 = U.parseFieldBoostsAndSlop(solrParams.getParams(DMP.PF3),3,pslop[3]);
- allPhraseFields = new ArrayList<FieldParams>(phraseFields.size() + phraseFields2.size() + phraseFields3.size());
+ allPhraseFields = new ArrayList<>(phraseFields.size() + phraseFields2.size() + phraseFields3.size());
allPhraseFields.addAll(phraseFields);
allPhraseFields.addAll(phraseFields2);
allPhraseFields.addAll(phraseFields3);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FastLRUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FastLRUCache.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FastLRUCache.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FastLRUCache.java Wed Mar 12 18:14:05 2014
@@ -85,7 +85,7 @@ public class FastLRUCache<K,V> extends S
str = (String) args.get("showItems");
showItems = str == null ? 0 : Integer.parseInt(str);
description = generateDescription(limit, initialSize, minLimit, acceptableLimit, newThread);
- cache = new ConcurrentLRUCache<K,V>(limit, minLimit, acceptableLimit, initialSize, newThread, false, null);
+ cache = new ConcurrentLRUCache<>(limit, minLimit, acceptableLimit, initialSize, newThread, false, null);
cache.setAlive(false);
statsList = (List<ConcurrentLRUCache.Stats>) persistence;
@@ -93,7 +93,7 @@ public class FastLRUCache<K,V> extends S
// must be the first time a cache of this type is being created
// Use a CopyOnWriteArrayList since puts are very rare and iteration may be a frequent operation
// because it is used in getStatistics()
- statsList = new CopyOnWriteArrayList<ConcurrentLRUCache.Stats>();
+ statsList = new CopyOnWriteArrayList<>();
// the first entry will be for cumulative stats of caches that have been closed.
statsList.add(new ConcurrentLRUCache.Stats());
@@ -197,7 +197,7 @@ public class FastLRUCache<K,V> extends S
@Override
public NamedList getStatistics() {
- NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
+ NamedList<Serializable> lst = new SimpleOrderedMap<>();
if (cache == null) return lst;
ConcurrentLRUCache.Stats stats = cache.getStats();
long lookups = stats.getCumulativeLookups();
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FunctionQParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FunctionQParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FunctionQParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/FunctionQParser.java Wed Mar 12 18:14:05 2014
@@ -84,7 +84,7 @@ public class FunctionQParser extends QPa
consumeArgumentDelimiter();
if (lst == null) {
- lst = new ArrayList<ValueSource>(2);
+ lst = new ArrayList<>(2);
lst.add(valsource);
}
}
@@ -208,7 +208,7 @@ public class FunctionQParser extends QPa
* @return List<ValueSource>
*/
public List<ValueSource> parseValueSourceList() throws SyntaxError {
- List<ValueSource> sources = new ArrayList<ValueSource>(3);
+ List<ValueSource> sources = new ArrayList<>(3);
while (hasMoreArguments()) {
sources.add(parseValueSource(true));
}
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/Grouping.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/Grouping.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/Grouping.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/Grouping.java Wed Mar 12 18:14:05 2014
@@ -83,7 +83,7 @@ public class Grouping {
private final SolrIndexSearcher searcher;
private final SolrIndexSearcher.QueryResult qr;
private final SolrIndexSearcher.QueryCommand cmd;
- private final List<Command> commands = new ArrayList<Command>();
+ private final List<Command> commands = new ArrayList<>();
private final boolean main;
private final boolean cacheSecondPassSearch;
private final int maxDocsPercentageToCache;
@@ -105,7 +105,7 @@ public class Grouping {
private DocSet filter;
private Filter luceneFilter;
private NamedList grouped = new SimpleOrderedMap();
- private Set<Integer> idSet = new LinkedHashSet<Integer>(); // used for tracking unique docs when we need a doclist
+ private Set<Integer> idSet = new LinkedHashSet<>(); // used for tracking unique docs when we need a doclist
private int maxMatches; // max number of matches from any grouping command
private float maxScore = Float.NEGATIVE_INFINITY; // max score seen in any doclist
private boolean signalCacheWarning = false;
@@ -331,7 +331,7 @@ public class Grouping {
}
AbstractAllGroupHeadsCollector<?> allGroupHeadsCollector = null;
- List<Collector> collectors = new ArrayList<Collector>(commands.size());
+ List<Collector> collectors = new ArrayList<>(commands.size());
for (Command cmd : commands) {
Collector collector = cmd.createFirstPassCollector();
if (collector != null) {
@@ -649,8 +649,8 @@ public class Grouping {
protected DocList createSimpleResponse() {
GroupDocs[] groups = result != null ? result.groups : new GroupDocs[0];
- List<Integer> ids = new ArrayList<Integer>();
- List<Float> scores = new ArrayList<Float>();
+ List<Integer> ids = new ArrayList<>();
+ List<Float> scores = new ArrayList<>();
int docsToGather = getMax(offset, numGroups, maxDoc);
int docsGathered = 0;
float maxScore = Float.NEGATIVE_INFINITY;
@@ -888,7 +888,7 @@ public class Grouping {
protected void finish() throws IOException {
TopDocsCollector topDocsCollector = (TopDocsCollector) collector.getDelegate();
TopDocs topDocs = topDocsCollector.topDocs();
- GroupDocs<String> groupDocs = new GroupDocs<String>(Float.NaN, topDocs.getMaxScore(), topDocs.totalHits, topDocs.scoreDocs, query.toString(), null);
+ GroupDocs<String> groupDocs = new GroupDocs<>(Float.NaN, topDocs.getMaxScore(), topDocs.totalHits, topDocs.scoreDocs, query.toString(), null);
if (main) {
mainResult = getDocList(groupDocs);
} else {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/JoinQParserPlugin.java Wed Mar 12 18:14:05 2014
@@ -240,7 +240,7 @@ class JoinQuery extends Query {
long end = debug ? System.currentTimeMillis() : 0;
if (debug) {
- SimpleOrderedMap<Object> dbg = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> dbg = new SimpleOrderedMap<>();
dbg.add("time", (end-start));
dbg.add("fromSetSize", fromSetSize); // the input
dbg.add("toSetSize", resultSet.size()); // the output
@@ -295,7 +295,7 @@ class JoinQuery extends Query {
DocSet fromSet = fromSearcher.getDocSet(q);
fromSetSize = fromSet.size();
- List<DocSet> resultList = new ArrayList<DocSet>(10);
+ List<DocSet> resultList = new ArrayList<>(10);
// make sure we have a set that is fast for random access, if we will use it for that
DocSet fastForRandomSet = fromSet;
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/LFUCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/LFUCache.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/LFUCache.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/LFUCache.java Wed Mar 12 18:14:05 2014
@@ -109,7 +109,7 @@ public class LFUCache<K, V> implements S
}
description += ')';
- cache = new ConcurrentLFUCache<K, V>(limit, minLimit, acceptableSize, initialSize, newThread, false, null, timeDecay);
+ cache = new ConcurrentLFUCache<>(limit, minLimit, acceptableSize, initialSize, newThread, false, null, timeDecay);
cache.setAlive(false);
statsList = (List<ConcurrentLFUCache.Stats>) persistence;
@@ -117,7 +117,7 @@ public class LFUCache<K, V> implements S
// must be the first time a cache of this type is being created
// Use a CopyOnWriteArrayList since puts are very rare and iteration may be a frequent operation
// because it is used in getStatistics()
- statsList = new CopyOnWriteArrayList<ConcurrentLFUCache.Stats>();
+ statsList = new CopyOnWriteArrayList<>();
// the first entry will be for cumulative stats of caches that have been closed.
statsList.add(new ConcurrentLFUCache.Stats());
@@ -242,7 +242,7 @@ public class LFUCache<K, V> implements S
@Override
public NamedList getStatistics() {
- NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
+ NamedList<Serializable> lst = new SimpleOrderedMap<>();
if (cache == null) return lst;
ConcurrentLFUCache.Stats stats = cache.getStats();
long lookups = stats.getCumulativeLookups();
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/MaxScoreQParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/MaxScoreQParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/MaxScoreQParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/MaxScoreQParser.java Wed Mar 12 18:14:05 2014
@@ -58,8 +58,8 @@ public class MaxScoreQParser extends Luc
return q;
}
BooleanQuery obq = (BooleanQuery)q;
- Collection<Query> should = new ArrayList<Query>();
- Collection<BooleanClause> prohibOrReq = new ArrayList<BooleanClause>();
+ Collection<Query> should = new ArrayList<>();
+ Collection<BooleanClause> prohibOrReq = new ArrayList<>();
BooleanQuery newq = new BooleanQuery();
for (BooleanClause clause : obq.getClauses()) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QParser.java Wed Mar 12 18:14:05 2014
@@ -66,7 +66,7 @@ public abstract class QParser {
@SuppressWarnings("unchecked")
Map<Object,Collection<Object>> tagMap = (Map<Object, Collection<Object>>)req.getContext().get("tags");
if (tagMap == null) {
- tagMap = new HashMap<Object,Collection<Object>>();
+ tagMap = new HashMap<>();
context.put("tags", tagMap);
}
if (tagStr.indexOf(',') >= 0) {
@@ -88,7 +88,7 @@ public abstract class QParser {
private static void addTag(Map<Object,Collection<Object>> tagMap, Object key, Object val) {
Collection<Object> lst = tagMap.get(key);
if (lst == null) {
- lst = new ArrayList<Object>(2);
+ lst = new ArrayList<>(2);
tagMap.put(key, lst);
}
lst.add(val);
@@ -283,7 +283,7 @@ public abstract class QParser {
int localParamsEnd = -1;
if (qstr != null && qstr.startsWith(QueryParsing.LOCALPARAM_START)) {
- Map<String, String> localMap = new HashMap<String, String>();
+ Map<String, String> localMap = new HashMap<>();
localParamsEnd = QueryParsing.parseLocalParams(qstr, 0, localMap, globalParams);
String val = localMap.get(QueryParsing.V);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryParsing.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryParsing.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryParsing.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryParsing.java Wed Mar 12 18:14:05 2014
@@ -207,7 +207,7 @@ public class QueryParsing {
if (txt == null || !txt.startsWith(LOCALPARAM_START)) {
return null;
}
- Map<String, String> localParams = new HashMap<String, String>();
+ Map<String, String> localParams = new HashMap<>();
int start = QueryParsing.parseLocalParams(txt, 0, localParams, params);
String val = localParams.get(V);
@@ -255,8 +255,8 @@ public class QueryParsing {
public static SortSpec parseSortSpec(String sortSpec, SolrQueryRequest req) {
if (sortSpec == null || sortSpec.length() == 0) return newEmptySortSpec();
- List<SortField> sorts = new ArrayList<SortField>(4);
- List<SchemaField> fields = new ArrayList<SchemaField>(4);
+ List<SortField> sorts = new ArrayList<>(4);
+ List<SchemaField> fields = new ArrayList<>(4);
try {
@@ -920,7 +920,7 @@ public class QueryParsing {
* Builds a list of String which are stringified versions of a list of Queries
*/
public static List<String> toString(List<Query> queries, IndexSchema schema) {
- List<String> out = new ArrayList<String>(queries.size());
+ List<String> out = new ArrayList<>(queries.size());
for (Query q : queries) {
out.add(QueryParsing.toString(q, schema));
}
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryResultKey.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryResultKey.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryResultKey.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/QueryResultKey.java Wed Mar 12 18:14:05 2014
@@ -144,7 +144,7 @@ public final class QueryResultKey {
// (And of course: if the SolrIndexSearcher / QueryCommmand was ever changed to
// sort the filter query list, then this whole method could be eliminated).
- final ArrayList<Query> set2 = new ArrayList<Query>(fqList2.subList(start, sz));
+ final ArrayList<Query> set2 = new ArrayList<>(fqList2.subList(start, sz));
for (int i = start; i < sz; i++) {
Query q1 = fqList1.get(i);
if ( ! set2.remove(q1) ) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SimpleQParserPlugin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SimpleQParserPlugin.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SimpleQParserPlugin.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SimpleQParserPlugin.java Wed Mar 12 18:14:05 2014
@@ -72,7 +72,7 @@ public class SimpleQParserPlugin extends
public static final String NAME = "simple";
/** Map of string operators to their int counterparts in SimpleQueryParser. */
- private static final Map<String, Integer> OPERATORS = new HashMap<String, Integer>();
+ private static final Map<String, Integer> OPERATORS = new HashMap<>();
/* Setup the map of possible operators. */
static {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java Wed Mar 12 18:14:05 2014
@@ -152,7 +152,7 @@ public class SolrIndexSearcher extends I
// map of generic caches - not synchronized since it's read-only after the constructor.
private final HashMap<String, SolrCache> cacheMap;
- private static final HashMap<String, SolrCache> noGenericCaches=new HashMap<String,SolrCache>(0);
+ private static final HashMap<String, SolrCache> noGenericCaches=new HashMap<>(0);
// list of all caches associated with this searcher.
private final SolrCache[] cacheList;
@@ -224,7 +224,7 @@ public class SolrIndexSearcher extends I
cachingEnabled=enableCache;
if (cachingEnabled) {
- ArrayList<SolrCache> clist = new ArrayList<SolrCache>();
+ ArrayList<SolrCache> clist = new ArrayList<>();
fieldValueCache = solrConfig.fieldValueCacheConfig==null ? null : solrConfig.fieldValueCacheConfig.newInstance();
if (fieldValueCache!=null) clist.add(fieldValueCache);
filterCache= solrConfig.filterCacheConfig==null ? null : solrConfig.filterCacheConfig.newInstance();
@@ -237,7 +237,7 @@ public class SolrIndexSearcher extends I
if (solrConfig.userCacheConfigs == null) {
cacheMap = noGenericCaches;
} else {
- cacheMap = new HashMap<String,SolrCache>(solrConfig.userCacheConfigs.length);
+ cacheMap = new HashMap<>(solrConfig.userCacheConfigs.length);
for (CacheConfig userCacheConfig : solrConfig.userCacheConfigs) {
SolrCache cache = null;
if (userCacheConfig != null) cache = userCacheConfig.newInstance();
@@ -262,7 +262,7 @@ public class SolrIndexSearcher extends I
// optimizer = solrConfig.filtOptEnabled ? new LuceneQueryOptimizer(solrConfig.filtOptCacheSize,solrConfig.filtOptThreshold) : null;
optimizer = null;
- fieldNames = new HashSet<String>();
+ fieldNames = new HashSet<>();
fieldInfos = atomicReader.getFieldInfos();
for(FieldInfo fieldInfo : fieldInfos) {
fieldNames.add(fieldInfo.name);
@@ -387,7 +387,7 @@ public class SolrIndexSearcher extends I
public Collection<String> getStoredHighlightFieldNames() {
synchronized (this) {
if (storedHighlightFieldNames == null) {
- storedHighlightFieldNames = new LinkedList<String>();
+ storedHighlightFieldNames = new LinkedList<>();
for (String fieldName : fieldNames) {
try {
SchemaField field = schema.getField(fieldName);
@@ -979,10 +979,10 @@ public class SolrIndexSearcher extends I
ExtendedQuery eq = (ExtendedQuery)q;
if (!eq.getCache()) {
if (eq.getCost() >= 100 && eq instanceof PostFilter) {
- if (postFilters == null) postFilters = new ArrayList<Query>(sets.length-end);
+ if (postFilters == null) postFilters = new ArrayList<>(sets.length-end);
postFilters.add(q);
} else {
- if (notCached == null) notCached = new ArrayList<Query>(sets.length-end);
+ if (notCached == null) notCached = new ArrayList<>(sets.length-end);
notCached.add(q);
}
continue;
@@ -991,7 +991,7 @@ public class SolrIndexSearcher extends I
if (filterCache == null) {
// there is no cache: don't pull bitsets
- if (notCached == null) notCached = new ArrayList<Query>(sets.length-end);
+ if (notCached == null) notCached = new ArrayList<>(sets.length-end);
WrappedQuery uncached = new WrappedQuery(q);
uncached.setCache(false);
notCached.add(uncached);
@@ -1035,7 +1035,7 @@ public class SolrIndexSearcher extends I
if (notCached != null) {
Collections.sort(notCached, sortByCost);
- List<Weight> weights = new ArrayList<Weight>(notCached.size());
+ List<Weight> weights = new ArrayList<>(notCached.size());
for (Query q : notCached) {
Query qq = QueryUtils.makeQueryable(q);
weights.add(createNormalizedWeight(qq));
@@ -1322,7 +1322,7 @@ public class SolrIndexSearcher extends I
if (cmd.getFilterList()==null) {
out.docSet = getDocSet(cmd.getQuery());
} else {
- List<Query> newList = new ArrayList<Query>(cmd.getFilterList().size()+1);
+ List<Query> newList = new ArrayList<>(cmd.getFilterList().size()+1);
newList.add(cmd.getQuery());
newList.addAll(cmd.getFilterList());
out.docSet = getDocSet(newList);
@@ -2240,7 +2240,7 @@ public class SolrIndexSearcher extends I
@Override
public NamedList<Object> getStatistics() {
- NamedList<Object> lst = new SimpleOrderedMap<Object>();
+ NamedList<Object> lst = new SimpleOrderedMap<>();
lst.add("searcherName", name);
lst.add("caching", cachingEnabled);
lst.add("numDocs", reader.numDocs());
@@ -2318,7 +2318,7 @@ public class SolrIndexSearcher extends I
}
filterList = null;
if (f != null) {
- filterList = new ArrayList<Query>(2);
+ filterList = new ArrayList<>(2);
filterList.add(f);
}
return this;
@@ -2464,7 +2464,7 @@ class FilterImpl extends Filter {
@Override
public DocIdSetIterator iterator() throws IOException {
- List<DocIdSetIterator> iterators = new ArrayList<DocIdSetIterator>(weights.size()+1);
+ List<DocIdSetIterator> iterators = new ArrayList<>(weights.size()+1);
if (docIdSet != null) {
DocIdSetIterator iter = docIdSet.iterator();
if (iter == null) return null;
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/SolrReturnFields.java Wed Mar 12 18:14:05 2014
@@ -49,14 +49,14 @@ public class SolrReturnFields extends Re
// Special Field Keys
public static final String SCORE = "score";
- private final List<String> globs = new ArrayList<String>(1);
+ private final List<String> globs = new ArrayList<>(1);
// The lucene field names to request from the SolrIndexSearcher
- private final Set<String> fields = new HashSet<String>();
+ private final Set<String> fields = new HashSet<>();
// Field names that are OK to include in the response.
// This will include pseudo fields, lucene fields, and matching globs
- private Set<String> okFieldNames = new HashSet<String>();
+ private Set<String> okFieldNames = new HashSet<>();
// The list of explicitly requested fields
// Order is important for CSVResponseWriter
@@ -106,7 +106,7 @@ public class SolrReturnFields extends Re
return;
}
- NamedList<String> rename = new NamedList<String>();
+ NamedList<String> rename = new NamedList<>();
DocTransformers augmenters = new DocTransformers();
for (String fieldList : fl) {
add(fieldList,rename,augmenters,req);
@@ -122,7 +122,7 @@ public class SolrReturnFields extends Re
if(from.equals(rename.getName(j))) {
rename.setName(j, to); // copy from the current target
if(reqFieldNames==null) {
- reqFieldNames = new LinkedHashSet<String>();
+ reqFieldNames = new LinkedHashSet<>();
}
reqFieldNames.add(to); // don't rename our current target
}
@@ -247,7 +247,7 @@ public class SolrReturnFields extends Re
// This is identical to localParams syntax except it uses [] instead of {!}
if (funcStr.startsWith("[")) {
- Map<String,String> augmenterArgs = new HashMap<String,String>();
+ Map<String,String> augmenterArgs = new HashMap<>();
int end = QueryParsing.parseLocalParams(funcStr, 0, augmenterArgs, req.getParams(), "[", ']');
sp.pos += end;
@@ -356,7 +356,7 @@ public class SolrReturnFields extends Re
private void addField(String field, String key, DocTransformers augmenters, boolean isPseudoField)
{
if(reqFieldNames==null) {
- reqFieldNames = new LinkedHashSet<String>();
+ reqFieldNames = new LinkedHashSet<>();
}
if(key==null) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/ValueSourceParser.java Wed Mar 12 18:14:05 2014
@@ -65,7 +65,7 @@ public abstract class ValueSourceParser
public abstract ValueSource parse(FunctionQParser fp) throws SyntaxError;
/* standard functions */
- public static Map<String, ValueSourceParser> standardValueSourceParsers = new HashMap<String, ValueSourceParser>();
+ public static Map<String, ValueSourceParser> standardValueSourceParsers = new HashMap<>();
/** Adds a new parser for the name and returns any existing one that was overriden.
* This is not thread safe.
@@ -849,8 +849,8 @@ public abstract class ValueSourceParser
}
} else {
int dim = sources.size() / 2;
- List<ValueSource> sources1 = new ArrayList<ValueSource>(dim);
- List<ValueSource> sources2 = new ArrayList<ValueSource>(dim);
+ List<ValueSource> sources1 = new ArrayList<>(dim);
+ List<ValueSource> sources2 = new ArrayList<>(dim);
//Get dim value sources for the first vector
splitSources(dim, sources, sources1, sources2);
mvr.mv1 = new VectorValueSource(sources1);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/function/FileFloatSource.java Wed Mar 12 18:14:05 2014
@@ -261,7 +261,7 @@ public class FileFloatSource extends Val
// because of this, simply ask the reader for a new termEnum rather than
// trying to use skipTo()
- List<String> notFound = new ArrayList<String>();
+ List<String> notFound = new ArrayList<>();
int notFoundCount=0;
int otherErrors=0;
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/CommandHandler.java Wed Mar 12 18:14:05 2014
@@ -53,7 +53,7 @@ public class CommandHandler {
public static class Builder {
private SolrIndexSearcher.QueryCommand queryCommand;
- private List<Command> commands = new ArrayList<Command>();
+ private List<Command> commands = new ArrayList<>();
private SolrIndexSearcher searcher;
private boolean needDocSet = false;
private boolean truncateGroups = false;
@@ -137,7 +137,7 @@ public class CommandHandler {
@SuppressWarnings("unchecked")
public void execute() throws IOException {
final int nrOfCommands = commands.size();
- List<Collector> collectors = new ArrayList<Collector>(nrOfCommands);
+ List<Collector> collectors = new ArrayList<>(nrOfCommands);
for (Command command : commands) {
collectors.addAll(command.create());
}
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/SearchGroupsFieldCommand.java Wed Mar 12 18:14:05 2014
@@ -88,7 +88,7 @@ public class SearchGroupsFieldCommand im
@Override
public List<Collector> create() throws IOException {
- List<Collector> collectors = new ArrayList<Collector>();
+ List<Collector> collectors = new ArrayList<>();
if (topNGroups > 0) {
firstPassGroupingCollector = new TermFirstPassGroupingCollector(field.getName(), groupSort, topNGroups);
collectors.add(firstPassGroupingCollector);
@@ -114,7 +114,7 @@ public class SearchGroupsFieldCommand im
} else {
groupCount = null;
}
- return new Pair<Integer, Collection<SearchGroup<BytesRef>>>(groupCount, topGroups);
+ return new Pair<>(groupCount, topGroups);
}
@Override
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/command/TopGroupsFieldCommand.java Wed Mar 12 18:14:05 2014
@@ -125,7 +125,7 @@ public class TopGroupsFieldCommand imple
return Collections.emptyList();
}
- List<Collector> collectors = new ArrayList<Collector>();
+ List<Collector> collectors = new ArrayList<>();
secondPassCollector = new TermSecondPassGroupingCollector(
field.getName(), firstPhaseGroups, groupSort, sortWithinGroup, maxDocPerGroup, needScores, needMaxScore, true
);
@@ -137,7 +137,7 @@ public class TopGroupsFieldCommand imple
@SuppressWarnings("unchecked")
public TopGroups<BytesRef> result() {
if (firstPhaseGroups.isEmpty()) {
- return new TopGroups<BytesRef>(groupSort.getSort(), sortWithinGroup.getSort(), 0, 0, new GroupDocs[0], Float.NaN);
+ return new TopGroups<>(groupSort.getSort(), sortWithinGroup.getSort(), 0, 0, new GroupDocs[0], Float.NaN);
}
return secondPassCollector.getTopGroups(0);
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/StoredFieldsShardRequestFactory.java Wed Mar 12 18:14:05 2014
@@ -42,7 +42,7 @@ public class StoredFieldsShardRequestFac
@Override
public ShardRequest[] constructRequest(ResponseBuilder rb) {
- HashMap<String, Set<ShardDoc>> shardMap = new HashMap<String,Set<ShardDoc>>();
+ HashMap<String, Set<ShardDoc>> shardMap = new HashMap<>();
for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {
for (GroupDocs<BytesRef> group : topGroups.groups) {
mapShardToDocs(shardMap, group.scoreDocs);
@@ -75,7 +75,7 @@ public class StoredFieldsShardRequestFac
}
}
- List<String> ids = new ArrayList<String>(shardDocs.size());
+ List<String> ids = new ArrayList<>(shardDocs.size());
for (ShardDoc shardDoc : shardDocs) {
ids.add(shardDoc.id.toString());
}
@@ -91,7 +91,7 @@ public class StoredFieldsShardRequestFac
ShardDoc solrDoc = (ShardDoc) scoreDoc;
Set<ShardDoc> shardDocs = shardMap.get(solrDoc.shard);
if (shardDocs == null) {
- shardMap.put(solrDoc.shard, shardDocs = new HashSet<ShardDoc>());
+ shardMap.put(solrDoc.shard, shardDocs = new HashSet<>());
}
shardDocs.add(solrDoc);
}
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/requestfactory/TopGroupsShardRequestFactory.java Wed Mar 12 18:14:05 2014
@@ -67,7 +67,7 @@ public class TopGroupsShardRequestFactor
private ShardRequest[] createRequestForSpecificShards(ResponseBuilder rb) {
// Determine all unique shards to query for TopGroups
- Set<String> uniqueShards = new HashSet<String>();
+ Set<String> uniqueShards = new HashSet<>();
for (String command : rb.searchGroupToShards.keySet()) {
Map<SearchGroup<BytesRef>, Set<String>> groupsToShard = rb.searchGroupToShards.get(command);
for (Set<String> shards : groupsToShard.values()) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/SearchGroupShardResponseProcessor.java Wed Mar 12 18:14:05 2014
@@ -52,8 +52,8 @@ public class SearchGroupShardResponsePro
Sort groupSort = rb.getGroupingSpec().getGroupSort();
String[] fields = rb.getGroupingSpec().getFields();
- Map<String, List<Collection<SearchGroup<BytesRef>>>> commandSearchGroups = new HashMap<String, List<Collection<SearchGroup<BytesRef>>>>();
- Map<String, Map<SearchGroup<BytesRef>, Set<String>>> tempSearchGroupToShards = new HashMap<String, Map<SearchGroup<BytesRef>, Set<String>>>();
+ Map<String, List<Collection<SearchGroup<BytesRef>>>> commandSearchGroups = new HashMap<>();
+ Map<String, Map<SearchGroup<BytesRef>, Set<String>>> tempSearchGroupToShards = new HashMap<>();
for (String field : fields) {
commandSearchGroups.put(field, new ArrayList<Collection<SearchGroup<BytesRef>>>(shardRequest.responses.size()));
tempSearchGroupToShards.put(field, new HashMap<SearchGroup<BytesRef>, Set<String>>());
@@ -69,13 +69,13 @@ public class SearchGroupShardResponsePro
NamedList<Object> shardInfo = null;
if (rb.req.getParams().getBool(ShardParams.SHARDS_INFO, false)) {
- shardInfo = new SimpleOrderedMap<Object>();
+ shardInfo = new SimpleOrderedMap<>();
rb.rsp.getValues().add(ShardParams.SHARDS_INFO + ".firstPhase", shardInfo);
}
for (ShardResponse srsp : shardRequest.responses) {
if (shardInfo != null) {
- SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();
+ SimpleOrderedMap<Object> nl = new SimpleOrderedMap<>();
if (srsp.getException() != null) {
Throwable t = srsp.getException();
@@ -126,7 +126,7 @@ public class SearchGroupShardResponsePro
Map<SearchGroup<BytesRef>, java.util.Set<String>> map = tempSearchGroupToShards.get(field);
Set<String> shards = map.get(searchGroup);
if (shards == null) {
- shards = new HashSet<String>();
+ shards = new HashSet<>();
map.put(searchGroup, shards);
}
shards.add(srsp.getShard());
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/responseprocessor/TopGroupsShardResponseProcessor.java Wed Mar 12 18:14:05 2014
@@ -70,12 +70,12 @@ public class TopGroupsShardResponseProce
}
int docsPerGroupDefault = rb.getGroupingSpec().getGroupLimit();
- Map<String, List<TopGroups<BytesRef>>> commandTopGroups = new HashMap<String, List<TopGroups<BytesRef>>>();
+ Map<String, List<TopGroups<BytesRef>>> commandTopGroups = new HashMap<>();
for (String field : fields) {
commandTopGroups.put(field, new ArrayList<TopGroups<BytesRef>>());
}
- Map<String, List<QueryCommandResult>> commandTopDocs = new HashMap<String, List<QueryCommandResult>>();
+ Map<String, List<QueryCommandResult>> commandTopDocs = new HashMap<>();
for (String query : queries) {
commandTopDocs.put(query, new ArrayList<QueryCommandResult>());
}
@@ -84,14 +84,14 @@ public class TopGroupsShardResponseProce
NamedList<Object> shardInfo = null;
if (rb.req.getParams().getBool(ShardParams.SHARDS_INFO, false)) {
- shardInfo = new SimpleOrderedMap<Object>();
+ shardInfo = new SimpleOrderedMap<>();
rb.rsp.getValues().add(ShardParams.SHARDS_INFO, shardInfo);
}
for (ShardResponse srsp : shardRequest.responses) {
SimpleOrderedMap<Object> individualShardInfo = null;
if (shardInfo != null) {
- individualShardInfo = new SimpleOrderedMap<Object>();
+ individualShardInfo = new SimpleOrderedMap<>();
if (srsp.getException() != null) {
Throwable t = srsp.getException();
@@ -161,7 +161,7 @@ public class TopGroupsShardResponseProce
for (String query : commandTopDocs.keySet()) {
List<QueryCommandResult> queryCommandResults = commandTopDocs.get(query);
- List<TopDocs> topDocs = new ArrayList<TopDocs>(queryCommandResults.size());
+ List<TopDocs> topDocs = new ArrayList<>(queryCommandResults.size());
int mergedMatches = 0;
for (QueryCommandResult queryCommandResult : queryCommandResults) {
topDocs.add(queryCommandResult.getTopDocs());
@@ -173,7 +173,7 @@ public class TopGroupsShardResponseProce
rb.mergedQueryCommandResults.put(query, new QueryCommandResult(mergedTopDocs, mergedMatches));
}
- Map<Object, ShardDoc> resultIds = new HashMap<Object, ShardDoc>();
+ Map<Object, ShardDoc> resultIds = new HashMap<>();
int i = 0;
for (TopGroups<BytesRef> topGroups : rb.mergedTopGroups.values()) {
for (GroupDocs<BytesRef> group : topGroups.groups) {
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/SearchGroupsResultTransformer.java Wed Mar 12 18:14:05 2014
@@ -53,9 +53,9 @@ public class SearchGroupsResultTransform
*/
@Override
public NamedList transform(List<Command> data) throws IOException {
- NamedList<NamedList> result = new NamedList<NamedList>();
+ NamedList<NamedList> result = new NamedList<>();
for (Command command : data) {
- final NamedList<Object> commandResult = new NamedList<Object>();
+ final NamedList<Object> commandResult = new NamedList<>();
if (SearchGroupsFieldCommand.class.isInstance(command)) {
SearchGroupsFieldCommand fieldCommand = (SearchGroupsFieldCommand) command;
Pair<Integer, Collection<SearchGroup<BytesRef>>> pair = fieldCommand.result();
@@ -81,15 +81,15 @@ public class SearchGroupsResultTransform
*/
@Override
public Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) {
- Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> result = new HashMap<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>>();
+ Map<String, Pair<Integer, Collection<SearchGroup<BytesRef>>>> result = new HashMap<>();
for (Map.Entry<String, NamedList> command : shardResponse) {
- List<SearchGroup<BytesRef>> searchGroups = new ArrayList<SearchGroup<BytesRef>>();
+ List<SearchGroup<BytesRef>> searchGroups = new ArrayList<>();
NamedList topGroupsAndGroupCount = command.getValue();
@SuppressWarnings("unchecked")
NamedList<List<Comparable>> rawSearchGroups = (NamedList<List<Comparable>>) topGroupsAndGroupCount.get("topGroups");
if (rawSearchGroups != null) {
for (Map.Entry<String, List<Comparable>> rawSearchGroup : rawSearchGroups){
- SearchGroup<BytesRef> searchGroup = new SearchGroup<BytesRef>();
+ SearchGroup<BytesRef> searchGroup = new SearchGroup<>();
searchGroup.groupValue = rawSearchGroup.getKey() != null ? new BytesRef(rawSearchGroup.getKey()) : null;
searchGroup.sortValues = rawSearchGroup.getValue().toArray(new Comparable[rawSearchGroup.getValue().size()]);
for (int i = 0; i < searchGroup.sortValues.length; i++) {
@@ -112,7 +112,7 @@ public class SearchGroupsResultTransform
}
private NamedList serializeSearchGroup(Collection<SearchGroup<BytesRef>> data, Sort groupSort) {
- NamedList<Object[]> result = new NamedList<Object[]>();
+ NamedList<Object[]> result = new NamedList<>();
for (SearchGroup<BytesRef> searchGroup : data) {
Object[] convertedSortValues = new Object[searchGroup.sortValues.length];
Modified: lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java?rev=1576837&r1=1576836&r2=1576837&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java (original)
+++ lucene/dev/branches/branch_4x/solr/core/src/java/org/apache/solr/search/grouping/distributed/shardresultserializer/TopGroupsResultTransformer.java Wed Mar 12 18:14:05 2014
@@ -66,7 +66,7 @@ public class TopGroupsResultTransformer
*/
@Override
public NamedList transform(List<Command> data) throws IOException {
- NamedList<NamedList> result = new NamedList<NamedList>();
+ NamedList<NamedList> result = new NamedList<>();
final IndexSchema schema = rb.req.getSearcher().getSchema();
for (Command command : data) {
NamedList commandResult;
@@ -91,7 +91,7 @@ public class TopGroupsResultTransformer
*/
@Override
public Map<String, ?> transformToNative(NamedList<NamedList> shardResponse, Sort groupSort, Sort sortWithinGroup, String shard) {
- Map<String, Object> result = new HashMap<String, Object>();
+ Map<String, Object> result = new HashMap<>();
final IndexSchema schema = rb.req.getSearcher().getSchema();
@@ -147,7 +147,7 @@ public class TopGroupsResultTransformer
Integer totalHitCount = (Integer) commandResult.get("totalHitCount");
- List<GroupDocs<BytesRef>> groupDocs = new ArrayList<GroupDocs<BytesRef>>();
+ List<GroupDocs<BytesRef>> groupDocs = new ArrayList<>();
for (int i = 2; i < commandResult.size(); i++) {
String groupValue = commandResult.getName(i);
@SuppressWarnings("unchecked")
@@ -182,12 +182,12 @@ public class TopGroupsResultTransformer
}
BytesRef groupValueRef = groupValue != null ? new BytesRef(groupValue) : null;
- groupDocs.add(new GroupDocs<BytesRef>(Float.NaN, maxScore, totalGroupHits, scoreDocs, groupValueRef, null));
+ groupDocs.add(new GroupDocs<>(Float.NaN, maxScore, totalGroupHits, scoreDocs, groupValueRef, null));
}
@SuppressWarnings("unchecked")
GroupDocs<BytesRef>[] groupDocsArr = groupDocs.toArray(new GroupDocs[groupDocs.size()]);
- TopGroups<BytesRef> topGroups = new TopGroups<BytesRef>(
+ TopGroups<BytesRef> topGroups = new TopGroups<>(
groupSort.getSort(), sortWithinGroup.getSort(), totalHitCount, totalGroupedHitCount, groupDocsArr, Float.NaN
);
@@ -198,7 +198,7 @@ public class TopGroupsResultTransformer
}
protected NamedList serializeTopGroups(TopGroups<BytesRef> data, SchemaField groupField) throws IOException {
- NamedList<Object> result = new NamedList<Object>();
+ NamedList<Object> result = new NamedList<>();
result.add("totalGroupedHitCount", data.totalGroupedHitCount);
result.add("totalHitCount", data.totalHitCount);
if (data.totalGroupCount != null) {
@@ -209,15 +209,15 @@ public class TopGroupsResultTransformer
final IndexSchema schema = rb.req.getSearcher().getSchema();
SchemaField uniqueField = schema.getUniqueKeyField();
for (GroupDocs<BytesRef> searchGroup : data.groups) {
- NamedList<Object> groupResult = new NamedList<Object>();
+ NamedList<Object> groupResult = new NamedList<>();
groupResult.add("totalHits", searchGroup.totalHits);
if (!Float.isNaN(searchGroup.maxScore)) {
groupResult.add("maxScore", searchGroup.maxScore);
}
- List<NamedList<Object>> documents = new ArrayList<NamedList<Object>>();
+ List<NamedList<Object>> documents = new ArrayList<>();
for (int i = 0; i < searchGroup.scoreDocs.length; i++) {
- NamedList<Object> document = new NamedList<Object>();
+ NamedList<Object> document = new NamedList<>();
documents.add(document);
Document doc = retrieveDocument(uniqueField, searchGroup.scoreDocs[i].doc);
@@ -254,20 +254,20 @@ public class TopGroupsResultTransformer
}
protected NamedList serializeTopDocs(QueryCommandResult result) throws IOException {
- NamedList<Object> queryResult = new NamedList<Object>();
+ NamedList<Object> queryResult = new NamedList<>();
queryResult.add("matches", result.getMatches());
queryResult.add("totalHits", result.getTopDocs().totalHits);
if (rb.getGroupingSpec().isNeedScore()) {
queryResult.add("maxScore", result.getTopDocs().getMaxScore());
}
- List<NamedList> documents = new ArrayList<NamedList>();
+ List<NamedList> documents = new ArrayList<>();
queryResult.add("documents", documents);
final IndexSchema schema = rb.req.getSearcher().getSchema();
SchemaField uniqueField = schema.getUniqueKeyField();
CharsRef spare = new CharsRef();
for (ScoreDoc scoreDoc : result.getTopDocs().scoreDocs) {
- NamedList<Object> document = new NamedList<Object>();
+ NamedList<Object> document = new NamedList<>();
documents.add(document);
Document doc = retrieveDocument(uniqueField, scoreDoc.doc);