Another example for SONARJAVA-2286 (false positive in S1170

https://jira.sonarsource.com/browse/SONARJAVA-2286

import java.util.Date;

public class TTT {

    public static interface ValueGetter {
        Date getValue();
    }

    Date date = new Date();

    final ValueGetter getter = () -> TTT.this.date; // <-- S1170
}
1 Like

Thanks for the reproducer, I added the link to this thread in the ticket.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.