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/i...@i
BMUS To
[email protected]
05/28/2009 12:23 cc
PM [email protected]
Subject
Re: [jira] Updated: (IMPERIUS-28)
Please respond to byte[] method return type does not
imperius-...@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
[email protected]
914-784-5123 (office), 914-396-6515 (mobile)
From:
Xiping Wang/Watson/i...@ibmus
To:
[email protected]
Cc:
[email protected]
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)" <[email protected]>
"David Wood (JIRA)" <[email protected]>
05/26/2009 08:29 PM
Please respond to
[email protected]
To
[email protected]
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.