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()
{
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;
}
try
{
runLock.acquire();
log.info("... Running " + this.getClass().getSimpleName() + " for core [" + coreName + "].");
log.info("... Running " + this.getClass().getSimpleName() + " " + hashCode() + " for core [" + coreName + "].");
if(state == null)
{
@@ -191,8 +191,11 @@ public abstract class AbstractTracker implements Tracker
finally
{
infoSrv.unregisterTrackerThread();
if (state != null)
{
state.setRunning(false);
state.setCheck(false);
}
runLock.release();
}
}