-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ManifestElement.parseBundleManifest without map parameter #615
Add ManifestElement.parseBundleManifest without map parameter #615
Conversation
7ac7f23
to
6dd92be
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package version org.eclipse.osgi.util
will need to increase to 1.2
for the new API. This seems like overkill on convenience to me when one can simply use the existing method and choose the Map they want:
parseBundleManifest(manifest, new TreeMap<>(String::compareToIgnoreCase));
Yet simply adds to the overall API we have to support forever.
Convenience matters (for me) here especially as it is the most common case, incrementing a litte number in the manifest looks like not to much effort for that, every-time I have use for that method I need to think about what will happen if I pass
As it just delegates to the existing method we have to support forever I really don't see much effort here on the long run :-) |
6dd92be
to
7b16de2
Compare
It seems strange that it currently creates a HashMap when null is supplied. That's kind of useless and is not well documented so it could arguably be changed to any Map implementation, e.g., One could also argue that (all?) confusion could be eliminated with better documentation instead of a convenience API method. |
The |
7b16de2
to
9553d53
Compare
@tjwatson can we have an agreement here? Would you be fine now we incremented package version and just think its maybe not worth the efforts or do you have general concerns and we should dispose this all together. |
e1d08dc
to
e0cfa00
Compare
Currently the existing ManifestElement.parseBundleManifest with a wild mixture of parameters, some using access restricted maps, some use null some use a hashmap (what likely causes issue if case of headers is different than expected). This adds a new method that simply removes the map parameter and uses a CaseInsensitiveDictionaryMap that is also used internally in the framework and is most likely the most natural choice for this usecase.
e0cfa00
to
3eef0d4
Compare
Currently the existing ManifestElement.parseBundleManifest with a wild mixture of parameters, some using access restricted maps, some use null some use a hashmap (what likely causes issue if case of headers is different than expected).
This adds a new method that simply removes the map parameter and uses a CaseInsensitiveDictionaryMap that is also used internally in the framework and is most likely the most natural choice for this usecase.