Bug 1004869 - Jcr2vfs migration tool replaces '#' with '//' on places where it shouldn't
Jcr2vfs migration tool replaces '#' with '//' on places where it shouldn't
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ER6
: 6.0.0
Assigned To: Mark Proctor
Petr Široký
Depends On:
  Show dependency treegraph
Reported: 2013-09-05 11:55 EDT by Petr Široký
Modified: 2014-08-06 16:18 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:18:44 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Diff of BPMN2 process definition before and after migration (217.53 KB, image/png)
2013-09-05 11:55 EDT, Petr Široký
no flags Details

  None (edit)
Description Petr Široký 2013-09-05 11:55:38 EDT
Created attachment 794326 [details]
Diff of BPMN2 process definition before and after migration

Description of problem:
Jcr2vfs migration tool replaces the old (in 6.0 not supported) comment char '#' with '//' also on places where it should not. For example in BPMN2 process definitions, it replaces color definitions from '#ffffff' to '//ffffff' which makes them invalid. See the screenshot showing the diff between original BPMN2 asset and migrated BPMN2 asset.

I am not sure what other places (assets) could be affected, will try more use cases to find out.

Version-Release number of selected component (if applicable):
Community 6.0.0-SNAPSHOT

Steps to Reproduce:
1. Migrate some BPMN2 asset
2. Look for "drools:bgcolor" in the migrated process definition.
Comment 1 Petr Široký 2013-09-05 12:24:08 EDT
I just saw the same replacements in json files that use #ffffff for colors. I guess this is general issue for all the non-DRL assets.
Comment 3 Petr Široký 2013-09-06 04:09:55 EDT
Looking at the code, the '#' will be replaced also in strings, which is not desired. For example, consider following DRL file content:

    rule 'Dummy rule'

it gets migrated to:

    rule 'Dummy rule'

The string parameter "#8" should not be replaced by "//8".
Comment 4 Jervis Liu 2013-09-08 22:56:07 EDT
Fixed. Thanks for pointing out the problem. 

Comment 5 Petr Široký 2013-09-14 19:25:40 EDT
Fixed following issues:
 * end of lines were thrown away, that's fixed now
 * comments _not_ starting at the start of line are migrated too
   e.g. 'some text # comment' -> 'some text // comment'
 * hash tags inside double and single quotes are not touched
 * DSL debug mark '#/' is not touched
 * escaped quotes (\' and \") are ignored

Comment 10 Petr Široký 2013-10-31 07:31:47 EDT
One more commit needed for fixing this issue:
Comment 12 Petr Široký 2014-01-14 05:46:58 EST
Verified fixed in 6.0.0-ER7.

Note You need to log in before you can comment on or make changes to this bug.