Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 6573426
Votes 0
Synopsis InputMethodManager: unnecessary try-catch clause should be deleted in the run() method
Category java:classes_awt_im
Reported Against
Release Fixed 7(b20)
State 10-Fix Delivered, bug
Priority: 4-Low
Related Bugs 6544309
Submit Date 25-JUN-2007
Description
There is an oversight of the fix for 6544309. Look at the code in sun.awt. customer .InputMethodManager:

286     public void run() {
...
297         // Loop for processing input method change requests
298         while (true) {
299             waitForChangeRequest();
300             initializeInputMethodLocatorList();
301             try {
302                 if (requestComponent != null) {
303                     try {
304                         showInputMethodMenuOnRequesterEDT(requestComponent);
305                     } catch (Exception ex) {
306                         throw new RuntimeException(ex);
307                     }
308                 } else {
309                     // show the popup menu within the event thread
310                     EventQueue.invokeAndWait(new Runnable() {
311                         public void run() {
312                             showInputMethodMenu();
313                         }
314                     });
315                 }
316             } catch (InterruptedException ie) {
317             } catch (InvocationTargetException ite) {
318                 // should we do anything under these exceptions?
319             }
320         }
321     }

There is an unnecessary try-catch clause at 303-307 lines. InterruptedException and InvocationTargetException that could be thrown in showInputMethodMenuOnRequesterEDT() will be caught in the outer try-catch clause. The try-catch clause should be deleted in this way:

286     public void run() {
...
297         // Loop for processing input method change requests
298         while (true) {
299             waitForChangeRequest();
300             initializeInputMethodLocatorList();
301             try {
302                 if (requestComponent != null) {
303                     showInputMethodMenuOnRequesterEDT(requestComponent);
304                 } else {
305                     // show the popup menu within the event thread
306                     EventQueue.invokeAndWait(new Runnable() {
307                         public void run() {
308                             showInputMethodMenu();
309                         }
310                     });
311                 }
312             } catch (InterruptedException ie) {
313             } catch (InvocationTargetException ite) {
314                 // should we do anything under these exceptions?
315             }
316         }
317     }
Posted Date : 2007-06-25 14:38:34.0
Work Around
N/A
Evaluation
See description.
Posted Date : 2007-06-25 14:38:34.0
Comments
  
  Include a link with my name & email   


PLEASE NOTE: JDK6 is formerly known as Project Mustang