Bug 997415

Summary: It is possible to create package with illegal name
Product: [Retired] JBoss BRMS Platform 6 Reporter: Jiri Locker <jlocker>
Component: Business CentralAssignee: manstis
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Locker <jlocker>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: zkrejcov
Target Milestone: ER4   
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:59 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:

Description Jiri Locker 2013-08-15 13:14:52 UTC
Description of problem:
1) When creating a package through New item menu the form doesn't validate package name and accepts illegal values.

2) After creating a new project, new package is automatically generated from GroupID and ArtifactID. Legal values for GID and AID may result in illegal package name (typically hyphens in ArtifactID).

Illegal package name will cause, for example, compiler errors.

Version-Release number of selected component (if applicable):
ER1

How reproducible:
always

Steps to Reproduce:
1. create new project org.sample:my-project:1.0
OR
1. in existing project create new package and enter illegal value

Actual results:
No validation, invalid package created and can be used without warning. First problem occurs when building the project.

Expected results:
- New package form should validate user input and not allow to create package with illegal name. See Data modeler input validation.
- When generating a default package for a new project its name should be automatically legalized.

Additional info:
http://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html
http://docs.oracle.com/javase/specs/jls/se7/html/jls-6.html#d5e6484 :

    If the domain name contains a hyphen, or any other special character not allowed in an identifier (§3.8), convert it into an underscore.

    If any of the resulting package name components are keywords (§3.9), append an underscore to them.

    If any of the resulting package name components start with a digit, or any other character that is not allowed as an initial character of an identifier, have an underscore prefixed to the component.

Comment 5 Jiri Locker 2013-10-18 13:56:46 UTC
Fixed in ER4.