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

add AutoCloseable interface to Graphics class

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P3 P3
    • tbd
    • 7u45
    • client-libs
    • 2d
    • linux_ubuntu

      A DESCRIPTION OF THE REQUEST :
      would be nice if Graphics.dispose() would be called from try-with-resources

      JUSTIFICATION :
      simplify coding

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      try (Graphics g2 = g.create()) {
           g.paintOval(r0;
      }

      would call g2.dispose() automagically
      ACTUAL -
      you need to manually add a finally block to dispose()

            prr Philip Race
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: