You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by "Glen Mazza (JIRA)" <ji...@apache.org> on 2014/03/14 02:53:44 UTC

[jira] [Resolved] (ROL-1870) Duplicate bookmarks not showing

     [ https://issues.apache.org/jira/browse/ROL-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Glen Mazza resolved ROL-1870.
-----------------------------

       Resolution: Fixed
    Fix Version/s: 5.1

Application will no longer allow creating bookmarks of the same name as another in its folder, but will show any legacy duplicate bookmarks for the user to resolve if he wishes, also allow any duplicates created as a result of moving a bookmark into another folder with an already existing bookmark of that name.  Switched from Set to List partly to facilitate this feature.

> Duplicate bookmarks not showing
> -------------------------------
>
>                 Key: ROL-1870
>                 URL: https://issues.apache.org/jira/browse/ROL-1870
>             Project: Apache Roller
>          Issue Type: Bug
>          Components: Blogroll (Bookmarks)
>    Affects Versions: 4.0.1
>            Reporter: Greg Huber
>            Assignee: Roller Unassigned
>             Fix For: 5.1
>
>         Attachments: duplicate-bookmark.patch
>
>
> Hello,
> Noticed that bookmarks with the same name in the same folder do not show on the ui.  The method from WeblogBookmarkFolder
> public Set getBookmarks() {
>         return this.bookmarks;
>     }
> uses a set, but the pojo WeblogBookmark uses this equals/hashcode,  ie name and folder.  Needs a uniqueness.  Only option is to use the id. 
> public boolean equals(Object other) {
>         if (other == this) return true;
>         if (other instanceof WeblogBookmark != true) return false;
>         WeblogBookmark o = (WeblogBookmark)other;
>         return new EqualsBuilder()
>         .append(getName(), o.getName())
>         .append(getFolder(), o.getFolder())
>         .isEquals();
>     }
>     
>     public int hashCode() {
>         return new HashCodeBuilder()
>         .append(getName())
>         .append(getFolder())
>         .toHashCode();
>     }



--
This message was sent by Atlassian JIRA
(v6.2#6252)