Please note the logger info messages and the values of the Longs. .getId() returns a Long value. procDefIdIn is defined as :
private static Long procDefIdIn = null;
procDefIdIn is passed to this class with a value of 131. How does the last line of log info occur? I also tried converting them to Strings using toString(). Same result.
private static void getDefinitions(List<DefinitionProcess> processes)
{
Long procDefId = null;
for (Iterator<DefinitionProcess> iterator = processes.iterator(); iterator.hasNext(); ) {
DefinitionProcess proc = iterator.next();
if(procDefIdIn != null){
procDefId = procDefIdIn;
logger.info(String.format("proc = #%d procDefIdIn = #%d", proc.getId(), procDefIdIn));
if(procDefIdIn != proc.getId()){ // How does 131 && 131 get past this?
logger.info(String.format("Removed proc = #%d", proc.getId()));
iterator.remove();
continue;
}
}
else{
procDefId = proc.getId();
}
........
//Code here does not execute
.......
}
}
INFO - proc = #129 procDefIdIn = #131
INFO - Removed proc = #129
INFO - proc = #130 procDefIdIn = #131
INFO - Removed proc = #130
INFO - proc = #131 procDefIdIn = #131
INFO - Removed proc = #131 //?!?!