<AWT Dev> hg: jdk8/awt/jdk: 6995769: occasion NPE thrown from SwingUtilities.computeIntersection()

Mario Torre neugens.limasoftware at gmail.com
Thu Jul 28 07:46:42 PDT 2011

2011/7/28  <pavel.porvatov at oracle.com>:
> Changeset: 34fdcdb70d20
> Author:    rupashka
> Date:      2011-07-28 18:13 +0400
> URL:       http://hg.openjdk.java.net/jdk8/awt/jdk/rev/34fdcdb70d20
> 6995769: occasion NPE thrown from SwingUtilities.computeIntersection()
> Reviewed-by: alexp
> ! src/share/classes/javax/swing/RepaintManager.java

Hi Pavel,

I'm not very happy with this patch, what is the rationale behind it?

The bug report doesn't explain much, but from what I can see, I
believe this could be related to the fact that the RepaintManager is
not reentrant.

I have seen cases of nested repaint events, caused by long database
invocations (sigh!) that in turn trigger new updates, corrupting the
RepaintManager internal state.

I believe that this patch will make this kind of bugs more difficult
to find, because normally the EDT is blocked (it doesn't receive
events), however, it's possible that some events still gets dispatched
and this is when we see the NPE... yes, you ought to be creative, but
it's still possible to show a modal dialog that creates a new EQ, for
example fire up a JOptionPane during a repaint.

In my opinion this is an application bug, while making swing more
"solid" we hide important bugs, hence in reality making the whole
thing less solid IMHO.


What do you think?

pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

IcedRobot: www.icedrobot.org
Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:

More information about the awt-dev mailing list