lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r1578144 [27/37] - in /lucene/dev/branches/lucene5376_2: ./ dev-tools/ dev-tools/idea/.idea/libraries/ dev-tools/idea/solr/contrib/dataimporthandler/ dev-tools/idea/solr/contrib/map-reduce/ dev-tools/idea/solr/core/src/test/ dev-tools/scrip...
Date Sun, 16 Mar 2014 19:39:37 GMT
Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java Sun Mar 16 19:39:10 2014
@@ -17,16 +17,21 @@
 
 package org.apache.solr.handler.component;
 
+import java.io.PrintWriter;
+import java.io.StringWriter;
 import java.util.ArrayList;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.solr.client.solrj.SolrServerException;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.SolrException.ErrorCode;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ModifiableSolrParams;
 import org.apache.solr.common.params.ShardParams;
 import org.apache.solr.common.util.ContentStream;
+import org.apache.solr.common.util.NamedList;
+import org.apache.solr.common.util.SimpleOrderedMap;
 import org.apache.solr.core.CloseHook;
 import org.apache.solr.core.PluginInfo;
 import org.apache.solr.core.SolrCore;
@@ -64,7 +69,7 @@ public class SearchHandler extends Reque
 
   protected List<String> getDefaultComponents()
   {
-    ArrayList<String> names = new ArrayList<String>(6);
+    ArrayList<String> names = new ArrayList<>(6);
     names.add( QueryComponent.COMPONENT_NAME );
     names.add( FacetComponent.COMPONENT_NAME );
     names.add( MoreLikeThisComponent.COMPONENT_NAME );
@@ -72,6 +77,7 @@ public class SearchHandler extends Reque
     names.add( StatsComponent.COMPONENT_NAME );
     names.add( DebugComponent.COMPONENT_NAME );
     names.add( AnalyticsComponent.COMPONENT_NAME );
+    names.add( ExpandComponent.COMPONENT_NAME);
     return names;
   }
 
@@ -125,7 +131,7 @@ public class SearchHandler extends Reque
     }
 
     // Build the component list
-    components = new ArrayList<SearchComponent>( list.size() );
+    components = new ArrayList<>( list.size() );
     DebugComponent dbgCmp = null;
     for(String c : list){
       SearchComponent comp = core.getSearchComponent( c );
@@ -230,15 +236,14 @@ public class SearchHandler extends Reque
         if (rb.isDebugTimings()) {
           rb.addDebugInfo("timing", timer.asNamedList() );
         }
-      }
-
+      }      
     } else {
       // a distributed request
 
       if (rb.outgoing == null) {
-        rb.outgoing = new LinkedList<ShardRequest>();
+        rb.outgoing = new LinkedList<>();
       }
-      rb.finished = new ArrayList<ShardRequest>();
+      rb.finished = new ArrayList<>();
 
       int nextStage = 0;
       do {
@@ -262,7 +267,7 @@ public class SearchHandler extends Reque
             if (sreq.actualShards==ShardRequest.ALL_SHARDS) {
               sreq.actualShards = rb.shards;
             }
-            sreq.responses = new ArrayList<ShardResponse>();
+            sreq.responses = new ArrayList<>();
 
             // TODO: map from shard to address[]
             for (String shard : sreq.actualShards) {
@@ -331,6 +336,37 @@ public class SearchHandler extends Reque
         // we are done when the next stage is MAX_VALUE
       } while (nextStage != Integer.MAX_VALUE);
     }
+    
+    // SOLR-5550: still provide shards.info if requested even for a short circuited distrib request
+    if(!rb.isDistrib && req.getParams().getBool(ShardParams.SHARDS_INFO, false) && rb.shortCircuitedURL != null) {  
+      NamedList<Object> shardInfo = new SimpleOrderedMap<Object>();
+      SimpleOrderedMap<Object> nl = new SimpleOrderedMap<Object>();        
+      if (rsp.getException() != null) {
+        Throwable cause = rsp.getException();
+        if (cause instanceof SolrServerException) {
+          cause = ((SolrServerException)cause).getRootCause();
+        } else {
+          if (cause.getCause() != null) {
+            cause = cause.getCause();
+          }          
+        }
+        nl.add("error", cause.toString() );
+        StringWriter trace = new StringWriter();
+        cause.printStackTrace(new PrintWriter(trace));
+        nl.add("trace", trace.toString() );
+      }
+      else {
+        nl.add("numFound", rb.getResults().docList.matches());
+        nl.add("maxScore", rb.getResults().docList.maxScore());
+      }
+      nl.add("shardAddress", rb.shortCircuitedURL);
+      nl.add("time", rsp.getEndTime()-req.getStartTime()); // elapsed time of this request so far
+      
+      int pos = rb.shortCircuitedURL.indexOf("://");        
+      String shardInfoName = pos != -1 ? rb.shortCircuitedURL.substring(pos+3) : rb.shortCircuitedURL;
+      shardInfo.add(shardInfoName, nl);   
+      rsp.getValues().add(ShardParams.SHARDS_INFO,shardInfo);            
+    }
   }
 
   //////////////////////// SolrInfoMBeans methods //////////////////////

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardDoc.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardDoc.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardDoc.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardDoc.java Sun Mar 16 19:39:10 2014
@@ -110,7 +110,7 @@ class ShardFieldSortedHitQueue extends P
   protected SortField[] fields;
 
   /** The order of these fieldNames should correspond to the order of sort field values retrieved from the shard */
