API change request (RT-23413)

Richard Bair richard.bair at oracle.com
Fri Jul 20 10:13:37 PDT 2012


On Jul 20, 2012, at 10:10 AM, Greg Brown 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?
> 
> Right. But that would only happen if a) a loader instance was re-used, which is uncommon and b) the second document referred to a class with the same name but different package than a class referenced by the first document (also uncommon).

Correct, the fact that we don't have APIs with the same name but in different packages makes this less common (although I expect quite difficult to debug if it happens!)

>> 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?
> 
> That would work, but I don't think there's much harm in simply preserving the imports. If you really want to make sure they are cleared, you can either use a new loader instance or call clearImports().

I'm just wondering if we can get the best behavior by default without the developer having to do anything special. That is, the behavior would still be correct (even those edge cases mentioned above wouldn't occur) but when a single FXMLLoader is used to load multiple instances of the same document all the imports are already cached.



More information about the openjfx-dev mailing list