Issues
- InputBaseN casting to int unnecessarilyLDEV-1634Resolved issue: LDEV-1634Michael Offner
- REReplace() does not return and can take down serverLDEV-1631Michael Offner
- Add support for query timeout for datasource and/or globally for an applicationLDEV-1628
- this.javasettings - support OSGi bundlesLDEV-1624Resolved issue: LDEV-1624Michael Offner
- Intermediate values used in function not released until function is finishedLDEV-1623Resolved issue: LDEV-1623Michael Offner
- Cfdump output with text format has html tagsLDEV-1615Resolved issue: LDEV-1615Pothys - MitrahSoft
6 of 6
InputBaseN casting to int unnecessarily
Fixed
Description
Environment
None
Details
Assignee
Michael OffnerMichael OffnerReporter
Simon WrightSimon WrightPriority
MinorFix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Simon Wright
Simon WrightPriority
Fix versions
New Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Affects versions
Created 28 December 2017 at 08:02
Updated 4 April 2018 at 15:42
Resolved 4 April 2018 at 15:42
Activity
Show:
Michael Offner4 April 2018 at 15:41
Pothys - MitrahSoft2 January 2018 at 07:29
I've added test case for this ticket & confirmed issue happened on lucee. InputBaseN function returns as integer which is not expected result. I fixed the issue, after this fix it's working fine for me.
PullRequest: https://github.com/lucee/Lucee/pull/360
https://github.com/lucee/Lucee/blob/master/core/src/main/java/lucee/runtime/functions/math/InputBaseN.java
public static double call(PageContext pc , String string, double radix) throws ExpressionException { ... return (int)Long.parseLong(string, (int)radix); }
Long.parseLong(string, radix) is performing the actual BaseN conversion.
The returned value is a double.
However there is a casting to (int) which appears to be unnecessary.
The consequence is that the following code does not return the correct result:
<cfdump var="#InputBaseN('40390719E3C0', 16)#">
This returns the correct result:
<cfdump var="#CreateObject('java', 'java.lang.Long').parseLong('40390719E3C0', 16)#">