You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If sourceDataLine is null, the whole method openLine() does nothing, silently. Isn't that an error condition? Isn't it better to let a NullPointerException happen, and fix the bug so that it doesn't happen again?
I think it would be a good idea to make a wrapper class on SourceDataLine, where you are guaranteed that the sourceDataLine is not null. Then you don't need this kind of tests.
The text was updated successfully, but these errors were encountered:
You are so right, i haven't thought about it, actually it can throw a LIneUnavailable exception which now it doesn't, please proceed showing me your idea i think you are very right!!! :)
java-stream-player/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java
Line 523 in 4991e4a
Why is this test for nullity there?
If sourceDataLine is null, the whole method openLine() does nothing, silently. Isn't that an error condition? Isn't it better to let a NullPointerException happen, and fix the bug so that it doesn't happen again?
I think it would be a good idea to make a wrapper class on SourceDataLine, where you are guaranteed that the sourceDataLine is not null. Then you don't need this kind of tests.
The text was updated successfully, but these errors were encountered: