goxr3plus / java-stream-player

🌌Java Advanced Audio Controller Library (WAV, AU, AIFF, MP3, OGG VORBIS, FLAC, MONKEY's AUDIO and SPEEX audio formats )
GNU General Public License v3.0
147 stars 33 forks source link

Deprecate open(Object) #45

Closed HelgeStenstrom closed 5 years ago

HelgeStenstrom commented 5 years ago

It's better to know at compile time that you cannot call open(String). If open(Objet) is permitted, the error appears at runtime, not compile time.

goxr3plus commented 5 years ago

We used to have 3 open methods one for File, one for InputStream and one for URL i changed it like that because of code duplication in XR3Player but yes you are right.

goxr3plus commented 5 years ago

Is it fully ready :)?

HelgeStenstrom commented 5 years ago

Code duplication is bad, but I think it's more important to expose runtime problems at compile time, if possible. Marking a method as deprecated doesn't remove it. But it becomes clearer exactly which data types are allowed in the overloaded open() method. This pull request doesn't change any runtime behavior. It just makes sense.

HelgeStenstrom commented 5 years ago

Yes, it's ready. It's tested.

goxr3plus commented 5 years ago

Great Job :)