Valid characters in a module name

Ess Kay s.2016.kay at gmail.com
Thu Jan 5 08:22:27 UTC 2017


> No, that's not how it works at all ... Only container code will be
creating or referencing such modules
This may be true for JBoss & JEE modules.  However, the very reason I
raised the initial question was because it is NOT true for identifiers
embedded in Java bytecode.  There are utilities out there now that
manipulate bytecode that are driven by script files that specify Java
identifiers using a Java-style syntax.  I raised the initial question
because I have the job of updating such a utility to support Java 9.  In
part that entails parsing user specified module names out of a script file.
If we now need to support quotes and spaces etc in a module identifier then
it is going to be a problem.

> In the language, the module identifier is bounded by quite strict syntax
If you are a downstream user processing bytecode files rather than source
code then that doesn't help. You technically need to support the the broad
character range specified by the JVM specification even though you know
that the chance that someone will put a space or quote etc in a module name
is vanishingly small.

> There are zero cases where one would have to parse an arbitrary module
identifier from a text file
As set out above that is not the case. I'll give you a another perhaps more
mainstream example.  I imagine that there will be times when errors
reporting module issues (e.g. missing modules?) will be written to a log
file. It is not uncommon for other applications to read such log files and
process the contents. Technically the applications reading such log files
should, in their parsing, allow for module names containing spaces and
quotes etc because that is what the JVM specification says is possible.

> Yes it's allowed (not 0x00 but the others are), but I don't think there
is any practical way to actually accomplish injecting most of those values
Again, as set out above, it doesn't matter if anyone actually put spaces
and quotes etc in a module name.  If you are going to be guided by the JVM
Spec then sadly you to need to allow for them.

> "sanity" characters are selected completely arbitrarily
Exactly. That is what makes it so frustrating.  I have little doubt that if
the people who decided the range of excluded characters had to write the
code to parse out module names from text files then we would have a few
extra characters excluded and no existing module system would be
compromised.


More information about the jigsaw-dev mailing list