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

compilation of broken provides statement produces incorrect error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • 9
    • 9-repo-jigsaw
    • tools
    • None

      In case of module-info file declares provides statement with broken service interface (interface is not public,interface is not reachable), compiler returns two errors:
      One is expected:
      Inter is not public in pack; cannot be accessed from outside package

      And one confusing error:
      the service implementation does not have a default constructor: <any>

      There is no reason of second error, because in fact implementation has a default constructor.
      -----------------------------------
      Minimal test case:
      Directory layout:
      mod01/module-info.java
      mod01/pack/Implem.java

      Code:
      module-info.java:
      module mod01{
          provides pack.Inter with pack.Implem;
      }

      Implem.java:
      package pack;
      public class Implem implements Inter{}

      interface Inter{}

      This bug is reproduced both on Windows and Linux with jigsaw build 103.

            vromero Vicente Arturo Romero Zaldivar
            kbarzilovich Konstantin Barzilovich (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: