Skip to content

What to do if null? #36

@HelgeStenstrom

Description

@HelgeStenstrom

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementRefactorings and internal structure improvementsquestion

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions