View Javadoc
1   /*
2   NoWhitespaceAfter
3   allowLineBreaks = (default)true
4   tokens = METHOD_REF
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.whitespace.nowhitespaceafter;
10  
11  import java.util.function.Supplier;
12  
13  public class InputNoWhitespaceAfterTestMethodRefAfter {
14      public static class SomeClass {
15          public static class Nested<V> {
16              private Nested() {
17              }
18          }
19      }
20  
21      public static class Nested2<V> {
22      }
23  
24      public <V> void methodName(V value) {
25          Supplier<?> t = Nested2<V>:: new; // violation
26          Supplier<SomeClass.Nested<V>> passes = SomeClass.Nested:: new; // violation
27          Supplier<SomeClass.Nested<V>> fails = SomeClass.Nested<V>::new; //no violation
28      }
29  }