This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I modified a java application. During my development Eclipse identified a "NamingException" condition which needed either a throws or try/catch.
try/catch met my needs. I've done all my testing and everything appears to be working properly. Now in the try/catch section there's a check in the left hand column. Hovering over it indicates "TODO Auto-generated catch block".
Clicking it gives me the option of 1. Removing the task tag, 2. Remove the catch clause or 3. Replace catch clause with throws.
What is this? While I worked with Eclipse a bit this is new to me.
What's what? Are you saying there's no longer a comment in the catch block and the gutter icon is still there?
Joined: Jan 22, 2007
The automated comment "// TODO Auto-generated catch block" is still there. It's got nothing to do with that. What I'm saying is in the left hand column (same area where you would set your breakpoints during the debug) is a checkbox. This was created when I accepted Eclipse's suggestion/recommendation for a try/catch.
That's what I'm questioning. It almost appears that it now offers to remove the catch that was inserted. What is this?
Is this an automated feature that you can ignore? A Eclipse setting you can turn off?
I'm Googling this but if you have any insights/comments please let me know.
Yeah, actually it *does* have something to do with that.
> What is this?
It's an offer to remove the catch block with the task tag in it, exactly like it says. I believe you can turn off some or all gutter notifications, although if you're not having performance issues, I don't know why you'd want to.
Remove the task tag (the comment) and observe.
Joined: Jan 22, 2007
I removed the task tag and it removed the comment. The catch block with my code is still there (whew...) which is exactly what I want.
So this is an automated feature - it appears there's no harm in leaving it in - and if you decide to invoke one - depending on what you want - select one of the options...
>> Clicking it gives me the option of 1. Removing the task tag, 2. Remove the catch clause or 3. Replace catch clause with throws.
If that's it - thank you for gettng me through this - it is appreciated!