... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)

2008-07-31

JUnit Gotcha

In JUnit 4, if you use the version of assertEquals that compares two objects, and those objects happen to be subclasses of Number, the framework converts them to long before comparing them.  This is broken for any non-integral type since it will neglect the fractional part.

Just to make matters worse, if you attempt to compare two floating point numbers using assertEquals and you forget to add the 'delta' argument, then once again you will get the object-version of the method and the comparison will be invalid.  This is a regression from the old JUnit which predated auto-boxing and the compiler would moan about mismatched argument types.  It is hard to believe, but this unit test passes:

@Test
public void test() {
    assertEquals(1.2, 1.3);
}

Functional Java

Functional Java is a Java library inspired by Scala and Haskell.  It anticipates the addition of first-class functions to Java 7, especially if it follows the BGGA Closure proposal.

Closures

It is increasingly bugging me how the term "closure" is becoming synonymous with "function literal", especially in the Java community now that it is just discovering functions.  People seem to forget that Pascal had closures in 1974, but it didn't support function literals.  I thought that Algol had closures first, but according to Wikipedia Scheme was the first in 1970.  Naturally it inherited function literals from LISP.  Of course, Scheme has the definitive implementation of closures which are not restricted to stack-based lifetime nesting.  This is unlike Pascal and practically every other language under the Sun which thinks that the stack is fundamental -- nobody in Java-land is talking about that.  At least BGGA has the UnmatchedNonlocalTransfer exception.  This is an improvement over Smalltalk where the VM would just crash.

I'm sure Algol had closures.  Maybe in Algol 60 but certainly by the time of Algol 68.

2008-07-21

Riena

Riena is an Eclipse initiative to develop a workbench replacement that is friendlier to business users.

2008-07-20

Joe Armstrong on Erlang

InfoQ has an interesting one hour lecture by Joe Armstrong: Erlang - software for a concurrent world.

2008-07-03

Enerjy

Enerjy is an Eclipse plug-in that computes various code metrics, along the lines of CheckStyle.

Jupiter

Jupiter is an Eclipse plug-in that supports team code review.

2008-07-01

SchemaSpy

SchemaSpy can used to generate decent off-line documentation for an SQL schema.

Blog Archive