removes some warnings: unused imports, params

pull/389/head
sgaebel 4 years ago
parent e039a797d2
commit df9ea0a42a

@ -23,6 +23,5 @@
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>

@ -35,7 +35,6 @@ import java.io.IOException;
import java.util.Iterator;
import java.util.Properties;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.peers.Protocol;
import net.yacy.search.Switchboard;

@ -163,7 +163,7 @@ public class FederateSearchManager {
public void search(SearchEvent theSearch) {
if (theSearch != null) {
if (!theSearch.query.isLocal() && !MemoryControl.shortStatus()) {
Set<AbstractFederateSearchConnector> picklist = getBest(theSearch.getQuery());
Set<AbstractFederateSearchConnector> picklist = getBest();
for (AbstractFederateSearchConnector fsc : picklist) {
fsc.search(theSearch);
}
@ -180,7 +180,7 @@ public class FederateSearchManager {
public List<URIMetadataNode> query(QueryParams query) {
if (!query.isLocal() && !MemoryControl.shortStatus()) {
List<URIMetadataNode> sdl = new ArrayList<URIMetadataNode>();
Set<AbstractFederateSearchConnector> picklist = getBest(query);
Set<AbstractFederateSearchConnector> picklist = getBest();
for (AbstractFederateSearchConnector fsc : picklist) {
sdl.addAll(fsc.query(query));
}
@ -279,12 +279,11 @@ public class FederateSearchManager {
}
/**
* Get best systems from configured targets for this search
*
* @param theSearch
* Get best systems from configured targets
*
* @return list of searchtargetconnectors
*/
protected Set<AbstractFederateSearchConnector> getBest(final QueryParams query) {
protected Set<AbstractFederateSearchConnector> getBest() {
HashSet<AbstractFederateSearchConnector> retset = new HashSet<AbstractFederateSearchConnector>();
MultiProtocolURL connectorURL;
for (AbstractFederateSearchConnector fsc : conlist) {

@ -52,10 +52,7 @@ public class FlatJSONResponseWriter implements QueryResponseWriter, EmbeddedSolr
private static final char lb = '\n';
private boolean elasticsearchBulkRequest;
public FlatJSONResponseWriter(boolean elasticsearchBulkRequest) {
this.elasticsearchBulkRequest = elasticsearchBulkRequest;
public FlatJSONResponseWriter() {
}
@Override

@ -261,7 +261,7 @@ public class YaCyDigestScheme extends DigestScheme {
sb.append(checksum).append(':').append(nonce).append(':').append(cnonce);
a1 = sb.toString();*/
sb.append(pwd).append(':').append(nonce).append(':').append(cnonce);
hasha1 = encode(digester.digest(EncodingUtils.getBytes(sb.toString(), charset)));;
hasha1 = encode(digester.digest(EncodingUtils.getBytes(sb.toString(), charset)));
} else {
// unq(username-value) ":" unq(realm-value) ":" passwd
/* Modification for YaCy Digest Authentication : the pwd value is already the result of MD5(userName:realm:password)

@ -32,7 +32,6 @@ import java.util.Map;
import java.util.TreeMap;
import net.yacy.cora.storage.Configuration.Entry;
import net.yacy.cora.storage.Files;
/**
* this class reads configuration attributes as a list of keywords from a list

@ -237,6 +237,8 @@ public class Html2Image {
* @param proxy the eventual proxy address to use. Can be null.
* @param destination the destination PDF file that should be written. Must not
* be null.
* @param userAgent TODO: implement
* @param acceptLanguage TODO: implement
* @param ignoreErrors when true wkhtmltopdf is instructed to ignore load errors
* @param maxSeconds the maximum time in seconds to wait for the wkhtmltopdf
* dedicated process termination. Beyond this limit the

@ -673,6 +673,7 @@ public class DateDetection {
/**
* get all dates in the text
* @param text
* @param timezoneOffset TODO: implement
* @return a set of dates, ordered by time. first date in the ordered set is the oldest time.
*/
public static LinkedHashSet<Date> parse(String text, int timezoneOffset) {
@ -692,7 +693,7 @@ public class DateDetection {
* This is used by the query parser for query date modifier on:, from: or to:
*
* @param text
* @param timezoneOffset
* @param timezoneOffset TODO: implement
* @return determined date or null
*/
public static Date parseLine(final String text, final int timezoneOffset) {

@ -28,7 +28,6 @@ import java.util.Set;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.document.Parser.Failure;
public interface Parser {

@ -59,6 +59,7 @@ public class ResumptionToken extends TreeMap<String, String> {
private final DigestURL source;
@SuppressWarnings("unused")
public ResumptionToken(final DigestURL source, final byte[] b) throws IOException {
super((Collator) insensitiveCollator.clone());
this.source = source;

@ -252,7 +252,7 @@ public final class TransformerWriter extends Writer {
// we have a new tag
if (opening) {
// case (2):
return filterTagOpening(tagname, content, quotechar);
return filterTagOpening(tagname, content);
}
// its a close tag where no should be
@ -267,7 +267,7 @@ public final class TransformerWriter extends Writer {
// it's a tag! which one?
if (opening) {
// case (5): the opening should not be here. But we keep the order anyway
this.tagStack.lastElement().content.append(filterTagOpening(tagname, content, quotechar));
this.tagStack.lastElement().content.append(filterTagOpening(tagname, content));
return new char[0];
}
@ -281,7 +281,7 @@ public final class TransformerWriter extends Writer {
return filterTagCloseing(quotechar);
}
private char[] filterTagOpening(final String tagname, final char[] content, final char quotechar) {
private char[] filterTagOpening(final String tagname, final char[] content) {
final CharBuffer charBuffer = new CharBuffer(ContentScraper.MAX_DOCSIZE, content);
ContentScraper.Tag tag = new ContentScraper.Tag(tagname, charBuffer.propParser());
charBuffer.close();

@ -31,15 +31,14 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.protocol.RequestHeader;
import net.yacy.cora.protocol.ResponseHeader;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.retrieval.Response;
import net.yacy.http.servlets.YaCyDefaultServlet;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
/**
* jetty http handler serves pages from cache if available and valid

@ -254,6 +254,7 @@ public class ThreadDump extends HashMap<ThreadDump.StackTrace, List<String>> imp
}
}
final String threaddump = sb.toString();
@SuppressWarnings("unlikely-arg-type")
List<String> threads = get(threaddump);
if (threads == null) threads = new ArrayList<String>();
Thread.State state = null;

@ -1044,8 +1044,10 @@ public final class HTTPDProxyHandler {
String orgHostName = orgurl.getHost();
if (orgHostName == null) orgHostName = "unknown";
orgHostName = orgHostName.toLowerCase(Locale.ROOT);
String orgHostPath = orgurl.getPath(); if (orgHostPath == null) orgHostPath = "";
String orgHostArgs = orgurl.getSearchpart();; if (orgHostArgs == null) orgHostArgs = "";
String orgHostPath = orgurl.getPath();
if (orgHostPath == null) orgHostPath = "";
String orgHostArgs = orgurl.getSearchpart();
if (orgHostArgs == null) orgHostArgs = "";
if (orgHostArgs.length() > 0) orgHostArgs = "?" + orgHostArgs;
detailedErrorMsgMap.put("hostName", orgHostName);

@ -43,7 +43,7 @@ import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.util.ConcurrentLog;
public class gzip {
public class Gzip {
private final static ConcurrentLog logger = new ConcurrentLog("GZIP");
@ -109,7 +109,7 @@ public class gzip {
return UTF8.String(gunzip(in));
}
public static byte[] gzip(byte[] b) {
public static byte[] gzip(final byte[] b) {
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream(b.length);
GZIPOutputStream out = new GZIPOutputStream(baos, Math.min(65536, b.length)){{def.setLevel(Deflater.BEST_COMPRESSION);}};
@ -215,13 +215,13 @@ public class gzip {
} else {
target = s[2];
}
gzip.gunzipFile(new File(s[1]), new File(target));
Gzip.gunzipFile(new File(s[1]), new File(target));
System.exit(0);
}
if ((s.length < 1) || (s.length > 2)) {help(); System.exit(-1);}
String target;
if (s.length == 1) target = s[0] + ".gz"; else target = s[1];
gzip.gzipFile((s[0]), target);
Gzip.gzipFile((s[0]), target);
System.exit(0);
}

@ -75,7 +75,7 @@ public class crypt {
if (key == null) { key = "NULL"; }
switch (method) {
case 'b' : return "b|" + Base64Order.enhancedCoder.encodeString(content);
case 'z' : return "z|" + Base64Order.enhancedCoder.encode(gzip.gzipString(content));
case 'z' : return "z|" + Base64Order.enhancedCoder.encode(Gzip.gzipString(content));
case 'p' : return "p|" + content;
default : return null;
}
@ -94,7 +94,7 @@ public class crypt {
}
case 'z':
try {
return gzip.gunzipString(Base64Order.enhancedCoder.decode(encoded.substring(2)));
return Gzip.gunzipString(Base64Order.enhancedCoder.decode(encoded.substring(2)));
} catch (final Exception e) {
ConcurrentLog.logException(e);
return null;

@ -380,7 +380,7 @@ public class cryptbig {
//System.out.println("Salt=" + salt);
final cryptbig c = new cryptbig(key, salt);
boolean gzFlag = true;
byte[] gz = gzip.gzipString(s);
byte[] gz = Gzip.gzipString(s);
if (gz.length > s.length()) {
// revert compression
try {
@ -406,7 +406,7 @@ public class cryptbig {
if (b64dec == null) return null; // error in input string (inconsistency)
final byte[] dec = c.decryptArray(b64dec);
if (dec == null) return null;
if (gzFlag) return gzip.gunzipString(dec);
if (gzFlag) return Gzip.gunzipString(dec);
return UTF8.String(dec);
}
@ -429,7 +429,7 @@ public class cryptbig {
if (key == null) key = "NULL";
if (method == 'p') return "p|" + content;
if (method == 'b') return "b|" + Base64Order.enhancedCoder.encodeString(content);
if (method == 'z') return "z|" + Base64Order.enhancedCoder.encode(gzip.gzipString(content));
if (method == 'z') return "z|" + Base64Order.enhancedCoder.encode(Gzip.gzipString(content));
if (method == 'c') return "c|" + scrambleString(key, content);
return null;
}
@ -441,7 +441,7 @@ public class cryptbig {
encoded = encoded.substring(2);
if (method == 'p') return encoded;
if (method == 'b') return Base64Order.enhancedCoder.decodeString(encoded);
if (method == 'z') return gzip.gunzipString(Base64Order.enhancedCoder.decode(encoded));
if (method == 'z') return Gzip.gunzipString(Base64Order.enhancedCoder.decode(encoded));
if (method == 'c') return descrambleString(key, encoded);
return null;
}

@ -54,10 +54,8 @@ import com.google.common.io.Files;
import net.yacy.cora.date.GenericFormatter;
import net.yacy.cora.document.encoding.UTF8;
import net.yacy.cora.document.id.DigestURL;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.federate.solr.instance.RemoteInstance;
import net.yacy.cora.federate.yacy.CacheStrategy;
import net.yacy.cora.order.Digest;
import net.yacy.cora.protocol.ClientIdentification;
import net.yacy.cora.protocol.ConnectionInfo;
@ -66,10 +64,8 @@ import net.yacy.cora.protocol.TimeoutRequest;
import net.yacy.cora.protocol.http.HTTPClient;
import net.yacy.cora.sorting.Array;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.crawler.retrieval.Response;
import net.yacy.data.TransactionManager;
import net.yacy.data.Translator;
import net.yacy.document.Document;
import net.yacy.gui.YaCyApp;
import net.yacy.gui.framework.Browser;
import net.yacy.http.Jetty9HttpServerImpl;

@ -45,7 +45,7 @@ public class NewsPoolTest {
Seed myseed = new Seed(ASCII.String(hash), dna);
// generate 3 test messages and simulate publish (put in outgoing queuq
Map<String, String> msgattr = new HashMap();
Map<String, String> msgattr = new HashMap<>();
for (int i = 1; i <= 3; i++) {
msgattr.put("text", "message " + Integer.toString(i));
msgattr.put("#", Integer.toString(i)); // use id modificator attribute (to generate unique id for same creation second, used in id)
@ -53,7 +53,7 @@ public class NewsPoolTest {
}
// test the distribution process
Set<String> resultmemory = new LinkedHashSet();
Set<String> resultmemory = new LinkedHashSet<>();
NewsDB.Record rec = newsPool.myPublication();
int cnt = 3 * 30 + 5; // end condition (3 msg * 30 distribution) for loop (+5 > as expected count)
while (rec != null && cnt > 0) {

Loading…
Cancel
Save