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

Doclet API: It's confusing that modifiers() returns "interface"

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • 9
    • 1.3.0
    • tools

      The method modifiers() returns the word "interface", much to
      the surprise of several users. It comes as a total
      surprise to anyone who uses the API.

      This is either a doc bug to better document "modifiers()" or a Doclet API bug
      to improve the interface.

      The issue basically stems from the fact that there is
      no InterfaceDoc type -- only a ClassDoc type. So
      anything other than the word "class" in the signature
      is considered a "modifier" -- even when the word is
      "interface".

      That is just plain wrong-headed. But any doclet code
      ever written has accounted for that behavior, by now.

      The only real solution, then, is to both:
        a) Deprecate modifiers()
        b) Replace it with something that does the right
           thing, called declarations(), or something.

      And, optionally:
        a) Create an IfcDoc class.
        b) Have both ClassDoc and IfcDoc extend a common
           class, called PrototypeDoc
        c) Create a TemplateDoc subclass of PrototypeDoc,
           when parameterized types become a reality.
        
      Then maybe I could *remember* that the thing the
      code is processing could be either a class or an
      interface. (Calling it a classdoc object leads me
      to forgetting, over and over, that it might be an
      interface. Calling it a PrototypeDoc would assist
      my beleagured memory.)
        

            ksrini Kumar Srinivasan
            dkramersunw Douglas Kramer (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: