Hi All,
I am doing some clean up and I cam across some loading warnings for a rule that say
The operator '!==' is undefined for the argument types long and null
The operator '===' is undefined for the argument types long and null
I can see that I am indeed comparing defined long type variable with null, here is such an example:
DWEnabled is type long
if (DWEnabled!==null) {
logInfo("DW_Appliance.rules", "DWEnabled: "+DWEnabled)
val long DWElapsedTime = DWDisabled - DWEnabled
val long DWElapsedTimeMin = DWElapsedTime / 1000 / 60
postUpdate(DWCycleTime,DWElapsedTimeMin)
logInfo("DW_Appliance.rules", " DW was INUSE for "+ DWElapsedTimeMin + "Mins.")
}
How do I keep the outcome intent in this situation?
I am wondering if I should only use == instead of === for long types, or possible use
Perhaps a defined long can never be null??? or I use the example I found in jave;
if (DWEnabled.isNull) {
do stuff
} else {
do other stuff
}
I am sure for seasoned coders this is a newbie question but as a project level coder its not clear.
Regards
Paul