You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hivemind.apache.org by "Liebig, Stefan " <St...@compeople.de> on 2005/09/23 11:58:49 UTC

ObjectProvider question reagarding the ´propertyType´ parameter

While writing the ConfigObjectProvider for the response to Fernando Enrique Ocampo Calero´s "properties file" question I figured out that the parameter propertyType within ObjectProvider
 public Object provideObject( Module contributingModule, Class propertyType, String locator, Location location )
 
seems to be unreliable, because it can not be predicted by HM in every case.

In my example hivemodule for testing the object provider:
 
<service-point id="ConfigObjectProviderTest" interface="java.util.Map">
  This "service" now contains the config properties from c:\temp\test.properties!
 
  <invoke-factory>
   <construct class="java.util.HashMap">
    <object>config:c:\temp\test.properties</object>
   </construct>
  </invoke-factory>
 </service-point>
 
the provideObject() method received an ´int´ as propertyType, probably because
of the HashMap(int initialCapacity) constructor instead of HashMap(Map m).
 
If my observations are true, should this parameter not be dropped?
 
Stefan