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

(ann) Add @Unsupported annotation

    XMLWordPrintable

    Details

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

      Description

      A DESCRIPTION OF THE REQUEST :
      The Java API (particularly collections), allows implementation classes to not follow an interface (optional methods) and instead throw an UnsupportedOperationException. Those methods should be annotated with an @Unsupported (or @UnsupportedOperation) annotation to allow tools to distinguish methods that should not be called, and to allow IDEs to highlight those methods when referencing the implementation class directly, the same way some IDEs will highlight deprecated methods.

      JUSTIFICATION :
      This allows for safer coding by earlier detection of unsupported methods, and may allow for actual compiler warnings, if the compiler can determine the implementation class at compile time.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              darcy Joe Darcy
              Reporter:
              ndcosta Nelson Dcosta (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: