1919
2020package org .netbeans .core .startup ;
2121
22- import java .awt .Component ;
2322import java .awt .Desktop ;
2423import java .awt .Dimension ;
2524import java .awt .EventQueue ;
2625import java .awt .GraphicsEnvironment ;
2726import java .awt .event .ActionEvent ;
2827import java .awt .event .ActionListener ;
2928import java .io .File ;
29+ import java .lang .reflect .InvocationTargetException ;
3030import java .util .ArrayList ;
3131import java .util .Collection ;
3232import java .util .List ;
5151import org .openide .modules .SpecificationVersion ;
5252import org .openide .util .NbBundle .Messages ;
5353import org .openide .util .NbCollections ;
54- import org .openide .util .RequestProcessor ;
5554
5655/** Report events to the performance logger, status text/splash screen,
5756 * console, and so on.
@@ -333,9 +332,8 @@ private void notify(String text, boolean warn) {
333332 private static final class Notifier implements Runnable {
334333 private static boolean showDialog = true ;
335334
336- private boolean warn ;
335+ private final boolean warn ;
337336 private String text ;
338- private static RequestProcessor RP = new RequestProcessor ("Notify About Module System" ); // NOI18N
339337
340338 public Notifier (String text , boolean type ) {
341339 this .warn = type ;
@@ -347,7 +345,11 @@ void show() {
347345 if (EventQueue .isDispatchThread ()) {
348346 run ();
349347 } else {
350- RP .post (this , 0 , Thread .MIN_PRIORITY ).waitFinished ();
348+ try {
349+ EventQueue .invokeAndWait (this );
350+ } catch (InterruptedException | InvocationTargetException ex ) {
351+ logger .log (Level .SEVERE , "Notifier failed" , ex ); // NOI18N
352+ }
351353 }
352354 }
353355 }
@@ -362,17 +364,9 @@ void show() {
362364 int type = warn ? JOptionPane .WARNING_MESSAGE : JOptionPane .INFORMATION_MESSAGE ;
363365 String msg = warn ? MSG_warning () : MSG_info ();
364366
365- Splash out = Splash .getInstance ();
366- final Component c = out .getComponent () == null ? null : out .getComponent ();
367367 try {
368368 UIManager .setLookAndFeel (UIManager .getSystemLookAndFeelClassName ());
369- } catch (ClassNotFoundException ex ) {
370- logger .log (Level .INFO , null , ex );
371- } catch (InstantiationException ex ) {
372- logger .log (Level .INFO , null , ex );
373- } catch (IllegalAccessException ex ) {
374- logger .log (Level .INFO , null , ex );
375- } catch (UnsupportedLookAndFeelException ex ) {
369+ } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex ) {
376370 logger .log (Level .INFO , null , ex );
377371 }
378372 JTextPane tp = new JTextPane ();
@@ -423,7 +417,7 @@ void show() {
423417 Object [] options = new JButton [] {continueButton , exitButton };
424418 op .setOptions (options );
425419 op .setInitialValue (options [1 ]);
426- JDialog d = op .createDialog ( c , msg );
420+ JDialog d = op .createDialog ( Splash . getInstance (). getComponent () , msg );
427421 d .setResizable (true );
428422 d .pack ();
429423 d .setVisible (true );
0 commit comments