incubator-imperius-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiping Wang <xip...@us.ibm.com>
Subject Re: [jira] Updated: (IMPERIUS-28) byte[] method return type does not match formal parameter
Date Thu, 28 May 2009 17:00:47 GMT

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@I                                             
             BMUS                                                       To 
                                       imperius-dev@incubator.apache.org   
             05/28/2009 12:23                                           cc 
             PM                        imperius-dev@incubator.apache.org   
                                                                   Subject 
                                       Re: [jira] Updated: (IMPERIUS-28)   
             Please respond to         byte[] method return type does not  
             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 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)" <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






    [
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 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 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.




Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message