From: Matthieu C. <cho...@gm...> - 2012-01-27 09:04:52
|
I agree, this method should not be interruptible, what you expect is that the caller of that method knows if it was interrupted or not ? Ok but at this time I don't see where we could put that information, and I do not want to change the method signature unless there is no other choice. 2012/1/27 Jarek Czekalski <jar...@po...> > > Matthieu Casanova pisze: > > So it is blocking when you use it from the console. > > Ok I understand. > > I suppose instead having that catch in the loop, the catch could be > > outside, so after catching the exception the method would return. > > > Still wrong. You must differentiate between returning as a result of > interruption and as a result of normal exit. > > First decide whether this method should be interruptible or not. Then > code it. Then document it. > > I suggest it being non-interruptable. But then you must set interrupt > flag in a suitable place. > > Otherwise one will be able to demonstrate the failures of this code. > > Jarek > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > -- > ----------------------------------------------- > jEdit Developers' List > jEd...@li... > https://lists.sourceforge.net/lists/listinfo/jedit-devel > |