Bug 18039 Opening .class file fails
- build 20020528 - I have loaded a number of classes from the cvs repository at org.eclipse.dev (HEAD stream). Among them are org.eclipse.core.runtime and org.eclipse.core.boot - Search->File - fill in "findResource(" in the 'Containing Text' field - leave everything else as default (searching the workspace and for file name patterns '*') - do the search - I get 2 hits: DelegatingURLClassLoader.class (org.eclipse.core.boot/bin/org/eclipse/core/internal/boot) and DelegatingURLClassLoader.java (org.eclipse.core.boot/src/org/eclipse/core/internal/boot) - 10 matches - try to open the first file in the search result (which doesn't really make sense since it is a .class file) - you get the error: Could not open the editor Reason: bin/org/eclipse/core/internal/boot does not exist - But it does exist and there is a DelegatingURLClassLoader.class there. - Now try to redo the search - Search->File - in the 'Containing Text' field you find "findResource(_x0008__x0001_u_x000C__x0001_6_x0001_7" (i.e added garbage to the end of my search string).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/ClassFileEditor.java
if (path == null) {			
								createLabel(composite, JavaEditorMessages.getFormattedString("SourceAttachmentForm.message.noSourceAttachment", root.getElementName())); 
								createLabel(composite, JavaEditorMessages.getString("SourceAttachmentForm.message.pressButtonToAttach")); 
								createLabel(composite, null);
		
								button= createButton(composite, JavaEditorMessages.getString("SourceAttachmentForm.button.attachSource"));		 
		
							} else {
								createLabel(composite, JavaEditorMessages.getFormattedString("SourceAttachmentForm.message.noSourceInAttachment", fFile.getElementName())); 
								createLabel(composite, JavaEditorMessages.getString("SourceAttachmentForm.message.pressButtonToChange")); 
								createLabel(composite, null);
		
								button= createButton(composite, JavaEditorMessages.getString("SourceAttachmentForm.button.changeAttachedSource")); 
							}
		
							button.addSelectionListener(new SelectionListener() {
								public void widgetSelected(SelectionEvent event) {				
									try {
										SourceAttachmentDialog dialog= new SourceAttachmentDialog(fScrolledComposite.getShell(), root);
										if (dialog.open() == SourceAttachmentDialog.OK)
											verifyInput(getEditorInput());
		
									} catch (CoreException e) {
										String title= JavaEditorMessages.getString("SourceAttachmentForm.error.title"); 
										String message= JavaEditorMessages.getString("SourceAttachmentForm.error.message"); 
										ExceptionHandler.handle(e, fScrolledComposite.getShell(), title, message);				
									}
								}
		
								public void widgetDefaultSelected(SelectionEvent e) {}