View Javadoc
1   ////////////////////////////////////////////////////////////////////////////////
2   // Test case file for checkstyle.
3   // Created: 2015
4   ////////////////////////////////////////////////////////////////////////////////
5   package com.puppycrawl.tools.checkstyle.checks.modifier.redundantmodifier;
6   
7   public interface InputRedundantModifierNestedClassInPublicInterfaceRedundantModifiers {
8           interface PublicInnerInterface {
9                   interface PublicInnerInnerInterface {
10                          class PublicInnerClassInNestedPublicInterfaces {
11                                  public PublicInnerClassInNestedPublicInterfaces() { } // OK in public class
12                          }
13                  }
14          }
15          class PublicClassInsideInterface {
16                  private interface PrivateNestedInterface {
17                          class ClassInPrivateNestedInterface {
18                                  public ClassInPrivateNestedInterface() { } // Redundant in not public class
19                          }
20                          public interface PrivateNestedInterfaceWithPublicModifier {
21                                  class ClassInPrivateNestedInterface {
22                                          public ClassInPrivateNestedInterface() { } // Redundant in non public scope
23                                  }
24                          }
25                  }
26                  public interface PublicInnerInnerPublicInterface {
27                          class PublicInnerClassInNestedPublicInterfaces {
28                                  public PublicInnerClassInNestedPublicInterfaces() { } // OK in public class
29                          }
30                  }
31                  protected interface PublicInnerInnerProtectedInterface {
32                          class PublicInnerClassInNestedProtectedInterfaces {
33                                  public PublicInnerClassInNestedProtectedInterfaces() { } // Redundant in non public scope
34                          }
35                  }
36          }
37          class PublicNestedClassInInterfaceWithPublicConstructor {
38                  public PublicNestedClassInInterfaceWithPublicConstructor() { } // OK in public class
39                  private class PrivateClassInPublicNestedClass {
40                          public class PublicInPrivateClass {
41                                  public PublicInPrivateClass() { } // Redundant in non public class
42                          }
43                  }
44          }
45          final class FinalNestedClassInInterface {
46                  interface InnerInterface {
47                          final class FinalNestedClassInNestedInterface {}
48                  }
49          }
50  }