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

Bug 312111

Summary: [content assist] [api] StructuredContentAssistProcessor#CompletionListener#assistSessionEnded always skipped
Product: [WebTools] WTP Source Editing Reporter: Ian Tewksbury <itewksbu>
Component: wst.sseAssignee: Ian Tewksbury <itewksbu>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev
Version: 3.2Flags: nsand.dev: review+
thatnitind: review+
Target Milestone: 3.2 RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Fix Patch nsand.dev: iplog+

Description Ian Tewksbury CLA 2010-05-07 14:45:03 EDT
StructuredContentAssistProcessor#CompletionListener#assistSessionEnded is always being skipped right now because it starts with the following statement:

event.processor == StructuredContentAssistProcessor.this

This would be fine except in SSE the StructuredContentAssistProcessor is always a child of a CompoundContentAssistProcessor and thus that statement fails.

Ironically enough StructuredContentAssistProcessor#CompletionListener#assistSessionStarted already has the correct if check of:

if (event.processor == StructuredContentAssistProcessor.this ||
					(event.processor instanceof CompoundContentAssistProcessor &&
							((CompoundContentAssistProcessor)event.processor).containsProcessor(StructuredContentAssistProcessor.this))) {

This most likly happned because none of the SSE code takes advantage of ICompletionProposalComputer#sessionEnded so the issue was never noticed there like it was in ICompletionProposalComputer#sessionStarted.

Because of this bug anyone who implements ICompletionProposalComputer will never have their #sessionEnded method called.

Fix is simple, use the same if statment in #assistSessionEnded as in #assistSessionStarted.
Comment 1 Ian Tewksbury CLA 2010-05-07 14:47:09 EDT
Created attachment 167534 [details]
Fix Patch

Fix as described in the description.  This fix really should go into WTP 3.2 otherwise any adopter of the new content assist framework will not be able to take advantage of the ICompletionProposalComputer#sessionEnded method.
Comment 2 Nick Sandonato CLA 2010-05-10 14:27:20 EDT
Looks good to me.