Author: batosai
Date: 2008-08-13 14:48:57 +0000 (Wed, 13 Aug 2008)
New Revision: 21810

Modified:
   trunk/apps/WoT/src/plugins/WoT/WoT.java
Log:
Refactor

Modified: trunk/apps/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-13 14:28:08 UTC (rev 
21809)
+++ trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-13 14:48:57 UTC (rev 
21810)
@@ -175,6 +175,13 @@
                return identities.size() - getNbOwnIdentities();
        }

+       public OwnIdentity getOwnIdentityByURI(String uri) throws 
InvalidParameterException, MalformedURLException, UnknownIdentityException {
+               
+               Identity identity = getIdentityByURI(uri);
+               if(!(identity instanceof OwnIdentity)) throw new 
InvalidParameterException("It's not an OwnIdentity");
+               return (OwnIdentity) identity;
+       }
+       
        public Identity getIdentityByURI(String uri) throws 
InvalidParameterException, MalformedURLException, UnknownIdentityException {

                FreenetURI key = new FreenetURI(uri);
@@ -196,9 +203,7 @@

        public ObjectSet<Score> getIdentitiesByScore (String reference, String 
select) throws InvalidParameterException, MalformedURLException, 
UnknownIdentityException {

-               Identity identity = getIdentityByURI(reference);
-               if(!(identity instanceof OwnIdentity)) throw new 
InvalidParameterException("It's not an OwnIdentity");
-               OwnIdentity treeOwner = (OwnIdentity) identity;
+               OwnIdentity treeOwner = getOwnIdentityByURI(reference);

                Query query = db.query();
                query.constrain(Score.class);


Reply via email to