Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions platform/core.startup/src/org/netbeans/core/startup/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package org.netbeans.core.startup;

import java.beans.Introspector;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
Expand Down Expand Up @@ -89,7 +88,7 @@ public static void initUICustomizations() {
return;
}

Class uiClass = CLIOptions.uiClass;
Class<?> uiClass = CLIOptions.uiClass;
// try again loading L&F class, this time with full module system.
if (CLIOptions.uiClassName != null && CLIOptions.uiClass == null) {
// try again
Expand Down Expand Up @@ -163,7 +162,7 @@ public static ModuleSystem getModuleSystem(boolean init) {
SystemFileSystem.registerMutex(moduleSystem.getManager().mutex());
} catch (IOException ioe) {
// System will be screwed up.
throw (IllegalStateException) new IllegalStateException("Module system cannot be created").initCause(ioe); // NOI18N
throw new IllegalStateException("Module system cannot be created", ioe); // NOI18N
}
StartLog.logProgress ("ModuleSystem created"); // NOI18N
}
Expand Down Expand Up @@ -316,7 +315,6 @@ static void start (String[] args) throws SecurityException {
level.run();
}

Splash.getInstance().setRunning(false);
Splash.getInstance().dispose();
StartLog.logProgress ("Splash hidden"); // NOI18N
StartLog.logEnd ("Preparation"); // NOI18N
Expand Down Expand Up @@ -347,7 +345,7 @@ private static void rm(File f) {
}

/** Loads a class from available class loaders. */
private static final Class getKlass(String cls) {
private static Class<?> getKlass(String cls) {
try {
ClassLoader loader;
ModuleSystem ms = moduleSystem;
Expand Down Expand Up @@ -380,7 +378,7 @@ public boolean shouldDoAnImport () {
return classname != null && !installed.exists ();
}


@Override
public void run() {
// This module is included in our distro somewhere... may or may not be turned on.
// Whatever - try running some classes from it anyway.
Expand All @@ -400,16 +398,12 @@ public void run() {
} else {
LOG.log(Level.WARNING, null, ex);
}
} catch (Exception e) {
} catch (Exception | LinkageError e) {
// If exceptions are thrown, notify them - something is broken.
LOG.log(Level.WARNING, null, e);
} catch (LinkageError e) {
// These too...
LOG.log(Level.WARNING, null, e);
}
}


public boolean canContinue () {
if (shouldDoAnImport ()) {
try {
Expand Down Expand Up @@ -440,7 +434,6 @@ public boolean canContinue () {
}
}


ImportHandler handler = new ImportHandler ();

return handler.canContinue ();
Expand Down Expand Up @@ -493,12 +486,9 @@ public void run() {
} else {
LOG.log(Level.WARNING, null, ex);
}
} catch (Exception ex) {
} catch (Exception | LinkageError ex) {
// If exceptions are thrown, notify them - something is broken.
LOG.log(Level.WARNING, null, ex);
} catch (LinkageError ex) {
// These too...
LOG.log(Level.WARNING, null, ex);
}
}

Expand Down
24 changes: 9 additions & 15 deletions platform/core.startup/src/org/netbeans/core/startup/NbEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@

package org.netbeans.core.startup;

import java.awt.Component;
import java.awt.Desktop;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.GraphicsEnvironment;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
Expand All @@ -51,7 +51,6 @@
import org.openide.modules.SpecificationVersion;
import org.openide.util.NbBundle.Messages;
import org.openide.util.NbCollections;
import org.openide.util.RequestProcessor;

/** Report events to the performance logger, status text/splash screen,
* console, and so on.
Expand Down Expand Up @@ -333,9 +332,8 @@ private void notify(String text, boolean warn) {
private static final class Notifier implements Runnable {
private static boolean showDialog = true;

private boolean warn;
private final boolean warn;
private String text;
private static RequestProcessor RP = new RequestProcessor("Notify About Module System"); // NOI18N

public Notifier(String text, boolean type) {
this.warn = type;
Expand All @@ -347,7 +345,11 @@ void show() {
if (EventQueue.isDispatchThread()) {
run();
} else {
RP.post(this, 0, Thread.MIN_PRIORITY).waitFinished ();
try {
EventQueue.invokeAndWait(this);
} catch (InterruptedException | InvocationTargetException ex) {
logger.log(Level.SEVERE, "Notifier failed", ex); // NOI18N
}
}
}
}
Expand All @@ -362,17 +364,9 @@ void show() {
int type = warn ? JOptionPane.WARNING_MESSAGE : JOptionPane.INFORMATION_MESSAGE;
String msg = warn ? MSG_warning() : MSG_info();

Splash out = Splash.getInstance();
final Component c = out.getComponent() == null ? null : out.getComponent();
try {
UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ());
} catch (ClassNotFoundException ex) {
logger.log(Level.INFO, null, ex);
} catch (InstantiationException ex) {
logger.log(Level.INFO, null, ex);
} catch (IllegalAccessException ex) {
logger.log(Level.INFO, null, ex);
} catch (UnsupportedLookAndFeelException ex) {
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
logger.log(Level.INFO, null, ex);
}
JTextPane tp = new JTextPane ();
Expand Down Expand Up @@ -423,7 +417,7 @@ void show() {
Object [] options = new JButton [] {continueButton, exitButton};
op.setOptions (options);
op.setInitialValue (options [1]);
JDialog d = op.createDialog (c, msg);
JDialog d = op.createDialog(Splash.getInstance().getComponent(), msg);
d.setResizable (true);
d.pack();
d.setVisible (true);
Expand Down
Loading
Loading