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

IllegalArgumentException in java.awt.image.ReplicateScaleFilter

    Details

    • Subcomponent:
    • Resolved In Build:
      b163

      Backports

        Description


        For a Java appliction on Debian GNU/Linux 8 (OS) on Linux mde 4.7.5 (kernel)
        with JRE 1.7.0_121-b31, the application crashes when restarting the
        application without restarting the device. The following exception is thrown
        when setting javax.swing.jcomponent cursor:

        java.lang.IllegalArgumentException: Width (0) and height (0) must be non-zero
                        at
        java.awt.image.ReplicateScaleFilter.<init>(ReplicateScaleFilter.java:102)
                        at java.awt.Image.getScaledInstance(Image.java:173)
                        at sun.awt.CustomCursor.<init>(CustomCursor.java:69)
                        at sun.awt.X11CustomCursor.<init>(X11CustomCursor.java:43)
                        at sun.awt.X11.XCustomCursor.<init>(XCustomCursor.java:42)
                        at
        sun.awt.X11.XToolkit.createCustomCursor(XToolkit.java:1069)

          Activity

          Hide
          dmarkov Dmitry Markov added a comment -
          Problem description:
          Sometimes XQueryBestCursor may return zero-dimension to the code inside XCustomCursor.getBestCursorSize(). As a result the subsequent invocation of CustomCursor constructor will fail wit IllegalArgumentException during scaling of the image.

          Suggested fix:
          It is necessary to avoid scaling if getBestCursorSize() returns zero-dimension.
          Show
          dmarkov Dmitry Markov added a comment - Problem description: Sometimes XQueryBestCursor may return zero-dimension to the code inside XCustomCursor.getBestCursorSize(). As a result the subsequent invocation of CustomCursor constructor will fail wit IllegalArgumentException during scaling of the image. Suggested fix: It is necessary to avoid scaling if getBestCursorSize() returns zero-dimension.
          Hide
          dmarkov Dmitry Markov added a comment - - edited
          It was technically proved (via FVB) that proposed fix resolved the problem for jdk7u
          Show
          dmarkov Dmitry Markov added a comment - - edited It was technically proved (via FVB) that proposed fix resolved the problem for jdk7u
          Hide
          dmarkov Dmitry Markov added a comment -
          The same code is present in jdk8u and jdk9. So I believe the problem is reproducible there, as well.
          Show
          dmarkov Dmitry Markov added a comment - The same code is present in jdk8u and jdk9. So I believe the problem is reproducible there, as well.
          Hide
          vdyakov Victor Dyakov added a comment - - edited
          Please push the fix by 3/16 end-of-the-day
          Show
          vdyakov Victor Dyakov added a comment - - edited Please push the fix by 3/16 end-of-the-day
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/75a8a6117014
          User: dmarkov
          Date: 2017-03-14 06:06:13 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/75a8a6117014 User: dmarkov Date: 2017-03-14 06:06:13 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/75a8a6117014
          User: lana
          Date: 2017-03-29 21:57:50 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/75a8a6117014 User: lana Date: 2017-03-29 21:57:50 +0000

            People

            • Assignee:
              dmarkov Dmitry Markov
              Reporter:
              shadowbug Shadow Bug
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: