Bug 3555 source for binaries - 'defaults' button does not work (1G840M4)
AK (1/25/01 2:43:33 PM) 1. create a java project 2. open the properties page for rt.jar in the project 3. clear the 'Sources JAR file' field 4. press 'Defaults' nothing happens NOTES: EG (2/1/01 10:02:53 AM) wait until we finish the Library presentation issue.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/SourceAttachmentBlock.java
public IRunnableWithProgress getRunnable(final IJavaProject jproject, final Shell shell) {
		return new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException {				
				try {
					IClasspathEntry newEntry;
					if (fIsVariableEntry) {
						newEntry= JavaCore.newVariableEntry(fJARPath, getSourceAttachmentPath(), getSourceAttachmentRootPath(), false);
					} else {
						newEntry= JavaCore.newLibraryEntry(fJARPath, getSourceAttachmentPath(), getSourceAttachmentRootPath(), false);
					}
					IClasspathEntry[] entries= modifyClasspath(jproject, newEntry, shell);		
					if (entries != null) {
						jproject.setRawClasspath(entries, monitor);
					}
				} catch (JavaModelException e) {
					throw new InvocationTargetException(e);
				}
			}
		};
	}
	private IClasspathEntry[] modifyClasspath(IJavaProject jproject, IClasspathEntry newEntry, Shell shell) throws JavaModelException{
		IClasspathEntry[] oldClasspath= jproject.getRawClasspath();
		int nEntries= oldClasspath.length;
		ArrayList newEntries= new ArrayList(nEntries + 1);
		int entryKind= newEntry.getEntryKind();
		IPath jarPath= newEntry.getPath();
		boolean found= false;
		for (int i= 0; i < nEntries; i++) {
			IClasspathEntry curr= oldClasspath[i];
			if (curr.getEntryKind() == entryKind && curr.getPath().equals(jarPath)) {