Source:
public static Workspace getWorkspace() throws Exception { if (getInstance() == null) { throw new IllegalStateException("Central is not initialised"); } Workspace ws; boolean resolve; synchronized (workspaceQueue) { ws = workspace; File workspaceDirectory = getWorkspaceDirectory(); if (ws != null) { if (workspaceDirectory != null && ws.isDefaultWorkspace()) { ws.setFileSystem(workspaceDirectory, Workspace.CNFDIR); ws.refresh(); resolve = !workspaceQueue.getPromise() .isDone(); } else if (workspaceDirectory == null && !ws.isDefaultWorkspace()) { ws.setFileSystem(Workspace.BND_DEFAULT_WS, Workspace.CNFDIR); ws.refresh(); resolve = false; } else { resolve = false; } } else { try { Workspace.setDriver(Constants.BNDDRIVER_ECLIPSE); Workspace.addGestalt(Constants.GESTALT_INTERACTIVE, new Attrs()); if (workspaceDirectory == null) { ws = Workspace.createDefaultWorkspace(); } else { ws = Workspace.getWorkspace(workspaceDirectory); } resolve = !workspaceQueue.getPromise() .isDone(); ws.setOffline(new BndPreferences().isWorkspaceOffline()); ws.addBasicPlugin(new SWTClipboard()); ws.addBasicPlugin(new WorkspaceListener(ws)); ws.addBasicPlugin(getInstance().repoListenerTracker); ws.addBasicPlugin(getEclipseWorkspaceRepository()); ws.addBasicPlugin(new JobProgress()); ws.getBuildOrder(); addCnfChangeListener(ws); workspaceRepositoryChangeDetector = new WorkspaceRepositoryChangeDetector(ws); workspace = ws; } catch (final Exception e) { if (ws != null) { ws.close(); } logger.logError("Init of workspace", e); throw e; } } getInstance().repoPluginTracker.open(ws); } if (resolve) workspaceQueue.resolve(ws); return ws; }

Target:
public static Workspace getWorkspace() throws Exception { if (getInstance() == null) { throw new IllegalStateException("Central is not initialised"); } Workspace ws; boolean resolve; synchronized (workspaceQueue) { ws = workspace; File workspaceDirectory = getWorkspaceDirectory(); if (ws != null) { if (workspaceDirectory != null && ws.isDefaultWorkspace()) { ws.setFileSystem(workspaceDirectory, Workspace.CNFDIR); ws.refresh(); resolve = !workspaceQueue.getPromise() .isDone(); } else if (workspaceDirectory == null && !ws.isDefaultWorkspace()) { ws.setFileSystem(Workspace.BND_DEFAULT_WS, Workspace.CNFDIR); ws.refresh(); resolve = false; } else { resolve = false; } } else { try { Workspace.setDriver(Constants.BNDDRIVER_ECLIPSE); Workspace.addGestalt(Constants.GESTALT_INTERACTIVE, new Attrs()); if (workspaceDirectory == null) { ws = Workspace.createDefaultWorkspace(); resolve = false; } else { ws = Workspace.getWorkspace(workspaceDirectory); resolve = true; } ws.setOffline(new BndPreferences().isWorkspaceOffline()); ws.addBasicPlugin(new SWTClipboard()); ws.addBasicPlugin(new WorkspaceListener(ws)); ws.addBasicPlugin(getInstance().repoListenerTracker); ws.addBasicPlugin(getEclipseWorkspaceRepository()); ws.addBasicPlugin(new JobProgress()); ws.getBuildOrder(); addCnfChangeListener(ws); workspaceRepositoryChangeDetector = new WorkspaceRepositoryChangeDetector(ws); workspace = ws; } catch (final Exception e) { if (ws != null) { ws.close(); } logger.logError("Init of workspace", e); throw e; } } } if (resolve) workspaceQueue.resolve(ws); return ws; }