tracker issue : CF-4177585

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

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: 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(cfml40.java:14410)
    at coldfusion.compiler.cfml40.jj_consume_token(cfml40.java:14281)
    at coldfusion.compiler.cfml40.OrderedStructInitializer(cfml40.java:898)
    at coldfusion.compiler.cfml40.ArrayOrStructInitializer(cfml40.java:732)
    at coldfusion.compiler.cfml40.Initializer(cfml40.java:692)
    at coldfusion.compiler.cfml40.HookExpression(cfml40.java:5700)
    at coldfusion.compiler.cfml40.expr(cfml40.java:5661)
    at coldfusion.compiler.cfml40.cfScriptExpression(cfml40.java:2856)
    at coldfusion.compiler.cfml40.SimpleStatement(cfml40.java:619)
    at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1651)
    at coldfusion.compiler.cfml40.cfscriptBlock(cfml40.java:2821)
    at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1708)
    at coldfusion.compiler.cfml40.ComplexStatement(cfml40.java:1806)
    at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1695)
    at coldfusion.compiler.cfml40.functionDefinition(cfml40.java:3467)
    at coldfusion.compiler.cfml40.cfscriptStatement(cfml40.java:1713)
    at coldfusion.compiler.cfml40.start(cfml40.java:5112)
    at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:690)
    at coldfusion.compiler.NeoTranslator.parsePage(NeoTranslator.java:635)
    at coldfusion.compiler.NeoTranslator.parseAndTransform(NeoTranslator.java:457)
    at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:407)
    at coldfusion.compiler.NeoTranslator.translateJava(NeoTranslator.java:160)
    at coldfusion.runtime.TemplateClassLoader$TemplateCache$1.fetch(TemplateClassLoader.java:480)
    at coldfusion.util.LruCache.get(LruCache.java:180)
    at coldfusion.runtime.TemplateClassLoader$TemplateCache.fetchSerial(TemplateClassLoader.java:400)
    at coldfusion.util.AbstractCache.fetch(AbstractCache.java:58)
    at coldfusion.util.SoftCache.get_statsOff(SoftCache.java:133)
    at coldfusion.util.SoftCache.get(SoftCache.java:81)
    at coldfusion.runtime.TemplateClassLoader.findClass(TemplateClassLoader.java:668)
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(MetadataUtils.java:140)
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(MetadataUtils.java:126)
    at coldfusion.runtime.MetadataUtils.getComponentMetadata(MetadataUtils.java:113)
    at coldfusion.runtime.CfJspPage.GetComponentMetadata(CfJspPage.java:3643)

Expected Result:

Success

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	http://java.oracle.com/

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

Attachments:

Comments:

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 nimsharm@adobe.com -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