Bug 1004869

Summary: Jcr2vfs migration tool replaces '#' with '//' on places where it shouldn't
Product: [Retired] JBoss BRMS Platform 6 Reporter: Petr Široký <psiroky>
Component: Business CentralAssignee: Mark Proctor <mproctor>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Široký <psiroky>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: rzhang
Target Milestone: ER6   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:18:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Diff of BPMN2 process definition before and after migration none

Description Petr Široký 2013-09-05 15:55:38 UTC
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 16:24:08 UTC
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 08:09:55 UTC
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'
    when
      #conditions
    then
      System.out.println("#8");
      #actions
    end

it gets migrated to:

    rule 'Dummy rule'
    when
      //conditions
    then
      System.out.println("//8");
      //actions
    end

The string parameter "#8" should not be replaced by "//8".

Comment 4 Jervis Liu 2013-09-09 02:56:07 UTC
Fixed. Thanks for pointing out the problem. 

http://github.com/droolsjbpm/drools-wb/commit/98aff2eb4

Comment 5 Petr Široký 2013-09-14 23:25:40 UTC
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

https://github.com/droolsjbpm/drools-wb/commit/b633aa7ef12690b2d6e1312a92f535a7bf879589

Comment 10 Petr Široký 2013-10-31 11:31:47 UTC
One more commit needed for fixing this issue:
https://github.com/droolsjbpm/drools-wb/commit/dd9e544d6a31020a90b0140f74f4729a6823fe5f

Comment 12 Petr Široký 2014-01-14 10:46:58 UTC
Verified fixed in 6.0.0-ER7.