code: private static VisitorAttributes checkAttributes(VirtualFileFilter filter, VisitorAttributes attributes) {
          if (filter == null) {
              throw MESSAGES.nullArgument("filter");
          }
          // Specified
          if (attributes != null) { return attributes; }
          // From the filter
          if (filter instanceof VirtualFileFilterWithAttributes) { return ((VirtualFileFilterWithAttributes) filter).getAttributes(); }
          // It will use the default
          return null;
      }
docs: Check the attributes
  
  @param filter     the filter
  @param attributes the attributes
  @return the attributes
  @throws IllegalArgumentException for a null filter