@Override public ISourcePathComputer getSourcePathComputer() { ISourcePathComputer sourcePathComputer = super.getSourcePathComputer(); if(sourcePathComputer != null) { return sourcePathComputer; } return new ISourcePathComputer() { LangSourcePathComputer langSourcePathComputer = new LangSourcePathComputer(); @Override public ISourceContainer[] computeSourceContainers(ILaunchConfiguration configuration, IProgressMonitor monitor) throws CoreException { return langSourcePathComputer.computeSourceContainers(configuration, monitor); } @Override public String getId() { return LangDebug.LANG_SOURCE_LOOKUP_DIRECTOR; } }; }
protected void setSourceLocator(ILaunch launch) throws CoreException { ILaunchConfiguration configuration = launch.getLaunchConfiguration(); if (configuration != null && launch.getSourceLocator() == null) { ISourceLookupDirector sourceLocator = new JavaSourceLookupDirector(); ISourcePathComputer locator = getLaunchManager().getSourcePathComputer(SOURCE_LOCATOR); if (locator != null) { sourceLocator.setSourcePathComputer(locator); sourceLocator.initializeDefaults(configuration); launch.setSourceLocator(sourceLocator); } } }