Home > java, WTF > Extreme Exception Programming – Catch Every Exception and Work Around It

Extreme Exception Programming – Catch Every Exception and Work Around It

I was reviewing the commit log from the last week commits and found this gem:
try{
list = (ArrayList<MyObject1>)session.getAttribute(TEMPORARY_LIST);
}catch (ClassCastException e){
if(add.getMyObjectCurrentItem()) != -1)
try{
list = add.getOtherList().get(add.getMyObjectList()).getMyObjectList();
} catch(IndexOutOfBoundsException e2){
try{
list = add.getOtherList().get(add.getMyObjectList()-1).getMyObjectList();<
} catch(IndexOutOfBoundsException e3){
//Move On
}
}
}

Only thing that came to mind was WTF, after Showing it to my boss he called it : Extreme Exception Programming.
I tweeted before about how in Enterprise we end up coding for every possible chance, but this is going too far.
Advertisements
Categories: java, WTF Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

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: