Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

NullPointer Exception handling in the code [closed]

...
wandermonk's user avatar
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: ...
Vikas Prasad's user avatar
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: ...
XoXo's user avatar
  • 185
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: ...
Vince's user avatar
  • 275
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: ...
k_rollo's user avatar
  • 478
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 ...
user3590149's user avatar
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 ...
Aki K's user avatar
  • 1,329