View Javadoc
1   package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespacebefore;
2   
3   import java.util.function.Supplier;
4   
5   public class InputNoWhitespaceBeforeMethodRef {
6       public static class SomeClass {
7       public static class Nested<V> {
8         private Nested() {
9         }
10      }
11    }
12  
13    public static class Nested2<V> {
14    }
15  
16    public <V> void methodName(V value) {
17      Supplier<?> t = Nested2<V> ::new; //violation
18      Supplier<SomeClass.Nested<V>> passes = SomeClass.Nested ::new; //violation
19      Supplier<SomeClass.Nested<V>> fails = SomeClass.Nested<V>::new;
20    }
21  }