tracker issue : CF-4148767

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

ToString() Member Function Broken for Binary Data

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/

Reporter/Name(from Bugbase): Matthew Clemente / Matthew Clemente (Matthew Clemente)

Created: 05/04/2016

Components: Language

Versions: 11.0

Failure Type: Incorrect w/Workaround

Found In Build/Fixed In Build: CF11_Final /

Priority/Frequency: Major / All users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description: variable.ToString() member function does not work

Steps to Reproduce:

<cfscript>
	test = 'test@test.com:test';
	//mimic basic auth
	test = test.tobase64();

	//start decoding
	test = test.BinaryDecode("Base64");

	//expected
	writeDump(tostring(test));

	//broken
	writeDump(test.tostring());
</cfscript>

Actual Result: [B@427f4796

Expected Result: test@test.com:test

Any Workarounds: Not using member function

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4148767

External Customer Info:
External Company:  
External Customer Name: Matthew Clemente
External Customer Email:  
External Test Config: My Hardware and Environment details:



Version	11,0,07,296330

Tomcat Version	7.0.64.0

Edition	Developer 

Operating System	Windows Server 2012 R2 

OS Version	6.3 

Update Level	C:/ColdFusion11/cfusion/lib/updates/hf1100-3929327.jar  

Adobe Driver Version	5.1.3 (Build 000094) 

Java Version: 1.8.0_66

Attachments:

Comments:

Hi Mathew, Member function's support has mainly been added for in-built CF data structure like Struct, list, array, Data, query. Currently, it is not supported for byte array (the object under discussion) and it is not planned for near future as well. Reason, member functions have performance overhead over headless functions and unless an object is very generic and highly used, we might not add Member function support for it. testcase discussed here is similar other objects. Byte[] is not so
Comment by Awdhesh K.
2945 | August 05, 2016 01:01:12 AM GMT
Thanks for adding the note when updating the status Awdhesh. The real issue then, is that the "tostring()" method is found and returns incorrect data. If you don't plan on supporting it, the developer experience would be better if you threw an error: "The tostring method was not found." I spent quite a long time debugging this when I encountered it, because there was no error. Thanks.
Comment by External U.
2946 | August 05, 2016 05:05:41 AM GMT