cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Connert (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CXF-2504) HolderOutInterceptor messes up Holder
Date Wed, 28 Oct 2009 07:41:59 GMT

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

Christian Connert updated CXF-2504:
-----------------------------------

    Priority: Trivial  (was: Major)

> HolderOutInterceptor messes up Holder
> -------------------------------------
>
>                 Key: CXF-2504
>                 URL: https://issues.apache.org/jira/browse/CXF-2504
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>         Environment: System:
> 2.6.28-15-generic #52-Ubuntu SMP Wed Sep 9 10:48:52 UTC 2009 x86_64 GNU/Linux
> Java:
> java version "1.6.0_16"
> Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
> Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)
> Apache CXF 2.2.3 (not in version list) 
>            Reporter: Christian Connert
>            Priority: Trivial
>
> Hi,
> The HolderOutInterceptor causes that the holder object is lost, when the response is
send back to the client.
> It's caused by the following code block (line 72 - 79:
>             if (inObjects != null) {
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(x + 1, o);
>                     }
>                 }
>             }
> inObjects contains (in this order!) the request and the older object, out objects the
response. Thus the older which is at index 1 will be appended to the out objects at index
2, leaving index 1 empty, but only the first two objects are send back to the client. From
my point of view it can be fixed by using a separate index variable for the outObjects and
initialize it with outObjects.getSize(). Which would result in some code like this:
>             if (inObjects != null) {
>                 int index = outObjects.size();
>                 for (int x = 0; x < inObjects.size(); x++) {
>                     Object o = inObjects.get(x);
>                     if (o instanceof Holder) {
>                         outObjects.set(index++, o);
>                     }
>                 }
>             }
> Cheers
> Christian

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message