Yet Another Java Trick

Saturday, April 5th, 2008

Recently I ran into a bit of trouble when coding a particular method. It had a number of exit points, something like this:
PLAIN TEXT
JAVA:

boolean method() {

  if (conditionA)

    return resultA;

 

  if (conditionB)

    return resultB;

 

  if (conditionC)

    return resultC;

}

The problem was that I also needed to log the result before [...]