Source:
<code>private InitializationManager(Project project) { final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.findId("nl.tudelft.watchdog")); <START> <END> if (plugin == null) { throw new IllegalArgumentException("Plugin id \"nl.tudelft.watchdog\" could not be found in the list of installed plugins."); } File baseFolder = new File(plugin.getPath().getPath()); File toTransferDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdog.mapdb"); File statisticsDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdogStatistics.mapdb"); toTransferPersister = new Persister( toTransferDatabaseFile); statisticsPersister = new Persister( statisticsDatabaseFile); intervalManager = new IntervalManager(toTransferPersister, statisticsPersister); WatchDogEvent.intervalManager = intervalManager; WatchDogEvent.editorSpecificImplementation = new WatchDogEvent.WatchDogEventEditorSpecificImplementation() { @Override public void addJUnitInterval(WatchDogEvent event) { JUnitInterval junitInterval = (JUnitInterval) event.getSource(); intervalManager.addInterval(junitInterval); } @Override public EditorWrapperBase createEditorWrapper(Object editor) { return new EditorWrapper((Editor) editor); } @Override public Document createDocument(Object editor) { return DocumentCreator.createDocument((Editor) editor); } }; trackingEventManager = new TrackingEventManager(toTransferPersister, statisticsPersister); trackingEventManager.setSessionSeed(intervalManager.getSessionSeed()); new TimeSynchronityChecker(intervalManager); transferManager = new TransferManagerBase(toTransferPersister, WatchDogUtils.getProjectName()); intelliJListener = new IntelliJListener(trackingEventManager, project); }</code><technical_language>get pluginid programmatically</technical_language>

Target:
private InitializationManager(Project project) { final IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.findId(PLUGIN_ID)); if (plugin == null) { throw new IllegalArgumentException("Plugin id \"" + PLUGIN_ID + "\" could not be found in the list of installed plugins."); } File baseFolder = new File(plugin.getPath().getPath()); File toTransferDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdog.mapdb"); File statisticsDatabaseFile = new File(baseFolder, WatchDogUtils.getProjectName() + "watchdogStatistics.mapdb"); toTransferPersister = new Persister( toTransferDatabaseFile); statisticsPersister = new Persister( statisticsDatabaseFile); intervalManager = new IntervalManager(toTransferPersister, statisticsPersister); WatchDogEventType.intervalManager = intervalManager; WatchDogEventType.editorSpecificImplementation = new WatchDogEventType.WatchDogEventEditorSpecificImplementation() { @Override public void addJUnitInterval(Object source) { JUnitInterval junitInterval = (JUnitInterval) source; intervalManager.addInterval(junitInterval); } @Override public EditorWrapperBase createEditorWrapper(Object editor) { return new EditorWrapper((Editor) editor); } @Override public Document createDocument(Object editor) { return DocumentCreator.createDocument((Editor) editor); } }; trackingEventManager = new TrackingEventManager(toTransferPersister, statisticsPersister); trackingEventManager.setSessionSeed(intervalManager.getSessionSeed()); new TimeSynchronityChecker(intervalManager); transferManager = new TransferManagerBase(toTransferPersister, WatchDogUtils.getProjectName()); intelliJListener = new IntelliJListener(trackingEventManager, project); }