Author: batosai
Date: 2008-08-20 17:27:15 +0000 (Wed, 20 Aug 2008)
New Revision: 22052

Modified:
   trunk/apps/WoT/src/plugins/WoT/WoT.java
Log:
Stop updating ownIdentities score in their own trustList. Might help with bug 
#2517

Modified: trunk/apps/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-20 09:10:57 UTC (rev 
22051)
+++ trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-20 17:27:15 UTC (rev 
22052)
@@ -56,6 +56,8 @@
                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
                        Trust oldTrust = trustResult.next();
@@ -100,6 +102,8 @@
                int newCapacity = 0;
                boolean hasNegativeTrust = false;

+               // Don't update in our own trustTree
+               if(identity == treeOwner) return;

                // We get the trust given by the tree owner (because if it is 
negative, the identity has no capacity)
                Trust trust = identity.getTrust(treeOwner, db);
@@ -127,7 +131,7 @@

                }

-               if(newRank == -1) { // None of the trusters had capacity in 
that trust tree, this identity isn't either
+               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                                
@@ -162,6 +166,8 @@
                }
                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.



Reply via email to