All Questions
7 questions
1
vote
1
answer
1k
views
2
votes
1
answer
400
views
Is catching null pointer exception to handle it instead of null check beforehand always a bad practice or it depends? [closed]
I wrote a static method for an enum that returns the corresponding enum instance based on the source string, trimming any whitespaces and ignoring case as:
...
2
votes
4
answers
1k
views
Throwing exceptions if there is not exactly one box retrieved
(Note: this is originally posted as this SO question )
I'm trying to refactor the error logging and exception throwing into a method.
Original code:
...
4
votes
2
answers
285
views
Verifying value before parsing
I am writing some Java code and am coming across a try/catch block in which I decided to verify the value is not null before parsing it:
...
5
votes
3
answers
5k
views
User registration Servlet
I have a servlet that processes user registration to a website. It takes inputs from an HTML form like username, password, email, etc.
MySQL Table:
...
7
votes
3
answers
260
views
Creating check parameter class instead of repetitive null checks
What I'm trying to accomplish is to have a error checking class mostly to check if parameters that are pass null but also data structures within class are not null. So my thought is a clean static ...
16
votes
2
answers
5k
views
Using finally with return statement or not
I was wondering if it is the proper way to always put the return statement of a function with a try-catch clause in the finally ...