There is nothing un-nice about not leaving a comment!
It is not mean, or rude or not nice to not leave a comment. The
close reason says it all. Leaving a comment just begs for extended
discussion for you to spoon feed them an explanation and turns into a
real time debugging session in the comments which is not what the comments are for. Comments on down votes, close votes are never
constructive in the aggregate.
Since you put up the straw man of NullPointerException
the canonical is all you need to dupe with. Because every NullPointerException
is caused by the exact same thing. Now the solution on how to prevent that is extremely localized in almost every case. And in those cases 10 seconds of using a step debugger will show exactly how to fix the problem.
Same goes with NoClassDefFoundError
and FileNotFoundException
and the same things exist in javascript with Undefined
methods and attributes. They are all caused by the same thing but have extremely localized fixes, which can always be solved quickly with a step debugger.
There is no reasonable way to debug someones environment from StackOverflow.
If there is a hint of what is wrong in the code is going to be closed because of a Typo/Unreproducible anyway.
These extremely common exceptions/error messages can be resolved with minimal searching and reading of documentation and a few seconds of setting break points in a step debugger.
Adding yet another extremely localized explanation of these types of questions actually makes the problem worse because it just generates more answers that do no one any good except the OP for that specific line of code. They will just come back in 5 mins or less asking the exact same thing on the next NPE
.
These questions always qualify for a down vote as well per the reasoning under the arrow. This question does not show any research effort; it is unclear or not useful
The dupe to a canonical makes the site better in every way.