Friday, February 16, 2007

Slides from JUGS Talket online

The (German) slides from my yesterday talk at Java User Group Stuttgart are online at bsd.de/e3fu/ as PDF.

Wednesday, February 14, 2007

Eclipse 3.2.1 performance patch

I was recently complaining that Eclipse is taking a nap after a right-click before displaying the context menu.
When looking for an updated Findbugs plugin the update manager also offered me an update called
"Eclipse Java Development Tools 3.2.1 performance patch (bug: 159325) 1.0.0", which is related to the this bug :
https://bugs.eclipse.org/bugs/show_bug.cgi?id=159325
After installing the Patch, the context menu appears again directly after a right click without any nap.
So this was no problem with the Mac or the Apple VM, but with Eclipse which I only never saw before in Win* times as I was not using such a big workspace together with Eclipse 3.2.1.
According to the bug notes, this is also fixed in 3.3.M2 and - as I understand it - an upcoming 3.2.2 maintenance release.

Timestamp comparision oddities

Yesterday a colleague of mine ran into a problem where code like this produced a ClassCastException:

.. av.getEndTime().compareTo(someDate);

av is a domain class in JPA with endTime like this

@Temporal(TemporalType.TIMESTAMP)
java.util.Date endTime

and someDate being a java.util.Date.

This just worked on my Mac, but failed for one colleague, while others had no problem.
Looking under the covers turned out that av.getEndTime() actually returned a java.sql.Timestamp, which in java versions between 1.5.0_00 and 1.5.0_06 (including) were suposed to throw a CCE when the argument of compareTo() is a Date. Interstingly before() and after(), which also compare, did not have this restriction.
In Java Version 1.4.x the CCE was also not present and SUN seems to have it changed back to the original behaviour in 1.5.0_07. Unfortunately the manual page was not updated, adding to the confusion.
This blog entry also talks about this problem. Sun has a list of page about incompatibilities where this problem is listed. Unfortunately, the original bug report is not accessible (to me).

Some people argue that one should write own comparators, but I think it is easier to update to a newer version of the JDK. Of course if the software gets shipped to customers, one needs to make sure the customer also has 1.5.0_07 at least.

Tuesday, February 13, 2007

Elvis^Wmarcf has left the building

Now it is official. Marc Fleury, founder of JBoss has retired from his position as SVP JBoss division at Red Hat. Many suspected this when he started to take his paternity leave. There are numerous posts around this like e.g. from Sacha Labourey.

I think it is a pitty, as Marc was a brilliant visionaire. I will aways remember when I was at the Advance Training in Paris in 2003. Juha and Adrian were teaching about various aspects (no pun intended) of the system (it was ealy 3.2 time) when Marc was coming into the room, watching the two for a minute and then running to the front of the room, saying "Forget all the bullshit - now we're doing it the AOP way". And then he started to draw on the flip chart his ideas about interceptors, applying pointcuts etc. Many students in the course have been very irritated, but for me this was really great stuff.

As I am a dad myself I can very well undertand that Marc is now taking care of his kids and his other interests. Some have even seen him as DJ Red Baron. And if you want to know what Marf is up to, you can visit his blog, where he can now freely comment on various things. Also something that he couldn't really do as founder of JBoss or SVP at Red Hat.

Marc, I wish you well - hope we meet again.

Saturday, February 10, 2007

A totally subjective comparision of Eclipse 3.2.1 and IDEA 6.0.4

As most of the project I am working on are using IntelliJ IDEA, I thought to give it a try as well. This was not easy, as I am a long term Eclipse and derivates (Rational XDE) user. But on my MacBook, Eclipse is often taking naps when e.g. right clicking in the navigator or package view. I find this behaviour very annoying. And yes, I already have 2GB Ram in the box and I am giving Eclise half a gig for the heap, which doesn't need according to this memory usage bar. IntelliJ just feels much snappier.
This are the differences I found so far:

Eclipse:

  • Better problem view. It shows all errors in the project if I e.g. break a method signature
  • Only one version of Ctrl-Space for autocomplete. I don't want to remember if I need to press alt-ctrl-space or shift-ctrl-space etc. for a given situation
  • Many more plugins
  • Plugins and features are often based on other huge features (e.g. EMF)
  • More than one main window. This is cool when you e.g. are working on transitioning a project from EJB2 to EJB3 or spring. On one monitor you have an Eclipse window with the old code and on the other monitor you have the new code. And on both monitors you can use Overview-view or Package explorer for the class just shown. It also helps when you just want to see a referenced class for the code you are working on. Splitting the window in more tab groups isn't the same.
  • Quick-fixes seem to do a better work for my typos


IDEA:

  • Changelists are an extremely cool feature if you are working at different parts of the project you don't want to commit together
  • Snappier than Eclipse (probably because it does no incremental compilation of the entire code base)
  • cmd-D in Changes View is very handy to see what one has done to a file.
  • Much better code smell detection.
  • Nicer UI look and feel (native Mac, I am not talking about some Motif styles etc.
  • Commit dialog is better arranged (probably due to the changelists). But the "show me the last commit messages" is hidden (cmd-m)
  • If one is programming in an EJB-2 project, Idea is able to follow calls into EJBs, as it knows through ejb-jar.xml which interface classes belong to which EJB. This is extremly helpful. It seems that there is a plugin for Eclipse that can do this as well.
  • The "Scope: Problem" view doesn't really work for me. Probably because IDEA does no incremental compile of the sources. If I change a class in the domain (remove a method) then classes in the GUI that access this method are not displayed as having an error until I open them. Eclipse shows me the GUI-classes directly upon save of the domain class.
  • Struts support is nice
  • Editors for HTML and other 'Web technologies' are better than what you find in a plain eclipse (one can download the WTP stuff to get this as well)


The comparision ends 0:0. If both were free then I'd just change around all the time. Using IDEA for hacking and Eclipse to find errors in the code

What do you think? And yes, there is also NetBeans. But this is not used in our project and I don't want to go through the process of setting up the project structure in it.

EJB3 alpha feature from IBM / Bea compliant

While in the past big blue was not too enthusiastic about EJB3, they now have an alpha version of EJB 3 support online.
It only works with WAS 6.1, but neverthless.

This means that EJB3 support is very widthspread now so that it will definitively become a widely accepted standard.
It is also interesting that vendors that haven't really been on the early adopters radar like SAP have one of the first certified implementations.
[update]
Bea announced that they are now also Java EE 5 compliant. See the post on TheServerSide.com. So Java EE and EJB 3 support by the big vendors is now also coming along. As many others I think this is a good thing even if I would have liked JBossAS to be the first.

Monday, February 05, 2007

Amazon finally has it - or not?

After I have my first copy of the EJB3 book since the 23th and I got my box of author copies, even Amazon now lists it as available :)
Man what a tough time waiting :-)

Another look at the Amazon page and it is listed as non available again. This sucks *sigh*