Community
Participate
Working Groups
The AttributeDefinitionImpl class will attempt to localize the option value if prefixed with a %. I don't think that the localization mechanism should attempt to localize any attribute value (an option value is basically a possible attribute value), so I think this is a bug. There are two hypothetic cases in which the implementation will cause troubles, altering the attributes value: 1. there is no translation for the value in the resource bundles, but the % as first character will be removed 2. there is a translation for the value in the resource bundle (i.e. the value matches another localized attribute name) and the value will be translated to the localization of that attribute name. I agree that the probability is low that a value will be prefixed with a % AND that it matches some other localized name, but I think that this should be fixed. The code causing this problem is in the getOptionValues() method: returnedValues[i] = getLocalized(valueKey); which should probably read: returnedValues[i] = valueKey; Regards, Dieter
Dieter, there are no such class in equinox. Could you please give the fully qualified name of the class?
Pascal, The fully qualified name of this class is: org.eclipse.equinox.metatype.AttributeDefinitionImpl Sorry that I did not specify the actual bundle. Probably each bundle implementation should be a component by itself. Regards, Dieter
Jennifer please investigate. If you think a fix should be included in 3.2 please provide a patch for review.
Created attachment 171191 [details] proposed patch If I read the spec correctly, option values should not be translated. The proposed patch returns the option values untranslated.
Tom, are there any unit tests for metatype? I couldn't find any in CVS.
(In reply to comment #5) > Tom, are there any unit tests for metatype? I couldn't find any in CVS. No, we have been using the OSGi CT to test. We need more tests in Equinox for this.
John, here is another meta-type bug to investigate.
(In reply to comment #7) > John, here is another meta-type bug to investigate. Option values should not be localized. These are meant for computer, not human, consumption. Any modification could, and probably would, result in unrecognizable input to the target system. I don't see any necessary or desired changes to the current patch.
Thanks I will review and release for M3.
Patch released. This is quite obvious and I am surprised it has not really been much of an issue for folks. Thanks Brian and John.