Copying a Community Bookmark Fails

Issue #1964 resolved
Former user created an issue

Stephan Doerfel wrote on May 14, 2014:

[Copying] Does not work with bookmarks of community posts. Please add the appropriate behavior for bookmarks too. Currently, an exception Internal Server Error: java.lang.RuntimeException: SimHash 2 doesn't exist is thrown.

Comments (4)

  1. Former user Account Deleted

    The exception is thrown by org.bibsonomy.model.util.SimHash.getSimHash(Bookmark, HashID)

    // FIXME: HashID was meant for BibTexs only - we should create a new enum for Bookmarks
    /**
     * @param bookmark the object whose hash is to be calculated
     * @param simHash the type of hash to be calculated
     * @return the corresponding simhash for a bookmark.
     */
    public static String getSimHash(final Bookmark bookmark, final HashID simHash) {
        if (simHash.getId() == HashID.SIM_HASH0.getId()) {
            // XXX: do we want to return simHash1 for SIM_HASH0?
            return getSimHash1(bookmark);
        } else if (simHash.getId() == HashID.SIM_HASH1.getId()) {
            // XXX: do we want to return simHash2 for SIM_HASH1?
            return getSimHash2(bookmark);
        } else {
            throw new RuntimeException("SimHash " + simHash.getId() + " doesn't exist.");
        }
    }
    

    when requesting a bookmark's intrahash (HashID.INTRAHASH.getId() == HashID.SIMHASH2.getId()), which is currently not supported.

    WHY?

  2. Log in to comment