From imperius-dev-return-404-apmail-incubator-imperius-dev-archive=incubator.apache.org@incubator.apache.org Thu May 28 17:01:13 2009 Return-Path: Delivered-To: apmail-incubator-imperius-dev-archive@minotaur.apache.org Received: (qmail 12700 invoked from network); 28 May 2009 17:01:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) 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: apmail-incubator-imperius-dev-archive@incubator.apache.org Received: (qmail 71410 invoked by uid 500); 28 May 2009 17:01:24 -0000 Mailing-List: contact imperius-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: imperius-dev@incubator.apache.org Delivered-To: mailing list imperius-dev@incubator.apache.org Received: (qmail 71398 invoked by uid 99); 28 May 2009 17:01:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) 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 xiping@us.ibm.com designates 32.97.182.143 as permitted sender) Received: from [32.97.182.143] (HELO e3.ny.us.ibm.com) (32.97.182.143) 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 [9.56.227.234]) by e3.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4SGuECk028347 for ; Thu, 28 May 2009 12:56:14 -0400 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4SH0m4g153750 for ; Thu, 28 May 2009 13:00:48 -0400 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4SH0mXG025745 for ; Thu, 28 May 2009 13:00:48 -0400 Received: from d01ml604.pok.ibm.com (d01ml604.pok.ibm.com [9.56.227.90]) by d01av03.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4SH0mKW025740 for ; Thu, 28 May 2009 13:00:48 -0400 In-Reply-To: Subject: Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter To: imperius-dev@incubator.apache.org Cc: imperius-dev@incubator.apache.org X-Mailer: Lotus Notes Release 7.0 HF277 June 21, 2006 Message-ID: From: Xiping Wang 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 imperius-dev@incubator.apache.or= g 05/28/2009 12:23 = cc PM imperius-dev@incubator.apache.or= 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 dawood@us.ibm.com 914-784-5123 (office), 914-396-6515 (mobile) From: Xiping Wang/Watson/IBM@IBMUS To: imperius-dev@incubator.apache.org Cc: imperius-dev@incubator.apache.org 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)" "David Wood (JIRA)" 05/26/2009 08:29 PM Please respond to imperius-dev@incubator.apache.org To imperius-dev@incubator.apache.org 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 TreeParser::Exception 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

Let's take a look at the line in red in t= he policy you provided. In you example, you have 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?

Import Class com.ibm.watso= n.pml.bytearray.ByteArrayFactory:baf;
Strategy Execute_All_Appli= cable;
Policy {
Condition { baf.takeByteArray(baf.getByteArr= ay()) }
Decision { ReturnValue(\= "OK\") }
}:1;


Xiping
IBM TJ Watson Research Center

3D"InactiveDavid Wood/Watson/IBM@IBMUS


=
          David Wood/Watson/IBM@IBMUS

          05/28/2009 12:23 PM
          Please respond to
          imperius-dev@incubator.apache.org

=
3D=
To
3D""
imperius-dev@incubator.apache.org
3D=
cc
3D""
imperius-dev@incubator.apache.org
3D=
Subject
3D""
Re: [jira] Updated: (IMPERIUS-28) byte[] method return= type does not match formal parameter
3D=3D""

I don't think this is an SPL specification issue.  This is str= ictly a
problem with the definition of the method's return type as indicated in=
the Java Class object.  Somehow that definition is not being picke= d up as
an array and instead just as a single byte.  It _is_ getting the f= ormal
parameter definition correct (i.e. a byte[]).

David Wood
Policy Technologies Group
IBM TJ Watson Research Center
dawood@us.ibm.com
914-784-5123 (office), 914-396-6515 (mobile)




From:
Xiping Wang/Watson/IBM@IBMUS
To:
imperius-dev@incubator.apache.org
Cc:
imperius-dev@incubator.apache.org
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)" <jira@apache.org>


"David Wood (JIRA)" <jira@apache.org>
05/26/2009 08:29 PM

Please respond to
imperius-dev@incubator.apache.org




To

imperius-dev@incubator.apache.org

cc


Subject

[jira] Updated: (IMPERIUS-28) byte[] method return type does not match =
formal parameter






   [
htt= ps://issues.apache.org/jira/browse/IMPERIUS-28?page=3Dcom.atlassian.jir= a.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: IMPER= IUS-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, Po= licyParser.java
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> It appears that a method's byte[] return type is not being properl= y
matched with a byte[] method argument.  The attached Java program = includes
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 TreeParser::Exception creating Expression at line 4 :=
Formal and passed parameter types don't match for method takeByteArray<= br> >  Formal and passed parameter types don't match for method tak= eByteArray
> 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(Polic= yParserImpl.java:166)
> at
org.apache.imperius.spl.datastore.impl.PolicyParserImpl.createInternalP= olicyObject(PolicyParserImpl.java:96)
> at com.ibm.watson.pml.bytearray.PolicyParser.main(PolicyParser.jav= a:55)
> I've attached both the Java program and the ByteArrayFactory inter= face
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-- --0__=0ABBFF57DFCF59048f9e8a93df938690918c0ABBFF57DFCF5904--