-  protected List<String> fieldNames = new ArrayList<String>();
+  protected List<String> fieldNames = new ArrayList<>();
 
   public ShardFieldSortedHitQueue(SortField[] fields, int size, IndexSearcher searcher) {
     super(size);

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardRequest.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardRequest.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/ShardRequest.java Sun Mar 16 19:39:10 2014
@@ -48,7 +48,7 @@ public class ShardRequest {
 
 
   /** list of responses... filled out by framework */
-  public List<ShardResponse> responses = new ArrayList<ShardResponse>();
+  public List<ShardResponse> responses = new ArrayList<>();
 
   /** actual shards to send the request to, filled out by framework */
   public String[] actualShards;

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckComponent.java Sun Mar 16 19:39:10 2014
@@ -100,7 +100,7 @@ public class SpellCheckComponent extends
   /**
    * Key is the dictionary, value is the SpellChecker for that dictionary name
    */
-  protected Map<String, SolrSpellChecker> spellCheckers = new ConcurrentHashMap<String, SolrSpellChecker>();
+  protected Map<String, SolrSpellChecker> spellCheckers = new ConcurrentHashMap<>();
 
   protected QueryConverter queryConverter;
 
@@ -380,7 +380,7 @@ public class SpellCheckComponent extends
       mergeData.origVsSuggestion.put(suggestion.getToken(), suggestion);
       HashSet<String> suggested = mergeData.origVsSuggested.get(suggestion.getToken());
       if (suggested == null) {
-        suggested = new HashSet<String>();
+        suggested = new HashSet<>();
         mergeData.origVsSuggested.put(suggestion.getToken(), suggested);
       }
 
@@ -470,7 +470,7 @@ public class SpellCheckComponent extends
   }
 
   private Collection<Token> getTokens(String q, Analyzer analyzer) throws IOException {
-    Collection<Token> result = new ArrayList<Token>();
+    Collection<Token> result = new ArrayList<>();
     assert analyzer != null;
     try (TokenStream ts = analyzer.tokenStream("", q)) {
       ts.reset();
@@ -555,7 +555,7 @@ public class SpellCheckComponent extends
       Token inputToken = entry.getKey();
       String tokenString = new String(inputToken.buffer(), 0, inputToken
           .length());
-      Map<String,Integer> theSuggestions = new LinkedHashMap<String,Integer>(
+      Map<String,Integer> theSuggestions = new LinkedHashMap<>(
           entry.getValue());
       Iterator<String> sugIter = theSuggestions.keySet().iterator();
       while (sugIter.hasNext()) {
@@ -585,7 +585,7 @@ public class SpellCheckComponent extends
           suggestionList.add("origFreq", spellingResult
               .getTokenFrequency(inputToken));
           
-          ArrayList<SimpleOrderedMap> sugs = new ArrayList<SimpleOrderedMap>();
+          ArrayList<SimpleOrderedMap> sugs = new ArrayList<>();
           suggestionList.add("suggestion", sugs);
           for (Map.Entry<String,Integer> suggEntry : theSuggestions.entrySet()) {
             SimpleOrderedMap sugEntry = new SimpleOrderedMap();
@@ -660,7 +660,7 @@ public class SpellCheckComponent extends
         }
      }
 
-      Map<String, QueryConverter> queryConverters = new HashMap<String, QueryConverter>();
+      Map<String, QueryConverter> queryConverters = new HashMap<>();
       core.initPlugins(queryConverters,QueryConverter.class);
 
       //ensure that there is at least one query converter defined

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckMergeData.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckMergeData.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckMergeData.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SpellCheckMergeData.java Sun Mar 16 19:39:10 2014
@@ -28,16 +28,16 @@ import org.apache.solr.spelling.SpellChe
 
 public class SpellCheckMergeData {
   //original token -> corresponding Suggestion object (keep track of start,end)
-  public Map<String, SpellCheckResponse.Suggestion> origVsSuggestion = new HashMap<String, SpellCheckResponse.Suggestion>();
+  public Map<String, SpellCheckResponse.Suggestion> origVsSuggestion = new HashMap<>();
   // original token string -> summed up frequency
-  public Map<String, Integer> origVsFreq = new HashMap<String, Integer>();
+  public Map<String, Integer> origVsFreq = new HashMap<>();
   // original token string -> # of shards reporting it as misspelled
-  public Map<String, Integer> origVsShards = new HashMap<String, Integer>();
+  public Map<String, Integer> origVsShards = new HashMap<>();
   // original token string -> set of alternatives
   // must preserve order because collation algorithm can only work in-order
-  public Map<String, HashSet<String>> origVsSuggested = new LinkedHashMap<String, HashSet<String>>();
+  public Map<String, HashSet<String>> origVsSuggested = new LinkedHashMap<>();
   // alternative string -> corresponding SuggestWord object
-  public Map<String, SuggestWord> suggestedVsWord = new HashMap<String, SuggestWord>();
-  public Map<String, SpellCheckCollation> collations = new HashMap<String, SpellCheckCollation>();
+  public Map<String, SuggestWord> suggestedVsWord = new HashMap<>();
+  public Map<String, SpellCheckCollation> collations = new HashMap<>();
   public int totalNumberShardResponses = 0;
 }

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsComponent.java Sun Mar 16 19:39:10 2014
@@ -19,18 +19,24 @@ package org.apache.solr.handler.componen
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import org.apache.lucene.search.*;
 import org.apache.lucene.index.AtomicReaderContext;
 import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrException.ErrorCode;
+import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.ShardParams;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.params.StatsParams;
 import org.apache.solr.common.util.NamedList;
 import org.apache.solr.common.util.SimpleOrderedMap;
+import org.apache.solr.common.util.StrUtils;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.request.UnInvertedField;
 import org.apache.solr.schema.FieldType;
@@ -38,7 +44,10 @@ import org.apache.solr.schema.IndexSchem
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.search.DocIterator;
 import org.apache.solr.search.DocSet;
+import org.apache.solr.search.QParser;
+import org.apache.solr.search.QueryParsing;
 import org.apache.solr.search.SolrIndexSearcher;
+import org.apache.solr.search.SyntaxError;
 
 /**
  * Stats component calculates simple statistics on numeric field values
@@ -62,7 +71,8 @@ public class StatsComponent extends Sear
       SolrParams params = rb.req.getParams();
       SimpleStats s = new SimpleStats(rb.req,
               rb.getResults().docSet,
-              params );
+              params,
+              rb );
 
       // TODO ???? add this directly to the response, or to the builder?
       rb.rsp.add( "stats", s.getStatsCounts() );
@@ -133,8 +143,8 @@ public class StatsComponent extends Sear
 
     StatsInfo si = rb._statsInfo;
 
-    NamedList<NamedList<Object>> stats = new SimpleOrderedMap<NamedList<Object>>();
-    NamedList<Object> stats_fields = new SimpleOrderedMap<Object>();
+    NamedList<NamedList<Object>> stats = new SimpleOrderedMap<>();
+    NamedList<Object> stats_fields = new SimpleOrderedMap<>();
     stats.add("stats_fields", stats_fields);
     for (String field : si.statsFields.keySet()) {
       NamedList stv = si.statsFields.get(field).getStatsValues();
@@ -171,7 +181,7 @@ class StatsInfo {
   Map<String, StatsValues> statsFields;
 
   void parse(SolrParams params, ResponseBuilder rb) {
-    statsFields = new HashMap<String, StatsValues>();
+    statsFields = new HashMap<>();
 
     String[] statsFs = params.getParams(StatsParams.STATS_FIELD);
     if (statsFs != null) {
@@ -194,49 +204,127 @@ class SimpleStats {
   /** Searcher to use for all calculations */
   protected SolrIndexSearcher searcher;
   protected SolrQueryRequest req;
+  protected ResponseBuilder rb;
+
+  // per-stats values
+  SolrParams localParams;
+  String statsField;
+  DocSet base;
+  String key;
 
   public SimpleStats(SolrQueryRequest req,
                       DocSet docs,
-                      SolrParams params) {
+                      SolrParams params,
+                      ResponseBuilder rb) {
     this.req = req;
     this.searcher = req.getSearcher();
     this.docs = docs;
     this.params = params;
+    this.rb = rb;
+  }
+
+  protected void parseParams(String param) throws SyntaxError, IOException {
+    localParams = QueryParsing.getLocalParams(param, req.getParams());
+    base = docs;
+    statsField = param;
+    key = param;
+
+    if (localParams == null) return;
+
+    statsField = localParams.get(CommonParams.VALUE);
+
+    // reset set the default key now that localParams have been removed
+    key = statsField;
+
+    // allow explicit set of the key
+    key = localParams.get(CommonParams.OUTPUT_KEY, key);
+
+
+    // figure out if we need a new base DocSet
+    String excludeStr = localParams.get(CommonParams.EXCLUDE);
+    if (excludeStr == null) return;
+
+    Map<?,?> tagMap = (Map<?,?>)req.getContext().get("tags");
+    if (tagMap != null && rb != null) {
+      List<String> excludeTagList = StrUtils.splitSmart(excludeStr,',');
+
+      IdentityHashMap<Query,Boolean> excludeSet = new IdentityHashMap<Query,Boolean>();
+      for (String excludeTag : excludeTagList) {
+        Object olst = tagMap.get(excludeTag);
+        // tagMap has entries of List<String,List<QParser>>, but subject to change in the future
+        if (!(olst instanceof Collection)) continue;
+        for (Object o : (Collection<?>)olst) {
+          if (!(o instanceof QParser)) continue;
+          QParser qp = (QParser)o;
+          excludeSet.put(qp.getQuery(), Boolean.TRUE);
+        }
+      }
+      if (excludeSet.size() == 0) return;
+
+      List<Query> qlist = new ArrayList<Query>();
+
+      // add the base query
+      if (!excludeSet.containsKey(rb.getQuery())) {
+        qlist.add(rb.getQuery());
+      }
+
+      // add the filters
+      if (rb.getFilters() != null) {
+        for (Query q : rb.getFilters()) {
+          if (!excludeSet.containsKey(q)) {
+            qlist.add(q);
+          }
+        }
+      }
+
+      // get the new base docset for this facet
+      this.base = searcher.getDocSet(qlist);
+    }
+
   }
 
   public NamedList<Object> getStatsCounts() throws IOException {
-    NamedList<Object> res = new SimpleOrderedMap<Object>();
-    res.add("stats_fields", getStatsFields());
+    NamedList<Object> res = new SimpleOrderedMap<>();
+
+    try {
+      res.add("stats_fields", getStatsFields());
+    } catch (SyntaxError e) {
+      throw new SolrException(ErrorCode.BAD_REQUEST, e);
+    }
+
     return res;
   }
 
-  public NamedList<Object> getStatsFields() throws IOException {
-    NamedList<Object> res = new SimpleOrderedMap<Object>();
+  public NamedList<Object> getStatsFields() throws IOException, SyntaxError {
+    NamedList<Object> res = new SimpleOrderedMap<>();
     String[] statsFs = params.getParams(StatsParams.STATS_FIELD);
     boolean isShard = params.getBool(ShardParams.IS_SHARD, false);
     if (null != statsFs) {
       final IndexSchema schema = searcher.getSchema();
       for (String f : statsFs) {
         boolean calcDistinct = params.getFieldBool(f, StatsParams.STATS_CALC_DISTINCT, false);
-        String[] facets = params.getFieldParams(f, StatsParams.STATS_FACET);
+
+        parseParams(f);
+
+        String[] facets = params.getFieldParams(key, StatsParams.STATS_FACET);
         if (facets == null) {
           facets = new String[0]; // make sure it is something...
         }
-        SchemaField sf = schema.getField(f);
+        SchemaField sf = schema.getField(statsField);
         FieldType ft = sf.getType();
         NamedList<?> stv;
 
         if (sf.multiValued() || ft.multiValuedFieldCache()) {
           //use UnInvertedField for multivalued fields
-          UnInvertedField uif = UnInvertedField.getUnInvertedField(f, searcher);
+          UnInvertedField uif = UnInvertedField.getUnInvertedField(statsField, searcher);
           stv = uif.getStats(searcher, docs, calcDistinct, facets).getStatsValues();
         } else {
-          stv = getFieldCacheStats(f, calcDistinct, facets);
+          stv = getFieldCacheStats(statsField, calcDistinct, facets);
         }
         if (isShard == true || (Long) stv.get("count") > 0) {
-          res.add(f, stv);
+          res.add(key, stv);
         } else {
-          res.add(f, null);
+          res.add(key, null);
         }
       }
     }
@@ -249,7 +337,7 @@ class SimpleStats {
 
     final StatsValues allstats = StatsValuesFactory.createStatsValues(sf, calcDistinct);
 
-    List<FieldFacetStats> facetStats = new ArrayList<FieldFacetStats>();
+    List<FieldFacetStats> facetStats = new ArrayList<>();
     for( String facetField : facet ) {
       SchemaField fsf = schema.getField(facetField);
 
@@ -263,7 +351,7 @@ class SimpleStats {
 
     final Iterator<AtomicReaderContext> ctxIt = searcher.getIndexReader().leaves().iterator();
     AtomicReaderContext ctx = null;
-    for (DocIterator docsIt = docs.iterator(); docsIt.hasNext(); ) {
+    for (DocIterator docsIt = base.iterator(); docsIt.hasNext(); ) {
       final int doc = docsIt.nextDoc();
       if (ctx == null || doc >= ctx.docBase + ctx.reader().maxDoc()) {
         // advance

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java Sun Mar 16 19:39:10 2014
@@ -88,12 +88,12 @@ abstract class AbstractStatsValues<T> im
   protected boolean calcDistinct = false;
   
   // facetField   facetValue
-  protected Map<String, Map<String, StatsValues>> facets = new HashMap<String, Map<String, StatsValues>>();
+  protected Map<String, Map<String, StatsValues>> facets = new HashMap<>();
 
   protected AbstractStatsValues(SchemaField sf, boolean calcDistinct) {
     this.sf = sf;
     this.ft = sf.getType();
-    this.distinctValues = new TreeSet<T>();
+    this.distinctValues = new TreeSet<>();
     this.calcDistinct = calcDistinct;
   }
 
@@ -122,7 +122,7 @@ abstract class AbstractStatsValues<T> im
       NamedList vals = (NamedList) f.getVal(i);
       Map<String, StatsValues> addTo = facets.get(field);
       if (addTo == null) {
-        addTo = new HashMap<String, StatsValues>();
+        addTo = new HashMap<>();
         facets.put(field, addTo);
       }
       for (int j = 0; j < vals.size(); j++) {
@@ -185,7 +185,7 @@ abstract class AbstractStatsValues<T> im
    */
   @Override
   public NamedList<?> getStatsValues() {
-    NamedList<Object> res = new SimpleOrderedMap<Object>();
+    NamedList<Object> res = new SimpleOrderedMap<>();
 
     res.add("min", min);
     res.add("max", max);
@@ -199,9 +199,9 @@ abstract class AbstractStatsValues<T> im
     addTypeSpecificStats(res);
 
      // add the facet stats
-    NamedList<NamedList<?>> nl = new SimpleOrderedMap<NamedList<?>>();
+    NamedList<NamedList<?>> nl = new SimpleOrderedMap<>();
     for (Map.Entry<String, Map<String, StatsValues>> entry : facets.entrySet()) {
-      NamedList<NamedList<?>> nl2 = new SimpleOrderedMap<NamedList<?>>();
+      NamedList<NamedList<?>> nl2 = new SimpleOrderedMap<>();
       nl.add(entry.getKey(), nl2);
       for (Map.Entry<String, StatsValues> e2 : entry.getValue().entrySet()) {
         nl2.add(e2.getKey(), e2.getValue().getStatsValues());

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SuggestComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SuggestComponent.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SuggestComponent.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/SuggestComponent.java Sun Mar 16 19:39:10 2014
@@ -80,7 +80,7 @@ public class SuggestComponent extends Se
   /**
    * Key is the dictionary name used in SolrConfig, value is the corresponding {@link SolrSuggester}
    */
-  protected Map<String, SolrSuggester> suggesters = new ConcurrentHashMap<String, SolrSuggester>();
+  protected Map<String, SolrSuggester> suggesters = new ConcurrentHashMap<>();
   
   /** Container for various labels used in the responses generated by this component */
   private static class SuggesterResultLabels {
@@ -211,7 +211,7 @@ public class SuggestComponent extends Se
       if (!buildAll && !reloadAll) {
         throw ex;
       } else {
-        querySuggesters = new HashSet<SolrSuggester>();
+        querySuggesters = new HashSet<>();
       }
     }
     
@@ -227,7 +227,7 @@ public class SuggestComponent extends Se
       int count = params.getInt(SUGGEST_COUNT, 1);
       SuggesterOptions options = new SuggesterOptions(new CharsRef(query), count);
       Map<String, SimpleOrderedMap<NamedList<Object>>> namedListResults = 
-          new HashMap<String, SimpleOrderedMap<NamedList<Object>>>();
+          new HashMap<>();
       for (SolrSuggester suggester : querySuggesters) {
         SuggesterResult suggesterResult = suggester.getSuggestions(options);
         toNamedList(suggesterResult, namedListResults);
@@ -247,7 +247,7 @@ public class SuggestComponent extends Se
       return;
     int count = params.getInt(SUGGEST_COUNT, 1);
     
-    List<SuggesterResult> suggesterResults = new ArrayList<SuggesterResult>();
+    List<SuggesterResult> suggesterResults = new ArrayList<>();
     
     // Collect Shard responses
     for (ShardRequest sreq : rb.finished) {
@@ -266,7 +266,7 @@ public class SuggestComponent extends Se
     // Merge Shard responses
     SuggesterResult suggesterResult = merge(suggesterResults, count);
     Map<String, SimpleOrderedMap<NamedList<Object>>> namedListResults = 
-        new HashMap<String, SimpleOrderedMap<NamedList<Object>>>();
+        new HashMap<>();
     toNamedList(suggesterResult, namedListResults);
     
     rb.rsp.add(SuggesterResultLabels.SUGGEST, namedListResults);
@@ -280,8 +280,8 @@ public class SuggestComponent extends Se
    * */
   private static SuggesterResult merge(List<SuggesterResult> suggesterResults, int count) {
     SuggesterResult result = new SuggesterResult();
-    Set<String> allTokens = new HashSet<String>();
-    Set<String> suggesterNames = new HashSet<String>();
+    Set<String> allTokens = new HashSet<>();
+    Set<String> suggesterNames = new HashSet<>();
     
     // collect all tokens
     for (SuggesterResult shardResult : suggesterResults) {
@@ -305,7 +305,7 @@ public class SuggestComponent extends Se
             resultQueue.insertWithOverflow(res);
           }
         }
-        List<LookupResult> sortedSuggests = new LinkedList<LookupResult>();
+        List<LookupResult> sortedSuggests = new LinkedList<>();
         Collections.addAll(sortedSuggests, resultQueue.getResults());
         result.add(suggesterName, token, sortedSuggests);
       }
@@ -325,7 +325,7 @@ public class SuggestComponent extends Se
   
   @Override
   public NamedList getStatistics() {
-    NamedList<String> stats = new SimpleOrderedMap<String>();
+    NamedList<String> stats = new SimpleOrderedMap<>();
     stats.add("totalSizeInBytes", String.valueOf(sizeInBytes()));
     for (Map.Entry<String, SolrSuggester> entry : suggesters.entrySet()) {
       SolrSuggester suggester = entry.getValue();
@@ -344,7 +344,7 @@ public class SuggestComponent extends Se
   }
   
   private Set<SolrSuggester> getSuggesters(SolrParams params) {
-    Set<SolrSuggester> solrSuggesters = new HashSet<SolrSuggester>();
+    Set<SolrSuggester> solrSuggesters = new HashSet<>();
     for(String suggesterName : getSuggesterNames(params)) {
       SolrSuggester curSuggester = suggesters.get(suggesterName);
       if (curSuggester != null) {
@@ -361,7 +361,7 @@ public class SuggestComponent extends Se
   }
   
   private Set<String> getSuggesterNames(SolrParams params) {
-    Set<String> suggesterNames = new HashSet<String>();
+    Set<String> suggesterNames = new HashSet<>();
     String[] suggesterNamesFromParams = params.getParams(SUGGEST_DICT);
     if (suggesterNamesFromParams == null) {
       suggesterNames.add(DEFAULT_DICT_NAME);
@@ -376,12 +376,12 @@ public class SuggestComponent extends Se
   /** Convert {@link SuggesterResult} to NamedList for constructing responses */
   private void toNamedList(SuggesterResult suggesterResult, Map<String, SimpleOrderedMap<NamedList<Object>>> resultObj) {
     for(String suggesterName : suggesterResult.getSuggesterNames()) {
-      SimpleOrderedMap<NamedList<Object>> results = new SimpleOrderedMap<NamedList<Object>>();
+      SimpleOrderedMap<NamedList<Object>> results = new SimpleOrderedMap<>();
       for (String token : suggesterResult.getTokens(suggesterName)) {
-        SimpleOrderedMap<Object> suggestionBody = new SimpleOrderedMap<Object>();
+        SimpleOrderedMap<Object> suggestionBody = new SimpleOrderedMap<>();
         List<LookupResult> lookupResults = suggesterResult.getLookupResult(suggesterName, token);
         suggestionBody.add(SuggesterResultLabels.SUGGESTION_NUM_FOUND, lookupResults.size());
-        List<SimpleOrderedMap<Object>> suggestEntriesNamedList = new ArrayList<SimpleOrderedMap<Object>>();
+        List<SimpleOrderedMap<Object>> suggestEntriesNamedList = new ArrayList<>();
         for (LookupResult lookupResult : lookupResults) {
           String suggestionString = lookupResult.key.toString();
           long weight = lookupResult.value;
@@ -389,7 +389,7 @@ public class SuggestComponent extends Se
               lookupResult.payload.utf8ToString()
               : "";
           
-          SimpleOrderedMap<Object> suggestEntryNamedList = new SimpleOrderedMap<Object>();
+          SimpleOrderedMap<Object> suggestEntryNamedList = new SimpleOrderedMap<>();
           suggestEntryNamedList.add(SuggesterResultLabels.SUGGESTION_TERM, suggestionString);
           suggestEntryNamedList.add(SuggesterResultLabels.SUGGESTION_WEIGHT, weight);
           suggestEntryNamedList.add(SuggesterResultLabels.SUGGESTION_PAYLOAD, payload);
@@ -415,7 +415,7 @@ public class SuggestComponent extends Se
       for (Iterator<Map.Entry<String, NamedList<Object>>> suggestionsIter = entry.getValue().iterator(); suggestionsIter.hasNext();) {
         Map.Entry<String, NamedList<Object>> suggestions = suggestionsIter.next(); 
         String tokenString = suggestions.getKey();
-        List<LookupResult> lookupResults = new ArrayList<LookupResult>();
+        List<LookupResult> lookupResults = new ArrayList<>();
         NamedList<Object> suggestion = suggestions.getValue();
         // for each suggestion
         for (int j = 0; j < suggestion.size(); j++) {

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermVectorComponent.java Sun Mar 16 19:39:10 2014
@@ -127,7 +127,7 @@ public class TermVectorComponent extends
     }
 
     // otherwise us the raw fldList as is, no special parsing or globs
-    Set<String> fieldNames = new LinkedHashSet<String>();
+    Set<String> fieldNames = new LinkedHashSet<>();
     for (String fl : fldLst) {
       fieldNames.addAll(Arrays.asList(SolrPluginUtils.split(fl)));
     }
@@ -141,7 +141,7 @@ public class TermVectorComponent extends
       return;
     }
 
-    NamedList<Object> termVectors = new NamedList<Object>();
+    NamedList<Object> termVectors = new NamedList<>();
     rb.rsp.add(TERM_VECTORS, termVectors);
 
     IndexSchema schema = rb.req.getSchema();
@@ -170,11 +170,11 @@ public class TermVectorComponent extends
     }
 
     //Build up our per field mapping
-    Map<String, FieldOptions> fieldOptions = new HashMap<String, FieldOptions>();
-    NamedList<List<String>> warnings = new NamedList<List<String>>();
-    List<String>  noTV = new ArrayList<String>();
-    List<String>  noPos = new ArrayList<String>();
-    List<String>  noOff = new ArrayList<String>();
+    Map<String, FieldOptions> fieldOptions = new HashMap<>();
+    NamedList<List<String>> warnings = new NamedList<>();
+    List<String>  noTV = new ArrayList<>();
+    List<String>  noPos = new ArrayList<>();
+    List<String>  noOff = new ArrayList<>();
 
     Set<String> fields = getFields(rb);
     if ( null != fields ) {
@@ -261,7 +261,7 @@ public class TermVectorComponent extends
 
     final String finalUniqFieldName = uniqFieldName;
 
-    final List<String> uniqValues = new ArrayList<String>();
+    final List<String> uniqValues = new ArrayList<>();
     
     // TODO: is this required to be single-valued? if so, we should STOP
     // once we find it...
@@ -291,7 +291,7 @@ public class TermVectorComponent extends
 
     while (iter.hasNext()) {
       Integer docId = iter.next();
-      NamedList<Object> docNL = new NamedList<Object>();
+      NamedList<Object> docNL = new NamedList<>();
 
       if (keyField != null) {
         reader.document(docId, getUniqValue);
@@ -331,14 +331,14 @@ public class TermVectorComponent extends
   }
 
   private void mapOneVector(NamedList<Object> docNL, FieldOptions fieldOptions, IndexReader reader, int docID, TermsEnum termsEnum, String field) throws IOException {
-    NamedList<Object> fieldNL = new NamedList<Object>();
+    NamedList<Object> fieldNL = new NamedList<>();
     docNL.add(field, fieldNL);
 
     BytesRef text;
     DocsAndPositionsEnum dpEnum = null;
     while((text = termsEnum.next()) != null) {
       String term = text.utf8ToString();
-      NamedList<Object> termInfo = new NamedList<Object>();
+      NamedList<Object> termInfo = new NamedList<>();
       fieldNL.add(term, termInfo);
       final int freq = (int) termsEnum.totalTermFreq();
       if (fieldOptions.termFreq == true) {
@@ -362,7 +362,7 @@ public class TermVectorComponent extends
           final int pos = dpEnum.nextPosition();
           if (usePositions && pos >= 0) {
             if (positionsNL == null) {
-              positionsNL = new NamedList<Integer>();
+              positionsNL = new NamedList<>();
               termInfo.add("positions", positionsNL);
             }
             positionsNL.add("position", pos);
@@ -372,7 +372,7 @@ public class TermVectorComponent extends
             if (dpEnum.startOffset() == -1) {
               useOffsets = false;
             } else {
-              theOffsets = new NamedList<Number>();
+              theOffsets = new NamedList<>();
               termInfo.add("offsets", theOffsets);
             }
           }
@@ -404,7 +404,7 @@ public class TermVectorComponent extends
   private List<Integer> getInts(String[] vals) {
     List<Integer> result = null;
     if (vals != null && vals.length > 0) {
-      result = new ArrayList<Integer>(vals.length);
+      result = new ArrayList<>(vals.length);
       for (int i = 0; i < vals.length; i++) {
         try {
           result.add(new Integer(vals[i]));
@@ -425,7 +425,7 @@ public class TermVectorComponent extends
   public void finishStage(ResponseBuilder rb) {
     if (rb.stage == ResponseBuilder.STAGE_GET_FIELDS) {
       
-      NamedList termVectors = new NamedList<Object>();
+      NamedList termVectors = new NamedList<>();
       Map.Entry<String, Object>[] arr = new NamedList.NamedListEntry[rb.resultIds.size()];
 
       for (ShardRequest sreq : rb.finished) {
@@ -444,13 +444,13 @@ public class TermVectorComponent extends
               }
             } else {
               int idx = sdoc.positionInResponse;
-              arr[idx] = new NamedList.NamedListEntry<Object>(key, nl.getVal(i));
+              arr[idx] = new NamedList.NamedListEntry<>(key, nl.getVal(i));
             }
           }
         }
       }
       // remove nulls in case not all docs were able to be retrieved
-      termVectors.addAll(SolrPluginUtils.removeNulls(new NamedList<Object>(arr)));
+      termVectors.addAll(SolrPluginUtils.removeNulls(new NamedList<>(arr)));
       rb.rsp.add(TERM_VECTORS, termVectors);
     }
   }

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/component/TermsComponent.java Sun Mar 16 19:39:10 2014
@@ -89,7 +89,7 @@ public class TermsComponent extends Sear
 
     String[] fields = params.getParams(TermsParams.TERMS_FIELD);
 
-    NamedList<Object> termsResult = new SimpleOrderedMap<Object>();
+    NamedList<Object> termsResult = new SimpleOrderedMap<>();
     rb.rsp.add("terms", termsResult);
 
     if (fields == null || fields.length==0) return;
@@ -121,7 +121,7 @@ public class TermsComponent extends Sear
     Fields lfields = indexReader.fields();
 
     for (String field : fields) {
-      NamedList<Integer> fieldTerms = new NamedList<Integer>();
+      NamedList<Integer> fieldTerms = new NamedList<>();
       termsResult.add(field, fieldTerms);
 
       Terms terms = lfields == null ? null : lfields.terms(field);
@@ -208,7 +208,7 @@ public class TermsComponent extends Sear
         if (docFreq >= freqmin && docFreq <= freqmax) {
           // add the term to the list
           if (sort) {
-            queue.add(new CountPair<BytesRef, Integer>(BytesRef.deepCopyOf(term), docFreq));
+            queue.add(new CountPair<>(BytesRef.deepCopyOf(term), docFreq));
           } else {
 
             // TODO: handle raw somehow
@@ -326,7 +326,7 @@ public class TermsComponent extends Sear
     private SolrParams params;
 
     public TermsHelper() {
-      fieldmap = new HashMap<String, HashMap<String, TermsResponse.Term>>(5);
+      fieldmap = new HashMap<>(5);
     }
 
     public void init(SolrParams params) {
@@ -374,7 +374,7 @@ public class TermsComponent extends Sear
     }
 
     public NamedList buildResponse() {
-      NamedList<Object> response = new SimpleOrderedMap<Object>();
+      NamedList<Object> response = new SimpleOrderedMap<>();
 
       // determine if we are going index or count sort
       boolean sort = !TermsParams.TERMS_SORT_INDEX.equals(params.get(
@@ -403,7 +403,7 @@ public class TermsComponent extends Sear
 
       // loop though each field we want terms from
       for (String key : fieldmap.keySet()) {
-        NamedList<Number> fieldterms = new SimpleOrderedMap<Number>();
+        NamedList<Number> fieldterms = new SimpleOrderedMap<>();
         TermsResponse.Term[] data = null;
         if (sort) {
           data = getCountSorted(fieldmap.get(key));

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/CSVLoaderBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/CSVLoaderBase.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/CSVLoaderBase.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/CSVLoaderBase.java Sun Mar 16 19:39:10 2014
@@ -164,7 +164,7 @@ abstract class CSVLoaderBase extends Con
   CSVLoaderBase(SolrQueryRequest req, UpdateRequestProcessor processor) {
     this.processor = processor;
     this.params = req.getParams();
-    this.literals = new HashMap<String, String>();
+    this.literals = new HashMap<>();
 
     templateAdd = new AddUpdateCommand(req);
     templateAdd.overwrite=params.getBool(OVERWRITE,true);

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/JsonLoader.java Sun Mar 16 19:39:10 2014
@@ -480,7 +480,7 @@ public class JsonLoader extends ContentS
             } else {
               // If we encounter other unknown map keys, then use a map
               if (extendedInfo == null) {
-                extendedInfo = new HashMap<String, Object>(2);
+                extendedInfo = new HashMap<>(2);
               }
               // for now, the only extended info will be field values
               // we could either store this as an Object or a SolrInputField

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/handler/loader/XMLLoader.java Sun Mar 16 19:39:10 2014
@@ -409,10 +409,10 @@ public class XMLLoader extends ContentSt
             // should I warn in some text has been found too
             Object v = isNull ? null : text.toString();
             if (update != null) {
-              if (updateMap == null) updateMap = new HashMap<String, Map<String, Object>>();
+              if (updateMap == null) updateMap = new HashMap<>();
               Map<String, Object> extendedValues = updateMap.get(name);
               if (extendedValues == null) {
-                extendedValues = new HashMap<String, Object>(1);
+                extendedValues = new HashMap<>(1);
                 updateMap.put(name, extendedValues);
               }
               Object val = extendedValues.get(update);
@@ -424,7 +424,7 @@ public class XMLLoader extends ContentSt
                   List list = (List) val;
                   list.add(v);
                 } else {
-                  List<Object> values = new ArrayList<Object>();
+                  List<Object> values = new ArrayList<>();
                   values.add(val);
                   values.add(v);
                   extendedValues.put(update, values);

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/DefaultSolrHighlighter.java Sun Mar 16 19:39:10 2014
@@ -70,27 +70,27 @@ public class DefaultSolrHighlighter exte
 
   // Thread safe registry
   protected final Map<String,SolrFormatter> formatters =
-    new HashMap<String, SolrFormatter>();
+    new HashMap<>();
 
   // Thread safe registry
   protected final Map<String,SolrEncoder> encoders =
-    new HashMap<String, SolrEncoder>();
+    new HashMap<>();
 
   // Thread safe registry
   protected final Map<String,SolrFragmenter> fragmenters =
-    new HashMap<String, SolrFragmenter>() ;
+    new HashMap<>() ;
 
   // Thread safe registry
   protected final Map<String, SolrFragListBuilder> fragListBuilders =
-    new HashMap<String, SolrFragListBuilder>() ;
+    new HashMap<>() ;
 
   // Thread safe registry
   protected final Map<String, SolrFragmentsBuilder> fragmentsBuilders =
-    new HashMap<String, SolrFragmentsBuilder>() ;
+    new HashMap<>() ;
 
   // Thread safe registry
   protected final Map<String, SolrBoundaryScanner> boundaryScanners =
-    new HashMap<String, SolrBoundaryScanner>() ;
+    new HashMap<>() ;
 
   @Override
   public void init(PluginInfo info) {
@@ -382,7 +382,7 @@ public class DefaultSolrHighlighter exte
     IndexSchema schema = searcher.getSchema();
     NamedList fragments = new SimpleOrderedMap();
     String[] fieldNames = getHighlightFields(query, req, defaultFields);
-    Set<String> fset = new HashSet<String>();
+    Set<String> fset = new HashSet<>();
      
     {
       // pre-fetch documents using the Searcher's doc cache
@@ -466,7 +466,7 @@ public class DefaultSolrHighlighter exte
     boolean mergeContiguousFragments = isMergeContiguousFragments(fieldName, params);
 
     String[] summaries = null;
-    List<TextFragment> frags = new ArrayList<TextFragment>();
+    List<TextFragment> frags = new ArrayList<>();
 
     TermOffsetsTokenStream tots = null; // to be non-null iff we're using TermOffsets optimization
     TokenStream tvStream = TokenSources.getTokenStreamWithOffsets(searcher.getIndexReader(), docId, fieldName);
@@ -555,7 +555,7 @@ public class DefaultSolrHighlighter exte
      // convert fragments back into text
      // TODO: we can include score and position information in output as snippet attributes
     if (frags.size() > 0) {
-      ArrayList<String> fragTexts = new ArrayList<String>();
+      ArrayList<String> fragTexts = new ArrayList<>();
       for (TextFragment fragment: frags) {
         if (preserveMulti) {
           if (fragment != null) {
@@ -606,7 +606,7 @@ public class DefaultSolrHighlighter exte
         // The alternate field did not exist, treat the original field as fallback instead
         docFields = doc.getFields(fieldName);
       }
-      List<String> listFields = new ArrayList<String>();
+      List<String> listFields = new ArrayList<>();
       for (StorableField field : docFields) {
         if (field.binaryValue() == null)
           listFields.add(field.stringValue());
@@ -617,7 +617,7 @@ public class DefaultSolrHighlighter exte
       if (altTexts != null && altTexts.length > 0){
         Encoder encoder = getEncoder(fieldName, params);
         int alternateFieldLen = params.getFieldInt(fieldName, HighlightParams.ALTERNATE_FIELD_LENGTH,0);
-        List<String> altList = new ArrayList<String>();
+        List<String> altList = new ArrayList<>();
         int len = 0;
         for( String altText: altTexts ){
           if( alternateFieldLen <= 0 ){
@@ -653,7 +653,7 @@ public class DefaultSolrHighlighter exte
  */
 final class TokenOrderingFilter extends TokenFilter {
   private final int windowSize;
-  private final LinkedList<OrderedToken> queue = new LinkedList<OrderedToken>();
+  private final LinkedList<OrderedToken> queue = new LinkedList<>();
   private boolean done=false;
   private final OffsetAttribute offsetAtt = addAttribute(OffsetAttribute.class);
   

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/HighlightingPluginBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/HighlightingPluginBase.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/HighlightingPluginBase.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/HighlightingPluginBase.java Sun Mar 16 19:39:10 2014
@@ -72,7 +72,7 @@ public abstract class HighlightingPlugin
 
   @Override
   public NamedList getStatistics() {
-    NamedList<Long> lst = new SimpleOrderedMap<Long>();
+    NamedList<Long> lst = new SimpleOrderedMap<>();
     lst.add("requests", numRequests);
     return lst;
   }

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/PostingsSolrHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/PostingsSolrHighlighter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/PostingsSolrHighlighter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/PostingsSolrHighlighter.java Sun Mar 16 19:39:10 2014
@@ -209,9 +209,9 @@ public class PostingsSolrHighlighter ext
    * @return encoded namedlist of summaries
    */
   protected NamedList<Object> encodeSnippets(String[] keys, String[] fieldNames, Map<String,String[]> snippets) {
-    NamedList<Object> list = new SimpleOrderedMap<Object>();
+    NamedList<Object> list = new SimpleOrderedMap<>();
     for (int i = 0; i < keys.length; i++) {
-      NamedList<Object> summary = new SimpleOrderedMap<Object>();
+      NamedList<Object> summary = new SimpleOrderedMap<>();
       for (String field : fieldNames) {
         String snippet = snippets.get(field)[i];
         // box in an array to match the format of existing highlighters, 

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/RegexFragmenter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/RegexFragmenter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/RegexFragmenter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/RegexFragmenter.java Sun Mar 16 19:39:10 2014
@@ -203,7 +203,7 @@ class LuceneRegexFragmenter implements F
 
   protected void addHotSpots(String text) {
     //System.out.println("hot spotting");
-    ArrayList<Integer> temphs = new ArrayList<Integer>(
+    ArrayList<Integer> temphs = new ArrayList<>(
                               text.length() / targetFragChars);
     Matcher match = textRE.matcher(text);
     int cur = 0;

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/highlight/SolrHighlighter.java Sun Mar 16 19:39:10 2014
@@ -77,7 +77,7 @@ public abstract class SolrHighlighter
         // create a Java regular expression from the wildcard string
         String fieldRegex = fields[0].replaceAll("\\*", ".*");
         Collection<String> storedHighlightFieldNames = request.getSearcher().getStoredHighlightFieldNames();
-        List<String> storedFieldsToHighlight = new ArrayList<String>();
+        List<String> storedFieldsToHighlight = new ArrayList<>();
         for (String storedFieldName: storedHighlightFieldNames) {
             if (storedFieldName.matches(fieldRegex)) {
               storedFieldsToHighlight.add(storedFieldName);

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/CircularList.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/CircularList.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/CircularList.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/CircularList.java Sun Mar 16 19:39:10 2014
@@ -108,7 +108,7 @@ public class CircularList<T> implements 
 
   public List<T> toList()
   {
-    ArrayList<T> list = new ArrayList<T>( size );
+    ArrayList<T> list = new ArrayList<>( size );
     for( int i=0; i<size; i++ ) {
       list.add( data[convert(i)] );
     }

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/LoggerInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/LoggerInfo.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/LoggerInfo.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/LoggerInfo.java Sun Mar 16 19:39:10 2014
@@ -43,7 +43,7 @@ public abstract class LoggerInfo impleme
   public abstract boolean isSet();
 
   public SimpleOrderedMap<?> getInfo() {
-    SimpleOrderedMap<Object> info = new SimpleOrderedMap<Object>();
+    SimpleOrderedMap<Object> info = new SimpleOrderedMap<>();
     info.add("name", getName());
     info.add("level", getLevel());
     info.add("set", isSet());

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/jul/JulWatcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/jul/JulWatcher.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/jul/JulWatcher.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/jul/JulWatcher.java Sun Mar 16 19:39:10 2014
@@ -88,7 +88,7 @@ public class JulWatcher extends LogWatch
     LogManager manager = LogManager.getLogManager();
 
     Logger root = manager.getLogger("");
-    Map<String,LoggerInfo> map = new HashMap<String,LoggerInfo>();
+    Map<String,LoggerInfo> map = new HashMap<>();
     Enumeration<String> names = manager.getLoggerNames();
     while (names.hasMoreElements()) {
       String name = names.nextElement();
@@ -133,7 +133,7 @@ public class JulWatcher extends LogWatch
     if(history!=null) {
       throw new IllegalStateException("History already registered");
     }
-    history = new CircularList<LogRecord>(cfg.size);
+    history = new CircularList<>(cfg.size);
     handler = new RecordHandler(this);
     if(cfg.threshold != null) {
       handler.setLevel(Level.parse(cfg.threshold));

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/logging/log4j/Log4jWatcher.java Sun Mar 16 19:39:10 2014
@@ -83,7 +83,7 @@ public class Log4jWatcher extends LogWat
   @Override
   public Collection<LoggerInfo> getAllLoggers() {
     org.apache.log4j.Logger root = org.apache.log4j.LogManager.getRootLogger();
-    Map<String,LoggerInfo> map = new HashMap<String,LoggerInfo>();
+    Map<String,LoggerInfo> map = new HashMap<>();
     Enumeration<?> loggers = org.apache.log4j.LogManager.getCurrentLoggers();
     while (loggers.hasMoreElements()) {
       org.apache.log4j.Logger logger = (org.apache.log4j.Logger)loggers.nextElement();
@@ -128,7 +128,7 @@ public class Log4jWatcher extends LogWat
     if(history!=null) {
       throw new IllegalStateException("History already registered");
     }
-    history = new CircularList<LoggingEvent>(cfg.size);
+    history = new CircularList<>(cfg.size);
 
     appender = new EventAppender(this);
     if(cfg.threshold != null) {

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/QueryParser.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/QueryParser.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/QueryParser.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/QueryParser.java Sun Mar 16 19:39:10 2014
@@ -100,7 +100,7 @@ public class QueryParser extends SolrQue
   }
 
   final public Query Query(String field) throws ParseException, SyntaxError {
-  List<BooleanClause> clauses = new ArrayList<BooleanClause>();
+  List<BooleanClause> clauses = new ArrayList<>();
   Query q, firstQuery=null;
   int conj, mods;
     mods = Modifiers();
@@ -581,7 +581,7 @@ public class QueryParser extends SolrQue
       return (jj_ntk = jj_nt.kind);
   }
 
-  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<int[]>();
+  private java.util.List<int[]> jj_expentries = new java.util.ArrayList<>();
   private int[] jj_expentry;
   private int jj_kind = -1;
   private int[] jj_lasttokens = new int[100];

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/parser/SolrQueryParserBase.java Sun Mar 16 19:39:10 2014
@@ -114,7 +114,7 @@ public abstract class SolrQueryParserBas
       return field;
     }
     private final static Map<String,MagicFieldName> lookup
-        = new HashMap<String,MagicFieldName>();
+        = new HashMap<>();
     static {
       for(MagicFieldName s : EnumSet.allOf(MagicFieldName.class))
         lookup.put(s.toString(), s);
@@ -671,7 +671,7 @@ public abstract class SolrQueryParserBas
 
 
   protected ReversedWildcardFilterFactory getReversedWildcardFilterFactory(FieldType fieldType) {
-    if (leadingWildcards == null) leadingWildcards = new HashMap<FieldType, ReversedWildcardFilterFactory>();
+    if (leadingWildcards == null) leadingWildcards = new HashMap<>();
     ReversedWildcardFilterFactory fac = leadingWildcards.get(fieldType);
     if (fac != null || leadingWildcards.containsKey(fac)) {
       return fac;

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/DocValuesFacets.java Sun Mar 16 19:39:10 2014
@@ -59,7 +59,7 @@ public class DocValuesFacets {
   public static NamedList<Integer> getCounts(SolrIndexSearcher searcher, DocSet docs, String fieldName, int offset, int limit, int mincount, boolean missing, String sort, String prefix) throws IOException {
     SchemaField schemaField = searcher.getSchema().getField(fieldName);
     FieldType ft = schemaField.getType();
-    NamedList<Integer> res = new NamedList<Integer>();
+    NamedList<Integer> res = new NamedList<>();
 
     final SortedSetDocValues si; // for term lookups only
     OrdinalMap ordinalMap = null; // for mapping per-segment ords to global ones

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/LocalSolrQueryRequest.java Sun Mar 16 19:39:10 2014
@@ -37,7 +37,7 @@ public class LocalSolrQueryRequest exten
   public final static Map emptyArgs = new HashMap(0,1);
 
   protected static SolrParams makeParams(String query, String qtype, int start, int limit, Map args) {
-    Map<String,String[]> map = new HashMap<String,String[]>();
+    Map<String,String[]> map = new HashMap<>();
     for (Iterator iter = args.entrySet().iterator(); iter.hasNext();) {
       Map.Entry e = (Map.Entry)iter.next();
       String k = e.getKey().toString();

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/NumericFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/NumericFacets.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/NumericFacets.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/NumericFacets.java Sun Mar 16 19:39:10 2014
@@ -235,13 +235,13 @@ final class NumericFacets {
 
     // 4. build the NamedList
     final ValueSource vs = ft.getValueSource(sf, null);
-    final NamedList<Integer> result = new NamedList<Integer>();
+    final NamedList<Integer> result = new NamedList<>();
 
     // This stuff is complicated because if facet.mincount=0, the counts needs
     // to be merged with terms from the terms dict
     if (!zeros || FacetParams.FACET_SORT_COUNT.equals(sort) || FacetParams.FACET_SORT_COUNT_LEGACY.equals(sort)) {
       // Only keep items we're interested in
-      final Deque<Entry> counts = new ArrayDeque<Entry>();
+      final Deque<Entry> counts = new ArrayDeque<>();
       while (pq.size() > offset) {
         counts.addFirst(pq.pop());
       }
@@ -258,7 +258,7 @@ final class NumericFacets {
           throw new IllegalStateException("Cannot use " + FacetParams.FACET_MINCOUNT + "=0 on field " + sf.getName() + " which is not indexed");
         }
         // Add zeros until there are limit results
-        final Set<String> alreadySeen = new HashSet<String>();
+        final Set<String> alreadySeen = new HashSet<>();
         while (pq.size() > 0) {
           Entry entry = pq.pop();
           final int readerIdx = ReaderUtil.subIndex(entry.docID, leaves);
@@ -314,7 +314,7 @@ final class NumericFacets {
       if (!sf.indexed()) {
         throw new IllegalStateException("Cannot use " + FacetParams.FACET_SORT + "=" + FacetParams.FACET_SORT_INDEX + " on a field which is not indexed");
       }
-      final Map<String, Integer> counts = new HashMap<String, Integer>();
+      final Map<String, Integer> counts = new HashMap<>();
       while (pq.size() > 0) {
         final Entry entry = pq.pop();
         final int readerIdx = ReaderUtil.subIndex(entry.docID, leaves);

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/PerSegmentSingleValuedFaceting.java Sun Mar 16 19:39:10 2014
@@ -78,7 +78,7 @@ class PerSegmentSingleValuedFaceting {
 
   NamedList<Integer> getFacetCounts(Executor executor) throws IOException {
 
-    CompletionService<SegFacet> completionService = new ExecutorCompletionService<SegFacet>(executor);
+    CompletionService<SegFacet> completionService = new ExecutorCompletionService<>(executor);
 
     // reuse the translation logic to go from top level set to per-segment set
     baseSet = docs.getTopFilter();
@@ -87,7 +87,7 @@ class PerSegmentSingleValuedFaceting {
     // The list of pending tasks that aren't immediately submitted
     // TODO: Is there a completion service, or a delegating executor that can
     // limit the number of concurrent tasks submitted to a bigger executor?
-    LinkedList<Callable<SegFacet>> pending = new LinkedList<Callable<SegFacet>>();
+    LinkedList<Callable<SegFacet>> pending = new LinkedList<>();
 
     int threads = nThreads <= 0 ? Integer.MAX_VALUE : nThreads;
 
@@ -308,7 +308,7 @@ class CountSortedFacetCollector extends 
     this.offset = offset;
     this.limit = limit;
     maxsize = limit>0 ? offset+limit : Integer.MAX_VALUE-1;
-    queue = new BoundedTreeSet<SimpleFacets.CountPair<String,Integer>>(maxsize);
+    queue = new BoundedTreeSet<>(maxsize);
     min=mincount-1;  // the smallest value in the top 'N' values
   }
 
@@ -319,7 +319,7 @@ class CountSortedFacetCollector extends 
       // index order, so we already know that the keys are ordered.  This can be very
       // important if a lot of the counts are repeated (like zero counts would be).
       UnicodeUtil.UTF8toUTF16(term, spare);
-      queue.add(new SimpleFacets.CountPair<String,Integer>(spare.toString(), count));
+      queue.add(new SimpleFacets.CountPair<>(spare.toString(), count));
       if (queue.size()>=maxsize) min=queue.last().val;
     }
     return false;
@@ -327,7 +327,7 @@ class CountSortedFacetCollector extends 
 
   @Override
   public NamedList<Integer> getFacetCounts() {
-    NamedList<Integer> res = new NamedList<Integer>();
+    NamedList<Integer> res = new NamedList<>();
     int off=offset;
     int lim=limit>=0 ? limit : Integer.MAX_VALUE;
      // now select the right page from the results
@@ -347,7 +347,7 @@ class IndexSortedFacetCollector extends 
   int offset;
   int limit;
   final int mincount;
-  final NamedList<Integer> res = new NamedList<Integer>();
+  final NamedList<Integer> res = new NamedList<>();
 
   public IndexSortedFacetCollector(int offset, int limit, int mincount) {
     this.offset = offset;

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SimpleFacets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SimpleFacets.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SimpleFacets.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SimpleFacets.java Sun Mar 16 19:39:10 2014
@@ -184,7 +184,7 @@ public class SimpleFacets {
     if (tagMap != null && rb != null) {
       List<String> excludeTagList = StrUtils.splitSmart(excludeStr,',');
 
-      IdentityHashMap<Query,Boolean> excludeSet = new IdentityHashMap<Query,Boolean>();
+      IdentityHashMap<Query,Boolean> excludeSet = new IdentityHashMap<>();
       for (String excludeTag : excludeTagList) {
         Object olst = tagMap.get(excludeTag);
         // tagMap has entries of List<String,List<QParser>>, but subject to change in the future
@@ -197,7 +197,7 @@ public class SimpleFacets {
       }
       if (excludeSet.size() == 0) return;
 
-      List<Query> qlist = new ArrayList<Query>();
+      List<Query> qlist = new ArrayList<>();
 
       // add the base query
       if (!excludeSet.containsKey(rb.getQuery())) {
@@ -254,7 +254,7 @@ public class SimpleFacets {
     if (!params.getBool(FacetParams.FACET,true))
       return null;
 
-    facetResponse = new SimpleOrderedMap<Object>();
+    facetResponse = new SimpleOrderedMap<>();
     try {
       facetResponse.add("facet_queries", getFacetQueryCounts());
       facetResponse.add("facet_fields", getFacetFieldCounts());
@@ -277,7 +277,7 @@ public class SimpleFacets {
    */
   public NamedList<Integer> getFacetQueryCounts() throws IOException,SyntaxError {
 
-    NamedList<Integer> res = new SimpleOrderedMap<Integer>();
+    NamedList<Integer> res = new SimpleOrderedMap<>();
 
     /* Ignore CommonParams.DF - could have init param facet.query assuming
      * the schema default with query param DF intented to only affect Q.
@@ -341,7 +341,7 @@ public class SimpleFacets {
   public NamedList<Integer> getTermCounts(String field, DocSet base) throws IOException {
     int offset = params.getFieldInt(field, FacetParams.FACET_OFFSET, 0);
     int limit = params.getFieldInt(field, FacetParams.FACET_LIMIT, 100);
-    if (limit == 0) return new NamedList<Integer>();
+    if (limit == 0) return new NamedList<>();
     Integer mincount = params.getFieldInt(field, FacetParams.FACET_MINCOUNT);
     if (mincount==null) {
       Boolean zeros = params.getFieldBool(field, FacetParams.FACET_ZEROS);
@@ -481,7 +481,7 @@ public class SimpleFacets {
 
     CharsRef charsRef = new CharsRef();
     FieldType facetFieldType = searcher.getSchema().getFieldType(field);
-    NamedList<Integer> facetCounts = new NamedList<Integer>();
+    NamedList<Integer> facetCounts = new NamedList<>();
     List<TermGroupFacetCollector.FacetEntry> scopedEntries 
       = result.getFacetEntries(offset, limit < 0 ? Integer.MAX_VALUE : limit);
     for (TermGroupFacetCollector.FacetEntry facetEntry : scopedEntries) {
@@ -524,7 +524,7 @@ public class SimpleFacets {
   public NamedList<Object> getFacetFieldCounts()
       throws IOException, SyntaxError {
 
-    NamedList<Object> res = new SimpleOrderedMap<Object>();
+    NamedList<Object> res = new SimpleOrderedMap<>();
     String[] facetFs = params.getParams(FacetParams.FACET_FIELD);
     if (null == facetFs) {
       return res;
@@ -536,7 +536,7 @@ public class SimpleFacets {
     int maxThreads = req.getParams().getInt(FacetParams.FACET_THREADS, 0);
     Executor executor = maxThreads == 0 ? directExecutor : facetExecutor;
     final Semaphore semaphore = new Semaphore((maxThreads <= 0) ? Integer.MAX_VALUE : maxThreads);
-    List<Future<NamedList>> futures = new ArrayList<Future<NamedList>>(facetFs.length);
+    List<Future<NamedList>> futures = new ArrayList<>(facetFs.length);
 
     try {
       //Loop over fields; submit to executor, keeping the future
@@ -550,7 +550,7 @@ public class SimpleFacets {
           @Override
           public NamedList call() throws Exception {
             try {
-              NamedList<Object> result = new SimpleOrderedMap<Object>();
+              NamedList<Object> result = new SimpleOrderedMap<>();
               if(termList != null) {
                 result.add(workerKey, getListedTermCounts(workerFacetValue, termList, workerBase));
               } else {
@@ -568,7 +568,7 @@ public class SimpleFacets {
           }
         };
 
-        RunnableFuture<NamedList> runnableFuture = new FutureTask<NamedList>(callable);
+        RunnableFuture<NamedList> runnableFuture = new FutureTask<>(callable);
         semaphore.acquire();//may block and/or interrupt
         executor.execute(runnableFuture);//releases semaphore when done
         futures.add(runnableFuture);
@@ -602,7 +602,7 @@ public class SimpleFacets {
   private NamedList getListedTermCounts(String field, String termList, DocSet base) throws IOException {
     FieldType ft = searcher.getSchema().getFieldType(field);
     List<String> terms = StrUtils.splitSmart(termList, ",", true);
-    NamedList<Integer> res = new NamedList<Integer>();
+    NamedList<Integer> res = new NamedList<>();
     for (String term : terms) {
       String internal = ft.toInternal(term);
       int count = searcher.numDocs(new TermQuery(new Term(field, internal)), base);
@@ -646,7 +646,7 @@ public class SimpleFacets {
     // trying to pass all the various params around.
 
     FieldType ft = searcher.getSchema().getFieldType(fieldName);
-    NamedList<Integer> res = new NamedList<Integer>();
+    NamedList<Integer> res = new NamedList<>();
 
     SortedDocValues si = FieldCache.DEFAULT.getTermsIndex(searcher.getAtomicReader(), fieldName);
 
@@ -808,7 +808,7 @@ public class SimpleFacets {
     boolean sortByCount = sort.equals("count") || sort.equals("true");
     final int maxsize = limit>=0 ? offset+limit : Integer.MAX_VALUE-1;
     final BoundedTreeSet<CountPair<BytesRef,Integer>> queue = sortByCount ? new BoundedTreeSet<CountPair<BytesRef,Integer>>(maxsize) : null;
-    final NamedList<Integer> res = new NamedList<Integer>();
+    final NamedList<Integer> res = new NamedList<>();
 
     int min=mincount-1;  // the smallest value in the top 'N' values    
     int off=offset;
@@ -908,7 +908,7 @@ public class SimpleFacets {
           if (sortByCount) {
             if (c>min) {
               BytesRef termCopy = BytesRef.deepCopyOf(term);
-              queue.add(new CountPair<BytesRef,Integer>(termCopy, c));
+              queue.add(new CountPair<>(termCopy, c));
               if (queue.size()>=maxsize) min=queue.last().val;
             }
           } else {
@@ -952,7 +952,7 @@ public class SimpleFacets {
   public NamedList<Object> getFacetDateCounts()
     throws IOException, SyntaxError {
 
-    final NamedList<Object> resOuter = new SimpleOrderedMap<Object>();
+    final NamedList<Object> resOuter = new SimpleOrderedMap<>();
     final String[] fields = params.getParams(FacetParams.FACET_DATE);
 
     if (null == fields || 0 == fields.length) return resOuter;
@@ -977,7 +977,7 @@ public class SimpleFacets {
     String f = facetValue;
 
 
-    final NamedList<Object> resInner = new SimpleOrderedMap<Object>();
+    final NamedList<Object> resInner = new SimpleOrderedMap<>();
     resOuter.add(key, resInner);
     final SchemaField sf = schema.getField(f);
     if (! (sf.getType() instanceof DateField)) {
@@ -1133,7 +1133,7 @@ public class SimpleFacets {
    */
 
   public NamedList<Object> getFacetRangeCounts() throws IOException, SyntaxError {
-    final NamedList<Object> resOuter = new SimpleOrderedMap<Object>();
+    final NamedList<Object> resOuter = new SimpleOrderedMap<>();
     final String[] fields = params.getParams(FacetParams.FACET_RANGE);
 
     if (null == fields || 0 == fields.length) return resOuter;
@@ -1203,8 +1203,8 @@ public class SimpleFacets {
      final RangeEndpointCalculator<T> calc) throws IOException {
     
     final String f = sf.getName();
-    final NamedList<Object> res = new SimpleOrderedMap<Object>();
-    final NamedList<Integer> counts = new NamedList<Integer>();
+    final NamedList<Object> res = new SimpleOrderedMap<>();
+    final NamedList<Integer> counts = new NamedList<>();
     res.add("counts", counts);
 
     final T start = calc.getValue(required.getFieldParam(f,FacetParams.FACET_RANGE_START));

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrQueryRequestBase.java Sun Mar 16 19:39:10 2014
@@ -57,7 +57,7 @@ public abstract class SolrQueryRequestBa
   @Override
   public Map<Object,Object> getContext() {
     // SolrQueryRequest as a whole isn't thread safe, and this isn't either.
-    if (context==null) context = new HashMap<Object,Object>();
+    if (context==null) context = new HashMap<>();
     return context;
   }
 

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrRequestInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrRequestInfo.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrRequestInfo.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/SolrRequestInfo.java Sun Mar 16 19:39:10 2014
@@ -32,7 +32,7 @@ import java.util.List;
 
 
 public class SolrRequestInfo {
-  protected final static ThreadLocal<SolrRequestInfo> threadLocal = new ThreadLocal<SolrRequestInfo>();
+  protected final static ThreadLocal<SolrRequestInfo> threadLocal = new ThreadLocal<>();
 
   protected SolrQueryRequest req;
   protected SolrQueryResponse rsp;
@@ -132,7 +132,7 @@ public class SolrRequestInfo {
     // is this better here, or on SolrQueryRequest?
     synchronized (this) {
       if (closeHooks == null) {
-        closeHooks = new LinkedList<Closeable>();
+        closeHooks = new LinkedList<>();
       }
       closeHooks.add(hook);
     }

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/UnInvertedField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/UnInvertedField.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/UnInvertedField.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/request/UnInvertedField.java Sun Mar 16 19:39:10 2014
@@ -100,7 +100,7 @@ public class UnInvertedField extends Doc
 
   int[] maxTermCounts = new int[1024];
 
-  final Map<Integer,TopTerm> bigTerms = new LinkedHashMap<Integer,TopTerm>();
+  final Map<Integer,TopTerm> bigTerms = new LinkedHashMap<>();
 
   private SolrIndexSearcher.DocsEnumState deState;
   private final SolrIndexSearcher searcher;
@@ -220,7 +220,7 @@ public class UnInvertedField extends Doc
 
     FieldType ft = searcher.getSchema().getFieldType(field);
 
-    NamedList<Integer> res = new NamedList<Integer>();  // order is important
+    NamedList<Integer> res = new NamedList<>();  // order is important
 
     DocSet docs = baseDocs;
     int baseSize = docs.size();

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/BinaryResponseWriter.java Sun Mar 16 19:39:10 2014
@@ -40,7 +40,7 @@ import org.slf4j.LoggerFactory;
 
 public class BinaryResponseWriter implements BinaryQueryResponseWriter {
   private static final Logger LOG = LoggerFactory.getLogger(BinaryResponseWriter.class);
-  public static final Set<Class> KNOWN_TYPES = new HashSet<Class>();
+  public static final Set<Class> KNOWN_TYPES = new HashSet<>();
 
   @Override
   public void write(OutputStream out, SolrQueryRequest req, SolrQueryResponse response) throws IOException {

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/CSVResponseWriter.java Sun Mar 16 19:39:10 2014
@@ -146,12 +146,12 @@ class CSVWriter extends TextResponseWrit
     CSVSharedBufPrinter mvPrinter;  // printer used to encode multiple values in a single CSV value
 
     // used to collect values
-    List<IndexableField> values = new ArrayList<IndexableField>(1);  // low starting amount in case there are many fields
+    List<IndexableField> values = new ArrayList<>(1);  // low starting amount in case there are many fields
     int tmp;
   }
 
   int pass;
-  Map<String,CSVField> csvFields = new LinkedHashMap<String,CSVField>();
+  Map<String,CSVField> csvFields = new LinkedHashMap<>();
 
   Calendar cal;  // for formatting date objects
 
@@ -242,7 +242,7 @@ class CSVWriter extends TextResponseWrit
       if (responseObj instanceof SolrDocumentList) {
         // get the list of fields from the SolrDocumentList
         if(fields==null) {
-          fields = new LinkedHashSet<String>();
+          fields = new LinkedHashSet<>();
         }
         for (SolrDocument sdoc: (SolrDocumentList)responseObj) {
           fields.addAll(sdoc.getFieldNames());

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/JSONResponseWriter.java Sun Mar 16 19:39:10 2014
@@ -124,7 +124,7 @@ class JSONWriter extends TextResponseWri
     // Disad: this is ambiguous with a real single value that happens to be an array
     //
     // Both of these mappings have ambiguities.
-    HashMap<String,Integer> repeats = new HashMap<String,Integer>(4);
+    HashMap<String,Integer> repeats = new HashMap<>(4);
 
     boolean first=true;
     for (int i=0; i<sz; i++) {
@@ -314,7 +314,7 @@ class JSONWriter extends TextResponseWri
     final ArrayList<IndexableField> fields;
     MultiValueField(SchemaField sfield, IndexableField firstVal) {
       this.sfield = sfield;
-      this.fields = new ArrayList<IndexableField>(4);
+      this.fields = new ArrayList<>(4);
       this.fields.add(firstVal);
     }
   }

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/PHPSerializedResponseWriter.java Sun Mar 16 19:39:10 2014
@@ -121,8 +121,8 @@ class PHPSerializedWriter extends JSONWr
   {
     writeKey(idx, false);
     
-    LinkedHashMap <String,Object> single = new LinkedHashMap<String, Object>();
-    LinkedHashMap <String,Object> multi = new LinkedHashMap<String, Object>();
+    LinkedHashMap <String,Object> single = new LinkedHashMap<>();
+    LinkedHashMap <String,Object> multi = new LinkedHashMap<>();
 
     for (String fname : doc.getFieldNames()) {
       if(!returnFields.wantsField(fname)){

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/SolrQueryResponse.java Sun Mar 16 19:39:10 2014
@@ -68,13 +68,13 @@ public class SolrQueryResponse {
    * @see #setAllValues
    * @see <a href="#returnable_data">Note on Returnable Data</a>
    */
-  protected NamedList<Object> values = new SimpleOrderedMap<Object>();
+  protected NamedList<Object> values = new SimpleOrderedMap<>();
   
   
 /**
    * Container for storing information that should be logged by Solr before returning.
    */
-  protected NamedList<Object> toLog = new SimpleOrderedMap<Object>();
+  protected NamedList<Object> toLog = new SimpleOrderedMap<>();
 
   protected ReturnFields returnFields;
 

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/TextResponseWriter.java Sun Mar 16 19:39:10 2014
@@ -235,7 +235,7 @@ public abstract class TextResponseWriter
       if (existing == null) {
         SchemaField sf = schema.getFieldOrNull(f.name());
         if (sf != null && sf.multiValued()) {
-          List<Object> vals = new ArrayList<Object>();
+          List<Object> vals = new ArrayList<>();
           vals.add( f );
           out.setField( f.name(), vals );
         } 

Modified: lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/transform/DocTransformers.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/transform/DocTransformers.java?rev=1578144&r1=1578143&r2=1578144&view=diff
==============================================================================
--- lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/transform/DocTransformers.java (original)
+++ lucene/dev/branches/lucene5376_2/solr/core/src/java/org/apache/solr/response/transform/DocTransformers.java Sun Mar 16 19:39:10 2014
@@ -32,7 +32,7 @@ import org.apache.solr.request.SolrQuery
  */
 public class DocTransformers extends DocTransformer
 {
-  final List<DocTransformer> children = new ArrayList<DocTransformer>();
+  final List<DocTransformer> children = new ArrayList<>();
 
   @Override
   public String getName()



Mime
View raw message