https://issues.apache.org/bugzilla/show_bug.cgi?id=49940

--- Comment #11 from Dr Meier <[email protected]> ---
(In reply to comment #9)
> Now i had the problem in another context. I used the "getXXXXArray()" method
> to iterate over a list of XML Elements.
> 
> I removed an element with the removeXXXX() method.
> 
> As soon as i forgot to refresh the Array afterwards with .getXXXXArray() the
> XmlValueDisconnectedException happens again.
> 
> After the correction the code works fine:
> 
> DTCVALUE[] dtcValues = envData.getDTCVALUES().getDTCVALUEArray();
> for(int k=dtcValues.length-1; k > 0 ;k--) {
>       DTCVALUE dtcValue = dtcValues[k];
>       if(!dtcMap.containsKey(dtcValue.getStringValue())){
>               dtcMap.put(dtcValue.getStringValue(), envData);
>       }else{
>               DTCVALUES vals = envData.getDTCVALUES();
>               vals.removeDTCVALUE(k);
> 
>               // !!!!!!! This is necessary, otherwise the Disconnected
>                 // Exception occors. !!!!!!!
>               dtcValues = envData.getDTCVALUES().getDTCVALUEArray();
>       }
> }


Loop must run until "k >= 0", sorry!

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to