Source:
<code>protected ISourceContainer[] createSourceContainers() throws CoreException { List<ISourceContainer> result = new LinkedList<ISourceContainer>(); ILaunchConfiguration config = getLaunchConfiguration(); Set<String> projectsAdded = new HashSet<>(); try { Run run = LaunchUtils.createRun(config); if (run != null) { Collection<Container> runbundles = run.getRunbundles(); for (Container runbundle : runbundles) { if (runbundle.getType() == TYPE.PROJECT) { String targetProjName = runbundle.getProject().getName(); if (projectsAdded.add(targetProjName)) { IProject targetProj = ResourcesPlugin.getWorkspace().getRoot().getProject(targetProjName); if (targetProj != null) { IJavaProject targetJavaProj = JavaCore.create(targetProj); result.add(new JavaProjectSourceContainer(targetJavaProj)); } } } else if (runbundle.getType() == TYPE.REPO) { IPath bundlePath = Central.toPath(runbundle.getFile()); IFile bundleFile = null; if (bundlePath != null) { bundleFile = ResourcesPlugin.getWorkspace().getRoot().getFile(bundlePath); } if (bundleFile != null) { ArchiveSourceContainer tempArchiveCont = new ArchiveSourceContainer(bundleFile, false); result.add(tempArchiveCont); } else { ExternalArchiveSourceContainer container = new ExternalArchiveSourceContainer(runbundle.getFile().toString(), false); result.add(container); } } } <START> lastRun = run; <END> } } catch (Exception e) { logger.logError("Error querying Bnd dependency source containers.", e); } return result.toArray(new ISourceContainer[0]); }</code><technical_language>this lastRun is ended in dispose. cases lastRun non-null is set run? In case, non-null run ended</technical_language>

Target:
protected ISourceContainer[] createSourceContainers() throws CoreException { List<ISourceContainer> result = new LinkedList<ISourceContainer>(); ILaunchConfiguration config = getLaunchConfiguration(); Set<String> projectsAdded = new HashSet<>(); try { if (lastRun != null) { LaunchUtils.endRun(lastRun); } Run run = LaunchUtils.createRun(config); if (run != null) { Collection<Container> runbundles = run.getRunbundles(); for (Container runbundle : runbundles) { if (runbundle.getType() == TYPE.PROJECT) { String targetProjName = runbundle.getProject().getName(); if (projectsAdded.add(targetProjName)) { IProject targetProj = ResourcesPlugin.getWorkspace().getRoot().getProject(targetProjName); if (targetProj != null) { IJavaProject targetJavaProj = JavaCore.create(targetProj); result.add(new JavaProjectSourceContainer(targetJavaProj)); } } } else if (runbundle.getType() == TYPE.REPO) { IPath bundlePath = Central.toPath(runbundle.getFile()); IFile bundleFile = null; if (bundlePath != null) { bundleFile = ResourcesPlugin.getWorkspace().getRoot().getFile(bundlePath); } if (bundleFile != null) { ISourceContainer sourceContainer = null; final String sourceProjectName = runbundle.getAttributes().get("sourceProjectName"); if (sourceProjectName != null) { try { IProject sourceProject = ResourcesPlugin.getWorkspace().getRoot().getProject(sourceProjectName); if (sourceProject.exists()) { IJavaProject javaSourceProject = JavaCore.create(sourceProject); sourceContainer = new JavaProjectSourceContainer(javaSourceProject); } } catch (Exception e) { logger.logError("Error getting source java project", e); } } if (sourceContainer == null) { sourceContainer = new ArchiveSourceContainer(bundleFile, false); } result.add(sourceContainer); } else { ExternalArchiveSourceContainer container = new ExternalArchiveSourceContainer(runbundle.getFile().toString(), false); result.add(container); } } } lastRun = run; } } catch (Exception e) { logger.logError("Error querying Bnd dependency source containers.", e); } return result.toArray(new ISourceContainer[0]); }