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

(anno) Introduce a new Annotation: RuntimeException

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 5.0
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_2000

      Description

      A DESCRIPTION OF THE REQUEST :
      Introduce a new Annotation RuntimeException.

      It should be use to automatically document thrown runtime exceptions in a method by the compiler.

      This should then also be documented by java doc.

      IDE's can use this information to provide hints which exceptions can be catched. Just like with checked exceptions.

      JUSTIFICATION :
      RuntimeExceptions are part of the contract and should always be well documented. Unfortunatelly this is seldom the case. further more One ofen forgets or is not able to document runtime exceptions thrown by used third party code.



      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Annotation should contain a list of all thrown runtime exceptions inside a method
      The Annotation should also collect the exceptions from methods that contain that annotation.

      The underlying methods can of course change and with it the thrown runtime exceptions. But it seems better to have runtime exceptions annotated that are not thrown as the other way around.
      ACTUAL -
      Not applicable

      ---------- BEGIN SOURCE ----------
      @Target({METHOD, CONSTRUCTOR})
      @Retention(RetentionPolicy.RUNTIME)
      public @interface ThrownRuntimeExceptions{
      /** Names of the thrown runtime exception classes */
          String[] exceptions();
      }
      ---------- END SOURCE ----------
      ###@###.### 2004-12-22 18:26:54 GMT

        Attachments

          Activity

            People

            Assignee:
            sseligmasunw Scott Seligman (Inactive)
            Reporter:
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: