所以我在挖掘时遇到了这段代码org.eclipse.ui.internal.Workbench
:
final boolean[] initOK = new boolean[1];
if (getSplash() != null) {
final boolean[] initDone = new boolean[] { false };
final Throwable[] error = new Throwable[1];
Thread initThread = new Thread() {
/*
* (non-Javadoc)
*
* @see java.lang.Thread#run()
*/
public void run() {
try {
// declare us to be a startup thread so that our
// syncs will be executed
UISynchronizer.startupThread.set(Boolean.TRUE);
initOK[0] = Workbench.this.init();
} catch (Throwable e) {
error[0] = e;
} finally {
initDone[0] = true;
display.wake();
}
}
};
initThread.start();
..............
}
只用一个元素创建数组的目的是什么?它更快吗?我肯定在这里遗漏了一些东西。