<< April 1, 2004 | Home | April 3, 2004 >>

Friday Thoughts

If you can't do it in five years, you can't do it in five years and a day. So don't bother coming in on Saturday.


Control-Shift-F1 on a Java GUI window dumps the GUI hierarchy to the terminal.


public boolean getFlag() {
    return this.flag;
}
public void setFlag(boolean flag) {
    this.flag = flag;
}
private boolean flag;

is not thread-safe. Synchronization on both getter and setter are required, all because of the Java Memory Model.


Bloglines.com is pretty cool. (BTW, I wrote this on this, which prompted this. :) )


How many Java developers turn on the assert keyword when they compile? Is it on by default?


Prefer

    jframe.show();

to

    jframe.setVisible(true);

The former works on more JDK platforms than the latter, and is shorter. Contrary to popular belief, JFrame.show(), which is inherited from java.awt.Window, is not deprecated.