Community
Participate
Working Groups
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.
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.
Patch has been committed for 2.1 M3 (r2068/9)
Verified using build 2.2.1.201209182002