This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 28243 - Duplicate items in exported XMI
Summary: Duplicate items in exported XMI
Status: RESOLVED FIXED
Alias: None
Product: java
Classification: Unclassified
Component: Unsupported (show other bugs)
Version: 3.x
Hardware: PC Windows 3.1/NT
: P3 blocker (vote)
Assignee: issues@java
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-10-24 11:42 UTC by Vincent Lombart
Modified: 2002-12-03 10:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Lombart 2002-10-24 11:42:29 UTC
Hello 

I am currently working with MDR (release build) and the 
CWM metamodel. 
I have a strange behavior (duplicate items) with the 
exported XMI file when using TransformationMap and 
ClassifierMap with the following code. What this code does 
is simply create a TransformationMap and add two 
ClassifierMaps to it.

                TransformationPackage tfm = 
cwmPackage.getTransformation(); 
                TransformationMap tfmMap = 
                        tfm.getTransformationMap
().createTransformationMap(); 
                tfmMap.setName("tfmMap"); 

                ClassifierMap clsMap1 = 
tfm.getClassifierMap().createClassifierMap(); 
                clsMap1.setName("clsMap1"); 
                clsMap1.setTransformationMap(tfmMap); 

                ClassifierMap clsMap2 = 
tfm.getClassifierMap().createClassifierMap(); 
                clsMap2.setName("clsMap2"); 
                clsMap2.setTransformationMap(tfmMap); 

The exported XMI is: 

<?xml version = '1.0' encoding = 'ISO-8859-1' ?> 
<XMI xmi.version = '1.2' xmlns:CWM 
= 'org.omg.xmi.namespace.CWM' xmlns:CWMXCOBOL 
= 'org.omg.xmi.namespace.CWMXCOBOL' 
  xmlns:CWMMIN = 'org.omg.xmi.namespace.CWMMIN' 
xmlns:CWMIV = 'org.omg.xmi.namespace.CWMIV' 
  xmlns:CWMBUS = 'org.omg.xmi.namespace.CWMBUS' 
xmlns:CWMXML = 'org.omg.xmi.namespace.CWMXML' 
  xmlns:CWMXIS = 'org.omg.xmi.namespace.CWMXIS' 
xmlns:CWMXESSB = 'org.omg.xmi.namespace.CWMXESSB' 
  xmlns:CWMREC = 'org.omg.xmi.namespace.CWMREC' 
xmlns:CWMXER = 'org.omg.xmi.namespace.CWMXER' 
  xmlns:CWMOLAP = 'org.omg.xmi.namespace.CWMOLAP' 
xmlns:CWMTFM = 'org.omg.xmi.namespace.CWMTFM' 
  xmlns:CWMMDB = 'org.omg.xmi.namespace.CWMMDB' 
xmlns:CWMXExpress = 'org.omg.xmi.namespace.CWMXExpress' 
  xmlns:CWMWHP = 'org.omg.xmi.namespace.CWMWHP' 
xmlns:CWMXDMSII = 'org.omg.xmi.namespace.CWMXDMSII' 
  xmlns:CWMXIMS = 'org.omg.xmi.namespace.CWMXIMS' 
xmlns:CWMRDB = 'org.omg.xmi.namespace.CWMRDB' 
  xmlns:CWMWHO = 'org.omg.xmi.namespace.CWMWHO' 
xmlns:CWMXIR = 'org.omg.xmi.namespace.CWMXIR' 
  timestamp = 'Mon Oct 21 16:46:00 CEST 2002'> 
  <XMI.header> 
    <XMI.documentation> 
      <XMI.exporter>Netbeans XMI Writer</XMI.exporter> 
      <XMI.exporterVersion>1.0</XMI.exporterVersion> 
    </XMI.documentation> 
  </XMI.header> 
  <XMI.content> 
    <CWMTFM:TransformationMap xmi.id = 'a1' name 
= 'tfmMap' isPrimary = 'false'> 
      <CWM:Namespace.ownedElement> 
        <CWMTFM:ClassifierMap xmi.id = 'a2' name 
= 'clsMap2'/> 
        <CWMTFM:ClassifierMap xmi.id = 'a3' name 
= 'clsMap1'/> 
      </CWM:Namespace.ownedElement> 
      <CWMTFM:TransformationMap.classifierMap> 
        <CWMTFM:ClassifierMap xmi.id = 'a2' name 
= 'clsMap2'/> 
        <CWMTFM:ClassifierMap xmi.id = 'a3' name 
= 'clsMap1'/> 
      </CWMTFM:TransformationMap.classifierMap> 
    </CWMTFM:TransformationMap> 
  </XMI.content> 
</XMI> 

What I find strange is that the ClassifierMap definitions 
appear twice in the output XMI. If I detail the 
ClassifierMaps, e.g. by adding source and target 
definitions, the details also appear twice.

Is this behavior normal, or at least harmless? Is it 
possible to prevent it? 
Is it linked to the fact that the association between 
TransformationMap and ClassifierMap (CWM Transformation 
package) is the same as the association between NameSpace 
and ModelElement (CWM Core package)?

Best regards 

Vincent Lombart
Comment 1 Daniel Prusa 2002-10-30 12:18:26 UTC
The bug in XMIWriter is fixed now, however, there are still some
problems related to the used association having protected visibility -
references to this association shoul not be allowed and it should not
be possible to generate the attached XMI file. As a consequence of
these problems, XMIReader fails to read the generated XMI file (even
if the serialization of ClassifierMap instances is fixed - there are
no duplicates anymore).
I am leaving the issue still open.
Comment 2 Martin Matula 2002-12-02 16:48:42 UTC
Is this resolved? If so, Dan, please close it.
Comment 3 Daniel Prusa 2002-12-03 10:19:40 UTC
The bug in XmiWriter is fixed, I am closing this issue.