Red Hat Bugzilla – Bug 997415
It is possible to create package with illegal name
Last modified: 2014-08-06 16:18:59 EDT
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):
Steps to Reproduce:
1. create new project org.sample:my-project:1.0
1. in existing project create new package and enter illegal value
No validation, invalid package created and can be used without warning. First problem occurs when building the project.
- 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.
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.
Fixed in ER4.