commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1429892 - in /commons/proper/collections/trunk/src: main/java/org/apache/commons/collections/trie/ test/java/org/apache/commons/collections/ test/java/org/apache/commons/collections/collection/ test/java/org/apache/commons/collections/map/
Date Mon, 07 Jan 2013 16:51:35 GMT
Author: ggregory
Date: Mon Jan  7 16:51:34 2013
New Revision: 1429892

URL: http://svn.apache.org/viewvc?rev=1429892&view=rev
Log:
Remove unnecessary casts.

Modified:
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/CharArrayKeyAnalyzer.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/StringKeyAnalyzer.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/collection/IndexedCollectionTest.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/map/MultiValueMapTest.java

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java?rev=1429892&r1=1429891&r2=1429892&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/ByteArrayKeyAnalyzer.java
Mon Jan  7 16:51:34 2013
@@ -105,8 +105,8 @@ public class ByteArrayKeyAnalyzer extend
             return false;
         }
         
-        int index = (int)(keyBitIndex / LENGTH);
-        int bit = (int)(keyBitIndex % LENGTH);
+        int index = keyBitIndex / LENGTH;
+        int bit = keyBitIndex % LENGTH;
         return (key[index] & mask(bit)) != 0;
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/CharArrayKeyAnalyzer.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/CharArrayKeyAnalyzer.java?rev=1429892&r1=1429891&r2=1429892&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/CharArrayKeyAnalyzer.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/CharArrayKeyAnalyzer.java
Mon Jan  7 16:51:34 2013
@@ -131,8 +131,8 @@ public class CharArrayKeyAnalyzer extend
             return false;
         }
 
-        int index = (int)(bitIndex / LENGTH);
-        int bit = (int)(bitIndex % LENGTH);
+        int index = bitIndex / LENGTH;
+        int bit = bitIndex % LENGTH;
 
         return (key[index] & mask(bit)) != 0;
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/StringKeyAnalyzer.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/StringKeyAnalyzer.java?rev=1429892&r1=1429891&r2=1429892&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/StringKeyAnalyzer.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections/trie/StringKeyAnalyzer.java
Mon Jan  7 16:51:34 2013
@@ -131,8 +131,8 @@ public class StringKeyAnalyzer extends A
             return false;
         }
         
-        int index = (int)(bitIndex / LENGTH);
-        int bit = (int)(bitIndex % LENGTH);
+        int index = bitIndex / LENGTH;
+        int bit = bitIndex % LENGTH;
         
         return (key.charAt(index) & mask(bit)) != 0;
     }

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java?rev=1429892&r1=1429891&r2=1429892&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java
(original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/CollectionUtilsTest.java
Mon Jan  7 16:51:34 2013
@@ -914,7 +914,7 @@ public class CollectionUtilsTest extends
         ints.add(3);
         Iterable<Integer> iterable = ints;
         assertTrue(CollectionUtils.filter(iterable, EQUALS_TWO));
-        assertEquals(1, (int) ints.size());
+        assertEquals(1, ints.size());
         assertEquals(2, (int) ints.get(0));
     }
 

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/collection/IndexedCollectionTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/collection/IndexedCollectionTest.java?rev=1429892&r1=1429891&r2=1429892&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/collection/IndexedCollectionTest.java
(original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/collection/IndexedCollectionTest.java
Mon Jan  7 16:51:34 2013
@@ -68,7 +68,7 @@ public class IndexedCollectionTest exten
 
     @Override
     public String[] getFullElements() {
-        return (String[]) new String[] { "1", "3", "5", "7", "2", "4", "6" };
+        return new String[] { "1", "3", "5", "7", "2", "4", "6" };
     }
 
     @Override

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/map/MultiValueMapTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/map/MultiValueMapTest.java?rev=1429892&r1=1429891&r2=1429892&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/map/MultiValueMapTest.java
(original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections/map/MultiValueMapTest.java
Mon Jan  7 16:51:34 2013
@@ -78,13 +78,13 @@ public class MultiValueMapTest<K, V> ext
     @SuppressWarnings("unchecked")
     public void testKeyContainsValue() {
         final MultiValueMap<K, V> map = createTestMap(HashSet.class);
-        assertTrue(map.containsValue((K) "one", "uno"));
-        assertTrue(map.containsValue((K) "one", "un"));
-        assertTrue(map.containsValue((K) "two", "dos"));
-        assertTrue(map.containsValue((K) "two", "deux"));
-        assertTrue(map.containsValue((K) "three", "tres"));
-        assertTrue(map.containsValue((K) "three", "trois"));
-        assertFalse(map.containsValue((K) "four", "quatro"));
+        assertTrue(map.containsValue("one", "uno"));
+        assertTrue(map.containsValue("one", "un"));
+        assertTrue(map.containsValue("two", "dos"));
+        assertTrue(map.containsValue("two", "deux"));
+        assertTrue(map.containsValue("three", "tres"));
+        assertTrue(map.containsValue("three", "trois"));
+        assertFalse(map.containsValue("four", "quatro"));
     }
 
     @SuppressWarnings("unchecked")



Mime
View raw message