Valid characters in a module name
s.2016.kay at gmail.com
Mon Jan 2 08:38:35 UTC 2017
My questions relate to module names in the binary form in the
My scenario is a utility that reads Java bytecode files and performs
transformations on them as specified by the user in a text script file. In
the text script file the user currently specifies package, class, field and
method names (amongst other things). If the utility and others like it is
to support Java 9 then the user must be able to specify module names that
match those within module-info.class files. These names must then be
parsed from within the script. This is where the difficulties arise.
Typically, utilities which process bytecode use a Java like syntax in their
scripting languages for obvious reasons. So if a module name can start with
/* or // then existing comment parsing will needlessly disrupted. If a
module name can start with or contain double or single quotes then existing
String literal parsing will be needlessly disrupted. If a module name can
contain semi-colons then existing line termination parsing will disrupted.
Put another way, is there an existing module system in world today that
commonly uses spaces, single quotes, double quotes or semicolons in a
module identifier? If not then why should these characters be allowed
within a Java 9 module name? Providing flexibility for some future
hypothetical module system has its costs here and now for downstream users.
More information about the jigsaw-dev