james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r718018 [3/3] - in /james/mime4j/trunk: ./ examples/src/java/org/apache/james/mime4j/samples/tree/ src/main/java/org/apache/james/mime4j/decoder/ src/main/java/org/apache/james/mime4j/descriptor/ src/main/java/org/apache/james/mime4j/field/...
Date Sun, 16 Nov 2008 12:56:22 GMT
Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/StringArrayMapTest.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/StringArrayMapTest.java?rev=718018&r1=718017&r2=718018&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/StringArrayMapTest.java
(original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/StringArrayMapTest.java
Sun Nov 16 04:56:20 2008
@@ -47,19 +47,19 @@
      * Test for {@link StringArrayMap#getMap()}.
      */
     public void testGetMap() {
-        final Map map = getSampleMap().getMap();
-        final List keys = new ArrayList(map.keySet());
+        final Map<String, String[]> map = getSampleMap().getMap();
+        final List<String> keys = new ArrayList<String>(map.keySet());
         assertEquals(keys.size(), 3);
         Collections.sort(keys);
         assertEquals("foo", keys.get(0));
         assertEquals("xs", keys.get(1));
         assertEquals("xyz", keys.get(2));
-        final String[] foo = (String[]) map.get("foo");
+        final String[] foo = map.get("foo");
         assertEquals("bAr", foo[0]);
-        final String[] xs = (String[]) map.get("xs");
+        final String[] xs = map.get("xs");
         assertEquals("1", xs[0]);
         assertEquals("2", xs[1]);
-        final String[] xyz = (String[]) map.get("xyz");
+        final String[] xyz = map.get("xyz");
         assertEquals(3, xyz.length);
         assertEquals("a", xyz[0]);
         assertEquals("B", xyz[1]);
@@ -82,7 +82,7 @@
      * Test case for {@link StringArrayMap#getNames()}.
      */
     public void testGetNames() {
-        final Enumeration names = getSampleMap().getNames();
+        final Enumeration<String> names = getSampleMap().getNames();
         assertEquals(new String[]{"foo", "xs", "xyz"}, names);
     }
 
@@ -129,8 +129,8 @@
         assertNull(map.getValues("xz"));
     }
 
-    private void assertEquals(String[] pArray, Enumeration pEnum) {
-        final List list = new ArrayList();
+    private void assertEquals(String[] pArray, Enumeration<String> pEnum) {
+        final List<String> list = new ArrayList<String>();
         while (pEnum.hasMoreElements()) {
             list.add(pEnum.nextElement());
         }

Modified: james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java
URL: http://svn.apache.org/viewvc/james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java?rev=718018&r1=718017&r2=718018&view=diff
==============================================================================
--- james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java
(original)
+++ james/mime4j/trunk/src/test/java/org/apache/james/mime4j/util/TestByteArrayBuffer.java
Sun Nov 16 04:56:20 2008
@@ -133,8 +133,8 @@
         assertEquals(4, buffer.capacity()); 
         
         byte[] tmp = new byte[] { 1, 127, -1, -128, 1, -2};
-        for (int i = 0; i < tmp.length; i++) {
-            buffer.append(tmp[i]);
+        for (byte b : tmp) {
+            buffer.append(b);
         }
         assertEquals(8, buffer.capacity()); 
         assertEquals(6, buffer.length());



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message