Fixed
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Adam CameronAdam CameronPriority
NewLabels
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
Sprint
NoneAffects versions
Details
Details
Assignee
Pothys - MitrahSoft
Pothys - MitrahSoftReporter
Adam Cameron
Adam CameronPriority
Labels
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
Sprint
None
Affects versions
Created 8 May 2023 at 12:06
Updated 9 June 2023 at 13:30
Resolved 9 June 2023 at 13:30
I have a stand-alone repro case defined here: https://github.com/adamcameron/cfml/tree/lucee_static_final_bug_improved/vendor/lucee/staticFinal. There’s a
docker run
statement in the readme.md to get it cranked up, but I will reproduce here for searchability. Code (all file go in same subdir):// Application.cfc component {} // Base.cfc component { include "include.cfm"; } // C.cfc component extends=Base { static { final static.MAORI_NUMBERS = ["tahi", "rua", "toru", "wha"] } } // include.cfm <cfscript> public function build() { return this; } </cfscript> // test.cfm <cfinvoke component="C" method="build" returnVariable="o"> <cfdump var="#o#">
Repro:
1. Grab the files from this directory, stick them somewhere (doesn't matter where)
2. Run a Lucee container in that directory, eg:
docker run \ --publish 8888:8888 \ --volume ${PWD}/:/var/www/ \ --name lucee-static-final-bug \ --detach \ lucee/lucee:5.3.10.97-nginx
3. Browse to http://localhost:8888/test.cfm. You should see a
<cfdump>
of the C object.4. Rename
include.cfm
to be anything else, eg:include2.cfm
. Change the reference to it inBase.cfc
as well. <--- THIS IS THE CRITICAL BIT!!5. Reload the page. I am seeing this:
Cannot update key [MAORI_NUMBERS] in static scope from component [C], that member is set to final The Error Occurred in /var/www/C.cfc: line 5 3: static { 4: final static.MAORI_NUMBERS = ["tahi", "rua", "toru", "wha"] 5: } 6: }
6. Revert to
include.cfm
. Refresh. Problem goes away.