Class OuterTypeFilenameCheck

All Implemented Interfaces:
Configurable, Contextualizable

Checks that the outer type name and the file name match. For example, the class Foo must be in a file named Foo.java.
Since:
5.3
  • Field Details

    • MSG_KEY

      public static final String MSG_KEY
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • FILE_EXTENSION_PATTERN

      private static final Pattern FILE_EXTENSION_PATTERN
      Pattern matching any file extension with dot included.
    • seenFirstToken

      private boolean seenFirstToken
      Indicates whether the first token has been seen in the file.
    • fileName

      private String fileName
      Current file name.
    • hasPublic

      private boolean hasPublic
      If file has public type.
    • wrongType

      Outer type with mismatched file name.
    • isCompactSourceFile

      private boolean isCompactSourceFile
      Indicates whether the file is a compact source file. Its outer type is an implicit unnamed class that is not declared with a name in the source, so there is no type name to compare against the file name.
  • Constructor Details

  • Method Details