Commons VFS
  1. Commons VFS
  2. VFS-337

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

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 2.0
    • Labels:
      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.

        Activity

        Sebb created issue -
        Ralph Goers made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]
        Sebb made changes -
        Resolution Invalid [ 6 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Sebb made changes -
        Summary AbstractFileName ctor accepts FileName as a parameter, but actually requires AbstractFileName AbstractFileObject ctor accepts FileName as a parameter, but actually requires AbstractFileName
        Description The AbstractFileName 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 AbstractFileName 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.
        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.
        Ralph Goers made changes -
        Status Reopened [ 4 ] Resolved [ 5 ]
        Fix Version/s 2.0 [ 12313174 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Sebb
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development