X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSearchPage.java;h=691453d63621f46a060c7f03d0a4bba9d3f3b8a7;hb=927de326e0af0f11a27b3444f4e25b0796c877db;hp=a4da9f4c83b2e8b550e0a1157ab513c61deb0f5b;hpb=480691a26222e035e53bda56029524e160fdf898;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index a4da9f4..691453d 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -111,7 +111,7 @@ public class SearchPage extends SoneTemplatePage { throw new RedirectException("index.html"); } - Set sones = webInterface.getCore().getSones(); + Collection sones = webInterface.getCore().getSones(); Set> soneHits = getHits(sones, phrases, SoneStringGenerator.COMPLETE_GENERATOR); Set> postHits; @@ -168,7 +168,7 @@ public class SearchPage extends SoneTemplatePage { * The string generator for the objects * @return The hits for the given phrases */ - private Set> getHits(Collection objects, List phrases, StringGenerator stringGenerator) { + private static Set> getHits(Collection objects, List phrases, StringGenerator stringGenerator) { Set> hits = new HashSet>(); for (T object : objects) { String objectString = stringGenerator.generateString(object); @@ -189,7 +189,7 @@ public class SearchPage extends SoneTemplatePage { * The query to parse * @return The parsed phrases */ - private List parseSearchPhrases(String query) { + private static List parseSearchPhrases(String query) { List parsedPhrases = null; try { parsedPhrases = StringEscaper.parseLine(query); @@ -229,7 +229,7 @@ public class SearchPage extends SoneTemplatePage { * The expression to search * @return The score of the expression */ - private double calculateScore(List phrases, String expression) { + private static double calculateScore(List phrases, String expression) { logger.log(Level.FINEST, String.format("Calculating Score for “%s”…", expression)); double optionalHits = 0; double requiredHits = 0;