roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Johnson (JIRA)" <>
Subject [jira] Commented: (ROL-1870) Duplicate bookmarks not showing
Date Tue, 01 Feb 2011 04:28:29 GMT


David Johnson commented on ROL-1870:

Anil, that's a good point. I don't know what use case there could possibly be for having multiple
bookmarks with the same name in the same folder. Question is, how should we fix this?

We could force names to be unique per folder in the database schema, in the JPA code and check
in the UI. But what about people who already have bookmarks with the same name. We would have
to repair those in the migration path, and how do we know which of two identically named bookmarks
to keep.

I think a better option might be to leave the database schema as is, apply the patch to allow
multiple bookmarks to be seen in the UI so users can clean things up themselves. Also, we
could add a uniqueness check in the UI so no new bookmarks get created with duplicate names.

> Duplicate bookmarks not showing
> -------------------------------
>                 Key: ROL-1870
>                 URL:
>             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:


View raw message