-
-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
improvementRefactorings and internal structure improvementsRefactorings and internal structure improvementsquestion
Description
java-stream-player/src/main/java/com/goxr3plus/streamplayer/stream/StreamPlayer.java
Line 523 in 4991e4a
if (sourceDataLine != null) { |
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.
goxr3plusgoxr3plus
Metadata
Metadata
Assignees
Labels
improvementRefactorings and internal structure improvementsRefactorings and internal structure improvementsquestion