In the course of working on more J2EE web applications, I am starting to run into things that annoy me about Java. One of the biggest annoyances I run into when developing web applications in Java is the lack of support for String in case constructs. Apparently I am not alone.
I know there is a Java 5 workaround involving enums, but as I work heavily on OS X and there is no production version of Java 5 for OS X (I wish Sun would take over OS X development and provide more timely Java support like they do for all other major platforms, but that's another issue), I can't use that workaround.
This results in code like this:
boolean seenYet = false;
if (seenYet == false && blah.equals("test")) {
dosomething();
seenYet = true;
}
etc....
This gets long, verbose, and ugly. So at this point my biggest wish is for the next version of Java to allow something like this PHP code:
switch ($blah) {
case "test":
dosomething();
break;
etc....
I'll probably get used to this, but I doubt I'll ever like it.