-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b125
-
Verified
URLPermission p1 = new URLPermission("wss://www.foo.com/-", ":X-Foo");
URLPermission p2 = new URLPermission("wss://www.foo.com/", "");
System.out.println(p1.implies(p2));
results in:
$ java Test
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:658)
at java.util.ArrayList.get(ArrayList.java:431)
at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
at java.net.URLPermission.implies(URLPermission.java:267)
at Test.main(Test.java:9)
It's not expecting an empty list of methods in the policy permission (p1 in the example).
An empty list in the policy to be consistent with the spec should only imply a permission with an empty list.
URLPermission p2 = new URLPermission("wss://www.foo.com/", "");
System.out.println(p1.implies(p2));
results in:
$ java Test
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(ArrayList.java:658)
at java.util.ArrayList.get(ArrayList.java:431)
at java.util.Collections$UnmodifiableList.get(Collections.java:1309)
at java.net.URLPermission.implies(URLPermission.java:267)
at Test.main(Test.java:9)
It's not expecting an empty list of methods in the policy permission (p1 in the example).
An empty list in the policy to be consistent with the spec should only imply a permission with an empty list.