From imperius-dev-returncourtneybowers@example.com Mon May 18 14:11:13 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 6323 invoked from network); 18 May 2009 14:11:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 18 May 2009 14:11:12 -0000 Received: (qmail 69346 invoked by uid 500); 18 May 2009 14:11:12 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 69303 invoked by uid 500); 18 May 2009 14:11:12 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 69258 invoked by uid 99); 18 May 2009 14:11:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 14:11:09 +0000 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e8.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 14:10:59 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [83.161.120.155]) by e8.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4IE0atT003645 for <courtneybowers@example.com>; Mon, 18 May 2009 10:00:36 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [83.161.120.155]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4IEAbOO257140 for <courtneybowers@example.com>; Mon, 18 May 2009 10:10:37 -0400 Received: from d01av03.pok.ibm.com (loopback [83.161.120.155]) by d01av03.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4IEAbvI026051 for <courtneybowers@example.com>; Mon, 18 May 2009 10:10:37 -0400 Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [83.161.120.155]) by d01av03.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4IEAbVQ026048 for <courtneybowers@example.com>; Mon, 18 May 2009 10:10:37 -0400 To: courtneybowers@example.com MIME-Version: 1.0 Subject: Overloaded java methods X-KeepSent: A1170780:69DF359C-852575BA:004D6B0F; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 HF105 April 10, 2008 From: David Wood <courtneybowers@example.com> Message-ID: <courtneybowers@example.com> Date: Mon, 18 May 2009 10:10:36 -0400 X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 8.5|December 05, 2008) at 05/18/2009 10:10:37, Serialize complete at 05/18/2009 10:10:37 Content-Type: multipart/alternative; boundary="=_alternative 004DBECE852575BA_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 004DBECE852575BA_= Content-Type: text/plain; charset="US-ASCII" All, Per the following discussion on the user mailing list, to which there was agreement, The Java binding for SPL is currently somewhat limited in that we can't use overloaded methods in the SPL policy. This seems to have arisen because CIM-SPL does not use overloading. Given that we have a Java binding, it seems to make sense to extend Imperius to support Java overloading. BTW, this is a bug submitted as Imperius-23 ( https://issues.apache.org/jira/browse/IMPERIUS-23). What do people think? As identified in Imperius-23,the symbol table gets multiple requests to store the 'getProperty' method with the key 'getProperty' (w/o the parameters). This keeps over writing the last method that was in the map. The map eventually gets merged into an SPLSymbolTable which only provides a getSymbol(String ). We have at least two options: Change the keys so they include the information from the parameter list (probably best to provide a static MethodSymbol.getKey(classname, methodname, paramlist) so we don't have classname + "." + methodname + paramelist sprinkled all over the place). Change the symbol table(s) so they store multiple instances for a given key. Thoughts? David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) --=_alternative 004DBECE852575BA_=-- From imperius-dev-returncourtneybowers@example.com Mon May 18 22:46:34 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 38248 invoked from network); 18 May 2009 22:46:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 18 May 2009 22:46:34 -0000 Received: (qmail 58639 invoked by uid 500); 18 May 2009 22:46:34 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 58618 invoked by uid 500); 18 May 2009 22:46:34 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 58607 invoked by uid 99); 18 May 2009 22:46:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 22:46:34 +0000 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e33.co.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 May 2009 22:46:21 +0000 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [83.161.120.155]) by e33.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4IMi9iq030573 for <courtneybowers@example.com>; Mon, 18 May 2009 16:44:09 -0600 Received: from d03av04.boulder.ibm.com (d03av04.boulder.ibm.com [83.161.120.155]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4IMk0bG206850 for <courtneybowers@example.com>; Mon, 18 May 2009 16:46:00 -0600 Received: from d03av04.boulder.ibm.com (loopback [83.161.120.155]) by d03av04.boulder.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4IMjx66012653 for <courtneybowers@example.com>; Mon, 18 May 2009 16:45:59 -0600 Received: from d03nm118.boulder.ibm.com (d03nm118.boulder.ibm.com [83.161.120.155]) by d03av04.boulder.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4IMjxY1012648 for <courtneybowers@example.com>; Mon, 18 May 2009 16:45:59 -0600 In-Reply-To: <courtneybowers@example.com> References: <courtneybowers@example.com> To: courtneybowers@example.com MIME-Version: 1.0 Subject: Re: Overloaded java methods X-KeepSent: 89858385:0D75219A-852575BA:007CF1BD; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 HF105 April 10, 2008 From: Neeraj Joshi <courtneybowers@example.com> Message-ID: <courtneybowers@example.com> Date: Mon, 18 May 2009 18:45:58 -0400 X-MIMETrack: Serialize by Router on D03NM118/03/M/IBM(Release 8.5|December 05, 2008) at 05/18/2009 16:45:58, Serialize complete at 05/18/2009 16:45:58 Content-Type: multipart/alternative; boundary="=_alternative 007D198F852575BA_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 007D198F852575BA_= Content-Type: text/plain; charset="US-ASCII" Hey David, I would prefer generating a unique key using the getKey method as you described I agree it will make the code cleaner by eliminating "class"."method" that is pervasive today. Thanks Neeraj ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "The light at the end of the tunnel...may be you" Neeraj Joshi WebSphere XD - Compute Grid AIM, IBM Apache Imperius - http://incubator.apache.org/imperius ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: David Wood/Watson/IBM@IBMUS To: courtneybowers@example.com Date: 05/18/2009 10:11 AM Subject: Overloaded java methods All, Per the following discussion on the user mailing list, to which there was agreement, The Java binding for SPL is currently somewhat limited in that we can't use overloaded methods in the SPL policy. This seems to have arisen because CIM-SPL does not use overloading. Given that we have a Java binding, it seems to make sense to extend Imperius to support Java overloading. BTW, this is a bug submitted as Imperius-23 ( https://issues.apache.org/jira/browse/IMPERIUS-23). What do people think? As identified in Imperius-23,the symbol table gets multiple requests to store the 'getProperty' method with the key 'getProperty' (w/o the parameters). This keeps over writing the last method that was in the map. The map eventually gets merged into an SPLSymbolTable which only provides a getSymbol(String ). We have at least two options: Change the keys so they include the information from the parameter list (probably best to provide a static MethodSymbol.getKey(classname, methodname, paramlist) so we don't have classname + "." + methodname + paramelist sprinkled all over the place). Change the symbol table(s) so they store multiple instances for a given key. Thoughts? David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) --=_alternative 007D198F852575BA_=-- From imperius-dev-returncourtneybowers@example.com Wed May 27 00:27:57 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 8191 invoked from network); 27 May 2009 00:27:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 27 May 2009 00:27:57 -0000 Received: (qmail 20609 invoked by uid 500); 27 May 2009 00:28:10 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 20576 invoked by uid 500); 27 May 2009 00:28:10 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 20566 invoked by uid 99); 27 May 2009 00:28:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 00:28:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 00:28:06 +0000 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 92EE8234C04B for <courtneybowers@example.com>; Tue, 26 May 2009 17:27:45 -0700 (PDT) Message-ID: <1494134494.1243384065601.JavaMail.jira@brutus> Date: Tue, 26 May 2009 17:27:45 -0700 (PDT) From: "David Wood (JIRA)" <courtneybowers@example.com> To: courtneybowers@example.com Subject: [jira] Created: (IMPERIUS-28) byte[] method return type does not match formal parameter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org byte[] method return type does not match formal parameter --------------------------------------------------------- Key: IMPERIUS-28 URL: https://issues.apache.org/jira/browse/IMPERIUS-28 Project: Imperius Issue Type: Bug Environment: Windows, Java 1.5 Reporter: David Wood Assignee: Bill Stoddard It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program includes a policy that passes the byte[] return value of a method to another method that expects the same. This gives the following message: May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 : Formal and passed parameter types don't match for method takeByteArray Formal and passed parameter types don't match for method takeByteArray May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile SEVERE: Error encountered while parsing tree Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encountered while parsing courtneybowers@example.com(PolicyParserImpl.java:166) at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalPolicyObject(PolicyParserImpl.java:96) at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.java:55) I've attached both the Java program and the ByteArrayFactory interface that is used in the policy (also found in the Java file). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. From imperius-dev-returncourtneybowers@example.com Wed May 27 00:29:57 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 8625 invoked from network); 27 May 2009 00:29:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 27 May 2009 00:29:57 -0000 Received: (qmail 22209 invoked by uid 500); 27 May 2009 00:30:09 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 22175 invoked by uid 500); 27 May 2009 00:30:09 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 22165 invoked by uid 99); 27 May 2009 00:30:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 00:30:09 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 00:30:06 +0000 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 9B070234C1E9 for <courtneybowers@example.com>; Tue, 26 May 2009 17:29:45 -0700 (PDT) Message-ID: <66445616.1243384185634.JavaMail.jira@brutus> Date: Tue, 26 May 2009 17:29:45 -0700 (PDT) From: "David Wood (JIRA)" <courtneybowers@example.com> To: courtneybowers@example.com Subject: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter In-Reply-To: <1494134494.1243384065601.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IMPERIUS-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-28: ------------------------------- Attachment: ByteArrayFactory.java PolicyParser.java > byte[] method return type does not match formal parameter > --------------------------------------------------------- > > Key: IMPERIUS-28 > URL: https://issues.apache.org/jira/browse/IMPERIUS-28 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5 > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: ByteArrayFactory.java, PolicyParser.java > > Original Estimate: 96h > Remaining Estimate: 96h > > It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program includes a policy that passes the byte[] return value of a method to another method that expects the same. This gives the following message: > May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary > SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 : Formal and passed parameter types don't match for method takeByteArray > Formal and passed parameter types don't match for method takeByteArray > May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile > SEVERE: Error encountered while parsing tree > Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encountered while parsing tree > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile(PolicyParserImpl.java:166) > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalPolicyObject(PolicyParserImpl.java:96) > at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.java:55) > I've attached both the Java program and the ByteArrayFactory interface that is used in the policy (also found in the Java file). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. From imperius-dev-returncourtneybowers@example.com Wed May 27 15:52:55 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 89479 invoked from network); 27 May 2009 15:52:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 27 May 2009 15:52:55 -0000 Received: (qmail 75572 invoked by uid 500); 27 May 2009 15:53:08 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 75543 invoked by uid 500); 27 May 2009 15:53:08 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 75533 invoked by uid 99); 27 May 2009 15:53:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 15:53:07 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 15:53:05 +0000 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id B193429A0018 for <courtneybowers@example.com>; Wed, 27 May 2009 08:52:45 -0700 (PDT) Message-ID: <189668197.1243439565726.JavaMail.jira@brutus> Date: Wed, 27 May 2009 08:52:45 -0700 (PDT) From: "David Wood (JIRA)" <courtneybowers@example.com> To: courtneybowers@example.com Subject: [jira] Updated: (IMPERIUS-23) Infinite loop, and then parse error. In-Reply-To: <1198400512.1236116336294.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/IMPERIUS-23?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-23: ------------------------------- Attachment: Imperius23.java This Imperius23.java file reproduces the problem and generates the following error message. Number of Formal and passed parameters don't match for method getProperty > Infinite loop, and then parse error. > ------------------------------------ > > Key: IMPERIUS-23 > URL: https://issues.apache.org/jira/browse/IMPERIUS-23 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5. > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: Imperius23.java > > > The following simple policy when parsed causes a hang, which I believe is an infinite loop (see below): > Import Class java.util.Properties:prop; > Strategy Execute_All_Applicable; > Policy > { > Condition > { > 1 == 1 && prop.getProperty("foo","bar").equals("foo") > } > Decision > { > prop.getProperty("foo") > } > }:1; > I found a loop in PrimaryExpression.validate() that may not always execute an Iterator.next() as follows: > while(identTupleIt.hasNext()) > { > if(returnType.getType() == TypeConstants.referenceType) > { > String referenceTypeName = returnType.getReferenceTypeName(); > IdentPrimaryTuple ipt = (IdentPrimaryTuple)identTupleIt.next(); > if(i++ == 0) // first element in the list has the same symbol table > { // as the primary expression > ipt.setSymbolTable(_symTab); > } > returnType = ipt.validate(referenceTypeName); > } else { > identTupleIt.next(); // <--- Added by dawood > } > > > } > However, this then causes the following exception.... > Mar 3, 2009 4:35:43 PM org.apache.imperius.spl.parser.expressions.impl.LogicalAnd <init> > SEVERE: main validation error: org.apache.imperius.spl.parser.expressions.impl.LogicalAnd has wrong data type passed in. > Mar 3, 2009 4:35:43 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser expr > SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 7 : validation error: org.apache.imperius.spl.parser.expressions.impl.LogicalAnd has wrong data type passed in. > validation error: org.apache.imperius.spl.parser.expressions.impl.LogicalAnd has wrong data type passed in. > Number of Formal and passed parameters don't match for method getProperty > Mar 3, 2009 4:35:43 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile > SEVERE: Error encountered while parsing tree > Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encountered while parsing tree > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile(PolicyParserImpl.java:166) > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalPolicyObject(PolicyParserImpl.java:96) > at com.ibm.watson.pml.spl.policy.SPLJavaParser.parse(SPLJavaParser.java:47) > at com.ibm.watson.pml.PolicyParser.main(PolicyParser.java:66) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. From imperius-dev-returncourtneybowers@example.com Wed May 27 19:59:31 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 92436 invoked from network); 27 May 2009 19:59:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 27 May 2009 19:59:31 -0000 Received: (qmail 82726 invoked by uid 500); 27 May 2009 19:59:43 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 82713 invoked by uid 500); 27 May 2009 19:59:43 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 82685 invoked by uid 99); 27 May 2009 19:59:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 19:59:43 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e7.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 27 May 2009 19:59:32 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [83.161.120.155]) by e7.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4RJlas0010762 for <courtneybowers@example.com>; Wed, 27 May 2009 15:47:36 -0400 Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [83.161.120.155]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4RJxBp5252736 for <courtneybowers@example.com>; Wed, 27 May 2009 15:59:11 -0400 Received: from d01av04.pok.ibm.com (loopback [83.161.120.155]) by d01av04.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4RJxBMk002631 for <courtneybowers@example.com>; Wed, 27 May 2009 15:59:11 -0400 Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [83.161.120.155]) by d01av04.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4RJxB8a002599 for <courtneybowers@example.com>; Wed, 27 May 2009 15:59:11 -0400 To: courtneybowers@example.com MIME-Version: 1.0 Subject: Method argument typing X-KeepSent: 43433F88:E60EA227-852575C3:006D42AC; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 HF105 April 10, 2008 From: David Wood <courtneybowers@example.com> Message-ID: <courtneybowers@example.com> Date: Wed, 27 May 2009 15:59:10 -0400 X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 8.5|December 05, 2008) at 05/27/2009 15:59:11, Serialize complete at 05/27/2009 15:59:11 Content-Type: multipart/alternative; boundary="=_alternative 006DA50F852575C3_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 006DA50F852575C3_= Content-Type: text/plain; charset="US-ASCII" The following is code I've modified in AnchorMethodInvokeAction.invokeClassMethod(...). if(!isArgCreated) { String refTypeName = exp.getType().getReferenceTypeName(); Argument arg = new ArgumentImpl(exp.getType().getType(), null, exp.isArray(), refTypeName); arg.setValue(result); // result is from an earlier evaluation parameterObjects.add(arg); // This is an argument to the method being called. } It used to be passing null intead of refTypeName, which later caused a problem when trying to to a Class.forName(). This seemed to do the right thing in my small test case, but I'm not familiar enough with the code. Does this seem the like the right change? David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) --=_alternative 006DA50F852575C3_=-- From imperius-dev-returncourtneybowers@example.com Thu May 28 15:50:21 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 90635 invoked from network); 28 May 2009 15:50:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 28 May 2009 15:50:21 -0000 Received: (qmail 6835 invoked by uid 500); 28 May 2009 15:50:34 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 6800 invoked by uid 500); 28 May 2009 15:50:34 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 6701 invoked by uid 99); 28 May 2009 15:50:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 15:50:30 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS,TVD_FW_GRAPHIC_NAME_MID X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e3.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 15:50:19 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [83.161.120.155]) by e3.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4SFjOBk010320 for <courtneybowers@example.com>; Thu, 28 May 2009 11:45:24 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [83.161.120.155]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4SFnwrK222666 for <courtneybowers@example.com>; Thu, 28 May 2009 11:49:58 -0400 Received: from d01av02.pok.ibm.com (loopback [83.161.120.155]) by d01av02.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4SFlqPe001990 for <courtneybowers@example.com>; Thu, 28 May 2009 11:47:52 -0400 Received: from d01ml604.pok.ibm.com (d01ml604.pok.ibm.com [83.161.120.155]) by d01av02.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4SFlqYj001984 for <courtneybowers@example.com>; Thu, 28 May 2009 11:47:52 -0400 In-Reply-To: <66445616.1243384185634.JavaMail.jira@brutus> Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter To: courtneybowers@example.com Cc: courtneybowers@example.com X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: <courtneybowers@example.com> From: Xiping Wang <courtneybowers@example.com> Date: Thu, 28 May 2009 11:49:57 -0400 X-MIMETrack: Serialize by Router on D01ML604/01/M/IBM(Release 8.5|December 05, 2008) at 05/28/2009 11:49:57 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1" X-Virus-Checked: Checked by ClamAV on apache.org --0__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1 Content-type: multipart/alternative; Boundary="1__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1" --1__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable David, It seems to me that Imperius is not capable of handling array return ty= pe because the SPL does not distinguish between primitive return type and array return type syntactically. Xiping IBM T.J. Watson Research Center = "David Wood = (JIRA)" = <courtneybowers@example.com> = To courtneybowers@example.com= g 05/26/2009 08:29 = cc PM = Subj= ect [jira] Updated: (IMPERIUS-28) by= te Please respond to [] method return type does not = imperius-dev@incu match formal parameter = bator.apache.org = = = = = = [ https://issues.apache.org/jira/browse/IMPERIUS-28?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-28: ------------------------------- Attachment: ByteArrayFactory.java PolicyParser.java > byte[] method return type does not match formal parameter > --------------------------------------------------------- > > Key: IMPERIUS-28 > URL: https://issues.apache.org/jira/browse/IMPERIUS-2= 8 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5 > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: ByteArrayFactory.java, PolicyParser.java > > Original Estimate: 96h > Remaining Estimate: 96h > > It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program inclu= des a policy that passes the byte[] return value of a method to another met= hod that expects the same. This gives the following message: > May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary > SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 : Fo= rmal and passed parameter types don't match for method takeByteArray > Formal and passed parameter types don't match for method takeByteArr= ay > May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile > SEVERE: Error encountered while parsing tree > Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encounter= ed while parsing tree > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile (PolicyParserImpl.java:166) > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalP= olicyObject (PolicyParserImpl.java:96) > at com.ibm.watson.pml.bytearray.PolicyParser.main (PolicyParser.java:55) > I've attached both the Java program and the ByteArrayFactory interfac= e that is used in the policy (also found in the Java file). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. = --1__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable <html><body> <p>David,<br> <br> It seems to me that Imperius is not capable of handling array return ty= pe because the SPL does not distinguish between primitive return type a= nd array return type syntactically.<br> <br> Xiping<br> <br> IBM T.J. Watson Research Center<br> <br> <br> <br> <img width=3D"16" height=3D"16" src=3D"cid:1__=3D0ABBFF57DFC5E4D18f9e8a= courtneybowers@example.com" border=3D"0" alt=3D"Inactive hide details for &quot= ;David Wood (JIRA)&quot; &lt;courtneybowers@example.com&gt;">&quot;David Wood (JIR= A)&quot; &lt;courtneybowers@example.com&gt;<br> <br> <br> <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">= <tr valign=3D"top"><td style=3D"background-image:url(cid:2__=3D0ABBFF57= courtneybowers@example.com); background-repeat: no-repeat; " widt= h=3D"40%"> <ul> <ul> <ul> <ul><b><font size=3D"2">&quot;David Wood (JIRA)&quot; &lt;courtneybowers@example.com= rg&gt;</font></b><font size=3D"2"> </font> <p><font size=3D"2">05/26/2009 08:29 PM</font> <table border=3D"1"> <tr valign=3D"top"><td width=3D"168" bgcolor=3D"#FFFFFF"><div align=3D"= center"><font size=3D"2">Please respond to<br> courtneybowers@example.com</font></div></td></tr> </table> </ul> </ul> </ul> </ul> </td><td width=3D"60%"> <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">= <tr valign=3D"top"><td width=3D"1%"><img width=3D"58" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""><br> <div align=3D"right"><font size=3D"2">To</font></div></td><td width=3D"= 100%"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D0ABBFF57DFC5E4D18f= courtneybowers@example.com" border=3D"0" alt=3D""><br> <font size=3D"2">courtneybowers@example.com</font></td></tr> <tr valign=3D"top"><td width=3D"1%"><img width=3D"58" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""><br> <div align=3D"right"><font size=3D"2">cc</font></div></td><td width=3D"= 100%"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D0ABBFF57DFC5E4D18f= courtneybowers@example.com" border=3D"0" alt=3D""><br> </td></tr> <tr valign=3D"top"><td width=3D"1%"><img width=3D"58" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""><br> <div align=3D"right"><font size=3D"2">Subject</font></div></td><td widt= h=3D"100%"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D0ABBFF57DFC5E= courtneybowers@example.com" border=3D"0" alt=3D""><br> <font size=3D"2">[jira] Updated: (IMPERIUS-28) byte[] method return typ= e does not match formal parameter</font></td></tr> </table> <table border=3D"0" cellspacing=3D"0" cellpadding=3D"0"> <tr valign=3D"top"><td width=3D"58"><img width=3D"1" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""></td><td width=3D"336"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D= courtneybowers@example.com" border=3D"0" alt=3D""></td></= tr> </table> </td></tr> </table> <br> <tt><br> &nbsp; &nbsp; [ </tt><tt><a href=3D"https://issues.apache.org/jira/bro= wse/IMPERIUS-28?page=3Dcom.atlassian.jira.plugin.system.issuetabpanels:= all-tabpanel">https://issues.apache.org/jira/browse/IMPERIUS-28?page=3D= com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel</a></tt><t= t>&nbsp;]<br> <br> David Wood updated IMPERIUS-28:<br> -------------------------------<br> <br> &nbsp; &nbsp;Attachment: ByteArrayFactory.java<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;PolicyParser.ja= va<br> <br> &gt; byte[] method return type does not match formal parameter<br> &gt; ---------------------------------------------------------<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Key: IMPER= IUS-28<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URL: </tt>= <tt><a href=3D"https://issues.apache.org/jira/browse/IMPERIUS-28">https= ://issues.apache.org/jira/browse/IMPERIUS-28</a></tt><tt><br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Project: Imperius<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Issue Type: Bug<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Environment: Windows, Java 1.5<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Reporter: David Wood<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assignee: Bill Stoddard<b= r> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Attachments: ByteArrayFactory.java, Po= licyParser.java<br> &gt;<br> &gt; &nbsp; Original Estimate: 96h<br> &gt; &nbsp;Remaining Estimate: 96h<br> &gt;<br> &gt; It appears that a method's byte[] return type is not being properl= y matched with a byte[] method argument. &nbsp;The attached Java progra= m includes a policy that passes the byte[] return value of a method to = another method that expects the same. &nbsp;This gives the following me= ssage:<br> &gt; May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SP= LTreeParser identPrimary<br> &gt; SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 := Formal and passed parameter types don't match for method takeByteArray= <br> &gt; &nbsp;Formal and passed parameter types don't match for method tak= eByteArray<br> &gt; May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.Pol= icyParserImpl parseFile<br> &gt; SEVERE: Error encountered while parsing tree<br> &gt; Exception in thread &quot;main&quot; org.apache.imperius.spl.parse= r.exceptions.SPLException: Error encountered while parsing tree<br> &gt; at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.pars= eFile(PolicyParserImpl.java:166)<br> &gt; at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.crea= teInternalPolicyObject(PolicyParserImpl.java:96)<br> &gt; at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.= java:55)<br> &gt; I've attached both the Java program and the ByteArrayFactory inter= face that is used in the policy (also found in the Java file).<br> <br> -- <br> This message is automatically generated by JIRA.<br> -<br> You can reply to this email to add a comment to the issue online.<br> <br> </tt><br> </body></html>= --1__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1-- --0__=0ABBFF57DFC5E4D18f9e8a93df938690918c0ABBFF57DFC5E4D1-- From imperius-dev-returncourtneybowers@example.com Thu May 28 16:35:41 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 3694 invoked from network); 28 May 2009 16:35:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 28 May 2009 16:35:41 -0000 Received: (qmail 81160 invoked by uid 500); 28 May 2009 16:24:21 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 81153 invoked by uid 500); 28 May 2009 16:24:21 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 81132 invoked by uid 99); 28 May 2009 16:24:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 16:24:19 +0000 X-ASF-Spam-Status: No, hits=-1.8 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e1.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 16:24:09 +0000 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [83.161.120.155]) by e1.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4SGJgFV009400 for <courtneybowers@example.com>; Thu, 28 May 2009 12:19:42 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [83.161.120.155]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4SGNliY148542 for <courtneybowers@example.com>; Thu, 28 May 2009 12:23:47 -0400 Received: from d01av02.pok.ibm.com (loopback [83.161.120.155]) by d01av02.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4SGLf6B030423 for <courtneybowers@example.com>; Thu, 28 May 2009 12:21:41 -0400 Received: from d01ml605.pok.ibm.com (d01ml605.pok.ibm.com [83.161.120.155]) by d01av02.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4SGLeRu030389 for <courtneybowers@example.com>; Thu, 28 May 2009 12:21:41 -0400 In-Reply-To: <courtneybowers@example.com> References: <66445616.1243384185634.JavaMail.jira@brutus> <courtneybowers@example.com> To: courtneybowers@example.com Cc: courtneybowers@example.com MIME-Version: 1.0 Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter X-KeepSent: 91E7FFB3:84C8D204-852575C4:0059C098; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 HF105 April 10, 2008 From: David Wood <courtneybowers@example.com> Message-ID: <courtneybowers@example.com> Date: Thu, 28 May 2009 12:23:46 -0400 X-MIMETrack: Serialize by Router on D01ML605/01/M/IBM(Release 8.5|December 05, 2008) at 05/28/2009 12:23:46, Serialize complete at 05/28/2009 12:23:46 Content-Type: multipart/alternative; boundary="=_alternative 0059EC83852575C4_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 0059EC83852575C4_= Content-Type: text/plain; charset="US-ASCII" I don't think this is an SPL specification issue. This is strictly a problem with the definition of the method's return type as indicated in the Java Class object. Somehow that definition is not being picked up as an array and instead just as a single byte. It _is_ getting the formal parameter definition correct (i.e. a byte[]). David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) From: Xiping Wang/Watson/IBM@IBMUS To: courtneybowers@example.com Cc: courtneybowers@example.com Date: 05/28/2009 11:51 AM Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter David, It seems to me that Imperius is not capable of handling array return type because the SPL does not distinguish between primitive return type and array return type syntactically. Xiping IBM T.J. Watson Research Center "David Wood (JIRA)" <courtneybowers@example.com> "David Wood (JIRA)" <courtneybowers@example.com> 05/26/2009 08:29 PM Please respond to courtneybowers@example.com To courtneybowers@example.com cc Subject [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter [ https://issues.apache.org/jira/browse/IMPERIUS-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-28: ------------------------------- Attachment: ByteArrayFactory.java PolicyParser.java > byte[] method return type does not match formal parameter > --------------------------------------------------------- > > Key: IMPERIUS-28 > URL: https://issues.apache.org/jira/browse/IMPERIUS-28 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5 > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: ByteArrayFactory.java, PolicyParser.java > > Original Estimate: 96h > Remaining Estimate: 96h > > It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program includes a policy that passes the byte[] return value of a method to another method that expects the same. This gives the following message: > May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary > SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 : Formal and passed parameter types don't match for method takeByteArray > Formal and passed parameter types don't match for method takeByteArray > May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile > SEVERE: Error encountered while parsing tree > Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encountered while parsing tree > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile(PolicyParserImpl.java:166) > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalPolicyObject(PolicyParserImpl.java:96) > at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.java:55) > I've attached both the Java program and the ByteArrayFactory interface that is used in the policy (also found in the Java file). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --=_alternative 0059EC83852575C4_=-- From imperius-dev-returncourtneybowers@example.com Thu May 28 17:01:13 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 12700 invoked from network); 28 May 2009 17:01:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 28 May 2009 17:01:13 -0000 Received: (qmail 71441 invoked by uid 500); 28 May 2009 17:01:24 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 71410 invoked by uid 500); 28 May 2009 17:01:24 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 71398 invoked by uid 99); 28 May 2009 17:01:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 17:01:20 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS,TVD_FW_GRAPHIC_NAME_MID X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e3.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 17:01:10 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [83.161.120.155]) by e3.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4SGuECk028347 for <courtneybowers@example.com>; Thu, 28 May 2009 12:56:14 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [83.161.120.155]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4SH0m4g153750 for <courtneybowers@example.com>; Thu, 28 May 2009 13:00:48 -0400 Received: from d01av03.pok.ibm.com (loopback [83.161.120.155]) by d01av03.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4SH0mXG025745 for <courtneybowers@example.com>; Thu, 28 May 2009 13:00:48 -0400 Received: from d01ml604.pok.ibm.com (d01ml604.pok.ibm.com [83.161.120.155]) by d01av03.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4SH0mKW025740 for <courtneybowers@example.com>; Thu, 28 May 2009 13:00:48 -0400 In-Reply-To: <courtneybowers@example.com> Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter To: courtneybowers@example.com Cc: courtneybowers@example.com X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: <courtneybowers@example.com> From: Xiping Wang <courtneybowers@example.com> Date: Thu, 28 May 2009 13:00:47 -0400 X-MIMETrack: Serialize by Router on D01ML604/01/M/IBM(Release 8.5|December 05, 2008) at 05/28/2009 13:00:48 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904" X-Virus-Checked: Checked by ClamAV on apache.org --0__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904 Content-type: multipart/alternative; Boundary="1__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904" --1__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Let's take a look at the line in red in the policy you provided. In you= example, you have getByteArray() method that returns a byte[] return ty= pe. Assume I add another method to the anchor class with the same name but renturns a byte type. How do you write a SPL policy to distinguish betw= een these two? Import Class com.ibm.watson.pml.bytearray.ByteArrayFactory:baf; Strategy Execute_All_Applicable; Policy { Condition { baf.takeByteArray(baf.getByteArray()) } Decision { ReturnValue(\"OK\") } }:1; Xiping IBM TJ Watson Research Center = David = Wood/Watson/IBM@I = BMUS = To courtneybowers@example.com= g 05/28/2009 12:23 = cc PM courtneybowers@example.com= g Subj= ect Re: [jira] Updated: (IMPERIUS-28= ) Please respond to byte[] method return type does n= ot imperius-dev@incu match formal parameter = bator.apache.org = = = = = = I don't think this is an SPL specification issue. This is strictly a problem with the definition of the method's return type as indicated in= the Java Class object. Somehow that definition is not being picked up = as an array and instead just as a single byte. It _is_ getting the formal= parameter definition correct (i.e. a byte[]). David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) From: Xiping Wang/Watson/IBM@IBMUS To: courtneybowers@example.com Cc: courtneybowers@example.com Date: 05/28/2009 11:51 AM Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not ma= tch formal parameter David, It seems to me that Imperius is not capable of handling array return ty= pe because the SPL does not distinguish between primitive return type and array return type syntactically. Xiping IBM T.J. Watson Research Center "David Wood (JIRA)" <courtneybowers@example.com> "David Wood (JIRA)" <courtneybowers@example.com> 05/26/2009 08:29 PM Please respond to courtneybowers@example.com To courtneybowers@example.com cc Subject [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter [ https://issues.apache.org/jira/browse/IMPERIUS-28?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-28: ------------------------------- Attachment: ByteArrayFactory.java PolicyParser.java > byte[] method return type does not match formal parameter > --------------------------------------------------------- > > Key: IMPERIUS-28 > URL: https://issues.apache.org/jira/browse/IMPERIUS-2= 8 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5 > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: ByteArrayFactory.java, PolicyParser.java > > Original Estimate: 96h > Remaining Estimate: 96h > > It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program inclu= des a policy that passes the byte[] return value of a method to another met= hod that expects the same. This gives the following message: > May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary > SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 : Formal and passed parameter types don't match for method takeByteArray > Formal and passed parameter types don't match for method takeByteArr= ay > May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile > SEVERE: Error encountered while parsing tree > Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encounter= ed while parsing tree > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile (PolicyParserImpl.java:166) > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalP= olicyObject (PolicyParserImpl.java:96) > at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.java:5= 5) > I've attached both the Java program and the ByteArrayFactory interfac= e that is used in the policy (also found in the Java file). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. = --1__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904 Content-type: text/html; charset=US-ASCII Content-Disposition: inline Content-transfer-encoding: quoted-printable <html><body> <p><font face=3D"Courier New">Let's take a look at the line in red in t= he policy you provided. In you example, you have</font><font face=3D"Co= urier New"> </font><font face=3D"Courier New">getByteArray() method tha= t returns a byte[] return type. Assume I add another method to the anch= or class with the same name but renturns a byte type. How do you write = a SPL policy to distinguish between these two?</font><br> <br> <font color=3D"#4200FF" face=3D"Courier New">Import Class com.ibm.watso= n.pml.bytearray.ByteArrayFactory:baf;</font><br> <font color=3D"#4200FF" face=3D"Courier New">Strategy Execute_All_Appli= cable;</font><br> <font color=3D"#4200FF" face=3D"Courier New">Policy {</font><br> <font color=3D"#4200FF" face=3D"Courier New"> </font><font color=3D"#FF= 0000" face=3D"Courier New">Condition { baf.takeByteArray(baf.getByteArr= ay()) }</font><br> <font color=3D"#4200FF" face=3D"Courier New"> Decision { ReturnValue(\= &quot;OK\&quot;) }</font><br> <font color=3D"#4200FF" face=3D"Courier New">}:1</font><font face=3D"Co= urier New">;</font><br> <br> <br> Xiping<br> <tt>IBM TJ Watson Research Center</tt><br> <br> <img width=3D"16" height=3D"16" src=3D"cid:1__=3D0ABBFF57DFCF59048f9e8a= courtneybowers@example.com" border=3D"0" alt=3D"Inactive hide details for David= Wood/Watson/IBM@IBMUS">David Wood/Watson/IBM@IBMUS<br> <br> <br> <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">= <tr valign=3D"top"><td style=3D"background-image:url(cid:2__=3D0ABBFF57= courtneybowers@example.com); background-repeat: no-repeat; " widt= h=3D"40%"> <ul> <ul> <ul> <ul><b><font size=3D"2">David Wood/Watson/IBM@IBMUS</font></b><font siz= e=3D"2"> </font> <p><font size=3D"2">05/28/2009 12:23 PM</font> <table border=3D"1"> <tr valign=3D"top"><td width=3D"168" bgcolor=3D"#FFFFFF"><div align=3D"= center"><font size=3D"2">Please respond to<br> courtneybowers@example.com</font></div></td></tr> </table> </ul> </ul> </ul> </ul> </td><td width=3D"60%"> <table width=3D"100%" border=3D"0" cellspacing=3D"0" cellpadding=3D"0">= <tr valign=3D"top"><td width=3D"1%"><img width=3D"58" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""><br> <div align=3D"right"><font size=3D"2">To</font></div></td><td width=3D"= 100%"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D0ABBFF57DFCF59048f= courtneybowers@example.com" border=3D"0" alt=3D""><br> <font size=3D"2">courtneybowers@example.com</font></td></tr> <tr valign=3D"top"><td width=3D"1%"><img width=3D"58" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""><br> <div align=3D"right"><font size=3D"2">cc</font></div></td><td width=3D"= 100%"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D0ABBFF57DFCF59048f= courtneybowers@example.com" border=3D"0" alt=3D""><br> <font size=3D"2">courtneybowers@example.com</font></td></tr> <tr valign=3D"top"><td width=3D"1%"><img width=3D"58" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""><br> <div align=3D"right"><font size=3D"2">Subject</font></div></td><td widt= h=3D"100%"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D0ABBFF57DFCF5= courtneybowers@example.com" border=3D"0" alt=3D""><br> <font size=3D"2">Re: [jira] Updated: (IMPERIUS-28) byte[] method return= type does not match formal parameter</font></td></tr> </table> <table border=3D"0" cellspacing=3D"0" cellpadding=3D"0"> <tr valign=3D"top"><td width=3D"58"><img width=3D"1" height=3D"1" src=3D= "cid:courtneybowers@example.com" border=3D"0" alt=3D= ""></td><td width=3D"336"><img width=3D"1" height=3D"1" src=3D"cid:3__=3D= courtneybowers@example.com" border=3D"0" alt=3D""></td></= tr> </table> </td></tr> </table> <br> <tt>I don't think this is an SPL specification issue. &nbsp;This is str= ictly a <br> problem with the definition of the method's return type as indicated in= <br> the Java Class object. &nbsp;Somehow that definition is not being picke= d up as <br> an array and instead just as a single byte. &nbsp;It _is_ getting the f= ormal <br> parameter definition correct (i.e. a byte[]). <br> <br> David Wood <br> Policy Technologies Group<br> IBM TJ Watson Research Center<br> courtneybowers@example.com<br> (802)829-8628 (office), (802)829-8628 (mobile)<br> <br> <br> <br> <br> From:<br> Xiping Wang/Watson/IBM@IBMUS<br> To:<br> courtneybowers@example.com<br> Cc:<br> courtneybowers@example.com<br> Date:<br> 05/28/2009 11:51 AM<br> Subject:<br> Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not ma= tch <br> formal parameter<br> <br> <br> <br> David,<br> <br> It seems to me that Imperius is not capable of handling array return ty= pe <br> because the SPL does not distinguish between primitive return type and = <br> array return type syntactically.<br> <br> Xiping<br> <br> IBM T.J. Watson Research Center<br> <br> <br> <br> &quot;David Wood (JIRA)&quot; &lt;courtneybowers@example.com&gt;<br> <br> <br> &quot;David Wood (JIRA)&quot; &lt;courtneybowers@example.com&gt; <br> 05/26/2009 08:29 PM <br> <br> Please respond to<br> courtneybowers@example.com<br> <br> <br> <br> <br> To<br> <br> courtneybowers@example.com<br> <br> cc<br> <br> <br> Subject<br> <br> [jira] Updated: (IMPERIUS-28) byte[] method return type does not match = <br> formal parameter<br> <br> <br> <br> <br> <br> <br> &nbsp; &nbsp;[ <br> </tt><tt><a href=3D"https://issues.apache.org/jira/browse/IMPERIUS-28?p= age=3Dcom.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel">htt= ps://issues.apache.org/jira/browse/IMPERIUS-28?page=3Dcom.atlassian.jir= a.plugin.system.issuetabpanels:all-tabpanel</a></tt><tt>&nbsp;<br> ]<br> <br> David Wood updated IMPERIUS-28:<br> -------------------------------<br> <br> &nbsp; Attachment: ByteArrayFactory.java<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; PolicyParser.java<br>= <br> &gt; byte[] method return type does not match formal parameter<br> &gt; ---------------------------------------------------------<br> &gt;<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Key: IMPER= IUS-28<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; URL: </tt>= <tt><a href=3D"https://issues.apache.org/jira/browse/IMPERIUS-28">https= ://issues.apache.org/jira/browse/IMPERIUS-28</a></tt><tt><br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Project: Imperius<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Issue Type: Bug<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Environment: Windows, Java 1.5<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Reporter: David Wood<br> &gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Assignee: Bill Stoddard<b= r> &gt; &nbsp; &nbsp; &nbsp; &nbsp; Attachments: ByteArrayFactory.java, Po= licyParser.java<br> &gt;<br> &gt; &nbsp; Original Estimate: 96h<br> &gt; &nbsp;Remaining Estimate: 96h<br> &gt;<br> &gt; It appears that a method's byte[] return type is not being properl= y <br> matched with a byte[] method argument. &nbsp;The attached Java program = includes <br> a policy that passes the byte[] return value of a method to another met= hod <br> that expects the same. &nbsp;This gives the following message:<br> &gt; May 26, 2009 8:20:52 PM <br> org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary<br> &gt; SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 := <br> Formal and passed parameter types don't match for method takeByteArray<= br> &gt; &nbsp;Formal and passed parameter types don't match for method tak= eByteArray<br> &gt; May 26, 2009 8:20:52 PM <br> org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile<br> &gt; SEVERE: Error encountered while parsing tree<br> &gt; Exception in thread &quot;main&quot; <br> org.apache.imperius.spl.parser.exceptions.SPLException: Error encounter= ed <br> while parsing tree<br> &gt; at <br> org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile(Polic= yParserImpl.java:166)<br> &gt; at <br> org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalP= olicyObject(PolicyParserImpl.java:96)<br> &gt; at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.jav= a:55)<br> &gt; I've attached both the Java program and the ByteArrayFactory inter= face <br> that is used in the policy (also found in the Java file).<br> <br> -- <br> This message is automatically generated by JIRA.<br> -<br> You can reply to this email to add a comment to the issue online.<br> <br> <br> <br> </tt><br> </body></html>= --1__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904-- --0__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904-- From imperius-dev-returncourtneybowers@example.com Thu May 28 17:48:33 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 34388 invoked from network); 28 May 2009 17:48:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 28 May 2009 17:48:33 -0000 Received: (qmail 59423 invoked by uid 500); 28 May 2009 17:48:46 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 59399 invoked by uid 500); 28 May 2009 17:48:46 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 59389 invoked by uid 99); 28 May 2009 17:48:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 17:48:45 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e37.co.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 17:48:35 +0000 Received: from d03relay03.boulder.ibm.com (d03relay03.boulder.ibm.com [83.161.120.155]) by e37.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4SHlatw030270 for <courtneybowers@example.com>; Thu, 28 May 2009 11:47:36 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [83.161.120.155]) by d03relay03.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4SHm7GC095300 for <courtneybowers@example.com>; Thu, 28 May 2009 11:48:10 -0600 Received: from d03av02.boulder.ibm.com (loopback [83.161.120.155]) by d03av02.boulder.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4SHm3Se019315 for <courtneybowers@example.com>; Thu, 28 May 2009 11:48:03 -0600 Received: from d03nm118.boulder.ibm.com (d03nm118.boulder.ibm.com [83.161.120.155]) by d03av02.boulder.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4SHm30P019276 for <courtneybowers@example.com>; Thu, 28 May 2009 11:48:03 -0600 In-Reply-To: <courtneybowers@example.com> References: <courtneybowers@example.com> <courtneybowers@example.com> To: courtneybowers@example.com MIME-Version: 1.0 Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter X-KeepSent: 1EF56E9C:DE11671A-852575C4:006187C4; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.0.1 HF105 April 10, 2008 From: Neeraj Joshi <courtneybowers@example.com> Message-ID: <courtneybowers@example.com> Date: Thu, 28 May 2009 13:48:02 -0400 X-MIMETrack: Serialize by Router on D03NM118/03/M/IBM(Release 8.5|December 05, 2008) at 05/28/2009 11:48:02, Serialize complete at 05/28/2009 11:48:02 Content-Type: multipart/alternative; boundary="=_alternative 0061CEBC852575C4_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 0061CEBC852575C4_= Content-Type: text/plain; charset="US-ASCII" Hey guys, There is an isArray variable that gets set automatically based on reflection. There must be some other issue involved here Neeraj ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "The light at the end of the tunnel...may be you" Neeraj Joshi WebSphere XD - Compute Grid AIM, IBM Apache Imperius - http://incubator.apache.org/imperius ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: Xiping Wang/Watson/IBM@IBMUS To: courtneybowers@example.com Cc: courtneybowers@example.com Date: 05/28/2009 01:01 PM Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter Let's take a look at the line in red in the policy you provided. In you example, you have getByteArray() method that returns a byte[] return type. Assume I add another method to the anchor class with the same name but renturns a byte type. How do you write a SPL policy to distinguish between these two? Import Class com.ibm.watson.pml.bytearray.ByteArrayFactory:baf; Strategy Execute_All_Applicable; Policy { Condition { baf.takeByteArray(baf.getByteArray()) } Decision { ReturnValue(\"OK\") } }:1; Xiping IBM TJ Watson Research Center David Wood/Watson/IBM@IBMUS David Wood/Watson/IBM@IBMUS 05/28/2009 12:23 PM Please respond to courtneybowers@example.com To courtneybowers@example.com cc courtneybowers@example.com Subject Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter I don't think this is an SPL specification issue. This is strictly a problem with the definition of the method's return type as indicated in the Java Class object. Somehow that definition is not being picked up as an array and instead just as a single byte. It _is_ getting the formal parameter definition correct (i.e. a byte[]). David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) From: Xiping Wang/Watson/IBM@IBMUS To: courtneybowers@example.com Cc: courtneybowers@example.com Date: 05/28/2009 11:51 AM Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter David, It seems to me that Imperius is not capable of handling array return type because the SPL does not distinguish between primitive return type and array return type syntactically. Xiping IBM T.J. Watson Research Center "David Wood (JIRA)" <courtneybowers@example.com> "David Wood (JIRA)" <courtneybowers@example.com> 05/26/2009 08:29 PM Please respond to courtneybowers@example.com To courtneybowers@example.com cc Subject [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter [ https://issues.apache.org/jira/browse/IMPERIUS-28?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-28: ------------------------------- Attachment: ByteArrayFactory.java PolicyParser.java > byte[] method return type does not match formal parameter > --------------------------------------------------------- > > Key: IMPERIUS-28 > URL: https://issues.apache.org/jira/browse/IMPERIUS-28 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5 > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: ByteArrayFactory.java, PolicyParser.java > > Original Estimate: 96h > Remaining Estimate: 96h > > It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program includes a policy that passes the byte[] return value of a method to another method that expects the same. This gives the following message: > May 26, 2009 8:20:52 PM org.apache.imperius.spl.parser.compiler.SPLTreeParser identPrimary > SEVERE: main TreeParser888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4xception creating Expression at line 4 : Formal and passed parameter types don't match for method takeByteArray > Formal and passed parameter types don't match for method takeByteArray > May 26, 2009 8:20:52 PM org.apache.imperius.spl.datastore.impl.PolicyParserImpl parseFile > SEVERE: Error encountered while parsing tree > Exception in thread "main" org.apache.imperius.spl.parser.exceptions.SPLException: Error encountered while parsing tree > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.parseFile(PolicyParserImpl.java:166) > at org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalPolicyObject(PolicyParserImpl.java:96) > at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.java:55) > I've attached both the Java program and the ByteArrayFactory interface that is used in the policy (also found in the Java file). -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --=_alternative 0061CEBC852575C4_=-- From imperius-dev-returncourtneybowers@example.com Thu May 28 20:28:40 2009 Return-Path: <imperius-dev-returncourtneybowers@example.com> Delivered-To: courtneybowers@example.com Received: (qmail 9007 invoked from network); 28 May 2009 20:28:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 28 May 2009 20:28:40 -0000 Received: (qmail 26218 invoked by uid 500); 28 May 2009 20:28:53 -0000 Delivered-To: courtneybowers@example.com Received: (qmail 26204 invoked by uid 500); 28 May 2009 20:28:53 -0000 Mailing-List: contact courtneybowers@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:courtneybowers@example.com> List-Unsubscribe: <mailto:courtneybowers@example.com> List-Post: <mailto:courtneybowers@example.com> List-Id: <imperius-dev.incubator.apache.org> Reply-To: courtneybowers@example.com Delivered-To: mailing list courtneybowers@example.com Received: (qmail 26194 invoked by uid 99); 28 May 2009 20:28:53 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 20:28:53 +0000 X-ASF-Spam-Status: No, hits=-0.6 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS,TVD_FW_GRAPHIC_NAME_MID X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of courtneybowers@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO e5.ny.us.ibm.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 May 2009 20:28:40 +0000 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [83.161.120.155]) by e5.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4SKMhQT016805 for <courtneybowers@example.com>; Thu, 28 May 2009 16:22:43 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [83.161.120.155]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4SKSJ1D232800 for <courtneybowers@example.com>; Thu, 28 May 2009 16:28:19 -0400 Received: from d01av02.pok.ibm.com (loopback [83.161.120.155]) by d01av02.pok.ibm.com (83.161.120.15560308/8.13.3) with ESMTP id n4SKQCJb028952 for <courtneybowers@example.com>; Thu, 28 May 2009 16:26:12 -0400 Received: from d01ml604.pok.ibm.com (d01ml604.pok.ibm.com [83.161.120.155]) by d01av02.pok.ibm.com (83.161.120.15560308/8.12.11) with ESMTP id n4SKQCun028940 for <courtneybowers@example.com>; Thu, 28 May 2009 16:26:12 -0400 In-Reply-To: <courtneybowers@example.com> Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter To: courtneybowers@example.com X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: <courtneybowers@example.com> From: Xiping Wang <courtneybowers@example.com> Date: Thu, 28 May 2009 16:28:18 -0400 X-MIMETrack: Serialize by Router on D01ML604/01/M/IBM(Release 8.5|December 05, 2008) at 05/28/2009 16:28:19 MIME-Version: 1.0 Content-type: multipart/related; Boundary="0__=0ABBFF57DFFC5F0D8f9e8a93df938690918c0ABBFF57DFFC5F0D" X-Virus-Checked: Checked by ClamAV on apache.org --0__=0ABBFF57DFFC5F0D8f9e8a93df938690918c0ABBFF57DFFC5F0D Content-type: multipart/alternative; Boundary="1__=0ABBFF57DFFC5F0D8f9e8a93df938690918c0ABBFF57DFFC5F0D" --1__=0ABBFF57DFFC5F0D8f9e8a93df938690918c0ABBFF57DFFC5F0D Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: quoted-printable Hi Neeraj, You are right, but the flag gets set when a policy is parsed without looking at the corresponding anchor class. A mismatch could occur at evaluation time depending the return type of a method, Xiping IBM TJ Watson Research Center = Neeraj = Joshi/Durham/IBM@ = IBMUS = To courtneybowers@example.com= g 05/28/2009 01:48 = cc PM = Subj= ect Re: [jira] Updated: (IMPERIUS-28= ) Please respond to byte[] method return type does n= ot imperius-dev@incu match formal parameter = bator.apache.org = = = = = = Hey guys, There is an isArray variable that gets set automatically based on reflection. There must be some other issue involved here Neeraj ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "The light at the end of the tunnel...may be you" Neeraj Joshi WebSphere XD - Compute Grid AIM, IBM Apache Imperius - http://incubator.apache.org/imperius ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: Xiping Wang/Watson/IBM@IBMUS To: courtneybowers@example.com Cc: courtneybowers@example.com Date: 05/28/2009 01:01 PM Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not ma= tch formal parameter Let's take a look at the line in red in the policy you provided. In you= example, you have getByteArray() method that returns a byte[] return ty= pe. Assume I add another method to the anchor class with the same name but renturns a byte type. How do you write a SPL policy to distinguish betw= een these two? Import Class com.ibm.watson.pml.bytearray.ByteArrayFactory:baf; Strategy Execute_All_Applicable; Policy { Condition { baf.takeByteArray(baf.getByteArray()) } Decision { ReturnValue(\"OK\") } }:1; Xiping IBM TJ Watson Research Center David Wood/Watson/IBM@IBMUS David Wood/Watson/IBM@IBMUS 05/28/2009 12:23 PM Please respond to courtneybowers@example.com To courtneybowers@example.com cc courtneybowers@example.com Subject Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not ma= tch formal parameter I don't think this is an SPL specification issue. This is strictly a problem with the definition of the method's return type as indicated in= the Java Class object. Somehow that definition is not being picked up = as an array and instead just as a single byte. It _is_ getting the formal= parameter definition correct (i.e. a byte[]). David Wood Policy Technologies Group IBM TJ Watson Research Center courtneybowers@example.com (802)829-8628 (office), (802)829-8628 (mobile) From: Xiping Wang/Watson/IBM@IBMUS To: courtneybowers@example.com Cc: courtneybowers@example.com Date: 05/28/2009 11:51 AM Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not ma= tch formal parameter David, It seems to me that Imperius is not capable of handling array return ty= pe because the SPL does not distinguish between primitive return type and array return type syntactically. Xiping IBM T.J. Watson Research Center "David Wood (JIRA)" <courtneybowers@example.com> "David Wood (JIRA)" <courtneybowers@example.com> 05/26/2009 08:29 PM Please respond to courtneybowers@example.com To courtneybowers@example.com cc Subject [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter [ https://issues.apache.org/jira/browse/IMPERIUS-28?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] David Wood updated IMPERIUS-28: ------------------------------- Attachment: ByteArrayFactory.java PolicyParser.java > byte[] method return type does not match formal parameter > --------------------------------------------------------- > > Key: IMPERIUS-28 > URL: https://issues.apache.org/jira/browse/IMPERIUS-2= 8 > Project: Imperius > Issue Type: Bug > Environment: Windows, Java 1.5 > Reporter: David Wood > Assignee: Bill Stoddard > Attachments: ByteArrayFactory.java, PolicyParser.java > > Original Estimate: 96h > Remaining Estimate: 96h > > It appears that a method's byte[] return type is not being properly matched with a byte[] method argument. The attached Java program inclu= des a policy that passes the byte[] return value of a method to another met= hod that expects the same. This gives the following message: > May 26,
{'source': 'Apache Software Foundation Public Mail Archives'}