Valid characters in a module name
s.2016.kay at gmail.com
Tue Jan 3 21:38:12 UTC 2017
> Java EE and JBoss Modules both allow this
Two points. Firstly there is a big difference between a character being
allowed and the character actually being used in practice. Are you saying
that in practice anyone anywhere is putting spaces, single quotes or double
quotes within a Java EE and JBoss module name? If the answer is yes then
how common would that be?
Also, do Java EE and JBoss module names currently allow the characters in
the range 0x00 to 0x1F? If the answer is yes then 100% compatibility with
Java 9 module names is already gone.
The second point is that we are now talking about Java 9 module names being
embedded as identifiers within Java class files where they will directly
affect downstream users. This was not the case with Java EE and JBoss
Module names. This is a much, much bigger deal.
> There has been plenty of serious thought
In the jpms-spec-experts list it is suggested that "for sanity" Java 9
module names should not contain "any character whose Unicode code point is
less than 0x20". Yet the DEL (0x127) character is allowed?
Taking a step backwards, it would appear that it was never considered that
Java 9 module names might need be be specified as identifiers in existing
bytecode processing scripting languages. That is 100% understandable.
However, now that it is known that that is the case, doesn't it make sense
"for sanity" to not allow a Java 9 module name to contain spaces, single
quotes, double quotes, semicolons or asterixes? The problem with spaces,
single quotes, double quotes in an identifier that needs to be parsed from
a text file is obvious. As mentioned earlier, the problem with semicolons
is that they are commonly used as terminators in the scripting languages
which nearly always use a Java style syntax. The problem with asterixes is
that they are commonly used as a wildcard character in identifiers in the
On Wed, Jan 4, 2017 at 2:04 AM, David M. Lloyd <david.lloyd at redhat.com>
> On 01/01/2017 07:44 PM, Ess Kay wrote:
>> Hi Rémi,
>> You can update your tool to use an escape character
>> Sure. However, can you imagine how much work it would be to update a Java
>> source parser to allow identifiers like package and class names to contain
>> escaped semi-colons, single quotes or double quotes? My scenario and that
>> of many others is the same. It can be done but the result will be ugly.
>> I repeat my earlier question, are there existing module systems out there
>> that allow spaces, quotes and semi colons to appear in a module name?
> Yes. Java EE and JBoss Modules both allow this, as do systems where a
> file name is a module name.
> All I ask is that serious thought be given to how much flexibility is
>> really needed in a module name. There are signs that there has not yet
>> been much serious thought. For example backspace is not allowed but DEL
>> (0x127) is allowed.
> There has been plenty of serious thought, and I agree that we should be
> disallowing all Unicode controls of any kind, but my understanding is that
> there are implementation complexities involved which make this somehow
> impractical. However UTF-8 parsing is not difficult so hopefully this can
> be revisited at some point.
> - DML
More information about the jigsaw-dev