Uploaded image for project: 'Commons VFS'
  1. Commons VFS
  2. VFS-337

AbstractFileObject ctor accepts FileName as a parameter, but actually requires AbstractFileName

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0
    • 2.0
    • None

    Description

      The AbstractFileObject constructor accepts FileName as a parameter, but actually requires an AbstractFileName.
      Anything else will generate a ClassCastException.

      The reason for the cast is to allow access to the package-protected method void AbstractFileName#setType(FileType type)

      Many of the AbstractFileObject methods rely on being able to invoke the setType method, so perhaps the parameter should be changed accordingly?
      This will change the API and require changes to subclasses.

      I'll add Javadoc to document the restriction.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sebb Sebb
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: