cleanup, correct visibility

This commit is contained in:
Alexey Kudravtsev
2013-08-08 17:38:24 +04:00
parent 5fafe1e0a8
commit 16a9ea5039
@@ -336,7 +336,7 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
return false;
}
}
ApplicationManager.getApplication().runWriteAction(new Runnable() {
runWriteAction(new Runnable() {
@Override
public void run() {
Disposer.dispose(ApplicationImpl.this);
@@ -636,8 +636,9 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
assertIsDispatchThread();
if (myExceptionalThreadWithReadAccessRunnable != null ||
ApplicationManager.getApplication().isUnitTestMode() ||
ApplicationManager.getApplication().isHeadlessEnvironment()) {
isUnitTestMode() ||
isHeadlessEnvironment()
) {
try {
ProgressManager.getInstance().runProcess(process, new EmptyProgressIndicator());
}
@@ -653,7 +654,7 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
try {
myExceptionalThreadWithReadAccessRunnable = process;
final boolean[] threadStarted = {false};
final AtomicBoolean threadStarted = new AtomicBoolean();
//noinspection SSBasedInspection
SwingUtilities.invokeLater(new Runnable() {
@Override
@@ -688,13 +689,13 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
}
}
});
threadStarted[0] = true;
threadStarted.set(true);
}
});
progress.startBlocking();
LOG.assertTrue(threadStarted[0]);
LOG.assertTrue(threadStarted.get());
LOG.assertTrue(!progress.isRunning());
}
finally {
@@ -801,7 +802,7 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
* Note: there are possible scenarios when we get a quit notification at a moment when another
* quit message is shown. In that case, showing multiple messages sounds contra-intuitive as well
*/
private volatile static boolean exiting = false;
private static volatile boolean exiting = false;
public void exit(final boolean force, final boolean allowListenersToCancel, final boolean restart) {
@@ -1109,7 +1110,7 @@ public class ApplicationImpl extends ComponentManagerImpl implements Application
assertIsDispatchThread("Access is allowed from event dispatch thread only.");
}
private static void assertIsDispatchThread(String message) {
private static void assertIsDispatchThread(@NotNull String message) {
final Thread currentThread = Thread.currentThread();
if (ourDispatchThread == currentThread) return;