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 )
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).
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
