Details
Assignee
Michael OffnerMichael OffnerReporter
Jon ClausenJon ClausenPriority
MajorNew 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
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Jon Clausen
Jon ClausenPriority
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
Created 5 December 2015 at 01:05
Updated 19 May 2021 at 11:08
When using duplicate() on certain Java types (in this case, a MongoDB BasicDBObject), an IncompatibleClassChange error is thrown when using the += mathematical operator after using duplicate() on the object. The following error can be recreated with a com.mongodb.BasicDBObject - or any of the Mongo document objects - but likely affects other java classes as well:
//You'll need to have the mongo driver in the classpath to create the object below var response1 = createObject("java","com.mongodb.BasicDBObject"); response1['aNumber'] = 77; //duplicate() returns lucee.runtime.type.wrap.MapAsStruct //Note: structCopy() does not fail and will still return a BasicDBObject type var response = duplicate(response1); var countUp = 1; //Will throw error: java.lang.IncompatibleClassChangeError response['aNumber'] += countUp;
As noted above, the same error doesn't appear when using structCopy() instead of duplicate(), as the former returns the same class,where duplicate() returns a lucee.runtime.type.wrap.MapAsStruct object.
This error is not thrown in Lucee 4.2 (I haven't checked 4.3)