code: @CheckForNull
      public File getCurrentFileName()
      {
          if (currentFileNameMockFile != null) {
              return currentFileNameMockFile;
          }
  
          // the remainder of this method is a workaround for Checkstyle issue #1205
          // https://github.com/checkstyle/checkstyle/issues/1205
          final FileContents fileContents = check.getFileContents();
          Method getFilename = null;
          try {
              getFilename = fileContents.getClass().getMethod("getFileName");
          }
          catch (NoSuchMethodException e) {
              try {
                  getFilename = fileContents.getClass().getMethod("getFilename");
              }
              catch (NoSuchMethodException e1) {
                  throw new UnsupportedOperationException("FileContents.getFilename()", e1);
              }
          }
  
          String filename = null;
          if (getFilename != null) {
              try {
                  filename = (String) getFilename.invoke(fileContents);
              }
              catch (IllegalAccessException | InvocationTargetException e) {
                  throw new UnsupportedOperationException("FileContents.getFilename()", e);
              }
          }
  
          File result = filename != null ? new File(filename) : null;
          return result;
      }
docs: Wrapper for <code>FileContents.getFileName()</code> (Checkstyle issue <a target="_blank"
  href="https://github.com/checkstyle/checkstyle/issues/1205">#1205</a>).
  
  @return the currently analyzed file as returned by Checkstyle
  
  @throws UnsupportedOperationException no known variant of <code>FileContents.getFileName()</code> could be found