projects
/
Sone.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c8d2fc
)
Move getSones() method to Sone provider interface.
author
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:43:37 +0000
(06:43 +0100)
committer
David ‘Bombe’ Roden
<bombe@pterodactylus.net>
Tue, 29 Jan 2013 05:52:42 +0000
(06:52 +0100)
src/main/java/net/pterodactylus/sone/core/Core.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/database/SoneProvider.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/sone/web/SearchPage.java
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/sone/core/Core.java
b/src/main/java/net/pterodactylus/sone/core/Core.java
index
4d39c10
..
de6ba55
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/core/Core.java
+++ b/
src/main/java/net/pterodactylus/sone/core/Core.java
@@
-347,11
+347,10
@@
public class Core extends AbstractService implements SoneProvider, PostProvider,
}
/**
}
/**
- * Returns all Sones, remote and local.
- *
- * @return All Sones
+ * {@inheritDocs}
*/
*/
- public Set<Sone> getSones() {
+ @Override
+ public Collection<Sone> getSones() {
synchronized (sones) {
return Collections.unmodifiableCollection(sones.values());
}
synchronized (sones) {
return Collections.unmodifiableCollection(sones.values());
}
diff --git
a/src/main/java/net/pterodactylus/sone/database/SoneProvider.java
b/src/main/java/net/pterodactylus/sone/database/SoneProvider.java
index
bbe0abf
..
f484aaf
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/database/SoneProvider.java
+++ b/
src/main/java/net/pterodactylus/sone/database/SoneProvider.java
@@
-17,6
+17,8
@@
package net.pterodactylus.sone.database;
package net.pterodactylus.sone.database;
+import java.util.Collection;
+
import net.pterodactylus.sone.data.Sone;
import com.google.common.base.Optional;
import net.pterodactylus.sone.data.Sone;
import com.google.common.base.Optional;
@@
-38,4
+40,11
@@
public interface SoneProvider {
*/
public Optional<Sone> getSone(String soneId);
*/
public Optional<Sone> getSone(String soneId);
+ /**
+ * Returns all Sones.
+ *
+ * @return All Sones
+ */
+ public Collection<Sone> getSones();
+
}
}
diff --git
a/src/main/java/net/pterodactylus/sone/web/SearchPage.java
b/src/main/java/net/pterodactylus/sone/web/SearchPage.java
index
320e7cd
..
01a5ed0
100644
(file)
--- a/
src/main/java/net/pterodactylus/sone/web/SearchPage.java
+++ b/
src/main/java/net/pterodactylus/sone/web/SearchPage.java
@@
-131,7
+131,7
@@
public class SearchPage extends SoneTemplatePage {
redirectIfNotNull(getImageId(phrase), "imageBrowser.html?image=");
}
redirectIfNotNull(getImageId(phrase), "imageBrowser.html?image=");
}
-
Set
<Sone> sones = webInterface.getCore().getSones();
+
Collection
<Sone> sones = webInterface.getCore().getSones();
Collection<Hit<Sone>> soneHits = getHits(sones, phrases, SoneStringGenerator.COMPLETE_GENERATOR);
Collection<Hit<Post>> postHits = hitCache.getUnchecked(phrases);
Collection<Hit<Sone>> soneHits = getHits(sones, phrases, SoneStringGenerator.COMPLETE_GENERATOR);
Collection<Hit<Post>> postHits = hitCache.getUnchecked(phrases);