Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 403000

Summary: Javadoc and Declaratoin views not updated when selection is deleted
Product: [Eclipse Project] JDT Reporter: Noopur Gupta <noopur_gupta>
Component: TextAssignee: Martin Mathew <manju656>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert
Version: 4.3   
Target Milestone: 4.3 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Noopur Gupta CLA 2013-03-12 04:59:38 EDT
Steps to reproduce:
1. Enable link with selection in javadoc view.
2. Select a java file in package explorer. The javadoc view will show its java doc.
3. Now, delete the java file. The javadoc view still shows the old content i.e. java doc of the deleted file and the icon for link with selection is also the normal one.

There is no indication that the content shown in the javadoc view after step 3 is not existing. It could be indicated by either clearing the javadoc view or showing the outdated icon.
Comment 1 Dani Megert CLA 2013-03-12 05:27:54 EDT
Looking at the code, we stop processing if the selection is empty. We should just remove that code. This should clear the view and also ensure that the out-of-sync icon is shown when the selection gets empty.

Manju, please take a look for M6.
Comment 2 Dani Megert CLA 2013-03-12 06:04:40 EDT
(In reply to comment #1)
> This should clear the view and also ensure that the
> out-of-sync icon is shown when the selection gets empty.

To clarify: in the deletion case, it would clear the view and leave the "normal" link icon. In case we have a valid input, and the selection gets empty, we'd show the out-of-sync icon.
Comment 3 Martin Mathew CLA 2013-03-12 08:29:55 EDT
In AbstractInfoView#computeAndDoSetInput() currently we return if the selection is empty. 
if (selection == null || selection.isEmpty())
    return;
If we allow the execution to continue, then the existing code will take care of clearing the view if the input is invalid or if it does not exist. If the input is valid but the selection is empty then the icon will indicate out-of-sync.
Comment 4 Dani Megert CLA 2013-03-13 08:34:01 EDT

*** This bug has been marked as a duplicate of bug 403074 ***