[OpenJDK 2D-Dev] What to override and what now

Mario Torre neugens.limasoftware at gmail.com
Fri Oct 14 20:30:04 UTC 2011

While working a bit on cacio, we just found some new nice addition to the Toolkit code, like this one:

    public boolean areExtraMouseButtonsEnabled() throws HeadlessException {

        return Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled();

Of course, this method is meant to be overridden, so it will end up doing nothing, but things like this may be very difficult to debug at times, and in any case, is definitely are not friendly code. Is there any reason for this smartness?

Why not simply provide a default implementation or just throw an exception or simply make the method abstract? Or maybe I'm missing something?

I hope there are not many more of those examples scattered around, or to know what to subclass and override will be a pain.

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 2d-dev mailing list