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

JShell API: Diag constructor should not be exposed and fix typo

    XMLWordPrintable

Details

    • 9
    • b117
    • generic
    • generic
    • Not verified

    Description

      jdk.jshell.Diag

      The default constructor for Diag is unintentionally exposed both to external users and visible in the javadoc (without text). Changing Diag to an interface is not a good choice since there are package-private concrete and abstract methods on Diag. Simply explicitly defining the constructor as package-private addresses this issue.

      There is also a typo in the javadoc.

      Original report below --

      The constructor for this class has no javadoc; it look like it might be the default constructor.

      Typo:
      > public abstract boolean isError()
      >
      > Is this diagnostic *and* error (as opposed to a warning or note)


      Should this type be an interface rather than an abstract class? Why do client need to be able to create their own instances of Diag? Basically, why is the constructor public vs package private?

      interface is a good choice because of its relationship to the compiler API Diagnostic

      Joe

      Attachments

        Issue Links

          Activity

            People

              rfield Robert Field (Inactive)
              rfield Robert Field (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: