You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Paulex Yang (JIRA)" <ji...@apache.org> on 2006/08/16 09:04:15 UTC
[jira] Resolved: (HARMONY-1200) [classlib][net]
SocketPermission.implies((Permission) null)) expected false but throws NPE
[ http://issues.apache.org/jira/browse/HARMONY-1200?page=all ]
Paulex Yang resolved HARMONY-1200.
----------------------------------
Resolution: Fixed
Denis, patch applied at revision r431849, thanks a lot for this enhancement, please verify that the problem is fully fixed as you expected.
BTW, I merged the regression test into the SocketPermissionTest
> [classlib][net] SocketPermission.implies((Permission) null)) expected false but throws NPE
> ------------------------------------------------------------------------------------------
>
> Key: HARMONY-1200
> URL: http://issues.apache.org/jira/browse/HARMONY-1200
> Project: Harmony
> Issue Type: Bug
> Components: Classlib
> Reporter: Denis Kishenko
> Assigned To: Paulex Yang
> Attachments: 1200-SocketPermission.patch
>
>
> According spec and RI behavior SocketPermission.implies((Permission) null)) should return FALSE while Harmony throws NPE
> =================== Spec =====================
> Checks if this socket permission object "implies" the specified permission.
> More specifically, this method first ensures that all of the following are true (and returns false if any of them are not):
> p is an instanceof SocketPermission,
> p's actions are a proper subset of this object's actions, and
> p's port range is included in this port range. Note: port range is ignored when p only contains the action, 'resolve'.
> Then implies checks each of the following, in order, and for each returns true if the stated condition is true:
> If this object was initialized with a single IP address and one of p's IP addresses is equal to this object's IP address.
> If this object is a wildcard domain (such as *.sun.com), and p's canonical name (the name without any preceding *) ends with this object's canonical host name. For example, *.sun.com implies *.eng.sun.com..
> If this object was not initialized with a single IP address, and one of this object's IP addresses equals one of p's IP addresses.
> If this canonical name equals p's canonical name.
> If none of the above are true, implies returns FALSE.
> ===================== Test =====================
> import java.net.*;
> import java.security.Permission;
> public class bug9446 {
> public static void main (String[] args) {
> try {
> SocketPermission sp = new SocketPermission("harmony", "connect");
> System.out.println("res=" + sp.implies((Permission) null));
> } catch (Exception e) {
> e.printStackTrace();
> }
> }
> }
> ================== Output ======================
> RI
> res=false
> Harmony
> java.lang.NullPointerException
> at java.net.SocketPermission.implies(SocketPermission.java:242)
> at bug9446.main(bug9446.java:9)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira