[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] What to override and what now
From:       neugens.limasoftware () gmail ! com (Mario Torre)
Date:       2011-10-14 20:30:04
Message-ID: B76ABEAD-9BF8-4F7A-87E9-344FA9F5D369 () gmail ! com
[Download RAW message or body]

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 {
        GraphicsEnvironment.checkHeadless();

        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.

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

http://www.ladybug-studio.com

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:
http://endsoftpatents.org/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic