X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FSearchPage.java;h=54b6f49ec74652c417ff96a6b25685e9440b7b7d;hp=832f9d9b86b8b2fb0f1c403f0a5aab0a61d2180e;hb=c9e306ac8e3ada846e87a0cc256a20fc148f381c;hpb=43a21f859e9fec31096c1540148bdd44a8e3702f diff --git a/src/main/java/net/pterodactylus/sone/web/SearchPage.java b/src/main/java/net/pterodactylus/sone/web/SearchPage.java index 832f9d9..54b6f49 100644 --- a/src/main/java/net/pterodactylus/sone/web/SearchPage.java +++ b/src/main/java/net/pterodactylus/sone/web/SearchPage.java @@ -67,6 +67,7 @@ public class SearchPage extends SoneTemplatePage { /** Short-term cache. */ private final Cache, Set>> hitCache = new MemoryCache, Set>>(new ValueRetriever, Set>>() { + @Override @SuppressWarnings("synthetic-access") public CacheItem>> retrieve(List phrases) throws CacheException { Set posts = new HashSet(); @@ -229,7 +230,7 @@ public class SearchPage extends SoneTemplatePage { * @return The score of the expression */ private double calculateScore(List phrases, String expression) { - logger.log(Level.FINEST, "Calculating Score for “%s”…", expression); + logger.log(Level.FINEST, String.format("Calculating Score for “%s”…", expression)); double optionalHits = 0; double requiredHits = 0; int forbiddenHits = 0; @@ -249,10 +250,10 @@ public class SearchPage extends SoneTemplatePage { } score += Math.pow(1 - position / (double) expression.length(), 2); index = position + phraseString.length(); - logger.log(Level.FINEST, "Got hit at position %d.", position); + logger.log(Level.FINEST, String.format("Got hit at position %d.", position)); ++matches; } - logger.log(Level.FINEST, "Score: %f", score); + logger.log(Level.FINEST, String.format("Score: %f", score)); if (matches == 0) { continue; }