roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shelan Perera (JIRA)" <j...@apache.org>
Subject [jira] Commented: (ROL-1870) Duplicate bookmarks not showing
Date Tue, 25 Jan 2011 16:23:52 GMT

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

Shelan Perera commented on ROL-1870:
------------------------------------

As stated before the problem is with the hash code generation and when i debug i found that
the new bookmark with the same name is not added to the Bookmark set.Therefore it is not displayed.I
would like to have comment on using ID to generate the hash code. So i would like to provide
a patch for this.

> 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
>
> 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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message