Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 85375 invoked from network); 21 Aug 2006 11:33:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 21 Aug 2006 11:33:24 -0000 Received: (qmail 38655 invoked by uid 500); 21 Aug 2006 11:33:24 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 38553 invoked by uid 500); 21 Aug 2006 11:33:23 -0000 Mailing-List: contact harmony-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-commits@incubator.apache.org Received: (qmail 38541 invoked by uid 99); 21 Aug 2006 11:33:23 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Aug 2006 04:33:23 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Aug 2006 04:33:23 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 43D537142C9 for ; Mon, 21 Aug 2006 11:30:19 +0000 (GMT) Message-ID: <15524295.1156159819271.JavaMail.jira@brutus> Date: Mon, 21 Aug 2006 04:30:19 -0700 (PDT) From: "Denis Kishenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Commented: (HARMONY-1200) [classlib][net] SocketPermission.implies((Permission) null)) expected false but throws NPE In-Reply-To: <8943479.1155649753904.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-1200?page=comments#action_12429393 ] Denis Kishenko commented on HARMONY-1200: ----------------------------------------- Verified > [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