You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2009/10/27 09:57:27 UTC

svn commit: r830097 - in /incubator/pivot/trunk/core: src/org/apache/pivot/beans/ src/org/apache/pivot/collections/ src/org/apache/pivot/serialization/ test/org/apache/pivot/serialization/test/

Author: smartini
Date: Tue Oct 27 08:57:26 2009
New Revision: 830097

URL: http://svn.apache.org/viewvc?rev=830097&view=rev
Log:
fixed some eclipse warnings

Modified:
    incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java
    incubator/pivot/trunk/core/src/org/apache/pivot/collections/HashMap.java
    incubator/pivot/trunk/core/src/org/apache/pivot/collections/LinkedList.java
    incubator/pivot/trunk/core/src/org/apache/pivot/collections/MapList.java
    incubator/pivot/trunk/core/src/org/apache/pivot/serialization/CSVSerializer.java
    incubator/pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java
    incubator/pivot/trunk/core/test/org/apache/pivot/serialization/test/CSVSerializerTest.java

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java Tue Oct 27 08:57:26 2009
@@ -396,9 +396,9 @@
 
                 if (cause instanceof RuntimeException) {
                     throw (RuntimeException)cause;
-                } else {
-                    throw new RuntimeException(cause);
                 }
+
+                throw new RuntimeException(cause);
             }
         }
 

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/collections/HashMap.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/collections/HashMap.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/collections/HashMap.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/collections/HashMap.java Tue Oct 27 08:57:26 2009
@@ -110,7 +110,7 @@
     }
 
     public HashMap(Pair<K, V>... entries) {
-        this(Math.max((int)((float)entries.length / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_CAPACITY));
+        this(Math.max((int)(entries.length / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_CAPACITY));
 
         for (int i = 0; i < entries.length; i++) {
             Pair<K, V> entry = entries[i];
@@ -119,7 +119,7 @@
     }
 
     public HashMap(Map<K, V> map) {
-        this(Math.max((int)((float)map.getCount() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_CAPACITY));
+        this(Math.max((int)(map.getCount() / DEFAULT_LOAD_FACTOR) + 1, DEFAULT_CAPACITY));
 
         for (K key : map) {
             put(key, map.get(key));
@@ -191,7 +191,7 @@
             count++;
 
             int capacity = getCapacity();
-            if (count > (int)((float)capacity * loadFactor)) {
+            if (count > (int)(capacity * loadFactor)) {
                 rehash(capacity * 2);
             }
 
@@ -340,7 +340,7 @@
         } else {
             if (keys == null) {
                 // Populate key list
-                ArrayList<K> keys = new ArrayList<K>((int)((float)getCapacity() * loadFactor));
+                ArrayList<K> keys = new ArrayList<K>((int)(getCapacity() * loadFactor));
                 for (K key : this) {
                     keys.add(key);
                 }

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/collections/LinkedList.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/collections/LinkedList.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/collections/LinkedList.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/collections/LinkedList.java Tue Oct 27 08:57:26 2009
@@ -137,7 +137,7 @@
                 if (index == 0) {
                     // Insert at head
                     next = first;
-                    previous = null;
+                    // previous = null;  // previous has already this value
                 } else if (index < length) {
                     if (forward) {
                         // Insert after current
@@ -150,7 +150,7 @@
                     }
                 } else {
                     // Insert at tail
-                    next = null;
+                    // next = null;  // next has already this value
                     previous = last;
                 }
 
@@ -395,9 +395,9 @@
             if (nodeIterator.next() == item) {
                 nodeIterator.remove();
                 break;
-            } else {
-                index++;
             }
+
+            index++;
         }
 
         if (!nodeIterator.hasNext()) {

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/collections/MapList.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/collections/MapList.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/collections/MapList.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/collections/MapList.java Tue Oct 27 08:57:26 2009
@@ -161,9 +161,7 @@
                 previousSource.getMapListeners().remove(mapHandler);
             }
 
-            if (source != null) {
                 source.getMapListeners().add(mapHandler);
-            }
 
             // Update source
             this.source = source;

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/serialization/CSVSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/serialization/CSVSerializer.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/serialization/CSVSerializer.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/serialization/CSVSerializer.java Tue Oct 27 08:57:26 2009
@@ -442,7 +442,7 @@
      * @param writer
      * The writer to which data will be written.
      */
-    @SuppressWarnings({"unchecked"})
+    @SuppressWarnings({"unchecked", "unused"})
     public void writeObject(List<?> items, Writer writer)
         throws IOException, SerializationException {
         if (items == null) {

Modified: incubator/pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/serialization/JSONSerializer.java Tue Oct 27 08:57:26 2009
@@ -313,6 +313,7 @@
         return stringBuilder.toString();
     }
 
+    @SuppressWarnings("unused")
     private Number readNumber(Reader reader)
         throws IOException, SerializationException {
         Number number = null;

Modified: incubator/pivot/trunk/core/test/org/apache/pivot/serialization/test/CSVSerializerTest.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/test/org/apache/pivot/serialization/test/CSVSerializerTest.java?rev=830097&r1=830096&r2=830097&view=diff
==============================================================================
--- incubator/pivot/trunk/core/test/org/apache/pivot/serialization/test/CSVSerializerTest.java (original)
+++ incubator/pivot/trunk/core/test/org/apache/pivot/serialization/test/CSVSerializerTest.java Tue Oct 27 08:57:26 2009
@@ -233,6 +233,7 @@
         assertEquals("a,\"\nb\n\",c\r\n", writer.toString());
     }
 
+    @SuppressWarnings("unused")
     @Test
     public void testStreamReader() throws IOException, SerializationException {
         // TODO