RFR: JDK-8199907: JShell: NoSuchFieldError occurred due to accessing variables of intersection type inferred by `var`

Robert Field robert.field at oracle.com
Wed Oct 2 03:28:39 UTC 2019


Thanks for doing this.

The methods in Unit tend to be called in the main live snippet recursive 
loop.  So, performance can matter.  Calling TreeDissector for every 
variable (an extra compilation step) might be an issue.  For explicitly 
typed variables this is unneeded. 'var' didn't exist when the API was 
created, can we, at least in the internal VarSnippet, a query for 
inferred type variables, and test that in this case?

I know the existing source documentation is sparse, but I'd love brief 
method comments, it will make it easier to maintain (now, and as time 
goes on) and easier to review.

Thanks,
Robert


On 9/20/19 5:34 AM, Jan Lahoda wrote:
> Hi,
>
> I ran into JDK-8199907 again - I apologize for missing it before.
>
> I think Shinya's patch from:
> https://mail.openjdk.java.net/pipermail/kulla-dev/2018-March/002248.html
>
> is fine. But I'd like to enhance that a little, so that when the type 
> of the variable changes (e.g. because of a change in the return type 
> of a method that is called in the initializer), it is automatically 
> recomputed (please see 
> VariablesTest.lvtiRecompileDependentsWithIntersectionTypes2 for an 
> example).
>
> Proposed patch:
> http://cr.openjdk.java.net/~jlahoda/8199907/webrev.00/
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8199907
>
> Thanks,
>     Jan


More information about the kulla-dev mailing list