Uploaded image for project: 'Commons IO'
  1. Commons IO
  2. IO-846

Undeprecate RandomAccessFileInputStream constructors, deprecate the builder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Streams/Writers
    • None

    Description

      The Builder pattern is actively negative here. It introduces at least one runtime failure mode (not setting the underlying file) that is a compile time error with a constructor. The constructors are simpler, more obvious, and less error prone.

      The builder pattern is *not* preferred to constructors in all cases. It is a non-standard idiom outside the Java language that is appropriate when:

      1. There are a large number of arguments.
      2. At least two of the arguments have the same type so there is a real risk of swapping them.
      3. Any combination of arguments is allowed.

      All three of those conditions are false in this case.

      Attachments

        Activity

          People

            Unassigned Unassigned
            elharo Elliotte Rusty Harold
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: