Friday, October 12, 2007

Use == for Enum comparision

I was recently running FindBugs over some Java5 based code and found some places where FindBugs was complaining that two Objects compared with equals() are not of the same type.
Closer inspection showed that this have been Enums in most cases. The IDEs did not warn here and maunal code inspection also does not directly show the issue.
Luckily with enums, you can use == to compare them. And then it gets obvious:




Just a small little change in habits, but it helps a lot.

JIRAClient is cool

Recently we at JBoss® received licenses for JIRAClient. It is a cool desktop app (written in Java) that serves as a frontent to Atlassians JIRA bugtracking sytem. One of the nicest features here is offline mode: JIRAClient is ablw to download issues to its local database, so you can work offline and upload changes later on.
The staff at Almworks is very responsive in the forums and also open to suggestions.

If you are using JIRA on an daily basis, then you should definitively check out JIRAClient.

Thursday, October 11, 2007

pg_stat_activity is your friend

PgAdmin for postgres has a nice feature called "Server status". It is great if you sit in front of a GUI.
But if you want to do some remote work or tell a customer to report that server status, it is not quite the right thing.

But at the end, pgAdmin is only doing

select * from pg_stat_activity order by procpid;


This will show you all client connections together with the command they are currently executing.