[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [bpel-dev] Bug of copy/paste the node has children nodes
|
Hi grovecai,
Hmm, this looks very strange indeed. It's almost as if a recursive algorithm doesn't know when to stop, and it's copying the elements in reverse order somehow. I haven't looked at that code yet, but I see you've already reported it here [1] - thanks for that :)
Cheers!
Bob
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=383169
----- Original Message -----
> Hi, guys.
> I need help to fix a bug. The following is about bug and some
> exploration.
> When copy and paste the node has children node, pasting action
> produces
> redundant children nodes.
> For example, if you copy node like :
>
> <bpel:if name="If">
> <bpel:sequence>
> <bpel:invoke name="Invoke"/>
> </bpel:sequence>
> <bpel:elseif/>
> <bpel:elseif/>
> </bpel:if>
>
> when you paste it, you may got this:
>
> <bpel:if name="If3">
> <bpel:sequence>
> <bpel:invoke name="Invoke"></bpel:invoke>
> </bpel:sequence>
>
> <bpel:elseif></bpel:elseif>
> <bpel:elseif></bpel:elseif>
> <bpel:elseif></bpel:elseif>
> <bpel:elseif></bpel:elseif>
>
> <bpel:sequence>
> <bpel:invoke name="Invoke"></bpel:invoke>
> </bpel:sequence>
>
> <bpel:elseif></bpel:elseif>
>
> <bpel:sequence>
> <bpel:invoke name="Invoke"></bpel:invoke>
> </bpel:sequence>
>
> </bpel:if>
>
> You may not get the same result in every copying and pasting
> operation.
> The result is not expected. I try to fix the bug, so I explore the
> BPELCopyAction and BPELPasteAction in package
> org.eclipse.bpel.ui.actions. At first, I thought the problem may
> have connection with BPELPasteCommand in package
> org.eclipse.bpel.ui.commands. The related code is BPELPasteCommand's
> doExcute() method, here is the code:
>
> public void doExecute() {
> TransferBuffer transferBuffer = fBpelEditor.getTransferBuffer();
> fPastedObjects = transferBuffer.copyTransferBuffer(fTargetObject,
> fBpelEditor.getExtensionMap(),fReference );
> }
>
> After I read the code of the method
> TransferBuffer.copyTransferBuffer, I found the method copy the
> source node model to the target node model. I thought the model
> copying may cause this bug. But after explore detail in
> TransferBuffer.copyContentsTo method, I found the there is nothing
> wrong in model copying, or I missed something? If the model copying
> is right, may be problem arise when model being serialized to xml. I
> cannot find the relative code, any hints may be help.
> Thanks!
>
> grovecai
>
>
>
> _______________________________________________
> bpel-dev mailing list
> bpel-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/bpel-dev
>