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 15:39:39 UTC
svn commit: r1576755 [15/27] - in /lucene/dev/trunk: lucene/
lucene/analysis/common/src/java/org/apache/lucene/analysis/charfilter/
lucene/analysis/common/src/java/org/apache/lucene/analysis/compound/
lucene/analysis/common/src/java/org/apache/lucene/a...
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/DocBuilder.java Wed Mar 12 14:39:17 2014
@@ -74,9 +74,9 @@ public class DocBuilder {
boolean verboseDebug = false;
- Map<String, Object> session = new HashMap<String, Object>();
+ Map<String, Object> session = new HashMap<>();
- static final ThreadLocal<DocBuilder> INSTANCE = new ThreadLocal<DocBuilder>();
+ static final ThreadLocal<DocBuilder> INSTANCE = new ThreadLocal<>();
private Map<String, Object> persistedProperties;
private DIHProperties propWriter;
@@ -132,7 +132,7 @@ public class DocBuilder {
resolver = new VariableResolver();
}
resolver.setEvaluators(dataImporter.getEvaluators());
- Map<String, Object> indexerNamespace = new HashMap<String, Object>();
+ Map<String, Object> indexerNamespace = new HashMap<>();
if (persistedProperties.get(LAST_INDEX_TIME) != null) {
indexerNamespace.put(LAST_INDEX_TIME, persistedProperties.get(LAST_INDEX_TIME));
} else {
@@ -140,9 +140,9 @@ public class DocBuilder {
indexerNamespace.put(LAST_INDEX_TIME, epoch);
}
indexerNamespace.put(INDEX_START_TIME, dataImporter.getIndexStartTime());
- indexerNamespace.put("request", new HashMap<String,Object>(reqParams.getRawParams()));
+ indexerNamespace.put("request", new HashMap<>(reqParams.getRawParams()));
for (Entity entity : dataImporter.getConfig().getEntities()) {
- Map<String, Object> entityNamespace = new HashMap<String, Object>();
+ Map<String, Object> entityNamespace = new HashMap<>();
String key = SolrWriter.LAST_INDEX_KEY;
Object lastIndex = persistedProperties.get(entity.getName() + "." + key);
if (lastIndex != null) {
@@ -213,10 +213,10 @@ public class DocBuilder {
}
AtomicBoolean fullCleanDone = new AtomicBoolean(false);
//we must not do a delete of *:* multiple times if there are multiple root entities to be run
- Map<String,Object> lastIndexTimeProps = new HashMap<String,Object>();
+ Map<String,Object> lastIndexTimeProps = new HashMap<>();
lastIndexTimeProps.put(LAST_INDEX_KEY, dataImporter.getIndexStartTime());
- epwList = new ArrayList<EntityProcessorWrapper>(config.getEntities().size());
+ epwList = new ArrayList<>(config.getEntities().size());
for (Entity e : config.getEntities()) {
epwList.add(getEntityProcessorWrapper(e));
}
@@ -342,7 +342,7 @@ public class DocBuilder {
addStatusMessage("Identifying Delta");
LOG.info("Starting delta collection.");
- Set<Map<String, Object>> deletedKeys = new HashSet<Map<String, Object>>();
+ Set<Map<String, Object>> deletedKeys = new HashSet<>();
Set<Map<String, Object>> allPks = collectDelta(currentEntityProcessorWrapper, resolver, deletedKeys);
if (stop.get())
return;
@@ -411,7 +411,7 @@ public class DocBuilder {
private void buildDocument(VariableResolver vr, DocWrapper doc,
Map<String,Object> pk, EntityProcessorWrapper epw, boolean isRoot,
ContextImpl parentCtx) {
- List<EntityProcessorWrapper> entitiesToDestroy = new ArrayList<EntityProcessorWrapper>();
+ List<EntityProcessorWrapper> entitiesToDestroy = new ArrayList<>();
try {
buildDocument(vr, doc, pk, epw, isRoot, parentCtx, entitiesToDestroy);
} catch (Exception e) {
@@ -565,7 +565,7 @@ public class DocBuilder {
Map<String ,Object> session;
public void setSessionAttribute(String key, Object val){
- if(session == null) session = new HashMap<String, Object>();
+ if(session == null) session = new HashMap<>();
session.put(key, val);
}
@@ -768,7 +768,7 @@ public class DocBuilder {
ContextImpl context1 = new ContextImpl(epw, resolver, null, Context.FIND_DELTA, session, null, this);
epw.init(context1);
- Set<Map<String, Object>> myModifiedPks = new HashSet<Map<String, Object>>();
+ Set<Map<String, Object>> myModifiedPks = new HashSet<>();
@@ -781,7 +781,7 @@ public class DocBuilder {
}
// identifying the modified rows for this entity
- Map<String, Map<String, Object>> deltaSet = new HashMap<String, Map<String, Object>>();
+ Map<String, Map<String, Object>> deltaSet = new HashMap<>();
LOG.info("Running ModifiedRowKey() for Entity: " + epw.getEntity().getName());
//get the modified rows in this entity
String pk = epw.getEntity().getPk();
@@ -804,7 +804,7 @@ public class DocBuilder {
return new HashSet();
}
//get the deleted rows for this entity
- Set<Map<String, Object>> deletedSet = new HashSet<Map<String, Object>>();
+ Set<Map<String, Object>> deletedSet = new HashSet<>();
while (true) {
Map<String, Object> row = epw.nextDeletedRowKey();
if (row == null)
@@ -834,7 +834,7 @@ public class DocBuilder {
LOG.info("Completed DeletedRowKey for Entity: " + epw.getEntity().getName() + " rows obtained : " + deletedSet.size());
myModifiedPks.addAll(deltaSet.values());
- Set<Map<String, Object>> parentKeyList = new HashSet<Map<String, Object>>();
+ Set<Map<String, Object>> parentKeyList = new HashSet<>();
//all that we have captured is useless (in a sub-entity) if no rows in the parent is modified because of these
//propogate up the changes in the chain
if (epw.getEntity().getParentEntity() != null) {
@@ -862,7 +862,7 @@ public class DocBuilder {
// Do not use entity.isDocRoot here because one of descendant entities may set rootEntity="true"
return epw.getEntity().getParentEntity() == null ?
- myModifiedPks : new HashSet<Map<String, Object>>(parentKeyList);
+ myModifiedPks : new HashSet<>(parentKeyList);
}
private void getModifiedParentRows(VariableResolver resolver,
@@ -949,7 +949,7 @@ public class DocBuilder {
}
public Map<String, Object> getStatsSnapshot() {
- Map<String, Object> result = new HashMap<String, Object>();
+ Map<String, Object> result = new HashMap<>();
result.put("docCount", docCount.get());
result.put("deletedDocCount", deletedDocCount.get());
result.put("rowCount", rowsCount.get());
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/EntityProcessorWrapper.java Wed Mar 12 14:39:17 2014
@@ -43,7 +43,7 @@ public class EntityProcessorWrapper exte
private EntityProcessor delegate;
private Entity entity;
private DataSource datasource;
- private List<EntityProcessorWrapper> children = new ArrayList<EntityProcessorWrapper>();
+ private List<EntityProcessorWrapper> children = new ArrayList<>();
private DocBuilder docBuilder;
private boolean initalized;
private String onError;
@@ -176,7 +176,7 @@ public class EntityProcessorWrapper exte
if (stopTransform) break;
try {
if (rows != null) {
- List<Map<String, Object>> tmpRows = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> tmpRows = new ArrayList<>();
for (Map<String, Object> map : rows) {
resolver.addNamespace(entityName, map);
Object o = t.transformRow(map, context);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/Evaluator.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/Evaluator.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/Evaluator.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/Evaluator.java Wed Mar 12 14:39:17 2014
@@ -71,7 +71,7 @@ public abstract class Evaluator {
* @return a List of objects which can either be a string, number or a variable wrapper
*/
List<Object> parseParams(String expression, VariableResolver vr) {
- List<Object> result = new ArrayList<Object>();
+ List<Object> result = new ArrayList<>();
expression = expression.trim();
String[] ss = expression.split(",");
for (int i = 0; i < ss.length; i++) {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/FileListEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -200,7 +200,7 @@ public class FileListEntityProcessor ext
public Map<String, Object> nextRow() {
if (rowIterator != null)
return getNext();
- List<Map<String, Object>> fileDetails = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> fileDetails = new ArrayList<>();
File dir = new File(baseDir);
String dateStr = context.getEntityAttribute(NEWER_THAN);
@@ -243,7 +243,7 @@ public class FileListEntityProcessor ext
}
private void addDetails(List<Map<String, Object>> files, File dir, String name) {
- Map<String, Object> details = new HashMap<String, Object>();
+ Map<String, Object> details = new HashMap<>();
File aFile = new File(dir, name);
if (aFile.isDirectory()) return;
long sz = aFile.length();
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/JdbcDataSource.java Wed Mar 12 14:39:17 2014
@@ -49,7 +49,7 @@ public class JdbcDataSource extends
private Connection conn;
- private Map<String, Integer> fieldNameVsType = new HashMap<String, Integer>();
+ private Map<String, Integer> fieldNameVsType = new HashMap<>();
private boolean convertType = false;
@@ -245,7 +245,7 @@ public class JdbcDataSource extends
private List<String> readFieldNames(ResultSetMetaData metaData)
throws SQLException {
- List<String> colNames = new ArrayList<String>();
+ List<String> colNames = new ArrayList<>();
int count = metaData.getColumnCount();
for (int i = 0; i < count; i++) {
colNames.add(metaData.getColumnLabel(i + 1));
@@ -309,7 +309,7 @@ public class JdbcDataSource extends
private Map<String, Object> getARow() {
if (resultSet == null)
return null;
- Map<String, Object> result = new HashMap<String, Object>();
+ Map<String, Object> result = new HashMap<>();
for (String colName : colNames) {
try {
if (!convertType) {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/LineEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/LineEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/LineEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/LineEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -125,7 +125,7 @@ public class LineEntityProcessor extends
if (acceptLineRegex != null && ! acceptLineRegex.matcher(line).find()) continue;
if (skipLineRegex != null && skipLineRegex.matcher(line).find()) continue;
// Contruct the 'row' of fields
- Map<String, Object> row = new HashMap<String, Object>();
+ Map<String, Object> row = new HashMap<>();
row.put("rawLine", line);
return row;
}
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/MockDataSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/MockDataSource.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/MockDataSource.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/MockDataSource.java Wed Mar 12 14:39:17 2014
@@ -33,7 +33,7 @@ import java.util.Properties;
public class MockDataSource extends
DataSource<Iterator<Map<String, Object>>> {
- private static Map<String, Iterator<Map<String, Object>>> cache = new HashMap<String, Iterator<Map<String, Object>>>();
+ private static Map<String, Iterator<Map<String, Object>>> cache = new HashMap<>();
public static void setIterator(String query,
Iterator<Map<String, Object>> iter) {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/PlainTextEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -69,7 +69,7 @@ public class PlainTextEntityProcessor ex
if (len <= 0) break;
sw.append(new String(buf, 0, len));
}
- Map<String, Object> row = new HashMap<String, Object>();
+ Map<String, Object> row = new HashMap<>();
row.put(PLAIN_TEXT, sw.toString());
ended = true;
IOUtils.closeQuietly(r);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RegexTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RegexTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RegexTransformer.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RegexTransformer.java Wed Mar 12 14:39:17 2014
@@ -75,7 +75,7 @@ public class RegexTransformer extends Tr
Map.Entry<String ,Object> entry = (Map.Entry<String, Object>) e;
List l = results;
if(!col.equals(entry.getKey())){
- if(otherVars == null) otherVars = new HashMap<String, List>();
+ if(otherVars == null) otherVars = new HashMap<>();
l = otherVars.get(entry.getKey());
if(l == null){
l = new ArrayList();
@@ -131,7 +131,7 @@ public class RegexTransformer extends Tr
@SuppressWarnings("unchecked")
private List<String> readBySplit(String splitBy, String value) {
String[] vals = value.split(splitBy);
- List<String> l = new ArrayList<String>();
+ List<String> l = new ArrayList<>();
l.addAll(Arrays.asList(vals));
return l;
}
@@ -151,7 +151,7 @@ public class RegexTransformer extends Tr
if(groupNames == null){
l = new ArrayList();
} else {
- map = new HashMap<String, String>();
+ map = new HashMap<>();
}
for (int i = 1; i <= m.groupCount(); i++) {
try {
@@ -186,7 +186,7 @@ public class RegexTransformer extends Tr
return result;
}
- private HashMap<String, Pattern> PATTERN_CACHE = new HashMap<String, Pattern>();
+ private HashMap<String, Pattern> PATTERN_CACHE = new HashMap<>();
public static final String REGEX = "regex";
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RequestInfo.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RequestInfo.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RequestInfo.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/RequestInfo.java Wed Mar 12 14:39:17 2014
@@ -91,11 +91,11 @@ public class RequestInfo {
List<String> modifiableEntities = null;
if(o != null) {
if (o instanceof String) {
- modifiableEntities = new ArrayList<String>();
+ modifiableEntities = new ArrayList<>();
modifiableEntities.add((String) o);
} else if (o instanceof List<?>) {
@SuppressWarnings("unchecked")
- List<String> modifiableEntities1 = new ArrayList<String>((List<String>) o);
+ List<String> modifiableEntities1 = new ArrayList<>((List<String>) o);
modifiableEntities = modifiableEntities1;
}
entitiesToRun = Collections.unmodifiableList(modifiableEntities);
@@ -110,7 +110,7 @@ public class RequestInfo {
dataConfigParam = null;
}
dataConfig = dataConfigParam;
- this.rawParams = Collections.unmodifiableMap(new HashMap<String,Object>(requestParams));
+ this.rawParams = Collections.unmodifiableMap(new HashMap<>(requestParams));
}
public String getCommand() {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SimplePropertiesWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SimplePropertiesWriter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SimplePropertiesWriter.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SimplePropertiesWriter.java Wed Mar 12 14:39:17 2014
@@ -171,7 +171,7 @@ public class SimplePropertiesWriter exte
* already converted them.
*/
protected Map<String,Object> propertiesToMap(Properties p) {
- Map<String,Object> theMap = new HashMap<String,Object>();
+ Map<String,Object> theMap = new HashMap<>();
for(Map.Entry<Object,Object> entry : p.entrySet()) {
String key = entry.getKey().toString();
Object val = entry.getValue().toString();
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SolrEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -222,7 +222,7 @@ public class SolrEntityProcessor extends
public Map<String,Object> next() {
SolrDocument solrDocument = solrDocumentIterator.next();
- HashMap<String,Object> map = new HashMap<String,Object>();
+ HashMap<String,Object> map = new HashMap<>();
Collection<String> fields = solrDocument.getFieldNames();
for (String field : fields) {
Object fieldValue = solrDocument.getFieldValue(field);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SortedMapBackedCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SortedMapBackedCache.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SortedMapBackedCache.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/SortedMapBackedCache.java Wed Mar 12 14:39:17 2014
@@ -60,7 +60,7 @@ public class SortedMapBackedCache implem
}
List<Map<String,Object>> thisKeysRecs = theMap.get(pk);
if (thisKeysRecs == null) {
- thisKeysRecs = new ArrayList<Map<String,Object>>();
+ thisKeysRecs = new ArrayList<>();
theMap.put(pk, thisKeysRecs);
}
thisKeysRecs.add(rec);
@@ -131,7 +131,7 @@ public class SortedMapBackedCache implem
return null;
}
if(key instanceof Iterable<?>) {
- List<Map<String,Object>> vals = new ArrayList<Map<String,Object>>();
+ List<Map<String,Object>> vals = new ArrayList<>();
Iterator<?> iter = ((Iterable<?>) key).iterator();
while(iter.hasNext()) {
List<Map<String,Object>> val = theMap.get(iter.next());
@@ -220,7 +220,7 @@ public class SortedMapBackedCache implem
checkOpen(false);
isOpen = true;
if (theMap == null) {
- theMap = new TreeMap<Object,List<Map<String,Object>>>();
+ theMap = new TreeMap<>();
}
String pkName = CachePropertyUtil.getAttributeValueAsString(context,
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/TemplateTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/TemplateTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/TemplateTransformer.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/TemplateTransformer.java Wed Mar 12 14:39:17 2014
@@ -49,7 +49,7 @@ import org.slf4j.LoggerFactory;
public class TemplateTransformer extends Transformer {
private static final Logger LOG = LoggerFactory.getLogger(TemplateTransformer.class);
- private Map<String ,List<String>> templateVsVars = new HashMap<String, List<String>>();
+ private Map<String ,List<String>> templateVsVars = new HashMap<>();
@Override
@SuppressWarnings("unchecked")
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/VariableResolver.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/VariableResolver.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/VariableResolver.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/VariableResolver.java Wed Mar 12 14:39:17 2014
@@ -54,30 +54,30 @@ public class VariableResolver {
.compile("^(\\w*?)\\((.*?)\\)$");
private Map<String,Object> rootNamespace;
private Map<String,Evaluator> evaluators;
- private Map<String,Resolved> cache = new WeakHashMap<String,Resolved>();
+ private Map<String,Resolved> cache = new WeakHashMap<>();
class Resolved {
- List<Integer> startIndexes = new ArrayList<Integer>(2);
- List<Integer> endOffsets = new ArrayList<Integer>(2);
- List<String> variables = new ArrayList<String>(2);
+ List<Integer> startIndexes = new ArrayList<>(2);
+ List<Integer> endOffsets = new ArrayList<>(2);
+ List<String> variables = new ArrayList<>(2);
}
public static final String FUNCTIONS_NAMESPACE = "dataimporter.functions.";
public static final String FUNCTIONS_NAMESPACE_SHORT = "dih.functions.";
public VariableResolver() {
- rootNamespace = new HashMap<String,Object>();
+ rootNamespace = new HashMap<>();
}
public VariableResolver(Properties defaults) {
- rootNamespace = new HashMap<String,Object>();
+ rootNamespace = new HashMap<>();
for (Map.Entry<Object,Object> entry : defaults.entrySet()) {
rootNamespace.put(entry.getKey().toString(), entry.getValue());
}
}
public VariableResolver(Map<String,Object> defaults) {
- rootNamespace = new HashMap<String,Object>(defaults);
+ rootNamespace = new HashMap<>(defaults);
}
/**
@@ -184,7 +184,7 @@ public class VariableResolver {
if (r == null) {
return Collections.emptyList();
}
- return new ArrayList<String>(r.variables);
+ return new ArrayList<>(r.variables);
}
public void addNamespace(String name, Map<String,Object> newMap) {
@@ -221,7 +221,7 @@ public class VariableResolver {
Object o = currentLevel.get(keyParts[i]);
if (o == null) {
if(i == j-1) {
- Map<String,Object> nextLevel = new HashMap<String,Object>();
+ Map<String,Object> nextLevel = new HashMap<>();
currentLevel.put(keyParts[i], nextLevel);
currentLevel = nextLevel;
} else {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -57,7 +57,7 @@ public class XPathEntityProcessor extend
private static final Logger LOG = LoggerFactory.getLogger(XPathEntityProcessor.class);
private static final XMLErrorLogger xmllog = new XMLErrorLogger(LOG);
- private static final Map<String, Object> END_MARKER = new HashMap<String, Object>();
+ private static final Map<String, Object> END_MARKER = new HashMap<>();
protected List<String> placeHolderVariables;
@@ -179,14 +179,14 @@ public class XPathEntityProcessor extend
for (String s : l) {
if (s.startsWith(entityName + ".")) {
if (placeHolderVariables == null)
- placeHolderVariables = new ArrayList<String>();
+ placeHolderVariables = new ArrayList<>();
placeHolderVariables.add(s.substring(entityName.length() + 1));
}
}
for (Map<String, String> fld : context.getAllEntityFields()) {
if (fld.get(COMMON_FIELD) != null && "true".equals(fld.get(COMMON_FIELD))) {
if (commonFields == null)
- commonFields = new ArrayList<String>();
+ commonFields = new ArrayList<>();
commonFields.add(fld.get(DataImporter.COLUMN));
}
}
@@ -249,8 +249,8 @@ public class XPathEntityProcessor extend
}
private void addNamespace() {
- Map<String, Object> namespace = new HashMap<String, Object>();
- Set<String> allNames = new HashSet<String>();
+ Map<String, Object> namespace = new HashMap<>();
+ Set<String> allNames = new HashSet<>();
if (commonFields != null) allNames.addAll(commonFields);
if (placeHolderVariables != null) allNames.addAll(placeHolderVariables);
if(allNames.isEmpty()) return;
@@ -278,7 +278,7 @@ public class XPathEntityProcessor extend
private void initQuery(String s) {
Reader data = null;
try {
- final List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
+ final List<Map<String, Object>> rows = new ArrayList<>();
try {
data = dataSource.getData(s);
} catch (Exception e) {
@@ -329,7 +329,7 @@ public class XPathEntityProcessor extend
wrapAndThrow(SEVERE, e, msg);
} else if (SKIP.equals(onError)) {
LOG.warn(msg, e);
- Map<String, Object> map = new HashMap<String, Object>();
+ Map<String, Object> map = new HashMap<>();
map.put(DocBuilder.SKIP_DOC, Boolean.TRUE);
rows.add(map);
} else if (CONTINUE.equals(onError)) {
@@ -357,7 +357,7 @@ public class XPathEntityProcessor extend
if (useSolrAddXml) {
List<String> names = (List<String>) record.get("name");
List<String> values = (List<String>) record.get("value");
- Map<String, Object> row = new HashMap<String, Object>();
+ Map<String, Object> row = new HashMap<>();
for (int i = 0; i < names.size() && i < values.size(); i++) {
if (row.containsKey(names.get(i))) {
Object existing = row.get(names.get(i));
@@ -417,8 +417,8 @@ public class XPathEntityProcessor extend
private Iterator<Map<String, Object>> getRowIterator(final Reader data, final String s) {
//nothing atomic about it. I just needed a StongReference
- final AtomicReference<Exception> exp = new AtomicReference<Exception>();
- final BlockingQueue<Map<String, Object>> blockingQueue = new ArrayBlockingQueue<Map<String, Object>>(blockingQueueSize);
+ final AtomicReference<Exception> exp = new AtomicReference<>();
+ final BlockingQueue<Map<String, Object>> blockingQueue = new ArrayBlockingQueue<>(blockingQueueSize);
final AtomicBoolean isEnd = new AtomicBoolean(false);
final AtomicBoolean throwExp = new AtomicBoolean(true);
publisherThread = new Thread() {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathRecordReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathRecordReader.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathRecordReader.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/XPathRecordReader.java Wed Mar 12 14:39:17 2014
@@ -162,7 +162,7 @@ public class XPathRecordReader {
* @return results a List of emitted records
*/
public List<Map<String, Object>> getAllRecords(Reader r) {
- final List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
+ final List<Map<String, Object>> results = new ArrayList<>();
streamRecords(r, new Handler() {
@Override
public void handle(Map<String, Object> record, String s) {
@@ -249,7 +249,7 @@ public class XPathRecordReader {
// prepare for the clean up that will occurr when the record
// is emitted after its END_ELEMENT is matched
recordStarted = true;
- valuesAddedinThisFrame = new HashSet<String>();
+ valuesAddedinThisFrame = new HashSet<>();
stack.push(valuesAddedinThisFrame);
} else if (recordStarted) {
// This node is a child of some parent which matched against forEach
@@ -274,7 +274,7 @@ public class XPathRecordReader {
}
}
- Set<Node> childrenFound = new HashSet<Node>();
+ Set<Node> childrenFound = new HashSet<>();
int event = -1;
int flattenedStarts=0; // our tag depth when flattening elements
StringBuilder text = new StringBuilder();
@@ -342,7 +342,7 @@ public class XPathRecordReader {
Stack<Set<String>> stack, boolean recordStarted)
throws IOException, XMLStreamException {
Node n = getMatchingNode(parser,childNodes);
- Map<String, Object> decends=new HashMap<String, Object>();
+ Map<String, Object> decends=new HashMap<>();
if (n != null) {
childrenFound.add(n);
n.parse(parser, handler, values, stack, recordStarted);
@@ -466,7 +466,7 @@ public class XPathRecordReader {
if (multiValued) {
List<String> v = (List<String>) values.get(fieldName);
if (v == null) {
- v = new ArrayList<String>();
+ v = new ArrayList<>();
values.put(fieldName, v);
}
v.add(value);
@@ -510,7 +510,7 @@ public class XPathRecordReader {
// we have reached end of element portion of Xpath and can now only
// have an element attribute. Add it to this nodes list of attributes
if (attributes == null) {
- attributes = new ArrayList<Node>();
+ attributes = new ArrayList<>();
}
xpseg = xpseg.substring(1); // strip the '@'
attributes.add(new Node(xpseg, fieldName, multiValued));
@@ -518,7 +518,7 @@ public class XPathRecordReader {
else if ( xpseg.length() == 0) {
// we have a '//' selector for all decendents of the current nodes
xpseg = paths.remove(0); // shift out next Xpath segment
- if (wildCardNodes == null) wildCardNodes = new ArrayList<Node>();
+ if (wildCardNodes == null) wildCardNodes = new ArrayList<>();
Node n = getOrAddNode(xpseg, wildCardNodes);
if (paths.isEmpty()) {
// We are current a leaf node.
@@ -535,7 +535,7 @@ public class XPathRecordReader {
}
else {
if (childNodes == null)
- childNodes = new ArrayList<Node>();
+ childNodes = new ArrayList<>();
// does this "name" already exist as a child node.
Node n = getOrAddNode(xpseg,childNodes);
if (paths.isEmpty()) {
@@ -572,13 +572,13 @@ public class XPathRecordReader {
n.name = m.group(1);
int start = m.start(2);
while (true) {
- HashMap<String, String> attribs = new HashMap<String, String>();
+ HashMap<String, String> attribs = new HashMap<>();
if (!m.find(start))
break;
attribs.put(m.group(3), m.group(5));
start = m.end(6);
if (n.attribAndValues == null)
- n.attribAndValues = new ArrayList<Map.Entry<String, String>>();
+ n.attribAndValues = new ArrayList<>();
n.attribAndValues.addAll(attribs.entrySet());
}
}
@@ -592,7 +592,7 @@ public class XPathRecordReader {
* deep-copied for thread safety
*/
private static Map<String, Object> getDeepCopy(Map<String, Object> values) {
- Map<String, Object> result = new HashMap<String, Object>();
+ Map<String, Object> result = new HashMap<>();
for (Map.Entry<String, Object> entry : values.entrySet()) {
if (entry.getValue() instanceof List) {
result.put(entry.getKey(), new ArrayList((List) entry.getValue()));
@@ -616,7 +616,7 @@ public class XPathRecordReader {
* seperator or if a sequence of multiple seperator's appear.
*/
private static List<String> splitEscapeQuote(String str) {
- List<String> result = new LinkedList<String>();
+ List<String> result = new LinkedList<>();
String[] ss = str.split("/");
for (int i=0; i<ss.length; i++) { // i=1: skip seperator at start of string
StringBuilder sb = new StringBuilder();
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigNameConstants.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigNameConstants.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigNameConstants.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigNameConstants.java Wed Mar 12 14:39:17 2014
@@ -49,7 +49,7 @@ public class ConfigNameConstants {
public static final Set<String> RESERVED_WORDS;
static{
- Set<String> rw = new HashSet<String>();
+ Set<String> rw = new HashSet<>();
rw.add(IMPORTER_NS);
rw.add(IMPORTER_NS_SHORT);
rw.add("request");
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigParseUtil.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigParseUtil.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigParseUtil.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/ConfigParseUtil.java Wed Mar 12 14:39:17 2014
@@ -41,7 +41,7 @@ public class ConfigParseUtil {
}
public static HashMap<String,String> getAllAttributes(Element e) {
- HashMap<String,String> m = new HashMap<String,String>();
+ HashMap<String,String> m = new HashMap<>();
NamedNodeMap nnm = e.getAttributes();
for (int i = 0; i < nnm.getLength(); i++) {
m.put(nnm.item(i).getNodeName(), nnm.item(i).getNodeValue());
@@ -68,7 +68,7 @@ public class ConfigParseUtil {
}
public static List<Element> getChildNodes(Element e, String byName) {
- List<Element> result = new ArrayList<Element>();
+ List<Element> result = new ArrayList<>();
NodeList l = e.getChildNodes();
for (int i = 0; i < l.getLength(); i++) {
if (e.equals(l.item(i).getParentNode())
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/DIHConfiguration.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/DIHConfiguration.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/DIHConfiguration.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/DIHConfiguration.java Wed Mar 12 14:39:17 2014
@@ -71,7 +71,7 @@ public class DIHConfiguration {
this.deleteQuery = ConfigParseUtil.getStringAttribute(element, "deleteQuery", null);
this.onImportStart = ConfigParseUtil.getStringAttribute(element, "onImportStart", null);
this.onImportEnd = ConfigParseUtil.getStringAttribute(element, "onImportEnd", null);
- List<Entity> modEntities = new ArrayList<Entity>();
+ List<Entity> modEntities = new ArrayList<>();
List<Element> l = ConfigParseUtil.getChildNodes(element, "entity");
boolean docRootFound = false;
for (Element e : l) {
@@ -84,7 +84,7 @@ public class DIHConfiguration {
if(functions==null) {
functions = Collections.emptyList();
}
- List<Map<String, String>> modFunc = new ArrayList<Map<String, String>>(functions.size());
+ List<Map<String, String>> modFunc = new ArrayList<>(functions.size());
for(Map<String, String> f : functions) {
modFunc.add(Collections.unmodifiableMap(f));
}
@@ -119,7 +119,7 @@ public class DIHConfiguration {
}
private Map<String,EntityField> gatherAllFields(DataImporter di, Entity e) {
- Map<String,EntityField> fields = new HashMap<String,EntityField>();
+ Map<String,EntityField> fields = new HashMap<>();
if (e.getFields() != null) {
for (EntityField f : e.getFields()) {
fields.put(f.getName(), f);
@@ -132,7 +132,7 @@ public class DIHConfiguration {
}
private Map<String,SchemaField> loadSchemaFieldMap() {
- Map<String, SchemaField> modLnvsf = new HashMap<String, SchemaField>();
+ Map<String, SchemaField> modLnvsf = new HashMap<>();
for (Map.Entry<String, SchemaField> entry : schema.getFields().entrySet()) {
modLnvsf.put(entry.getKey().toLowerCase(Locale.ROOT), entry.getValue());
}
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Entity.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Entity.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Entity.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Entity.java Wed Mar 12 14:39:17 2014
@@ -83,9 +83,9 @@ public class Entity {
this.allAttributes = Collections.unmodifiableMap(modAttributes);
List<Element> n = ConfigParseUtil.getChildNodes(element, "field");
- List<EntityField> modFields = new ArrayList<EntityField>(n.size());
- Map<String,Set<EntityField>> modColNameVsField = new HashMap<String,Set<EntityField>>();
- List<Map<String,String>> modAllFieldAttributes = new ArrayList<Map<String,String>>();
+ List<EntityField> modFields = new ArrayList<>(n.size());
+ Map<String,Set<EntityField>> modColNameVsField = new HashMap<>();
+ List<Map<String,String>> modAllFieldAttributes = new ArrayList<>();
for (Element elem : n) {
EntityField.Builder fieldBuilder = new EntityField.Builder(elem);
if (config.getSchema() != null) {
@@ -115,7 +115,7 @@ public class Entity {
}
Set<EntityField> fieldSet = modColNameVsField.get(fieldBuilder.column);
if (fieldSet == null) {
- fieldSet = new HashSet<EntityField>();
+ fieldSet = new HashSet<>();
modColNameVsField.put(fieldBuilder.column, fieldSet);
}
fieldBuilder.allAttributes.put("boost", Float
@@ -128,7 +128,7 @@ public class Entity {
fieldSet.add(field);
modFields.add(field);
}
- Map<String,Set<EntityField>> modColNameVsField1 = new HashMap<String,Set<EntityField>>();
+ Map<String,Set<EntityField>> modColNameVsField1 = new HashMap<>();
for (Map.Entry<String,Set<EntityField>> entry : modColNameVsField
.entrySet()) {
if (entry.getValue().size() > 0) {
@@ -161,7 +161,7 @@ public class Entity {
}
pkMappingFromSchema = modPkMappingFromSchema;
n = ConfigParseUtil.getChildNodes(element, "entity");
- List<Entity> modEntities = new ArrayList<Entity>();
+ List<Entity> modEntities = new ArrayList<>();
for (Element elem : n) {
modEntities.add(new Entity((docRootFound || this.docRoot), elem, di, config, this));
}
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/EntityField.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/EntityField.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/EntityField.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/EntityField.java Wed Mar 12 14:39:17 2014
@@ -46,7 +46,7 @@ public class EntityField {
this.multiValued = b.multiValued;
this.dynamicName = b.dynamicName;
this.entity = b.entity;
- this.allAttributes = Collections.unmodifiableMap(new HashMap<String,String>(b.allAttributes));
+ this.allAttributes = Collections.unmodifiableMap(new HashMap<>(b.allAttributes));
}
public String getName() {
@@ -89,7 +89,7 @@ public class EntityField {
public boolean multiValued = false;
public boolean dynamicName = false;
public Entity entity;
- public Map<String, String> allAttributes = new HashMap<String,String>();
+ public Map<String, String> allAttributes = new HashMap<>();
public Builder(Element e) {
this.name = ConfigParseUtil.getStringAttribute(e, DataImporter.NAME, null);
@@ -98,7 +98,7 @@ public class EntityField {
throw new DataImportHandlerException(SEVERE, "Field must have a column attribute");
}
this.boost = Float.parseFloat(ConfigParseUtil.getStringAttribute(e, "boost", "1.0f"));
- this.allAttributes = new HashMap<String, String>(ConfigParseUtil.getAllAttributes(e));
+ this.allAttributes = new HashMap<>(ConfigParseUtil.getAllAttributes(e));
}
public String getNameOrColumn() {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Field.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Field.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Field.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/Field.java Wed Mar 12 14:39:17 2014
@@ -46,7 +46,7 @@ public class Field {
this.multiValued = b.multiValued;
this.dynamicName = b.dynamicName;
this.entity = b.entity;
- this.allAttributes = Collections.unmodifiableMap(new HashMap<String,String>(b.allAttributes));
+ this.allAttributes = Collections.unmodifiableMap(new HashMap<>(b.allAttributes));
}
public String getName() {
@@ -89,7 +89,7 @@ public class Field {
public boolean multiValued = false;
public boolean dynamicName;
public Entity entity;
- public Map<String, String> allAttributes = new HashMap<String,String>();
+ public Map<String, String> allAttributes = new HashMap<>();
public Builder(Element e) {
this.name = ConfigParseUtil.getStringAttribute(e, DataImporter.NAME, null);
@@ -98,7 +98,7 @@ public class Field {
throw new DataImportHandlerException(SEVERE, "Field must have a column attribute");
}
this.boost = Float.parseFloat(ConfigParseUtil.getStringAttribute(e, "boost", "1.0f"));
- this.allAttributes = new HashMap<String, String>(ConfigParseUtil.getAllAttributes(e));
+ this.allAttributes = new HashMap<>(ConfigParseUtil.getAllAttributes(e));
}
public String getNameOrColumn() {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/PropertyWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/PropertyWriter.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/PropertyWriter.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/java/org/apache/solr/handler/dataimport/config/PropertyWriter.java Wed Mar 12 14:39:17 2014
@@ -27,7 +27,7 @@ public class PropertyWriter {
public PropertyWriter(String type, Map<String,String> parameters) {
this.type = type;
- this.parameters = Collections.unmodifiableMap(new HashMap<String,String>(parameters));
+ this.parameters = Collections.unmodifiableMap(new HashMap<>(parameters));
}
public Map<String,String> getParameters() {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHCacheTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHCacheTestCase.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHCacheTestCase.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDIHCacheTestCase.java Wed Mar 12 14:39:17 2014
@@ -42,7 +42,7 @@ public class AbstractDIHCacheTestCase {
protected static final Date Feb21_2011 = new Date(1298268000000l);
protected final String[] fieldTypes = { "INTEGER", "BIGDECIMAL", "STRING", "STRING", "FLOAT", "DATE", "CLOB" };
protected final String[] fieldNames = { "a_id", "PI", "letter", "examples", "a_float", "a_date", "DESCRIPTION" };
- protected List<ControlData> data = new ArrayList<ControlData>();
+ protected List<ControlData> data = new ArrayList<>();
protected Clob APPLE = null;
@Before
@@ -55,7 +55,7 @@ public class AbstractDIHCacheTestCase {
// The first row needs to have all non-null fields,
// otherwise we would have to always send the fieldTypes & fieldNames as CacheProperties when building.
- data = new ArrayList<ControlData>();
+ data = new ArrayList<>();
data.add(new ControlData(new Object[] { new Integer(1), new BigDecimal(Math.PI), "A", "Apple", new Float(1.11), Feb21_2011, APPLE }));
data.add(new ControlData(new Object[] { new Integer(2), new BigDecimal(Math.PI), "B", "Ball", new Float(2.22), Feb21_2011, null }));
data.add(new ControlData(new Object[] { new Integer(4), new BigDecimal(Math.PI), "D", "Dog", new Float(4.44), Feb21_2011, null }));
@@ -102,7 +102,7 @@ public class AbstractDIHCacheTestCase {
}
protected List<ControlData> extractDataInKeyOrder(DIHCache cache, String[] theFieldNames) {
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
Iterator<Map<String, Object>> cacheIter = cache.iterator();
while (cacheIter.hasNext()) {
data.add(mapToObjectArray(cacheIter.next(), theFieldNames));
@@ -114,7 +114,7 @@ public class AbstractDIHCacheTestCase {
//It will look for id's sequentially until one is skipped, then will stop.
protected List<ControlData> extractDataByKeyLookup(DIHCache cache, String[] theFieldNames) {
int recId = 1;
- List<Object[]> data = new ArrayList<Object[]>();
+ List<Object[]> data = new ArrayList<>();
while (true) {
Iterator<Map<String, Object>> listORecs = cache.iterator(recId);
if (listORecs == null) {
@@ -130,7 +130,7 @@ public class AbstractDIHCacheTestCase {
}
protected List<ControlData> listToControlData(List<Object[]> data) {
- List<ControlData> returnData = new ArrayList<ControlData>(data.size());
+ List<ControlData> returnData = new ArrayList<>(data.size());
for (int i = 0; i < data.size(); i++) {
returnData.add(new ControlData(data.get(i)));
}
@@ -147,7 +147,7 @@ public class AbstractDIHCacheTestCase {
protected void compareData(List<ControlData> theControl, List<ControlData> test) {
// The test data should come back primarily in Key order and secondarily in insertion order.
- List<ControlData> control = new ArrayList<ControlData>(theControl);
+ List<ControlData> control = new ArrayList<>(theControl);
Collections.sort(control);
StringBuilder errors = new StringBuilder();
@@ -189,9 +189,9 @@ public class AbstractDIHCacheTestCase {
protected Map<String, Object> controlDataToMap(ControlData cd, String[] theFieldNames, boolean keepOrdered) {
Map<String, Object> rec = null;
if (keepOrdered) {
- rec = new LinkedHashMap<String, Object>();
+ rec = new LinkedHashMap<>();
} else {
- rec = new HashMap<String, Object>();
+ rec = new HashMap<>();
}
for (int i = 0; i < cd.data.length; i++) {
String fieldName = theFieldNames[i];
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractDataImportHandlerTestCase.java Wed Mar 12 14:39:17 2014
@@ -113,7 +113,7 @@ public abstract class AbstractDataImport
* @throws Exception in case of any error
*/
protected void runFullImport(String dataConfig, Map<String, String> extraParams) throws Exception {
- HashMap<String, String> params = new HashMap<String, String>();
+ HashMap<String, String> params = new HashMap<>();
params.put("command", "full-import");
params.put("debug", "on");
params.put("dataConfig", dataConfig);
@@ -174,7 +174,7 @@ public abstract class AbstractDataImport
public static Map<String, String> getField(String col, String type,
String re, String srcCol, String splitBy) {
- HashMap<String, String> vals = new HashMap<String, String>();
+ HashMap<String, String> vals = new HashMap<>();
vals.put("column", col);
vals.put("type", type);
vals.put("regex", re);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/AbstractSqlEntityProcessorTestCase.java Wed Mar 12 14:39:17 2014
@@ -81,7 +81,7 @@ public abstract class AbstractSqlEntityP
}
protected void logPropertiesFile() {
- Map<String,String> init = new HashMap<String,String>();
+ Map<String,String> init = new HashMap<>();
init.put("filename", fileName);
init.put("directory", fileLocation);
SimplePropertiesWriter spw = new SimplePropertiesWriter();
@@ -339,7 +339,7 @@ public abstract class AbstractSqlEntityP
conn = newConnection();
s = conn.createStatement();
rs = s.executeQuery(query);
- List<String> results = new ArrayList<String>();
+ List<String> results = new ArrayList<>();
while (rs.next()) {
results.add(rs.getString(1));
}
@@ -409,9 +409,9 @@ public abstract class AbstractSqlEntityP
public IntChanges modifySomePeople() throws Exception {
underlyingDataModified = true;
int numberToChange = random().nextInt(people.length + 1);
- Set<Integer> changeSet = new HashSet<Integer>();
- Set<Integer> deleteSet = new HashSet<Integer>();
- Set<Integer> addSet = new HashSet<Integer>();
+ Set<Integer> changeSet = new HashSet<>();
+ Set<Integer> deleteSet = new HashSet<>();
+ Set<Integer> addSet = new HashSet<>();
Connection conn = null;
PreparedStatement change = null;
PreparedStatement delete = null;
@@ -484,7 +484,7 @@ public abstract class AbstractSqlEntityP
public String[] modifySomeCountries() throws Exception {
underlyingDataModified = true;
int numberToChange = random().nextInt(countries.length + 1);
- Set<String> changeSet = new HashSet<String>();
+ Set<String> changeSet = new HashSet<>();
Connection conn = null;
PreparedStatement change = null;
// One second in the future ensures a change time after the last import (DIH
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/DestroyCountCache.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/DestroyCountCache.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/DestroyCountCache.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/DestroyCountCache.java Wed Mar 12 14:39:17 2014
@@ -25,7 +25,7 @@ import java.util.Map;
import org.junit.Assert;
public class DestroyCountCache extends SortedMapBackedCache {
- static Map<DIHCache,DIHCache> destroyed = new IdentityHashMap<DIHCache,DIHCache>();
+ static Map<DIHCache,DIHCache> destroyed = new IdentityHashMap<>();
@Override
public void destroy() {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/MockInitialContextFactory.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/MockInitialContextFactory.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/MockInitialContextFactory.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/MockInitialContextFactory.java Wed Mar 12 14:39:17 2014
@@ -28,7 +28,7 @@ import org.easymock.IAnswer;
import org.easymock.IMocksControl;
public class MockInitialContextFactory implements InitialContextFactory {
- private static final Map<String, Object> objects = new HashMap<String, Object>();
+ private static final Map<String, Object> objects = new HashMap<>();
private final IMocksControl mockControl;
private final javax.naming.Context context;
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestBuiltInEvaluators.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestBuiltInEvaluators.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestBuiltInEvaluators.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestBuiltInEvaluators.java Wed Mar 12 14:39:17 2014
@@ -44,7 +44,7 @@ public class TestBuiltInEvaluators exten
super.setUp();
resolver = new VariableResolver();
- sqlTests = new HashMap<String, String>();
+ sqlTests = new HashMap<>();
sqlTests.put("foo\"", "foo\"\"");
sqlTests.put("foo\\", "foo\\\\");
@@ -53,7 +53,7 @@ public class TestBuiltInEvaluators exten
sqlTests.put("'foo\"", "''foo\"\"");
sqlTests.put("\"Albert D'souza\"", "\"\"Albert D''souza\"\"");
- urlTests = new HashMap<String, String>();
+ urlTests = new HashMap<>();
urlTests.put("*:*", URLEncoder.encode("*:*", ENCODING));
urlTests.put("price:[* TO 200]", URLEncoder.encode("price:[* TO 200]",
@@ -78,7 +78,7 @@ public class TestBuiltInEvaluators exten
@Test
public void parseParams() {
- Map<String,Object> m = new HashMap<String,Object>();
+ Map<String,Object> m = new HashMap<>();
m.put("b","B");
VariableResolver vr = new VariableResolver();
vr.addNamespace("a",m);
@@ -97,7 +97,7 @@ public class TestBuiltInEvaluators exten
@Test
public void testEscapeSolrQueryFunction() {
final VariableResolver resolver = new VariableResolver();
- Map<String,Object> m= new HashMap<String,Object>();
+ Map<String,Object> m= new HashMap<>();
m.put("query","c:t");
resolver.setEvaluators(new DataImporter().getEvaluators(Collections.<Map<String,String>>emptyList()));
@@ -147,7 +147,7 @@ public class TestBuiltInEvaluators exten
}
Date d = new Date();
- Map<String,Object> map = new HashMap<String,Object>();
+ Map<String,Object> map = new HashMap<>();
map.put("key", d);
resolver.addNamespace("A", map);
@@ -174,7 +174,7 @@ public class TestBuiltInEvaluators exten
private void runTests(Map<String, String> tests, Evaluator evaluator) {
ContextImpl ctx = new ContextImpl(null, resolver, null, Context.FULL_DUMP, Collections.<String, Object>emptyMap(), null, null);
for (Map.Entry<String, String> entry : tests.entrySet()) {
- Map<String, Object> values = new HashMap<String, Object>();
+ Map<String, Object> values = new HashMap<>();
values.put("key", entry.getKey());
resolver.addNamespace("A", values);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestClobTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestClobTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestClobTransformer.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestClobTransformer.java Wed Mar 12 14:39:17 2014
@@ -35,8 +35,8 @@ import java.util.*;
public class TestClobTransformer extends AbstractDataImportHandlerTestCase {
@Test
public void simple() throws Exception {
- List<Map<String, String>> flds = new ArrayList<Map<String, String>>();
- Map<String, String> f = new HashMap<String, String>();
+ List<Map<String, String>> flds = new ArrayList<>();
+ Map<String, String> f = new HashMap<>();
// <field column="dsc" clob="true" name="description" />
f.put(DataImporter.COLUMN, "dsc");
f.put(ClobTransformer.CLOB, "true");
@@ -44,7 +44,7 @@ public class TestClobTransformer extends
flds.add(f);
Context ctx = getContext(null, new VariableResolver(), null, Context.FULL_DUMP, flds, Collections.EMPTY_MAP);
Transformer t = new ClobTransformer();
- Map<String, Object> row = new HashMap<String, Object>();
+ Map<String, Object> row = new HashMap<>();
Clob clob = (Clob) Proxy.newProxyInstance(this.getClass().getClassLoader(), new Class[]{Clob.class}, new InvocationHandler() {
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDateFormatTransformer.java Wed Mar 12 14:39:17 2014
@@ -34,7 +34,7 @@ public class TestDateFormatTransformer e
@Test
@SuppressWarnings("unchecked")
public void testTransformRow_SingleRow() throws Exception {
- List<Map<String, String>> fields = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> fields = new ArrayList<>();
fields.add(createMap(DataImporter.COLUMN, "lastModified"));
fields.add(createMap(DataImporter.COLUMN,
"dateAdded", RegexTransformer.SRC_COL_NAME, "lastModified",
@@ -57,7 +57,7 @@ public class TestDateFormatTransformer e
@Test
@SuppressWarnings("unchecked")
public void testTransformRow_MultipleRows() throws Exception {
- List<Map<String, String>> fields = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> fields = new ArrayList<>();
fields.add(createMap(DataImporter.COLUMN, "lastModified"));
fields.add(createMap(DataImporter.COLUMN,
"dateAdded", RegexTransformer.SRC_COL_NAME, "lastModified",
@@ -67,8 +67,8 @@ public class TestDateFormatTransformer e
Date now1 = format.parse(format.format(new Date()));
Date now2 = format.parse(format.format(new Date()));
- Map<String,Object> row = new HashMap<String,Object>();
- List<String> list = new ArrayList<String>();
+ Map<String,Object> row = new HashMap<>();
+ List<String> list = new ArrayList<>();
list.add(format.format(now1));
list.add(format.format(now2));
row.put("lastModified", list);
@@ -79,7 +79,7 @@ public class TestDateFormatTransformer e
Context context = getContext(null, resolver,
null, Context.FULL_DUMP, fields, null);
new DateFormatTransformer().transformRow(row, context);
- List<Object> output = new ArrayList<Object>();
+ List<Object> output = new ArrayList<>();
output.add(now1);
output.add(now2);
assertEquals(output, row.get("dateAdded"));
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestDocBuilder.java Wed Mar 12 14:39:17 2014
@@ -95,7 +95,7 @@ public class TestDocBuilder extends Abst
di.loadAndInit(dc_singleEntity);
DIHConfiguration cfg = di.getConfig();
Entity ent = cfg.getEntities().get(0);
- List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> l = new ArrayList<>();
l.add(createMap("id", 1, "desc", "one"));
MockDataSource.setIterator("select * from x", l.iterator());
RequestInfo rp = new RequestInfo(null, createMap("command", "full-import"), null);
@@ -124,7 +124,7 @@ public class TestDocBuilder extends Abst
di.loadAndInit(dc_singleEntity);
DIHConfiguration cfg = di.getConfig();
Entity ent = cfg.getEntities().get(0);
- List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> l = new ArrayList<>();
l.add(createMap("id", 1, "desc", "one"));
MockDataSource.setIterator("select * from x", l.iterator());
RequestInfo rp = new RequestInfo(null, createMap("command", "import"), null);
@@ -154,7 +154,7 @@ public class TestDocBuilder extends Abst
DIHConfiguration cfg = di.getConfig();
Entity ent = cfg.getEntities().get(0);
RequestInfo rp = new RequestInfo(null, createMap("command", "full-import"), null);
- List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> l = new ArrayList<>();
l.add(createMap("id", 1, "desc", "one"));
l.add(createMap("id", 2, "desc", "two"));
l.add(createMap("id", 3, "desc", "three"));
@@ -180,7 +180,7 @@ public class TestDocBuilder extends Abst
}
static class SolrWriterImpl extends SolrWriter {
- List<SolrInputDocument> docs = new ArrayList<SolrInputDocument>();
+ List<SolrInputDocument> docs = new ArrayList<>();
Boolean deleteAllCalled = Boolean.FALSE;
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestEntityProcessorBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestEntityProcessorBase.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestEntityProcessorBase.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestEntityProcessorBase.java Wed Mar 12 14:39:17 2014
@@ -35,8 +35,8 @@ public class TestEntityProcessorBase ext
@Test
public void multiTransformer() {
- List<Map<String, String>> fields = new ArrayList<Map<String, String>>();
- Map<String, String> entity = new HashMap<String, String>();
+ List<Map<String, String>> fields = new ArrayList<>();
+ Map<String, String> entity = new HashMap<>();
entity.put("transformer", T1.class.getName() + "," + T2.class.getName()
+ "," + T3.class.getName());
fields.add(getField("A", null, null, null, null));
@@ -44,7 +44,7 @@ public class TestEntityProcessorBase ext
Context context = getContext(null, null, new MockDataSource(), Context.FULL_DUMP,
fields, entity);
- Map<String, Object> src = new HashMap<String, Object>();
+ Map<String, Object> src = new HashMap<>();
src.put("A", "NA");
src.put("B", "NA");
EntityProcessorWrapper sep = new EntityProcessorWrapper(new SqlEntityProcessor(), null, null);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestErrorHandling.java Wed Mar 12 14:39:17 2014
@@ -83,7 +83,7 @@ public class TestErrorHandling extends A
public void testTransformerErrorContinue() throws Exception {
StringDataSource.xml = wellformedXml;
- List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> rows = new ArrayList<>();
rows.add(createMap("id", "3", "desc", "exception-transformer"));
MockDataSource.setIterator("select * from foo", rows.iterator());
runFullImport(dataConfigWithTransformer);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFieldReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFieldReader.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFieldReader.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFieldReader.java Wed Mar 12 14:39:17 2014
@@ -37,7 +37,7 @@ public class TestFieldReader extends Abs
di.loadAndInit(config);
TestDocBuilder.SolrWriterImpl sw = new TestDocBuilder.SolrWriterImpl();
RequestInfo rp = new RequestInfo(null, createMap("command", "full-import"), null);
- List<Map<String, Object>> l = new ArrayList<Map<String, Object>>();
+ List<Map<String, Object>> l = new ArrayList<>();
l.add(createMap("xml", xml));
MockDataSource.setIterator("select * from a", l.iterator());
di.runCmd(rp, sw);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestFileListEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -51,7 +51,7 @@ public class TestFileListEntityProcessor
new VariableResolver(), null, Context.FULL_DUMP, Collections.EMPTY_LIST, attrs);
FileListEntityProcessor fileListEntityProcessor = new FileListEntityProcessor();
fileListEntityProcessor.init(c);
- List<String> fList = new ArrayList<String>();
+ List<String> fList = new ArrayList<>();
while (true) {
Map<String, Object> f = fileListEntityProcessor.nextRow();
if (f == null)
@@ -93,10 +93,10 @@ public class TestFileListEntityProcessor
FileListEntityProcessor.BIGGER_THAN, String.valueOf(minLength));
List<String> fList = getFiles(null, attrs);
assertEquals(2, fList.size());
- Set<String> l = new HashSet<String>();
+ Set<String> l = new HashSet<>();
l.add(new File(tmpdir, "a.xml").getAbsolutePath());
l.add(new File(tmpdir, "b.xml").getAbsolutePath());
- assertEquals(l, new HashSet<String>(fList));
+ assertEquals(l, new HashSet<>(fList));
attrs = createMap(
FileListEntityProcessor.FILE_NAME, ".*",
FileListEntityProcessor.BASE_DIR, tmpdir.getAbsolutePath(),
@@ -104,7 +104,7 @@ public class TestFileListEntityProcessor
fList = getFiles(null, attrs);
l.clear();
l.add(new File(tmpdir, smallestFile).getAbsolutePath());
- assertEquals(l, new HashSet<String>(fList));
+ assertEquals(l, new HashSet<>(fList));
attrs = createMap(
FileListEntityProcessor.FILE_NAME, ".*",
FileListEntityProcessor.BASE_DIR, tmpdir.getAbsolutePath(),
@@ -112,7 +112,7 @@ public class TestFileListEntityProcessor
VariableResolver resolver = new VariableResolver();
resolver.addNamespace("a", createMap("x", "4"));
fList = getFiles(resolver, attrs);
- assertEquals(l, new HashSet<String>(fList));
+ assertEquals(l, new HashSet<>(fList));
}
@SuppressWarnings("unchecked")
@@ -121,7 +121,7 @@ public class TestFileListEntityProcessor
resolver, null, Context.FULL_DUMP, Collections.EMPTY_LIST, attrs);
FileListEntityProcessor fileListEntityProcessor = new FileListEntityProcessor();
fileListEntityProcessor.init(c);
- List<String> fList = new ArrayList<String>();
+ List<String> fList = new ArrayList<>();
while (true) {
Map<String, Object> f = fileListEntityProcessor.nextRow();
if (f == null)
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestJdbcDataSource.java Wed Mar 12 14:39:17 2014
@@ -49,7 +49,7 @@ public class TestJdbcDataSource extends
private Connection connection;
private IMocksControl mockControl;
private JdbcDataSource jdbcDataSource = new JdbcDataSource();
- List<Map<String, String>> fields = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> fields = new ArrayList<>();
Context context = AbstractDataImportHandlerTestCase.getContext(null, null,
jdbcDataSource, Context.FULL_DUMP, fields, null);
@@ -207,12 +207,12 @@ public class TestJdbcDataSource extends
p.put("user", "root");
p.put("password", "");
- List<Map<String, String>> flds = new ArrayList<Map<String, String>>();
- Map<String, String> f = new HashMap<String, String>();
+ List<Map<String, String>> flds = new ArrayList<>();
+ Map<String, String> f = new HashMap<>();
f.put("column", "trim_id");
f.put("type", "long");
flds.add(f);
- f = new HashMap<String, String>();
+ f = new HashMap<>();
f.put("column", "msrp");
f.put("type", "float");
flds.add(f);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestLineEntityProcessor.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestLineEntityProcessor.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestLineEntityProcessor.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestLineEntityProcessor.java Wed Mar 12 14:39:17 2014
@@ -62,7 +62,7 @@ public class TestLineEntityProcessor ext
/// call the entity processor to the list of lines
if (VERBOSE) System.out.print("\n");
- List<String> fList = new ArrayList<String>();
+ List<String> fList = new ArrayList<>();
while (true) {
Map<String, Object> f = ep.nextRow();
if (f == null) break;
@@ -101,7 +101,7 @@ public class TestLineEntityProcessor ext
ep.init(c);
/// call the entity processor to the list of lines
- List<String> fList = new ArrayList<String>();
+ List<String> fList = new ArrayList<>();
while (true) {
Map<String, Object> f = ep.nextRow();
if (f == null) break;
@@ -139,7 +139,7 @@ public class TestLineEntityProcessor ext
ep.init(c);
/// call the entity processor to walk the directory
- List<String> fList = new ArrayList<String>();
+ List<String> fList = new ArrayList<>();
while (true) {
Map<String, Object> f = ep.nextRow();
if (f == null) break;
@@ -175,7 +175,7 @@ public class TestLineEntityProcessor ext
ep.init(c);
/// call the entity processor to walk the directory
- List<String> fList = new ArrayList<String>();
+ List<String> fList = new ArrayList<>();
while (true) {
Map<String, Object> f = ep.nextRow();
if (f == null) break;
@@ -195,7 +195,7 @@ public class TestLineEntityProcessor ext
String rw, // DIH regex attribute 'replaceWith'
String gn // DIH regex attribute 'groupNames'
) {
- HashMap<String, String> vals = new HashMap<String, String>();
+ HashMap<String, String> vals = new HashMap<>();
vals.put("column", col);
vals.put("type", type);
vals.put("sourceColName", srcCol);
Modified: lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNumberFormatTransformer.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNumberFormatTransformer.java?rev=1576755&r1=1576754&r2=1576755&view=diff
==============================================================================
--- lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNumberFormatTransformer.java (original)
+++ lucene/dev/trunk/solr/contrib/dataimporthandler/src/test/org/apache/solr/handler/dataimport/TestNumberFormatTransformer.java Wed Mar 12 14:39:17 2014
@@ -40,7 +40,7 @@ public class TestNumberFormatTransformer
@Test
public void testTransformRow_SingleNumber() {
char GERMAN_GROUPING_SEP = new DecimalFormatSymbols(Locale.GERMANY).getGroupingSeparator();
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.NUMBER));
l.add(createMap("column", "localizedNum",
@@ -55,13 +55,13 @@ public class TestNumberFormatTransformer
@Test
@SuppressWarnings("unchecked")
public void testTransformRow_MultipleNumbers() throws Exception {
- List<Map<String, String>> fields = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> fields = new ArrayList<>();
fields.add(createMap(DataImporter.COLUMN, "inputs"));
fields.add(createMap(DataImporter.COLUMN,
"outputs", RegexTransformer.SRC_COL_NAME, "inputs",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.NUMBER));
- List<String> inputs = new ArrayList<String>();
+ List<String> inputs = new ArrayList<>();
inputs.add("123" + GROUPING_SEP + "567");
inputs.add("245" + GROUPING_SEP + "678");
Map<String, Object> row = createMap("inputs", inputs);
@@ -72,7 +72,7 @@ public class TestNumberFormatTransformer
Context context = getContext(null, resolver, null, Context.FULL_DUMP, fields, null);
new NumberFormatTransformer().transformRow(row, context);
- List<Long> output = new ArrayList<Long>();
+ List<Long> output = new ArrayList<>();
output.add(new Long(123567));
output.add(new Long(245678));
Map<String, Object> outputRow = createMap("inputs", inputs, "outputs", output);
@@ -83,7 +83,7 @@ public class TestNumberFormatTransformer
@Test(expected = DataImportHandlerException.class)
@SuppressWarnings("unchecked")
public void testTransformRow_InvalidInput1_Number() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.NUMBER));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);
@@ -94,7 +94,7 @@ public class TestNumberFormatTransformer
@Test(expected = DataImportHandlerException.class)
@SuppressWarnings("unchecked")
public void testTransformRow_InvalidInput2_Number() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.NUMBER));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);
@@ -105,7 +105,7 @@ public class TestNumberFormatTransformer
@Test(expected = DataImportHandlerException.class)
@SuppressWarnings("unchecked")
public void testTransformRow_InvalidInput2_Currency() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.CURRENCY));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);
@@ -116,7 +116,7 @@ public class TestNumberFormatTransformer
@Test(expected = DataImportHandlerException.class)
@SuppressWarnings("unchecked")
public void testTransformRow_InvalidInput1_Percent() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.PERCENT));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);
@@ -127,7 +127,7 @@ public class TestNumberFormatTransformer
@Test(expected = DataImportHandlerException.class)
@SuppressWarnings("unchecked")
public void testTransformRow_InvalidInput3_Currency() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.CURRENCY));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);
@@ -138,7 +138,7 @@ public class TestNumberFormatTransformer
@Test(expected = DataImportHandlerException.class)
@SuppressWarnings("unchecked")
public void testTransformRow_InvalidInput3_Number() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.NUMBER));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);
@@ -149,7 +149,7 @@ public class TestNumberFormatTransformer
@Test
@SuppressWarnings("unchecked")
public void testTransformRow_MalformedInput_Number() {
- List<Map<String, String>> l = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> l = new ArrayList<>();
l.add(createMap("column", "num",
NumberFormatTransformer.FORMAT_STYLE, NumberFormatTransformer.NUMBER));
Context c = getContext(null, null, null, Context.FULL_DUMP, l, null);