wood burning stoves 2.0*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse newbie question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse newbie question" Watch "Eclipse newbie question" New topic
Author

Eclipse newbie question

bob reilly
Ranch Hand

Joined: Jan 22, 2007
Posts: 44
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.

Thank you.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

What's what? Are you saying there's no longer a comment in the catch block and the gutter icon is still there?
bob reilly
Ranch Hand

Joined: Jan 22, 2007
Posts: 44
No...

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.

Thank you for responding.

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

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.
bob reilly
Ranch Hand

Joined: Jan 22, 2007
Posts: 44
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse newbie question