View Javadoc
1   ////////////////////////////////////////////////////////////////////////////////
2   // Test case file for checkstyle.
3   // Created: 2001
4   ////////////////////////////////////////////////////////////////////////////////
5   package com.puppycrawl.tools.checkstyle.checks.whitespace.whitespacearound;
6   
7   import java.lang.annotation.Documented;
8   import java.lang.annotation.ElementType;
9   import java.lang.annotation.Retention;
10  import java.lang.annotation.RetentionPolicy;
11  import java.lang.annotation.Target;
12  import java.util.function.Function;
13  import java.util.function.Supplier;
14  
15  
16  
17  class myFoo
18  {
19  	private static final String ALLOWS_NULL_KEYS = "";
20  	private static final String ALLOWS_NULL_VALUES = "";
21  
22  	@MapFeature.Require({ALLOWS_NULL_KEYS, ALLOWS_NULL_VALUES})
23  	private void foo()
24  	{
25  		int i = 0;
26  		String[][] x = { {"foo"} };
27  		int len = 0;
28  		String sequence = null;
29  		for (int first = 0; first < len && matches(sequence.charAt(first)); first++) {}
30  		while (i == 1) {}
31  		do {} while (i == 1);
32  	}
33  
34  	private boolean matches(char charAt)
35  	{
36  		return false;
37  	}
38  }
39  
40  interface SupplierFunction<T> extends Function<Supplier<T>, T> {}
41  
42  class EmptyFoo {}
43  
44  enum EmptyFooEnum {}
45  
46  class WithEmptyAnonymous
47  {
48  	private void foo()
49  	{
50  		MyClass c = new MyClass() {};
51  	}
52  }
53  
54  
55  @Retention(value = RetentionPolicy.CLASS)
56  @Target(
57      ElementType.ANNOTATION_TYPE)
58  @Documented
59  @Deprecated
60  @interface Beta {}
61  @interface MapFeature {
62  	@interface Require {
63  
64  		String[] value();
65  		
66  	}
67  }
68  
69  class MyClass {
70  	
71  }