Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362003 - [assist] completion is broken after <B base R> after a base guard
Summary: [assist] completion is broken after <B base R> after a base guard
Status: VERIFIED FIXED
Alias: None
Product: Objectteams
Classification: Tools
Component: OTDT (show other bugs)
Version: 2.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 2.1 M3   Edit
Assignee: Stephan Herrmann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 16:26 EDT by Stephan Herrmann CLA
Modified: 2012-09-22 12:26 EDT (History)
0 users

See Also:


Attachments
test & proposed fix (11.45 KB, patch)
2011-10-25 19:00 EDT, Stephan Herrmann CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2011-10-25 16:26:33 EDT
This was observed in team CompilerAdaptation (re null annotations)
where at some point completion stopped to work.

In isolating the cause I found that the parser bails out if
1. a base guard predicate is found,
2. and then a method with <B base R> type parameter is found

When parsing (1) the scanner is put into base-is-identifier mode, but in
recovery mode the predicate itself is not recognized if the callin has no
signatures, so we never leave this mode.

Later, when parsing <B base R> while base is seen as an identifier we
create a ValueTypeParameter "B base" and still later 
AssistParser.indexOfAssistIdentifier(boolean) bails out with an AIOOBE
because an expected identifier is missing.
Comment 1 Stephan Herrmann CLA 2011-10-25 19:00:39 EDT
Created attachment 205956 [details]
test & proposed fix

This patch improves recovery parsing for method mappings in several ways:

+ update the grammar rules for RecoveryCallinHeader adding the option
  to recognized a guard predicate in this position.
  -> this way the parser properly consumes the predicate and can thus
     re-enable base as a keyword

This then broke a few tests from bug 340083 because short base specs were
dropped during recovery.

+ make sure short method specs are added to their RecoveredMethodMapping
  if syntax indicates that's where they belong.
Comment 2 Stephan Herrmann CLA 2011-10-25 19:03:25 EDT
Patch has been committed for 2.1 M3 (r2068/9)
Comment 3 Stephan Herrmann CLA 2012-09-22 12:26:56 EDT
Verified using build 2.2.1.201209182002