Author: batosai
Date: 2008-08-22 17:13:19 +0000 (Fri, 22 Aug 2008)
New Revision: 22101
Modified:
trunk/apps/WoT/src/plugins/WoT/WoT.java
Log:
Maybe fixed OwnIdentities disappearing problems.
Modified: trunk/apps/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoT.java 2008-08-22 17:11:36 UTC (rev
22100)
+++ trunk/apps/WoT/src/plugins/WoT/WoT.java 2008-08-22 17:13:19 UTC (rev
22101)
@@ -55,8 +55,6 @@
boolean changedTrustValue = false;
boolean changedComment = false;
-
- System.out.println(newTrust);
ObjectSet<Trust> trustResult = db.queryByExample(new
Trust(newTrust.getTruster(), newTrust.getTrustee(), 0));
if(trustResult.size() != 0) { // We are updating a existing
trust relationship
@@ -131,17 +129,20 @@
}
- if(newRank == -1 && !(identity instanceof OwnIdentity)) { //
None of the trusters had capacity in that trust tree, this identity isn't either
- try {
- score = identity.getScore(treeOwner, db);
- db.delete(score); // We get this identity out
of this trust tree
- }catch (NotInTrustTreeException e) {
- // Nothing to do
- }
+ if(newRank == -1) { // None of the trusters had capacity in
that trust tree, this identity isn't either
+ if(!(identity instanceof OwnIdentity)) {
+ try {
+ score = identity.getScore(treeOwner,
db);
+ db.delete(score); // We get this
identity out of this trust tree
+ }catch (NotInTrustTreeException e) {
+ // Nothing to do
+ }
+ }
return;
}
- else newRank++; // We don't want to give the trustee the same
rank as the truster, right ?
+ if(newRank != -1) newRank++; // We don't want to give the
trustee the same rank as the truster, right ?
+
if((newScore > 0) && !hasNegativeTrust) {
if(newRank >= capacities.length) {
newCapacity = capacities[capacities.length - 1];
@@ -166,8 +167,6 @@
}
score.setScore(newScore);
- System.out.println(score);
-
db.store(score);
// We don't commit here because this method is going to be
called *many* times while parsing a trust list.