UnsupportedOperationException on adding indexed types to a config object

classic Classic list List threaded Threaded
3 messages Options
vinshar vinshar
Reply | Threaded
Open this post in threaded view
|

UnsupportedOperationException on adding indexed types to a config object

Hi,

Below code throws UnsupportedOperationException.


public static void main(String[] args) {
                CacheConfiguration config = new CacheConfiguration((CompleteConfiguration)new CacheConfiguration());
                config.setIndexedTypes(Integer.class,String.class);
        }


trace:-
Exception in thread "main" java.lang.UnsupportedOperationException
        at java.util.AbstractList.add(AbstractList.java:148)

I am not sure whats going on in the setter hence thought of asking here.

Regards,
Vinay
Denis Magda Denis Magda
Reply | Threaded
Open this post in threaded view
|

Re: UnsupportedOperationException on adding indexed types to a config object

Hi,

Thanks for catching this. There was a tiny issue that is reproduced only when a CacheConfiguration is being initialized like in your example. I've done a hot fix and pushed changes into the master.

On your side you can initialized the configuration the way below to avoid the exception


CacheConfiguration config = new CacheConfiguration();


Regards,
Denis
vinshar vinshar
Reply | Threaded
Open this post in threaded view
|

Re: UnsupportedOperationException on adding indexed types to a config object

Thanks for the fix Denis.