roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anil Gangolli (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ROL-1870) Duplicate bookmarks not showing
Date Mon, 31 Jan 2011 15:33:35 GMT

    [ https://issues.apache.org/jira/browse/ROL-1870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12988783#comment-12988783
] 

Anil Gangolli commented on ROL-1870:
------------------------------------

I have a couple of comments on this.

First I'm having trouble understanding the issue here.  It seems to me that bookmark names
in a folder are similar to filenames in a directory;  I thought they were intended to be unique.
  I don't understand the use case for having multiple bookmarks of the same name in the same
folder.  What's wrong with my thinking?

Finally, If multiple instances of the same bookmark name in the same folder are supposed to
be supported, it would seem that the appropriate change would be to make the container a List
rather than continuing to use a Set with identity based on id.


> Duplicate bookmarks not showing
> -------------------------------
>
>                 Key: ROL-1870
>                 URL: https://issues.apache.org/jira/browse/ROL-1870
>             Project: Roller
>          Issue Type: Bug
>          Components: Bookmark Management
>    Affects Versions: 4.0.1
>            Reporter: Greg Huber
>            Assignee: Roller Unassigned
>         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 is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message