[
http://jira.andromda.org/browse/CORE-150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andy flury updated CORE-150:
----------------------------
Attachment: Merger.java.patch
> Mulit Line Merge Mappings not working
> -------------------------------------
>
> Key: CORE-150
> URL: http://jira.andromda.org/browse/CORE-150
> Project: AndroMDA Core
> Issue Type: Bug
> Affects Versions: 3.4-SNAPSHOT
> Environment: Windows 7
> Reporter: Andy flury
> Assignee: Chad Brandon
> Priority: Minor
> Attachments: Merger.java.patch
>
> Original Estimate: 1 hour
> Remaining Estimate: 1 hour
>
> There seams to be a problem with Multi Line Merge Mappings (Single Line Merge
> Mappings work without a problem).
> Example: SpringMergeMapping.xml:
> <?xml version="1.0" encoding="UTF-8"?>
> <mappings>
> <mapping>
> <from><![CDATA[<property reference="driver"/>
> <property reference="username"/>]]></from>
> <to><![CDATA[<test/>]]></to>
> </mapping>
> Unfortunately, the two lines (<property reference="driver"/> and <property
> reference="username"/>) are not getting recognized by the
> org.andromda.core.common.Merger.
> The problem seams to be in the org.andromda.core.common.XmlObjectFactory. The
> method getObject() receives the mapping-file with the original CR & LF (\r
> \n). The returned org.andromda.core.mapping.Mappings, which contains the
> parsed mappings however replaced the \r \n by only \n.
> Now of course the String to be replaced cannot be found in the cartridge.xml,
> and no replacement takes place.
> I can be fixed with the following workaround in
> org.andromda.core.common.Merger.getMergedString():
> remove all line breaks from both "string" and "from".
> for (String from : froms) {
> from = StringUtils.trimToEmpty(from);
> string = string.replaceAll("\\r|\\n", "");
> from = string.replaceAll("\\r|\\n", "");
> if (StringUtils.isNotBlank(from) && string.contains(from)) {
> final String to = StringUtils.trimToEmpty(mapping.getTo());
> string = StringUtils.replace(string, from, to);
> }
> }
> This should work on all plattforms. It would be nice, if this could be added
> the 3.4-SNAPSHOT.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve
application availability and disaster protection. Learn more about boosting
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev