Jody Garnett a écrit :
> The following will let us explore the problem (when you get a moment):
> - a static final boolean in CRS - if you change it to "true" 
>   GeoTools.getDefaultHints() will be used rather then "null"

I would prefer to investigate why CRS is unhappy with 
GeoTools.getDefaultHints(). Will try to do that after I catched up with all the 
recent changes in Geotools code base.


> I have a theory to bounce off you.... right now 
> GeoTools.getDefaultHints() returns a copy of the stored hints (so client 
> code can add to these defaults). It could be that this use of copy is 
> not an assumption you made? (All your examples have a single Hints map 
> used for an entire application). I figured that users would like the 
> default hints to start out with, and then override a few settings in code.

Using a copy should be perfectly legitimate. If it is a cause of problem with 
CRS, then it would be a bug.

> It appears as if Hints may be modified during the course of  "the 
> discovery process", as an example a Hint that was originally the name of 
> a class looks like it will be replaced with the class. The Hints are 
> also used to determine if "we already have that". Does the 
> implementation of hints equals take into account that 
> "org.geotools.filter.DefaultFilterFactory" should be equals to an 
> instance of DefaultFilterFactory? If not we may be creating factories 
> more often then intended.

The factory framework should never modifies the Hints map provided by the 
users. 
However it creates a copy of the Hints map with different values. As you 
pointed 
out, classnames are replaced by actual classes or actual instances. In 
addition, 
only the hints relevant to a given factory are copied; the other ones are 
dropped (so two factory instances are not considered as different if the only 
different hint is an irrelevant hint).

So yes, the implementation of "hints equals" (actually the implementation of 
FactoryRegistry.isAcceptable(...) - the Hints.equals(Object) method is not used 
for this purpose) should take in accout that 
"org.geotools.filter.DefaultFilterFactory" should be equals to an instance of 
DefaultFilterFactory. And Factory.isAcceptable(...) should cascade (recursive 
call) for making sure that the DefaultFilterFactory instance uses the expected 
hints as well.

        Martin

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to