harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From regi...@apache.org
Subject svn commit: r817189 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
Date Mon, 21 Sep 2009 08:20:25 GMT
Author: regisxu
Date: Mon Sep 21 08:20:21 2009
New Revision: 817189

URL: http://svn.apache.org/viewvc?rev=817189&view=rev
Log:
replace StringTokenizer with String.split in SecurityManager.java

StringTokenizer is not recommended by spec.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java?rev=817189&r1=817188&r2=817189&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/SecurityManager.java
Mon Sep 21 08:20:21 2009
@@ -405,9 +405,8 @@
                 .getSecurityProperty(property));
         if (list != null) {
             int plen = pkg.length();
-            StringTokenizer tokenizer = new StringTokenizer(list, ", "); //$NON-NLS-1$
-            while (tokenizer.hasMoreTokens()) {
-                String token = tokenizer.nextToken();
+            String[] tokens = list.split(", *"); //$NON-NLS-1$
+            for (String token : tokens) {
                 int tlen = token.length();
                 if (plen > tlen
                         && pkg.startsWith(token)



Mime
View raw message