harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r556563 - in /harmony/enhanced/classlib/trunk/modules/security/src: main/java/common/java/security/ test/api/java/tests/api/java/security/ test/impl/java/org/apache/harmony/security/tests/java/security/
Date Mon, 16 Jul 2007 09:05:59 GMT
Author: leoli
Date: Mon Jul 16 02:05:57 2007
New Revision: 556563

URL: http://svn.apache.org/viewvc?view=rev&rev=556563
Log:
Fix bug of java.security.PermissionCollection.toString().(1 new line should be appended at
the end. 2. one space instead of two as seperator between permissions.).

Modified:
    harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/PermissionCollectionTest.java
    harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/PermissionCollection_ImplTest.java

Modified: harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java?view=diff&rev=556563&r1=556562&r2=556563
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/main/java/common/java/security/PermissionCollection.java
Mon Jul 16 02:05:57 2007
@@ -122,8 +122,8 @@
         StringBuffer result = new StringBuffer(totalLength).append(superStr)
             .append(" ("); //$NON-NLS-1$
         for (int i = 0; i < esize; i++) {
-            result.append("\n  ").append(elist.get(i).toString()); //$NON-NLS-1$
+            result.append("\n ").append(elist.get(i).toString()); //$NON-NLS-1$
         }
-        return result.append("\n)").toString(); //$NON-NLS-1$
+        return result.append("\n)\n").toString(); //$NON-NLS-1$
     }
 }

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/PermissionCollectionTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/PermissionCollectionTest.java?view=diff&rev=556563&r1=556562&r2=556563
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/PermissionCollectionTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/api/java/tests/api/java/security/PermissionCollectionTest.java
Mon Jul 16 02:05:57 2007
@@ -222,6 +222,7 @@
                 "testing permissionCollection-isREadOnly");
         assertNotNull("toString should have returned a string of elements",
                 permi.newPermissionCollection().toString());
+        assertTrue(permi.newPermissionCollection().toString().endsWith("\n"));
     }
 
     // FIXME move me to Support_Resources

Modified: harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/PermissionCollection_ImplTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/PermissionCollection_ImplTest.java?view=diff&rev=556563&r1=556562&r2=556563
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/PermissionCollection_ImplTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/PermissionCollection_ImplTest.java
Mon Jul 16 02:05:57 2007
@@ -64,12 +64,12 @@
         // no elements
         PermissionCollection pc = new RealPermissionCollection(null);
         String superString = pc.getClass().getName() + "@" + Integer.toHexString(pc.hashCode());
-        assertEquals("no elements", superString + " (\n)", pc.toString());
+        assertEquals("no elements", superString + " (\n)\n", pc.toString());
         
         // several elements
         pc = new RealPermissionCollection(Arrays.asList(new Object[]{"aaa", "bbb", "ccc"}));
         superString = pc.getClass().getName() + "@" + Integer.toHexString(pc.hashCode());
-        assertEquals("several elements", superString + " (\n  aaa\n  bbb\n  ccc\n)", pc.toString());
+        assertEquals("several elements", superString + " (\n aaa\n bbb\n ccc\n)\n", pc.toString());
     }
    
 }



Mime
View raw message