Another example for SONARJAVA-2286 (false positive in S1170


(Henning) #1

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
}

(Nicolas Peru) #2

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