Bug 1038216 - jcr2vfs: Java keywords in package name are migrated as is, which results in invalid package names
Summary: jcr2vfs: Java keywords in package name are migrated as is, which results in i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Migration Tool
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER1
: 6.0.1
Assignee: Neus Miras
QA Contact: Petr Široký
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-04 16:08 UTC by Petr Široký
Modified: 2014-08-06 19:57 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Migrating packages with Java keywords as part of the name. Consequence: After migrating the BRMS 5.3 packages to BRMS 6.0 projects, the keywords in package names are not escaped, thus making the package names invalid. Workaround is to manually rename the projects after migration or the package names before migration. Fix: Result:
Clone Of:
Environment:
Last Closed: 2014-08-06 19:57:10 UTC
Type: Bug


Attachments (Terms of Use)
JCR repo that will reproduce the issue. (1.10 MB, application/zip)
2014-01-14 12:16 UTC, Petr Široký
no flags Details

Description Petr Široký 2013-12-04 16:08:59 UTC
Description of problem:
When a JCR package name contains Java keywords like 'package' or 'new' (complete list here: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html) it gets migrated into a project that contains the package name as is, thus making it invalid Java package name. Following is a directory structure created by the migration tool. There seems to be a try to "escape" the package keyword, however the assets are saved in the unescaped directory. Also note that for example DRL assets contain the wrong package name (with the unescaped keyword).

|-- pom.xml
|-- project.imports
`-- src
    |-- main
    |   |-- java
    |   |   `-- keyword
    |   |       `-- _package
    |   |           `-- in
    |   |               `-- name
    |   `-- resources
    |       |-- keyword
    |       |   |-- package
    |       |   |   `-- in
    |       |   |       `-- name
    |       |   |           |-- Rule\ in\ invalid\ package.drl
    |       |   |           `-- Simple\ text\ file.txt
    |       |   `-- _package
    |       |       `-- in
    |       |           `-- name
    |       `-- META-INF
    |           `-- kmodule.xml
    `-- test
        |-- java
        |   `-- keyword
        |       `-- _package
        |           `-- in
        |               `-- name
        `-- resources
            `-- keyword
                `-- _package
                    `-- in
                        `-- name



Version-Release number of selected component (if applicable):
6.0.0-ER5 (also community 6.0.0-SNAPSHOT)

Comment 1 Neus Miras 2013-12-10 16:52:31 UTC
To be consistent with the current package name management, all the package name migrated are converted to lowercase and escaped if it has keywords before creation.

Commit:
6.0.x
https://github.com/droolsjbpm/drools-wb/commit/6a6abab9dedc23560036885eb79335816d279589

Comment 2 Neus Miras 2013-12-11 15:53:48 UTC
Resolved an associaced bug related with the package naming of the scenarios 

Commit:
https://github.com/droolsjbpm/drools-wb/commit/25b986ca8fb60642b57c153ad7b9da6f799ed0d0

Comment 3 Petr Široký 2014-01-14 12:16:09 UTC
Tested again with 6.0.0-ER7 and I am still seeing the same wrong directory structure as described above. I am attaching the repo that can be used to reproduce the issue.

Comment 4 Petr Široký 2014-01-14 12:16:50 UTC
Created attachment 849915 [details]
JCR repo that will reproduce the issue.

Comment 6 Neus Miras 2014-01-23 09:56:41 UTC
Fixed. Now adds 'mod_' to the keyword and renames the project packages too.

Commited at 6.0.x:
https://github.com/droolsjbpm/drools-wb/commit/c02c2d71a23486c98df1cf3b633b7166ef3a5ead

Comment 7 Lukáš Petrovický 2014-02-07 16:19:31 UTC
This no longer has a target release of 6.0.0.

Comment 8 Petr Široký 2014-02-20 17:24:17 UTC
I am not sure if the prefix "mod_" is the best one, but it makes it clear that the package name changed, so that is good. The issue is fixed so I am closing it. Verified in 6.0.1-ER1.


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