API change request (RT-23413)

steve.x.northover at oracle.com steve.x.northover at oracle.com
Fri Jul 20 10:54:22 PDT 2012


Is there a case where someone could get burned by the caching?  If so, 
we could leave the default behavior and have a 
setImportsCached/getImportsCached flag.

Steve

On 20/07/2012 1:04 PM, Richard Bair wrote:
> Right, so the place where somebody would get tripped up by this change is if they use the same FXMLLoader instance for loading multiple different FXML files, is that right?
>
> One other thing I just thought of right this moment -- what if we auto-cleared the imports when calling load on a different URL than was used the last time?
>
> Richard
>
> On Jul 20, 2012, at 10:01 AM, Greg Brown wrote:
>
>> This change would add a clearImports() method to FXMLLoader. See http://javafx-jira.kenai.com/browse/RT-23413.
>>
>> Justification (from JIRA):
>>
>> "If the FXMLLoader is used to load the same fxml-file mutliple times, it should be able to cache the collected information about classes and properties between the load() calls. This would massively improve the performance when using one fxml-file to describe an arbitrary number of objects."
>>
>> Implementation:
>>
>> FXMLLoader no longer clears the imports when load() is called; instead, any previous imports are preserved. Callers can explicitly clear the imports via a new method named clearImports(); however, in practice, this won't generally be necessary, since FXMLLoader instances are typically only used once and then disposed.
>>


More information about the openjfx-dev mailing list