RFR: 8057543: Replace javac's Filter with Predicate (and lambdas) [v2]

Guoxiong Li gli at openjdk.java.net
Thu Apr 22 14:01:24 UTC 2021


On Thu, 22 Apr 2021 13:40:40 GMT, Rémi Forax <github.com+828220+forax at openjdk.org> wrote:

>> Actually - doing more tests, I think javac is right. Fields with explicit initializers are initialized BEFORE other constructor statements. Which means that the error message is legitimate (e.g. the lambda is capturing a final value that is not initialized). I think reverting back to anon class would be better here.
>
> It's not a bug, it's a dubious feature, the lambda EG discussed that at length, you can ask Brian about it.
> 
> Usually replacing
> 
> t.name != names.init
> 
> by
> 
>   t.name != this.names.init
> 
> is enough.

@forax Thank you for your reply. I tested `t.name != this.names.init` with `final Names names;` just now. The error also occurred. Same as `t.name != names.init`.

And I think that `t.name != names.init` and `t.name != this.names.init` are equal at this situation.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1898


More information about the compiler-dev mailing list