blob: 54a1b07a106f9616baa5a974ae416aa350d2a7e9 [file] [log] [blame]
package org.eclipse.jdt.launching;
/*******************************************************************************
* Copyright (c) 2001, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/cpl-v05.html
*
* Contributors:
* IBM Corporation - initial API and implementation
******************************************************************************/
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
/**
* Default implementation of source lookup path computation and resolution.
* <p>
* This class may be subclassed.
* </p>
* @since 2.0
*/
public class StandardSourcePathProvider extends StandardClasspathProvider {
/**
* @see IRuntimeClasspathProvider#computeUnresolvedClasspath(ILaunchConfiguration)
*/
public IRuntimeClasspathEntry[] computeUnresolvedClasspath(ILaunchConfiguration configuration) throws CoreException {
boolean useDefault = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_SOURCE_PATH, true);
IRuntimeClasspathEntry[] entries = null;
if (useDefault) {
// the default source lookup path is the same as the classpath
entries = super.computeUnresolvedClasspath(configuration);
} else {
// recover persisted source path
entries = recoverRuntimePath(configuration, IJavaLaunchConfigurationConstants.ATTR_SOURCE_PATH);
}
return entries;
}
}