tracker issue : CF-4177585

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

Use of implicit array syntax in conditional operator throws invalid CFML construct

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Jonathan Clausen / Jonathan Clausen (Jonathan Clausen)

Created: 08/01/2016

Components: Language, Functions

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Update1 /

Priority/Frequency: Major / All users will encounter

Locale/System: ALL / Mac 10 All

Vote Count: 0

Problem Description:

The use of an implicit array within a an implicit conditional statement throws intermitted errors.  

Steps to Reproduce:

myVar = someArray.isEmpty() ? [] : someArray;

Actual Result:

Invalid CFML construct found

Relevant stack trace:

at coldfusion.compiler.cfml40.generateParseException(
    at coldfusion.compiler.cfml40.jj_consume_token(
    at coldfusion.compiler.cfml40.OrderedStructInitializer(
    at coldfusion.compiler.cfml40.ArrayOrStructInitializer(
    at coldfusion.compiler.cfml40.Initializer(
    at coldfusion.compiler.cfml40.HookExpression(
    at coldfusion.compiler.cfml40.expr(
    at coldfusion.compiler.cfml40.cfScriptExpression(
    at coldfusion.compiler.cfml40.SimpleStatement(
    at coldfusion.compiler.cfml40.cfscriptStatement(
    at coldfusion.compiler.cfml40.cfscriptBlock(
    at coldfusion.compiler.cfml40.cfscriptStatement(
    at coldfusion.compiler.cfml40.ComplexStatement(
    at coldfusion.compiler.cfml40.cfscriptStatement(
    at coldfusion.compiler.cfml40.functionDefinition(
    at coldfusion.compiler.cfml40.cfscriptStatement(
    at coldfusion.compiler.cfml40.start(
    at coldfusion.compiler.NeoTranslator.parsePage(
    at coldfusion.compiler.NeoTranslator.parsePage(
    at coldfusion.compiler.NeoTranslator.parseAndTransform(
    at coldfusion.compiler.NeoTranslator.translateJava(
    at coldfusion.compiler.NeoTranslator.translateJava(
    at coldfusion.runtime.TemplateClassLoader$TemplateCache$1.fetch(
    at coldfusion.util.LruCache.get(
    at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(
    at coldfusion.util.AbstractCache.fetch(
    at coldfusion.util.SoftCache.get_statsOff(
    at coldfusion.util.SoftCache.get(
    at coldfusion.runtime.TemplateClassLoader.findClass(
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(
    at coldfusion.runtime.CfJspPage.GetComponentMetadata(

Expected Result:


Any Workarounds:

Using arrayNew(1) does not throw an error.

myVar = someArray.isEmpty() ? arrayNew(1) : someArray;

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

Watson Bug ID:	4177585

Reason:	PRHaveInfo

External Customer Info:
External Company:  
External Customer Name: Jonathan Clausen
External Customer Email:  
External Test Config: My Hardware and Environment details:

Server Details

Server Product	ColdFusion 2016

Version	2016.0.02.299200

Edition	Enterprise  

Operating System	Mac OS X  

OS Version	10.11.5  

Update Level	/WEB-INF/cfusion/lib/updates/chf20160002.jar  

Adobe Driver Version	5.1.4 (Build 0001)  

JVM Details

Java Version	1.8.0_102  

Java Vendor	Oracle Corporation  

Java Vendor URL

Java Home	/Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre  

Java File Encoding	UTF8  

Java Default Locale	en_US  

File Separator	/  

Path Separator	:  

Line Separator	Chr(10)

User Name	root  

Java VM Specification Version	1.8  

Java VM Specification Vendor	Oracle Corporation  

Java VM Specification Name	Java Virtual Machine Specification  

Java VM Version	25.102-b14  

Java VM Vendor	Oracle Corporation  

Java VM Name	Java HotSpot(TM) 64-Bit Server VM  

Java Specification Version	1.8  

Java Specification Vendor	Oracle Corporation  

Java Specification Name	Java Platform API Specification  

Java Class Version	52.0



Jonathan, I have tried the code snippet shared in this bug and it works fine with ColdFusion 2016 Update 2. Please share the details mentioned below: 1. ColdFusion Settings Summary [CF Admin > Server Settings > Settings Summary > Save As PDF] 2. Complete code snippet which you are trying to execute.
Comment by Nimit S.
2063 | August 02, 2016 01:17:51 AM GMT
Jonathan, Please provide the information asked below. -Nimit
Comment by Nimit S.
2064 | August 08, 2016 07:14:30 AM GMT
Hi Nimit, I can't expose additional information because of confidentiality concerns, but I can say that the application is one of Adobe's. Suffice it to say, though, that this bug is being revealed throughout the code. We've had to change over a dozen usages of the old implicit array syntax to use "arrayNew" because of it throwing the errors. If you'd like to contact me directly, please feel free, and I'll provide you with all of the required information. Thanks, Jon
Comment by External U.
2065 | August 08, 2016 04:49:05 PM GMT
Jon, You can send the required details at -Nimit
Comment by Nimit S.
2066 | August 09, 2016 04:50:13 AM GMT
Jon, I hope you've had the chance to share the required info at the email address mentioned by Nimit.
Comment by Vamseekrishna N.
2067 | August 24, 2016 09:13:38 PM GMT
Hi Vamseekrishna, Yes, the requested information was sent on 8/9/16.
Comment by External U.
2068 | August 24, 2016 09:23:51 PM GMT
Hi Jon, I am unable to repro this issue using the file which you have shared earlier. I have also sent an email to you but didn't get any reply. Please share the isolated repro case.
Comment by Nimit S.
2069 | September 11, 2017 05:01:46 AM GMT
Hi Jon, I am unable to repro this issue at my end, please provide an isolated repro case which should not have any dependency involved.
Comment by Nimit S.
2070 | September 22, 2017 05:15:27 AM GMT
Jon, We are unable to repro this issue. Hence, we are closing this bug. Please feel free to comment on this bug once you have an isolated repro case without any dependency and we will re-open this issue.
Comment by Nimit S.
2071 | September 25, 2017 06:56:16 AM GMT