RFR: 8296846: Minor cleanup of some dead code in Flow.java

Vicente Romero vromero at openjdk.org
Thu Nov 17 11:00:21 UTC 2022


On Wed, 16 Nov 2022 20:24:54 GMT, Archie L. Cobbs <duke at openjdk.org> wrote:

>> This patch removes two bits of dead code that I ran across.
>> 
>> The only interesting bit is the second patch, which removes this check:
>> 
>>                 /*  Ignore synthetic methods, except for translated lambda methods.
>>                  */
>>                 if ((tree.sym.flags() & (SYNTHETIC | LAMBDA_METHOD)) == SYNTHETIC) {
>>                     return;
>>                 }
>> 
>> because it's always preceded by this more general check:
>> 
>>              /*  MemberEnter can generate synthetic methods ignore them
>>               */
>>              if ((tree.sym.flags() & SYNTHETIC) != 0) {
>>                  return;
>>              }
>> 
>> and so can never match.
>> 
>> So the patch preserves the existing behavior, but the bit being removed there begs the question: was there some scenario where `tree.sym.flags()` could have both `SYNTHETIC` and `LAMBDA_METHOD` that we were supposed to be handling?
>> 
>> As it turns out, the `LAMBDA_METHOD` flag is only ever set by `LambdaToMethod`, but that class runs after this code (during flow analysis). So if there ever was any such scenario, it can no longer happen anyway.
>
> Thanks for the review.

Hi, @archiecobbs this test: test/jdk/javax/swing/JFileChooser/8046391/bug8046391.java is failing with your patch on Windows. I will rerun the tests just to double check

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

PR: https://git.openjdk.org/jdk/pull/11112


More information about the compiler-dev mailing list