[JAMESII-335] Handle package naming convention less restrictively Created: 02/Apr/13  Updated: 04/Apr/13  Resolved: 04/Apr/13

Status: Resolved
Project: James II
Component/s: Core
Affects Version/s: None
Fix Version/s: None
Security Level: public (Visible to EVERYONE.)

Type: Improvement Priority: Major
Reporter: re027 Assignee: Stefan Rybacki
Resolution: Fixed Votes: 0
Labels: plugnsimulate, regexp
Remaining Estimate: 0 minutes
Time Spent: Not Specified
Original Estimate: 0 minutes


 Description   

When a plugin.xml is loaded, the parser checks the FQCNs of the factories with the regular expression

[a-z][0-9a-zA-Z._]*[\[\]]*

which enforces that the first package name starts with a lower-case letter. While this is in tune with the JLS (see http://docs.oracle.com/javase/specs/jls/se7/jls7.pdf, p. 124: "The first component of a unique package name is always written in all-lowercase ASCII letters and should be one of the top level domain names, such as com, edu, gov, mil, net, or org, or one of the English two-letter codes identifying countries as specified in ISO Standard 3166."), it is not enforced by popular tools like Eclipse. Still, plugins referring to classes defined in the default package or within a (top-most) package named with an upper case as first character will not be loaded.

The error message will look like:

WARNING: Error reading plugin XML (might be ok if the loaded XML file is not a James II Plugin - XML File) --> [...]\GroupID\ArtificialID\model\plugin.xml/Path:[...]\target\classes\GroupID\ArtificialID\model\plugin.xml
org.xml.sax.SAXParseException; lineNumber: 4; columnNumber: 66; cvc-pattern-valid: Value 'GroupID.ArtificialID.model.MyModelFactory' is not facet-valid with respect to pattern '[a-z][0-9a-zA-Z._]*[\[\]]*' for type 'JavaClass'.

This may lead to confusion and seems too restrictive.

Credit: this issue was found by Lucio Tolentino (University of Iowa).


Generated at Fri Aug 14 07:15:38 CEST 2020 using JIRA 5.0.7#734-sha1:8ad78a62c71cf08b03545eb446cc3b9bb5ce37ad.