I'm experiencing a weird behaviour using a java method inside an EJB class.
I have a couple of Integer
, declared as follows:
Integer decimalDigit = null;
Integer decimalExponent = null;
I pass them to the following method, along with other parameters.
public void GetPrecision(Currency cur, String nodeCode, Integer decimalDigit, Integer decimalExponent) {
decimalDigit = new Integer(cur.getDecimalDigit());
decimalExponent = new Integer(cur.getDecimalExponent());
if (!CommonHelper.isNullOrEmptyOrBlank(nodeCode)) {
Node tempNode = nodeListProvider.getNodeList().get(nodeCode);
if (tempNode != null && tempNode.getDecimalDigit() != null) {
decimalDigit = (int) tempNode.getDecimalDigit();
decimalExponent = 0;
}
}
}
The 2 objects are correctly istantiated inside the method using the new operator and they stay like that until the end of the call but, as soon as i get out, the 2 variables are again null.
I cannot explain this behaviour, any hint?
Thanks in advance