If trimming was performed by default on tproperties, wouldn't that place a
little extra performance overhead into OSGi vs developers just making sure
there isn't trailing whitespace if they don't want it?  It wouldn't be
much, but it adds up...

Ryan

On Thu, Feb 22, 2018 at 12:52 PM Leschke, Scott <slesc...@medline.com>
wrote:

> I have a configuration type that has a fragment in it as shown below.
>
>
>
> @ProviderType
>
> @ObjectClassDefinition(name = "Provider Configuration")
>
> *public* *@interface* MetricProviderConfig
>
> {
>
>        String schedule() *default* "0";
>
> }
>
>
>
> If the associated property in a .cfg file exists but has no value, as in:
>
>
>
> schedule =
>
>
>
> I get the null string “” as opposed to the default which is what I would
> expect. While this is preferable to a null, which I got at some on some
> earlier Karaf release, I would think that you’d get the default whether the
> property didn’t exist or existed with no value.
>
>
>
> Another comment, which perhaps is more general to OSGi in this area, is
> that properties aren’t trimmed. I honestly can’t think of a use case where
> somebody would want trailing white space passed in.  Also, if the
> configuration type exposes an enumeration, an error occurs.
>
>
>
> @ProviderType
>
> @ObjectClassDefinition(name = "Provider Configuration")
>
> *public* *@interface* MetricProviderConfig
>
> {
>
>        MyEnum enumValue() *default* MyEnum.ENUM_VALUE;
>
> }
>
>
>
> So the first property below works, but the second one doesn’t.  Is this by
> design?
>
>
>
> enumValue = ENUM_VALUE
>
> enumValue = ENUM_VALUE
>
>
>
> Regards,
>
>
>
> Scott
>

Reply via email to