jdk/src/share/classes/java/lang/SecurityManager.java
changeset 22581 e868cde95050
parent 22342 c83795c442b7
child 24367 705490680527
--- a/jdk/src/share/classes/java/lang/SecurityManager.java	Mon Jan 27 17:13:16 2014 +0400
+++ b/jdk/src/share/classes/java/lang/SecurityManager.java	Mon Jan 27 14:29:37 2014 +0100
@@ -1476,10 +1476,10 @@
         /*
          * Traverse the list of packages, check for any matches.
          */
-        for (int i = 0; i < pkgs.length; i++) {
-            if (pkg.startsWith(pkgs[i]) || pkgs[i].equals(pkg + ".")) {
+        for (String restrictedPkg : pkgs) {
+            if (pkg.startsWith(restrictedPkg) || restrictedPkg.equals(pkg + ".")) {
                 checkPermission(
-                    new RuntimePermission("accessClassInPackage."+pkg));
+                    new RuntimePermission("accessClassInPackage." + pkg));
                 break;  // No need to continue; only need to check this once
             }
         }
@@ -1544,10 +1544,10 @@
         /*
          * Traverse the list of packages, check for any matches.
          */
-        for (int i = 0; i < pkgs.length; i++) {
-            if (pkg.startsWith(pkgs[i]) || pkgs[i].equals(pkg + ".")) {
+        for (String restrictedPkg : pkgs) {
+            if (pkg.startsWith(restrictedPkg) || restrictedPkg.equals(pkg + ".")) {
                 checkPermission(
-                    new RuntimePermission("defineClassInPackage."+pkg));
+                    new RuntimePermission("defineClassInPackage." + pkg));
                 break; // No need to continue; only need to check this once
             }
         }