[ 
https://issues.apache.org/jira/browse/PROTON-261?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Justin Ross reassigned PROTON-261:
----------------------------------

    Assignee: Justin Ross

> pn_delivery_local_state and pn_delivery_remote_state can return a zero value 
> (outside that defined by the pn_disposition_t enum)
> --------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: PROTON-261
>                 URL: https://issues.apache.org/jira/browse/PROTON-261
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.5
>            Reporter: Keith Wall
>            Assignee: Justin Ross
>             Fix For: 0.19.0
>
>
> In proton-c, pn_delivery_local_state and pn_delivery_remote_state are defined 
> as returning an pn_disposition_t:
> PN_EXTERN pn_disposition_t pn_delivery_local_state(pn_delivery_t *delivery);
> PN_EXTERN pn_disposition_t pn_delivery_remote_state(pn_delivery_t *delivery);
> with pn_disposition_t defined as:
> typedef enum pn_disposition_t {
>   PN_RECEIVED=1,
>   PN_ACCEPTED=2,
>   PN_REJECTED=3,
>   PN_RELEASED=4,
>   PN_MODIFIED=5
> } pn_disposition_t;
> However, there are circumstances when the proton-c implementation returns a 
> value outside this enumeration - value 0 - coming for the struct 
> initialisation in pn_delivery().  What does this value mean and how is an 
> application supposed to react to this value?   Are there an implicit 
> restrictions regarding when an application may call 
> pn_delivery_local_state/pn_delivery_remote_state?
> btw.  This question arises from work on PROTON-257.  Proton-jni (Swig 
> generated code - so called "Proper enums" - see 
> http://www.swig.org/Doc2.0/Java.html#Java_proper_enums_classes) is failing to 
> decode the enum when testing the state of a newly created Delivery.
> test(org.apache.qpid.proton.systemtests.ProtonEngineExampleTest)  Time 
> elapsed: 0.109 sec  <<< ERROR!
> java.lang.IllegalArgumentException: No enum class 
> org.apache.qpid.proton.jni.pn_disposition_t with value 0
>         at 
> org.apache.qpid.proton.jni.pn_disposition_t.swigToEnum(pn_disposition_t.java:32)
>         at 
> org.apache.qpid.proton.jni.Proton.pn_delivery_local_state(Proton.java:624)
>         at 
> org.apache.qpid.proton.engine.jni.JNIDelivery.getLocalState(JNIDelivery.java:100)
>         at 
> org.apache.qpid.proton.systemtests.ProtonEngineExampleTest.test(ProtonEngineExampleTest.java:190)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to