Author: batosai
Date: 2008-08-14 07:52:53 +0000 (Thu, 14 Aug 2008)
New Revision: 21835

Modified:
   trunk/apps/WoT/src/plugins/WoT/OwnIdentity.java
   trunk/apps/WoT/src/plugins/WoT/WoT.java
Log:
Warnings hunt. If you have an idea for db4o's, please talk.

Modified: trunk/apps/WoT/src/plugins/WoT/OwnIdentity.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/OwnIdentity.java     2008-08-14 07:41:36 UTC 
(rev 21834)
+++ trunk/apps/WoT/src/plugins/WoT/OwnIdentity.java     2008-08-14 07:52:53 UTC 
(rev 21835)
@@ -15,6 +15,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.Map.Entry;

 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -98,10 +99,10 @@
                identity.appendChild(publishTrustListTag);

                // Properties
-               Set set = props.entrySet();
-               Iterator i = set.iterator();
+               Set<Entry<String, String>> set = props.entrySet();
+               Iterator<Entry<String, String>> i = set.iterator();
                while(i.hasNext()){
-                       Map.Entry<String,String> prop = (Map.Entry)i.next();
+                       Map.Entry<String,String> prop = i.next();
                        Element propTag = xmlDoc.createElement("prop");
                        propTag.setAttribute("key", prop.getKey());
                        propTag.setAttribute("value", prop.getValue());
@@ -109,7 +110,7 @@
                }

                // Contexts
-               Iterator i2 = contexts.iterator();
+               Iterator<String> i2 = contexts.iterator();
                while(i2.hasNext()) {
                        String context = (String)i2.next();
                        Element contextTag = xmlDoc.createElement("context");

Modified: trunk/apps/WoT/src/plugins/WoT/WoT.java
===================================================================
--- trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-14 07:41:36 UTC (rev 
21834)
+++ trunk/apps/WoT/src/plugins/WoT/WoT.java     2008-08-14 07:52:53 UTC (rev 
21835)
@@ -195,17 +195,22 @@
                return getIdentityByURI(key);
        }

+       @SuppressWarnings("unchecked")
        private Identity getIdentityByURI(FreenetURI uri) throws 
InvalidParameterException, UnknownIdentityException {

                Query query = db.query();
                query.constrain(Identity.class);
                
query.descend("requestURI").constrain(uri.toString().substring(0, 
uri.toString().indexOf("/")));
+               
+               // This is generating warnings about unchecked conversion.
+               // Google is not my friend on this one, if you have an idea...
                ObjectSet<Identity> result = query.execute();

                if(result.size() == 0) throw new UnknownIdentityException("No 
identity has this request URI ("+uri.toString()+")");
                return result.next();
        }

+       @SuppressWarnings("unchecked")
        public ObjectSet<Score> getIdentitiesByScore (String reference, String 
select) throws InvalidParameterException, MalformedURLException, 
UnknownIdentityException {

                OwnIdentity treeOwner = getOwnIdentityByURI(reference);
@@ -225,6 +230,7 @@
                }
                else throw new InvalidParameterException("Unhandled select 
value ("+select+")");

+               // Same problem here
                return query.execute();
        }
 }


Reply via email to