summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lq/Doubles.java2
-rw-r--r--src/lq/ImportQuotes.java8
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lq/Doubles.java b/src/lq/Doubles.java
index 551e65a..a24a9ec 100644
--- a/src/lq/Doubles.java
+++ b/src/lq/Doubles.java
@@ -1,7 +1,7 @@
package lq;
public class Doubles {
- public static final int signum(Double d) {
+ public static final int signum(double d) {
if (d < 0.0) {
return -1;
}
diff --git a/src/lq/ImportQuotes.java b/src/lq/ImportQuotes.java
index 634521c..fc365a0 100644
--- a/src/lq/ImportQuotes.java
+++ b/src/lq/ImportQuotes.java
@@ -59,7 +59,13 @@ public class ImportQuotes extends HttpServlet {
}
else {
int importId = Integer.parseInt(importIdString);
- pm.makePersistent(quotes.get(importId));
+ Quote q = quotes.get(importId);
+ pm.makePersistent(q);
+ for (Vote v : votes) {
+ if (v.getQuoteId() == q.getId()) {
+ pm.makePersistent(v);
+ }
+ }
resp.getWriter().println("There are " + quotes.size() +
" quotes in the old db.");
resp.getWriter().println("Quote " + importId + " imported.");