[gvSIG-devel] Project and cleanBadReferences()
Flavio Pompermaier
fla83tn at gmail.com
Wed Aug 31 13:27:49 CEST 2011
In fact my intentions was to open a ticket but before doing so I want
to know why that method is commented and, thus, if there something I
didn't take into account..
2011/8/31 Francisco José Peñarrubia <fpenarru at gmail.com>:
> Hi Flavio.
>
> Yes, the intention of cleanBadReferences() was to avoid this bad
> behaviour. It seems someone detected a problem related to this method
> (maybe a null pointer exception) and he decided to comment this function.
> If you have tested the function and it works well, +1 to enable the
> function again. (Then, a ticket should be opened)
> But maybe the problem was other, I don't know. If this is the case,
> maybe someone can explain why this function was commented.
>
> Cheers.
>
> Fran.
>
> El 31/08/2011 12:23, Flavio Pompermaier escribió:
>> Hi to all,
>> during the developement of an extension I discovered that gvSIG always
>> keep track of all opened dataSources.
>> For example, if I create a new project and I save its .gvp file, the
>> new project (even if empty) could have a huge list of datasource
>> reference (all those hava been opened up to that moment).
>> I think that this is a bug, and the cleanBadReferences() seems to
>> solve the problem. Why is it commented? Will this problem be resolved
>> in gvSIG 1.12..?
>> It could cause dangerous problems in my case...
>> In our project we used the cleanBadRefereces (with a little
>> customization to avoid nullPointer errors) and everything worked fine.
>> This is the little modification we had to make to that method:
>>
>> if (!usedDataSources.containsKey(infos[i].name)) {
>> DataSource ds;
>>
>> try{
>> ds = LayerFactory.getDataSourceFactory().createRandomDataSource(infos[i].name);
>> ds.remove();
>> }catch(NullPointerException ne){
>> log.error("Ds.name = "+infos[i].name);
>> }
>> }
>>
>> Best regards,
>> Flavio
>> _______________________________________________
>> gvSIG-desktop-devel mailing list
>> gvSIG-desktop-devel at lists.forge.osor.eu
>> https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
>
> --
> Fran Peñarrubia
> Scolab
> www.scolab.es
>
> Asociación gvSIG
> www.gvsig.com
>
> _______________________________________________
> gvSIG-desktop-devel mailing list
> gvSIG-desktop-devel at lists.forge.osor.eu
> https://lists.forge.osor.eu/listinfo/gvsig-desktop-devel
>
More information about the gvSIG-desktop-devel
mailing list