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
Solve #31 Provide method to get all values for a key from all appende… #35
Conversation
@westonized Thanks for the pull request, let me find a reviewer.. |
@pinaf please review, thanks |
@westonized could you please add a link to the original issue in the first PR comment? |
* @param key The key of the manifest attribute | ||
* @return The list of all found values | ||
*/ | ||
List<String> getAll(String key); |
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.
@westonized let's rename this to allValues
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.
@pinaf OK
@westonized thanks. 18 commments above. |
* @throws Exception If something goes wrong | ||
*/ | ||
@Test | ||
public void listReturnedByAllValuesIsACopy() throws Exception { |
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.
@westonized returnsImmutableListOfAllValues
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.
@pinaf Well it's not immutable, it's just your own copy, an independent reference to anything held inside Manifest. I will go for returnsIndependentListOfAllValues
. It would only be immutable if I combined a copy with a readonly, i.e. return Collections.unmodifiableList(new ArrayList<String>(this.multimap.get(key)))
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.
@westonized agreed
@westonized np. a few more comments on test names and javadocs and we are good. |
Split allValues in comments Rename test methods
@pinaf Thanks again, applied comments, mostly as you said. Please re-review once more. |
@westonized good job! |
@rultor merge |
@pinaf Thank you! |
@yegor256 Please complete, I can't get any other tasks assigned for 4 days now, because both my tasks are waiting on your confirmation. |
@yegor256 please complete this merge |
@yegor256 hello? |
@westonized hm... looks very strange. why do we need to keep both |
@yegor256 That is a larger task which I broke out with this todo in accordance with "we encourage developers to deliver unfinished components"
e.g. When I do this Until that is decided, we need both. Or this would be so much simpler if the type was immutable and didn't implement Also note, this is not a case of a simple refactor to use this backing |
@yegor256 please let me know what's going on with this? If it's not good enough let me know I'll just close it right now. But reading the issue, I'm not the first person to this conclusion. The only way you're going to get what you're after in a single 30 minute task, is to wait for a dev who doesn't know/care about liskov to come along. |
@westonized OK, I'm ready to accept this code, but only if you explain in the TODO more explicitly, that the existence of two storages is a temporary solution and is definitely a mistake, which we have to fix ASAP |
The current design appears to have followed this line of thought, we have collected key-value pairs, so we might as well say this class implements This seemed OK, until the requirement to support both the That's not impossible, however there are zero tests around the vast majority of I suggest we do not implement |
@westonized yes, no argument about that, but current implementation of the class is absolutely wrong. we can't live with it. we should either make our TODO explicitly screaming for refactoring or fix the class. up to you. |
@yegor256 "we can't live with it" OK, how about we park this (marked blocked), do a new task first to refactor |
@westonized yes, it's a good idea, please submit a ticket |
Oops! Job |
#31
get(key)
Across Multiple Manifests