Worst. Code. Ever.

Currently working on refactoring some legacy website code which existed before I began my current job. Ultimately, I’d like to get it over to Ruby on Rails, but in the mean time, Struts is okay (although this code epitomises everything that is wrong with Java web development).

Inamongst the code I came across this gem, which I thought should be shared with the world at large.


/**
* Get the channel for the internet POS.
*
* @return Channel for the user's POS if available or empty string otherwise.
*/
protected String getChannel() {
String channel = null;
try {
// channel = ctx.getPOSContext().getUser().getChannel();
} finally {
if(channel==null) {
channel = "";
}
}
return channel;
}

Wow. Just. Wow.

Advertisements

~ by MattR on May 15, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: