[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom SourceLocator's possible?



Ondrej Lhotak wrote:
> Yes, this appears to be the case. SourceLocator has always been a
> singleton, which means that there's only one of them and it's not meant
> to be replaced or subclassed. I'm not saying that this is necessarily
> a good design decision, just that this is how it's always been.
> 
> > Second, my hack is to use a native method to set the otherwise private
> > field "instanceSourceLocator" of the G.v() object to point to an instance
> > of my custom class that subclasses soot.util.SourceLocator.. will this
> > work as expected?
> 
> This should work. If having to replace the SourceLocator is something
> that people commonly need, a cleaner solution would be to make the
> SourceLocator not be a singleton but rather a field of the Scene which
> could be overwritten to replace it.

Thanks!

-Archie

__________________________________________________________________________
Archie Cobbs     *    Halloo Communications    *     http://www.halloo.com