Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8164969

Module name check is too restrictive

    XMLWordPrintable

    Details

      Description

      While testing ASM,
      i've found that you can not currently load a module that has a '+' in its name.

      /usr/jdk/jdk-9-jigsaw/bin/java --module-path tmp --module "foo+bar"
      Error occurred during initialization of VM
      java.lang.module.ResolutionException: Error reading module: tmp/foo
      at java.lang.module.Resolver.findWithBeforeFinder(java.base@9-ea/Resolver.java:735)
      at java.lang.module.Resolver.resolveRequires(java.base@9-ea/Resolver.java:86)
      at java.lang.module.Configuration.resolveRequiresAndUses(java.base@9-ea/Configuration.java:370)
      at java.lang.module.ModuleDescriptor$1.resolveRequiresAndUses(java.base@9-ea/ModuleDescriptor.java:2081)
      at jdk.internal.module.ModuleBootstrap.boot(java.base@9-ea/ModuleBootstrap.java:263)
      at java.lang.System.initPhase2(java.base@9-ea/System.java:1927)
      Caused by: java.lang.module.InvalidModuleDescriptorException: foo+bar: Invalid module name: Illegal character at index 3

      According to the spec [1] section 2.1, the module name is a name in its internal form (JVMS 4.2.1)
      so it's a sequence of unicode characters (beside '.', ';', '[' and '/') separated by '/'.
      So '+' is a valid character.

      See:
        http://mail.openjdk.java.net/pipermail/jigsaw-dev/2016-August/009209.html

        Attachments

          Activity

            People

            Assignee:
            alanb Alan Bateman
            Reporter:
            hseigel Harold Seigel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: