mirror of https://github.com/apache/lucene.git
SOLR-135: import/warning cleanup for classes in org.apache.solr.common
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@547109 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
54bdcdc4cc
commit
e03f25801f
|
@ -27,6 +27,7 @@ public class AppendedSolrParams extends DefaultSolrParams {
|
|||
super(main, extra);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParams(String param) {
|
||||
String[] main = params.getParams(param);
|
||||
String[] extra = defaults.getParams(param);
|
||||
|
@ -42,6 +43,7 @@ public class AppendedSolrParams extends DefaultSolrParams {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{main("+params+"),extra("+defaults+")}";
|
||||
}
|
||||
|
|
|
@ -34,16 +34,19 @@ public class DefaultSolrParams extends SolrParams {
|
|||
this.defaults = defaults;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(String param) {
|
||||
String val = params.get(param);
|
||||
return val!=null ? val : defaults.get(param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParams(String param) {
|
||||
String[] vals = params.getParams(param);
|
||||
return vals!=null ? vals : defaults.getParams(param);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Iterator<String> getParameterNamesIterator() {
|
||||
final IteratorChain<String> c = new IteratorChain<String>();
|
||||
c.addIterator(defaults.getParameterNamesIterator());
|
||||
|
@ -51,6 +54,7 @@ public class DefaultSolrParams extends SolrParams {
|
|||
return c;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "{params("+params+"),defaults("+defaults+")}";
|
||||
}
|
||||
|
|
|
@ -17,27 +17,8 @@
|
|||
|
||||
package org.apache.solr.common.params;
|
||||
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.apache.solr.common.util.NamedList;
|
||||
import org.apache.solr.core.SolrCore;
|
||||
import org.apache.solr.core.SolrInfoMBean;
|
||||
|
||||
import org.apache.solr.util.StrUtils;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Handler;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.regex.Pattern;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -34,21 +34,25 @@ public class MapSolrParams extends SolrParams {
|
|||
this.map = map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(String name) {
|
||||
return map.get(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParams(String name) {
|
||||
String val = map.get(name);
|
||||
return val==null ? null : new String[]{val};
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Iterator<String> getParameterNamesIterator() {
|
||||
return map.keySet().iterator();
|
||||
}
|
||||
|
||||
public Map<String,String> getMap() { return map; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
try {
|
||||
|
|
|
@ -47,21 +47,25 @@ public class MultiMapSolrParams extends SolrParams {
|
|||
this.map = map;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(String name) {
|
||||
String[] arr = map.get(name);
|
||||
return arr==null ? null : arr[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getParams(String name) {
|
||||
return map.get(name);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Iterator<String> getParameterNamesIterator() {
|
||||
return map.keySet().iterator();
|
||||
}
|
||||
|
||||
public Map<String,String[]> getMap() { return map; }
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(128);
|
||||
try {
|
||||
|
|
|
@ -21,8 +21,6 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
/**
|
||||
* @author ryan
|
||||
* @version $Id$
|
||||
|
@ -52,7 +50,7 @@ public interface ContentStream {
|
|||
* </pre>
|
||||
*
|
||||
* Only the first call to <code>getStream()</code> or <code>getReader()</code>
|
||||
* is gaurenteed to work. The runtime behavior for aditional calls is undefined.
|
||||
* is guaranteed to work. The runtime behavior for additional calls is undefined.
|
||||
*/
|
||||
InputStream getStream() throws IOException;
|
||||
|
||||
|
@ -70,7 +68,7 @@ public interface ContentStream {
|
|||
* </pre>
|
||||
*
|
||||
* Only the first call to <code>getStream()</code> or <code>getReader()</code>
|
||||
* is gaurenteed to work. The runtime behavior for aditional calls is undefined.
|
||||
* is guaranteed to work. The runtime behavior for additional calls is undefined.
|
||||
*/
|
||||
Reader getReader() throws IOException;
|
||||
}
|
||||
|
|
|
@ -110,9 +110,10 @@ public abstract class ContentStreamBase implements ContentStream
|
|||
}
|
||||
|
||||
/**
|
||||
* If an charset is defined (by the contentType) ues that, otherwise
|
||||
* If an charset is defined (by the contentType) use that, otherwise
|
||||
* use a file reader
|
||||
*/
|
||||
@Override
|
||||
public Reader getReader() throws IOException {
|
||||
String charset = getCharsetFromContentType( contentType );
|
||||
return charset == null
|
||||
|
@ -143,9 +144,10 @@ public abstract class ContentStreamBase implements ContentStream
|
|||
}
|
||||
|
||||
/**
|
||||
* If an charset is defined (by the contentType) ues that, otherwise
|
||||
* If an charset is defined (by the contentType) use that, otherwise
|
||||
* use a StringReader
|
||||
*/
|
||||
@Override
|
||||
public Reader getReader() throws IOException {
|
||||
String charset = getCharsetFromContentType( contentType );
|
||||
return charset == null
|
||||
|
|
|
@ -17,18 +17,16 @@
|
|||
|
||||
package org.apache.solr.common.util;
|
||||
|
||||
import org.w3c.dom.Element;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.solr.common.SolrException;
|
||||
import org.w3c.dom.NamedNodeMap;
|
||||
import org.w3c.dom.Node;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.apache.solr.common.SolrException;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* @author yonik
|
||||
|
@ -116,6 +114,7 @@ public class DOMUtil {
|
|||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static void addToNamedList(Node nd, NamedList nlst, List arr) {
|
||||
// Nodes often include whitespace, etc... so just return if this
|
||||
// is not an Element.
|
||||
|
|
|
@ -53,6 +53,7 @@ public class SimpleOrderedMap<T> extends NamedList<T> {
|
|||
super(nameValuePairs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SimpleOrderedMap<T> clone() {
|
||||
ArrayList newList = new ArrayList(nvPairs.size());
|
||||
newList.addAll(nvPairs);
|
||||
|
|
Loading…
Reference in New Issue