tracker issue : CF-4202935

select a category, or use search below
(searches all categories and all time range)
Title:

[ANeff] Bug for: some cross-applied member functions throw incorrect parameter check exception

| View in Tracker

Status/Resolution/Reason: Needs Review//HasDependency

Reporter/Name(from Bugbase): Aaron Neff / ()

Created: 06/20/2018

Components: Language, Member Functions

Versions: 2018

Failure Type: Others

Found In Build/Fixed In Build: 2018.0.0.310409 /

Priority/Frequency: Normal / Very few users will encounter

Locale/System: / Platforms All

Vote Count: 0

Issue: some cross-applied member functions throw incorrect parameter check exception

Repro:

{code:java}
<cfscript>
  //string member on string
  myVar = "asdf"
  myVar.left()//coldfusion.runtime.java.AbstractMethodHandleMapper$WrongParameterNumberException (good)
  
  //string member on boolean
  myVar = true
  myVar.left()//coldfusion.runtime.java.AbstractMethodHandleMapper$WrongParameterNumberException (good)
  
  //string member on numeric
  myVar = 1
  myVar.left()//coldfusion.runtime.java.MethodSelectionException (bad)
  
  //numeric member on string
  myVar = "1"
  myVar.min()//coldfusion.runtime.java.MethodSelectionException (bad)
  
  //date member on string
  myVar = "2018-01-01T00:00:00Z"
  myVar.add()//coldfusion.runtime.java.MethodSelectionException (bad)
</cfscript>
{code}


Actual Result: some throw coldfusion.runtime.java.MethodSelectionException

Expected Result: all throw coldfusion.runtime.java.AbstractMethodHandleMapper$WrongParameterNumberException

Note: Please don't only fix this for numeric.left(), string.min() and string.add(). =P The fix should be generic and apply to all 'string member on numeric', 'numeric member on string' and 'date member on string' cases.

Attachments:

Comments:

IMHO, just about every string member function should work on a numeric even if the result would be identical. I pointed this type of issue 1 1/2 year ago. https://tracker.adobe.com/#/view/CF-4198258
Comment by James M.
29110 | June 20, 2018 02:21:16 PM GMT
Hi James, I completely agree. CF-4198258 is fixed in Aether. Aether added all string member functions to numeric. Aether also added all numeric member functions to string. In this ticket here, I'm intentionally causing an error by omitting required parameters. The issue is that the "(bad)" cases are throwing the wrong error. Thanks!, -Aaron
Comment by Aaron N.
29116 | June 20, 2018 11:42:45 PM GMT