[
https://issues.apache.org/jira/browse/OFBIZ-10485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16555718#comment-16555718 ]
Mathieu Lirzin edited comment on OFBIZ-10485 at 7/25/18 2:00 PM:
-----------------------------------------------------------------
Thanks Taher for applying the first two patches.
The {{Deque}} interface which corresponds to a double ended queue has semantics matching the {{MapContext/MapStack}} implementations. The methods it provides such as {{getFirst}}, {{addFirst}} and {{addLast}} methods are more declarative than the primitive {{List}} interface ones.
In fact, if we were removing the {{addToBottom}} method from {{MapContext}} which has only 2 callers, it would be even better to replace it by a {{Stack}} since {{addToBottom}} is the only method accessing the end of the {{Deque}}.
was (Author: mthl):
Thanks Taher for applying the first two patches.
The {{Deque}} interface which corresponds to a double ended queue has semantics matching the {{MapContext/MapStack}} implementations. The methods it provides such as {{getFirst}}, {{addFirst}} and {{addLast}} methods are more declarative that the primitive {{List}} interface ones.
In fact, if we were removing the {{addToBottom}} method from {{MapContext}} which has only 2 callers, it would be even better to replace it by a {{Stack}} since {{addToBottom}} is the only method accessing the end of the {{Deque}}.
> Refactor MapContext
> -------------------
>
> Key: OFBIZ-10485
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10485> Project: OFBiz
> Issue Type: Improvement
> Components: base
> Reporter: Mathieu Lirzin
> Assignee: Taher Alkhateeb
> Priority: Minor
> Fix For: Upcoming Branch
>
> Attachments: OFBIZ-10485_0001-Remove-MapContext-dead-code.patch, OFBIZ-10485_0002-Add-missing-Override-in-MapContext.patch, OFBIZ-10485_0003-Use-the-Deque-interface-in-MapContext.patch, OFBIZ-10485_0004-Rewrite-MapContext-isEmpty.patch, OFBIZ-10485_0005-Rewrite-MapContext-containsKey.patch, OFBIZ-10485_0006-Rewrite-MapContext-keySet.patch, OFBIZ-10485_0007-Remove-MapContext.ListSet-class.patch, OFBIZ-10485_0008-Inline-MapContext-getMapContext.patch, OFBIZ-10485_0009-Rename-stackList-to-maps.patch, OFBIZ-10485_0010-Rework-comments.patch, OFBIZ-10485_0011-Add-entryStream.patch, OFBIZ-10485_0012-Add-withMapContainingKey.patch, OFBIZ-10485_0013-Rewrite-size.patch
>
>
> Following conversation [
https://lists.apache.org/thread.htmlf1729ef5eafcf71adfbed0c3ea61dfb73225dff82abc4a57c3de8ed5@%3Cdev.ofbiz.apache.org%3E] on
[hidden email].
> Here is a first batch of patches to clean things up. Those patches are meant to be applied in order.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)