projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add unit test for delete image page
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
web
/
SearchPage.java
diff --git
a/src/main/java/net/pterodactylus/sone/web/SearchPage.java
b/src/main/java/net/pterodactylus/sone/web/SearchPage.java
index
7ec7f9f
..
8b444a7
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/SearchPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/SearchPage.java
@@
-1,5
+1,5
@@
/*
/*
- * Sone - SearchPage.java - Copyright © 2010–201
5
David Roden
+ * Sone - SearchPage.java - Copyright © 2010–201
6
David Roden
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-101,8
+101,7
@@
public class SearchPage extends SoneTemplatePage {
*/
@Override
@SuppressWarnings("synthetic-access")
*/
@Override
@SuppressWarnings("synthetic-access")
- protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
- super.processTemplate(request, templateContext);
+ protected void handleRequest(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
String query = request.getHttpRequest().getParam("query").trim();
if (query.length() == 0) {
throw new RedirectException("index.html");
String query = request.getHttpRequest().getParam("query").trim();
if (query.length() == 0) {
throw new RedirectException("index.html");
@@
-593,7
+592,7
@@
public class SearchPage extends SoneTemplatePage {
@Override
public int compare(Hit<?> leftHit, Hit<?> rightHit) {
@Override
public int compare(Hit<?> leftHit, Hit<?> rightHit) {
- return
(rightHit.getScore() < leftHit.getScore()) ? -1 : ((rightHit.getScore() > leftHit.getScore()) ? 1 : 0
);
+ return
Double.compare(rightHit.getScore(), leftHit.getScore()
);
}
};
}
};