the whole point in the final keyword on member variables is that we can trust in that variable never being null.
There are two ways to handle this situation:
- don't pass c to the constructor but the value returned by the method call.
- a) don't handle the exception thrown by the method call.
b) wrap the caught exception in a RuntimeException and throw that.
The "work around" you found is dangerous because other programmers will not expect this member being null so NPEs will occure often...