SmartClient Version: v12.1p_2021-10-22/PowerEdition Deployment (built 2021-10-22)
I know that what I'm about to describe is very vague, but I'm hoping that it may trigger a memory of a past problem ( my forum search didn't reveal anything that I found useful), or trigger a suggestion.
This is SmartGWT client side JAVA code.
I have a TreeNode [] array, of which copyNode is one selected element of the array. The following is cut an pastes from the Chrome source debugger.
This node appears to have this data, according to the debugger:
Notice that the entry 'TNS' is stored as a string, it appears. I have checked the datasources and the TNS field is defined as a 'float'.
In other entries of the TreeNode [] array when the value of TNS is many magnitudes smaller, eg -38.231 it appears to be stored as a 'float'
Anyway my code does this simple arithmetic, and the value of the attr string is 'TNS' in this case:
Double count = -0.764D;
Double nV = 0.0D;
nV = Double.valueOf(copyNode.getAttributeAsDouble(attr));
count = count + Double.valueOf(nV);
The result of executing the last line of code is that the variable count becomes a string: "-0.764-34726056.35200000" . A little later in the code I attempt to operate on the count variable, store it into a HashMap< String, Double> but that line throws a CastException when it executes with this value. No surprise.
There are 60+ elements of the TreeNode [] array, and 58 of them execute with appropriate float values of 'TNS' entry and two of them have this exception when the TNS value is some large magnitude.
What is happening under the hood in the Javascript that may be causing this? Any ideas?
I have added the Double.valueOf( x ) in my code to see if this affected the Exception but it doesn't. The original code, that had this Exception too, was a simple:
count += copyNode.getAttributeAsDouble(attr);
I have broken out the code into smaller steps just to help debug.
The unmodified code has been running successfully for many generations of 12.1 releases, but fails just in this edge case when the values of the 'TNS' entry get big. I have run the unmodified code on a July 15, 2021 version of 12.1 and it has the same exception. What I'm trying to say is that this Exception seems only dependent on the values of 'TNS'.
Putting a sample test case together is almost impossible. If we have to we will arrange for a direct consultancy.
I know that what I'm about to describe is very vague, but I'm hoping that it may trigger a memory of a past problem ( my forum search didn't reveal anything that I found useful), or trigger a suggestion.
This is SmartGWT client side JAVA code.
I have a TreeNode [] array, of which copyNode is one selected element of the array. The following is cut an pastes from the Chrome source debugger.
This node appears to have this data, according to the debugger:
Notice that the entry 'TNS' is stored as a string, it appears. I have checked the datasources and the TNS field is defined as a 'float'.
In other entries of the TreeNode [] array when the value of TNS is many magnitudes smaller, eg -38.231 it appears to be stored as a 'float'
Anyway my code does this simple arithmetic, and the value of the attr string is 'TNS' in this case:
Double count = -0.764D;
Double nV = 0.0D;
nV = Double.valueOf(copyNode.getAttributeAsDouble(attr));
count = count + Double.valueOf(nV);
The result of executing the last line of code is that the variable count becomes a string: "-0.764-34726056.35200000" . A little later in the code I attempt to operate on the count variable, store it into a HashMap< String, Double> but that line throws a CastException when it executes with this value. No surprise.
There are 60+ elements of the TreeNode [] array, and 58 of them execute with appropriate float values of 'TNS' entry and two of them have this exception when the TNS value is some large magnitude.
What is happening under the hood in the Javascript that may be causing this? Any ideas?
I have added the Double.valueOf( x ) in my code to see if this affected the Exception but it doesn't. The original code, that had this Exception too, was a simple:
count += copyNode.getAttributeAsDouble(attr);
I have broken out the code into smaller steps just to help debug.
The unmodified code has been running successfully for many generations of 12.1 releases, but fails just in this edge case when the values of the 'TNS' entry get big. I have run the unmodified code on a July 15, 2021 version of 12.1 and it has the same exception. What I'm trying to say is that this Exception seems only dependent on the values of 'TNS'.
Putting a sample test case together is almost impossible. If we have to we will arrange for a direct consultancy.
Comment