Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Surround with try/catch block, NOT
Surround with try/catch block, NOT [message #57990] Sun, 15 June 2003 20:43 Go to next message
Eclipse UserFriend
Originally posted by: oshteynbuk.nyc.rr.com

under source menu there is "Surround with try/catch block" but I could
not find remove try/catch or unSurround the same way as comment and
uncomment selected lines of code, is it hidden somewhere or just not
implemented?

thanks,

oleg
Re: Surround with try/catch block, NOT [message #58064 is a reply to message #57990] Sun, 15 June 2003 22:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

I don't think there's a command, but cut, select, paste works pretty well.

Bob

"oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
news:bcj3fa$2pc$1@rogue.oti.com...
> under source menu there is "Surround with try/catch block" but I could
> not find remove try/catch or unSurround the same way as comment and
> uncomment selected lines of code, is it hidden somewhere or just not
> implemented?
>
> thanks,
>
> oleg
>
>
>
Re: Surround with try/catch block, NOT [message #58110 is a reply to message #58064] Sun, 15 June 2003 22:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: oshteynbuk.nyc.rr.com

yes, it was what i did, but the same could be said for refactoring.
just was looking for some sort of symmetry comment/uncomment
surround/unsurround but probably was wrong.

oleg

Bob Foster wrote:
> I don't think there's a command, but cut, select, paste works pretty well.
>
> Bob
>
> "oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
> news:bcj3fa$2pc$1@rogue.oti.com...
>
>>under source menu there is "Surround with try/catch block" but I could
>>not find remove try/catch or unSurround the same way as comment and
>>uncomment selected lines of code, is it hidden somewhere or just not
>>implemented?
>>
>>thanks,
>>
>>oleg
>>
>>
>>
>
>
>
Re: Surround with try/catch block, NOT [message #58135 is a reply to message #58110] Mon, 16 June 2003 02:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yves.somewhere.com

The idea sounds good. You can enter a feature request in Bugzilla.

oleg shteynbuk wrote:
> yes, it was what i did, but the same could be said for refactoring.
> just was looking for some sort of symmetry comment/uncomment
> surround/unsurround but probably was wrong.
>
> oleg
>
> Bob Foster wrote:
>
>> I don't think there's a command, but cut, select, paste works pretty
>> well.
>>
>> Bob
>>
>> "oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
>> news:bcj3fa$2pc$1@rogue.oti.com...
>>
>>> under source menu there is "Surround with try/catch block" but I could
>>> not find remove try/catch or unSurround the same way as comment and
>>> uncomment selected lines of code, is it hidden somewhere or just not
>>> implemented?
>>>
>>> thanks,
>>>
>>> oleg
>>>
>>>
>>>
>>
>>
>>
>
Re: Surround with try/catch block, NOT [message #58186 is a reply to message #57990] Mon, 16 June 2003 03:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tom.eicher.gmx.ch.nodomain

When a catch clause becomes illegal (ie. catches a checked exception that is
not thrown), there is a quick fix "remove catch clause", but its only
available inside the catch clause, and only for checked exceptions. I added
a bug report about this, see

https://bugs.eclipse.org/bugs/show_bug.cgi?id=38932

-tom

BTW: try catch blocks can be nested - they should not be addable only once
(imagine a catch clause throwing exceptions).

"oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
news:bcj3fa$2pc$1@rogue.oti.com...
> under source menu there is "Surround with try/catch block" but I could
> not find remove try/catch or unSurround the same way as comment and
> uncomment selected lines of code, is it hidden somewhere or just not
> implemented?
>
> thanks,
>
> oleg
>
>
>
Re: Surround with try/catch block, NOT [message #58234 is a reply to message #58110] Mon, 16 June 2003 04:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: faust.acm.org

You can use undo with refactorings.


Randy

"oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
news:bcj8t3$5e6$1@rogue.oti.com...
> yes, it was what i did, but the same could be said for refactoring.
> just was looking for some sort of symmetry comment/uncomment
> surround/unsurround but probably was wrong.
>
> oleg
>
> Bob Foster wrote:
> > I don't think there's a command, but cut, select, paste works pretty
well.
> >
> > Bob
> >
> > "oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
> > news:bcj3fa$2pc$1@rogue.oti.com...
> >
> >>under source menu there is "Surround with try/catch block" but I could
> >>not find remove try/catch or unSurround the same way as comment and
> >>uncomment selected lines of code, is it hidden somewhere or just not
> >>implemented?
> >>
> >>thanks,
> >>
> >>oleg
> >>
> >>
> >>
> >
> >
> >
>
Re: Surround with try/catch block, NOT [message #58641 is a reply to message #58186] Mon, 16 June 2003 12:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: oshteynbuk.nyc.rr.com

Tom Eicher wrote:
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=38932

great

> BTW: try catch blocks can be nested - they should not be addable only once
> (imagine a catch clause throwing exceptions).


It is not so difficult to imagine in catch or finaly; close() in
java.io, java.sql packages throws checked exception :)
Actually using "Surround with try/catch block" too often can lead to
unreadable code that you want to refactor, also a try block introduces
new scope that could lead to a new cycle of refactoring.

oleg
Re: Surround with try/catch block, NOT [message #59067 is a reply to message #58110] Tue, 17 June 2003 05:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bob.objfac.com

"oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
news:bcj8t3$5e6$1@rogue.oti.com...
> yes, it was what i did, but the same could be said for refactoring.

No, actually not. I wasn't trying to be a smartass. Refactoring generally
does something you can't do with a simple cut and paste, whereas I find
myself doing this frequently without any trouble.

> just was looking for some sort of symmetry comment/uncomment
> surround/unsurround but probably was wrong.

I agree with you. You should file a feature request (good practice, anyway).

Bob
Re: Surround with try/catch block, NOT [message #59090 is a reply to message #57990] Tue, 17 June 2003 05:04 Go to previous messageGo to next message
Eclipse UserFriend
oleg shteynbuk wrote:
> under source menu there is "Surround with try/catch block" but I could
> not find remove try/catch or unSurround the same way as comment and
> uncomment selected lines of code, is it hidden somewhere or just not
> implemented?
>

Add your comments:
http://bugs.eclipse.org/bugs/show_bug.cgi?id=11068

Stein
Re: Surround with try/catch block, NOT [message #59669 is a reply to message #59067] Tue, 17 June 2003 16:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: oshteynbuk.nyc.rr.com

> No, actually not. I wasn't trying to be a smartass. Refactoring generally
> does something you can't do with a simple cut and paste, whereas I find
> myself doing this frequently without any trouble.

Yes, probably it would be better to say refactoring-lite. It depends on
the API that you use, latest API don't use checked exceptions
excessively (checked exceptions is a separate issue) so for them cut and
paste maybe ok but with API like java.io, java.sql, etc.. using quick
fix you will get pretty ugly code that you want some help from IDE.

OTOH with a good IDE you can get spoiled pretty fast :)

oleg
Re: Surround with try/catch block, NOT [message #61010 is a reply to message #58186] Wed, 18 June 2003 10:44 Go to previous message
Eclipse UserFriend
Additionally you can convert a valid catch block into a throws declaration
using quick assist.
Position the cursor inside the catch block and press Ctrl+1.

Dirk
"Tom Eicher" <tom.eicher@gmx.ch.nodomain> wrote in message
news:bcjr7j$g8v$1@rogue.oti.com...
> When a catch clause becomes illegal (ie. catches a checked exception that
is
> not thrown), there is a quick fix "remove catch clause", but its only
> available inside the catch clause, and only for checked exceptions. I
added
> a bug report about this, see
>
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=38932
>
> -tom
>
> BTW: try catch blocks can be nested - they should not be addable only once
> (imagine a catch clause throwing exceptions).
>
> "oleg shteynbuk" <oshteynbuk@nyc.rr.com> wrote in message
> news:bcj3fa$2pc$1@rogue.oti.com...
> > under source menu there is "Surround with try/catch block" but I could
> > not find remove try/catch or unSurround the same way as comment and
> > uncomment selected lines of code, is it hidden somewhere or just not
> > implemented?
> >
> > thanks,
> >
> > oleg
> >
> >
> >
>
>
Previous Topic:Any performance tools available?
Next Topic:Debug Menu not Working
Goto Forum:
  


Current Time: Wed Apr 30 16:13:10 EDT 2025

Powered by FUDForum. Page generated in 0.09504 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top