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

Auto-generated doc comments for enums have some doc errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • tbd
    • 5.0u4, 6
    • tools
    • generic, sparc
    • generic, solaris_10, windows_xp

      Auto-generated text for Java enums for auto-generated method values() has several doc problems:

      1. It mentions the order in which enum constants are declared, but the Summary and Detail section declare constants in different order: "Returns an array containing the constants of this enum type, in the order they're declared.". This is confusing. ###@###.### suggested to modify the doc comment so that it mentions which order is used:

      ">>>>The summary is sorted alphabetically. The detail is in source order.
      >>>>And we might allow the order of both to be specified by the user.
      >>>>(Some have argued we should not allow the source order.)
      >>>>Perhaps the bug would be that the method description should say:
      >>>>
      >>>> "Returns an array containing the constants of this enum type,
      >>>> in the order they're declared. This order is shown in the
      >>>> Detail section of the documentation for this class."
      "

      2. The example in values() method in not well-formatted according to the Java Code Conventions:
      for(TrayIcon.MessageType c : TrayIcon.MessageType.values())
              System.out.println(c);

      It is suggested that the example is modified to include curly braces "{", "}", and that the indent before System.out.println be 4 spaces

      See comments section for the example generated documents.

      ###@###.### 2005-2-09 15:37:48 GMT

            ksrini Kumar Srinivasan
            dmikhalksunw Denis Mikhalkin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: