Program: 62604
Project: 62604
Buggy source:
@Override public boolean handleRequest(ZWaveController zController,SerialMessage lastSentMessage,SerialMessage incomingMessage) throws ZWaveSerialMessageException {
  int nodeId;
  boolean result=true;
  UpdateState updateState=UpdateState.getUpdateState(incomingMessage.getMessagePayloadByte(0));
switch (updateState) {
case NODE_INFO_RECEIVED:
    nodeId=incomingMessage.getMessagePayloadByte(1);
  logger.debug("String_Node_Str",nodeId);
int length=incomingMessage.getMessagePayloadByte(2);
ZWaveNode node=zController.getNode(nodeId);
if (node == null) {
logger.debug("String_Node_Str",nodeId);
if (nodeId > 0 && nodeId <= 232) {
zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.IncludeDone,incomingMessage.getMessagePayloadByte(2)));
}
break;
}
node.setNodeState(ZWaveNodeState.ALIVE);
node.resetResendCount();
node.setApplicationUpdateReceived(true);
if (node.getNodeInitStage() == ZWaveNodeInitStage.DONE) {
if (node.getCommandClass(CommandClass.ASSOCIATION) == null) {
logger.debug("String_Node_Str",nodeId);
zController.notifyEventListeners(new ZWaveDelayedPollEvent(nodeId,0,75,TimeUnit.MILLISECONDS));
}
}
 else {
List<CommandClass> nifClasses=new ArrayList<CommandClass>();
for (int i=6; i < length + 3; i++) {
int data=incomingMessage.getMessagePayloadByte(i);
CommandClass commandClass=CommandClass.getCommandClass(data);
if (commandClass == null) {
logger.trace(String.format("String_Node_Str",nodeId,data));
continue;
}
if (commandClass == CommandClass.MARK) {
break;
}
if (node.getCommandClass(commandClass) == null) {
ZWaveCommandClass zwaveCommandClass=ZWaveCommandClass.getInstance(data,node,zController);
if (zwaveCommandClass != null) {
logger.debug("String_Node_Str",nodeId,commandClass);
node.addCommandClass(zwaveCommandClass);
}
}
nifClasses.add(commandClass);
}
node.updateNifClasses(nifClasses);
}
ZWaveWakeUpCommandClass wakeUp=(ZWaveWakeUpCommandClass)node.getCommandClass(ZWaveCommandClass.CommandClass.WAKE_UP);
if (wakeUp != null) {
wakeUp.setAwake(true);
}
break;
case NODE_INFO_REQ_FAILED:
if (lastSentMessage.getMessageClass() != SerialMessageClass.RequestNodeInfo) {
logger.warn("String_Node_Str",lastSentMessage.getMessageClass());
return false;
}
nodeId=lastSentMessage.getMessageNode();
logger.debug("String_Node_Str",nodeId);
if (--lastSentMessage.attempts >= 0) {
logger.error("String_Node_Str",nodeId);
zController.enqueue(lastSentMessage);
}
 else {
logger.warn("String_Node_Str",nodeId,lastSentMessage.toString());
}
incomingMessage.setTransactionCanceled();
result=false;
break;
default :
logger.warn("String_Node_Str",updateState.getLabel(),updateState.getKey());
}
checkTransactionComplete(lastSentMessage,incomingMessage);
return result;
}

Fixed version (ground truth):
@Override public boolean handleRequest(ZWaveController zController,SerialMessage lastSentMessage,SerialMessage incomingMessage) throws ZWaveSerialMessageException {
  int nodeId;
  boolean result=true;
  UpdateState updateState=UpdateState.getUpdateState(incomingMessage.getMessagePayloadByte(0));
switch (updateState) {
case NODE_INFO_RECEIVED:
    nodeId=incomingMessage.getMessagePayloadByte(1);
  logger.debug("String_Node_Str",nodeId);
int length=incomingMessage.getMessagePayloadByte(2);
ZWaveNode node=zController.getNode(nodeId);
if (node == null) {
logger.debug("String_Node_Str",nodeId);
if (nodeId > 0 && nodeId <= 232) {
zController.notifyEventListeners(new ZWaveInclusionEvent(ZWaveInclusionEvent.Type.IncludeDone,nodeId));
}
break;
}
node.setNodeState(ZWaveNodeState.ALIVE);
node.resetResendCount();
node.setApplicationUpdateReceived(true);
if (node.getNodeInitStage() == ZWaveNodeInitStage.DONE) {
if (node.getCommandClass(CommandClass.ASSOCIATION) == null) {
logger.debug("String_Node_Str",nodeId);
zController.notifyEventListeners(new ZWaveDelayedPollEvent(nodeId,0,75,TimeUnit.MILLISECONDS));
}
}
 else {
List<CommandClass> nifClasses=new ArrayList<CommandClass>();
for (int i=6; i < length + 3; i++) {
int data=incomingMessage.getMessagePayloadByte(i);
CommandClass commandClass=CommandClass.getCommandClass(data);
if (commandClass == null) {
logger.trace(String.format("String_Node_Str",nodeId,data));
continue;
}
if (commandClass == CommandClass.MARK) {
break;
}
if (node.getCommandClass(commandClass) == null) {
ZWaveCommandClass zwaveCommandClass=ZWaveCommandClass.getInstance(data,node,zController);
if (zwaveCommandClass != null) {
logger.debug("String_Node_Str",nodeId,commandClass);
node.addCommandClass(zwaveCommandClass);
}
}
nifClasses.add(commandClass);
}
node.updateNifClasses(nifClasses);
}
ZWaveWakeUpCommandClass wakeUp=(ZWaveWakeUpCommandClass)node.getCommandClass(ZWaveCommandClass.CommandClass.WAKE_UP);
if (wakeUp != null) {
wakeUp.setAwake(true);
}
break;
case NODE_INFO_REQ_FAILED:
if (lastSentMessage.getMessageClass() != SerialMessageClass.RequestNodeInfo) {
logger.warn("String_Node_Str",lastSentMessage.getMessageClass());
return false;
}
nodeId=lastSentMessage.getMessageNode();
logger.debug("String_Node_Str",nodeId);
if (--lastSentMessage.attempts >= 0) {
logger.error("String_Node_Str",nodeId);
zController.enqueue(lastSentMessage);
}
 else {
logger.warn("String_Node_Str",nodeId,lastSentMessage.toString());
}
incomingMessage.setTransactionCanceled();
result=false;
break;
default :
logger.warn("String_Node_Str",updateState.getLabel(),updateState.getKey());
}
checkTransactionComplete(lastSentMessage,incomingMessage);
return result;
}