RFR JDK-8080641: JEP-JDK-8042880 : Implement new tests on Project Coin
Alex Buckley
alex.buckley at oracle.com
Tue Oct 20 17:08:31 UTC 2015
Good improvements. Many thanks Sergei.
Alex
On 10/19/2015 9:52 PM, Sergei Pikalev wrote:
>
> Hi Alex and compiler team,
>
> New webrev is here:
> http://cr.openjdk.java.net/~shurailine/8080641/webrev.02/
>
> Illegal expressions moved to TwrForVariable3.
> Array components as variables moved to TwrVarKinds.
> WeirdTwr_WithVar case moved to TwrForVariable1.
>
> Sergi
>
> On 20.10.2015 04:08, Alex Buckley wrote:
>> Thanks for the pointers.
>>
>> I remember now: array components can't be used as resources because,
>> as variables, they are never final or effectively final. (Only an
>> array variable itself may be final or effectively final, not its
>> components.) That's why the grammar only allows ExpressionName and
>> FieldAccess, not ArrayAccess.
>>
>> But, since array components are variables, I would have expected them
>> to be tested in TwrVarKinds rather than TwrForVariable2. And, I would
>> have expected the negative tests in TwrForVariable2 for a conditional
>> expression and a null-with-cast to be located in TwrForVariable3 where
>> other (illegal) expressions are tried. Tests should be written in the
>> right place if we want people to read them.
>>
>> WeirdTwr_WithVar is misnamed and unnecessary. The single t-w-r
>> statement that it contains could live perfectly well in
>> TwrForVariable1, near the nice new cases for assertCloseCount(7) and
>> assertCloseCount(10).
>>
>> Alex
More information about the compiler-dev
mailing list