Community
Participate
Working Groups
OSGi R5 (previously known as 4.4) will add support for enums as part of filter matching. A full discussion may be found here: https://www.osgi.org/members/bugzilla/show_bug.cgi?id=2112. In summary, when comparing Comparables or unknowns, R5 will require implementations to prefer a public, static method named "valueOf" that takes a single String parameter over the current public constructor. If the appropriate "valueOf" method is not present, the constructor is still used as a secondary form of conversion. This will support java.lang.Enum since it implements Comparable and has the "valueOf" method. It will also take advantage of the flyweight pattern used in certain "valueOf" method implementations such as Integer. At a minimum, this will require updates to org.osgi.framework.FrameworkUtil.FilterImpl and org.eclipse.osgi.framework.internal.core.FilterImpl.
Apparently, if you assign a bug to yourself as part of creating it, emails go out to noone. So here's your email making you aware of it. Assigning back to me.
We still need to agree to this in OSGi before we implement in Equinox.
Created attachment 204463 [details] Proposed Patch I don't have permissions for hargrave/osgi44. Attached is a patch off of hargrave/osgi44 that copies over FrameworkUtil.FilterImpl and updates org.eclipse.osgi.framework.internal.core.FilterImpl.
Created attachment 204533 [details] Proposed Patch 2 Updates the previous patch with additional support for ensuring the target object's class is assignable from the valueOf method's return type.
Comment on attachment 204533 [details] Proposed Patch 2 Marking patch as obsolete. The necessary changes to osgi FrameworkUtil and equinox FilterImpl classes may be found at FilterImpl https://github.com/bjhargrave/rt.equinox.framework/commit/1375a524aaea2e91eec44c56fec64068cacff266 FrameworkUtil https://github.com/bjhargrave/rt.equinox.framework/commit/1f919a9ce579a1ebc0a2eccd2b0e0ea442750baa
Changes released to master in http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=f28739af35ffac2f8a08e37ba74387946b3f0b48 and http://git.eclipse.org/c/equinox/rt.equinox.framework.git/commit/?id=22ea986465e11d51890d7775b746c41794f4a141