Elliotte Rusty Harold created IO-830:
----------------------------------------

             Summary: Rethink AbstractOrigin
                 Key: IO-830
                 URL: https://issues.apache.org/jira/browse/IO-830
             Project: Commons IO
          Issue Type: Bug
            Reporter: Elliotte Rusty Harold


UnuspportedOperationException is a code smell that indicates the class 
hierarchy doesn't really fit the problem.

See 
https://softwareengineering.stackexchange.com/questions/337850/is-expecting-the-api-user-to-implement-an-unsupportedoperationexception-okay

It doesn't work to treat all origins the same. E.g. CharSequences really, 
really need a character set before they can be converted to byte arrays or 
input streams, but byte arrays and files don't. In reverse files need a 
character set to be converted to a reader but char sequences don't.

Different classes need different arguments, whether you use a builder or a 
constructor. There's not common type here. 




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to