Summary
The specification of the constructor java.net.SocketPermission(String, String) has to be updated to specify that it can throw NullPointerException or IllegalArgumentException.
Problem
Currently, the throws section of the constructor is completely omitted. On the other hand, constructors of other subclasses of java.security.Permission (for example, java.io.FilePermission, javax.smartcardio.CardPermission, java.net.URLPermission) do specify what exceptions they can throw.
Solution
The constructor SocketPermission(String, String) will be specified to throw IllegalArgumentException if format of the argument host is invalid or if the argument action is empty, malformed or contains unexpected values. It will also be specified that NullPointerException is thrown if any arguments are null.
Specification
+ *
+ * @throws NullPointerException if any parameters are null
+ * @throws IllegalArgumentException if the format of {@code host} is
+ * invalid, or if the {@code action} string is empty, malformed, or
+ * contains an action other than the specified possible actions
*/
public SocketPermission(String host, String action) {
- csr of
-
JDK-8230407 SocketPermission and FilePermission action list allows leading comma
-
- Closed
-