<AWT Dev> JDK-8098530: ArrayIndexOutOfBoundsException at sun.awt.X11.XEvent.getFieldsAsString

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Mon Oct 17 14:40:49 UTC 2016


On 17.10.16 15:12, Vladislav Rassokhin wrote:
> I'm just end user of jre and really annoyed by this exception clogs
> application logs.

If you know how to reproduce this bug, then the test will be quite 
simple. An example of such tests you can find here:
http://hg.openjdk.java.net/jdk9/client/jdk/file/32d9fe67dede/test/java/awt/Toolkit/ScreenInsetsTest/ScreenInsetsTest.java

> It took 15 minutes year ago to find that bug and vote for it, 15 minutes
> last week to fix that using grep and vim.
> Unfortunately I've no spare time to learn how to create tests for
> openjdk, sign CLA and do other stuff, so asked our jdk team to send
> patch somewhere.

In your case it is not necessary to sign OCA, because JetBrains s.r.o. 
already signed it:
http://www.oracle.com/technetwork/community/oca-486395.html

> Seems openjdk contributing process is quite complicated for simple fix.
>
> Anyway I'd attach patch to issue.
>
> On Wed, Oct 12, 2016 at 8:48 PM, Sergey Bylokhov
> <Sergey.Bylokhov at oracle.com <mailto:Sergey.Bylokhov at oracle.com>> wrote:
>
>     Is it possible to create a test for this issue?
>
>     On 12.10.16 19:07, Sergey Malenkov wrote:
>
>         Hi all,
>
>         Could you please consider the following changes to fix JDK-8098530?
>
>         --- src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java
>         (revision f0ae41314e223bf1b97c8126ac2b0d6edb5ee99d)
>         +++ src/solaris/classes/sun/awt/X11/generator/WrapperGenerator.java
>         (revision )
>         @@ -690,7 +690,7 @@
>                          if (type == AtomicType.TYPE_ATOM) {
>                              pw.println("\t\tret.append(\"" + name + " = \"
>         ).append( XAtom.get(get_" + name + "()) ).append(\", \");");
>                          } else if (name.equals("type")) {
>         -                    pw.println("\t\tret.append(\"type = \").append(
>         XlibWrapper.eventToString[get_type()] ).append(\", \");");
>         +                    pw.println("\t\tret.append(\"type = \").append(
>         XlibWrapper.getEventToString(get_type()) ).append(\", \");");
>                          } else if (name.equals("window")){
>                              pw.println("\t\tret.append(\"window = \"
>         ).append(
>         getWindow(get_window()) ).append(\", \");");
>                          } else if (type == AtomicType.TYPE_ARRAY) {
>
>         The sun.awt.X11.XlibWrapper class provides a method, which
>         handles such
>         errors.
>         We should not access to array directly.
>
>         --
>         Best regards,
>         Sergey A. Malenkov
>
>
>
>     --
>     Best regards, Sergey.
>
>
>
>
> --
> Vladislav Rassokhin
> Java developer (TeamCity)
> JetBrains
> https://www.jetbrains.com
> The Drive to Develop


-- 
Best regards, Sergey.


More information about the awt-dev mailing list