if (curHandle != null) throw new IllegalStateException("Only one application of is allowed to run at a time"); curHandle = appHandle;
if (curSingleton != null) throw new IllegalStateException("A singleton application instance is already running: " + curSingleton.getInstanceId()); EclipseAppDescriptor eclipseApp = (EclipseAppDescriptor) appHandle.getApplicationDescriptor(); if (eclipseApp.isSingleton()) { if (curHandles.size() > 0) throw new IllegalStateException("One or more applications are already running"); } if (eclipseApp.getType() == EclipseAppDescriptor.FLAG_TYPE_MAIN_THREAD) { if (curMain != null) throw new IllegalStateException("A application instance is already running on the main thread: " + curSingleton.getInstanceId()); }  if (eclipseApp.isSingleton()) curSingleton = appHandle; if (eclipseApp.getType() == EclipseAppDescriptor.FLAG_TYPE_MAIN_THREAD) curMain = appHandle; curHandles.add(appHandle);
	synchronized void lock(EclipseAppHandle appHandle) {		if (curHandle != null)			throw new IllegalStateException("Only one application of is allowed to run at a time");		curHandle = appHandle;		refreshAppDescriptors();	}