SEARCH-97: Handles NULL state object in finally{}

This commit is contained in:
Gethin James
2016-07-26 11:26:30 +02:00
parent 37c5cb4eb5
commit 049b82c897

View File

@@ -133,14 +133,14 @@ public abstract class AbstractTracker implements Tracker
public void track() public void track()
{ {
if(runLock.availablePermits() == 0) { if(runLock.availablePermits() == 0) {
log.info("... " + this.getClass().getSimpleName() + " for core [" + coreName + "] is already in use "+ this.getClass()); log.info("... " + this.getClass().getSimpleName() + " " + hashCode() + " for core [" + coreName + "] is already in use "+ this.getClass());
return; return;
} }
try try
{ {
runLock.acquire(); runLock.acquire();
log.info("... Running " + this.getClass().getSimpleName() + " for core [" + coreName + "]."); log.info("... Running " + this.getClass().getSimpleName() + " " + hashCode() + " for core [" + coreName + "].");
if(state == null) if(state == null)
{ {
@@ -191,8 +191,11 @@ public abstract class AbstractTracker implements Tracker
finally finally
{ {
infoSrv.unregisterTrackerThread(); infoSrv.unregisterTrackerThread();
if (state != null)
{
state.setRunning(false); state.setRunning(false);
state.setCheck(false); state.setCheck(false);
}
runLock.release(); runLock.release();
} }
} }