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

(ann) Add @Unsupported annotation

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P5 P5
    • None
    • 6
    • core-libs
    • x86
    • solaris_10

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: