Bug 5091

Summary: Source attachment is broken for JRE_LIB
Product: [Eclipse Project] JDT Reporter: Philipe Mulet <philippe_mulet>
Component: UIAssignee: Erich Gamma <erich_gamma>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Philipe Mulet CLA 2001-10-19 05:01:40 EDT
Build 205

The variable used to attach source to the JRE library (JRE_SRC) is incorrectly
bound to the source root path.

This can be seen on the properties of a rt.jar package fragment root.

Offending code seems to be (see below >>>>>>):
-----------------------------
JavaRuntime
	private static LibraryLocation getAdjustedLocation(IVMInstall 
defaultVM)  {
		IPath libraryPath;
		IPath sourcePath;
		IPath sourceRootPath;
		LibraryLocation location= defaultVM.getLibraryLocation();
		if (location == null) {
			LibraryLocation dflt= defaultVM.getVMInstallType
().getDefaultLibraryLocation(defaultVM.getInstallLocation());
			
			libraryPath= dflt.getSystemLibraryPath();
			if (!libraryPath.toFile().isFile()) {
				libraryPath= Path.EMPTY;
			}
			
			sourcePath= dflt.getSystemLibrarySourcePath();
			if (sourcePath.toFile().isFile()) {
>>>>>>				sourcePath= dflt.getPackageRootPath();
				sourceRootPath= dflt.getPackageRootPath();
			} else {
				sourcePath= Path.EMPTY;
				sourceRootPath= Path.EMPTY;
			}
		} else {
			libraryPath= location.getSystemLibraryPath();
			sourcePath= location.getSystemLibrarySourcePath();
			sourceRootPath= location.getPackageRootPath();
		}
		return new LibraryLocation(libraryPath, sourcePath, 
sourceRootPath);
	}
Comment 1 Martin Aeschlimann CLA 2001-10-19 09:36:43 EDT
fixed > 205