|
From: Jarek C. <jar...@po...> - 2012-01-27 06:24:33
|
From these words I gather you didn't have time to read the article. So I won't waste my time on further explanations. Matthieu Casanova pisze: > Maybe that method could rethrow the exception, but I don't think calling > interrupt on the current thread is a good idea. > You don't know what thread will call that method and have no idea of the > effects. > Did you had any problems with that method ? > > 2012/1/26 Jarekczek <jar...@po...> > > >> Quote: >> The worst thing you can do with InterruptedException is swallow it -- catch >> it and neither rethrow it nor reassert the thread's interrupted status. The >> standard approach to dealing with an exception you didn't plan for -- catch >> it and log it -- also counts as swallowing the interruption because code >> higher up on the call stack won't be able to find out about it. (Logging >> InterruptedException is also just silly because by the time a human reads >> the log, it is too late to do anything about it.) >> >> So what jedit does is many places is wrong. We should aim at correcting the >> wrong behaviour. Whole article is here: >> http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html >> >> The simplest approach instead of Log() is >> Thread.currentThread().interrupt() >> and go on. This is a solution without rethrowing the exception which is the >> other acceptable option. >> >> The first to be corrected is the >> ThreadUtilities.runInDispatchThreadAndWait() method. >> >> Jarek >> >> -- >> View this message in context: >> http://jedit.9.n6.nabble.com/interruption-handling-in-jedit-tp4341845p4341845.html >> Sent from the jedit-devel mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> 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-d2d >> -- >> ----------------------------------------------- >> jEdit Developers' List >> jEd...@li... >> https://lists.sourceforge.net/lists/listinfo/jedit-devel >> >> > > |