tuscany-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Florian Pinel (JIRA)" <tuscany-...@ws.apache.org>
Subject [jira] Updated: (TUSCANY-2288) MappingWrapper.getInsertOrder() uses incorrect algorithm
Date Fri, 02 May 2008 17:48:55 GMT

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

Florian Pinel updated TUSCANY-2288:
-----------------------------------

    Attachment: MappingWrapper.java

Attached is a suggested fix.

> MappingWrapper.getInsertOrder() uses incorrect algorithm
> --------------------------------------------------------
>
>                 Key: TUSCANY-2288
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-2288
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java DAS RDB
>    Affects Versions: Java-DAS-beta1
>            Reporter: Florian Pinel
>            Priority: Critical
>         Attachments: MappingWrapper.java
>
>
> MappingWrapper.getInsertOrder() uses an incorrect algorithm:
>             while (parents.size() > 0) {
>                 String parent = (String) parents.get(0);
>                 if (!children.contains(parent)) {
>                     if (!inserts.contains(parent)) {
>                         inserts.add(parent);
>                     }
>                     String child = (String) parentToChild.get(parent);
>                     if (!inserts.contains(child)) {
>                         inserts.add(child);
>                     }
>                     parents.remove(parent);
>                     children.remove(child);
>                 } else {
>                     parents.add(parents.remove(0));
>                 }
> The following line causes a bug:
> String child = (String) parentToChild.get(parent);
> A parent can have multiple children, and this line will not return the correct child.
> The bug will become visible if you try a data object with 1 parent, 2 children and 1
grandchild.

-- 
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