Menu

#2 NULL Pointer exception in ObjectPool.java

open
nobody
5
2003-09-23
2003-09-23
Anonymous
No

ObjectPool will throw a NULL pointer exception.

It's at line 324

if ((now - value.getLastUsedTime()) >=
(poolInfo.getUserTimeout() * 1000L)) ||
value.isFailed()) {

It should be something like

if (value != null && (((now - value.getLastUsedTime())
>= (poolInfo.getUserTimeout() * 1000L)) ||
value.isFailed())) {

Note that the variable "value" can be null !!!!!!!!

If it's not supposed to be null, then we have a problem
because it was null !!

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.