poohbar
07/27/2017, 4:54 PMval header = request.getHeader("xyz")
I see that header
has an inferred type of String!
... is this okay? what happens if getHeader
returns null
?diesieben07
07/27/2017, 5:00 PMgetHeader
returns null
and you try to call something on header
, you get a NullPointerException
.diesieben07
07/27/2017, 5:01 PMheader
as String
explicitly, you will get the NPE immediately on assignment instead.poohbar
07/27/2017, 5:27 PM