Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version mgr reuse and efficient event generation #197

Merged
merged 4 commits into from Dec 10, 2013
Merged

Conversation

barmintor
Copy link
Contributor

No description provided.

@ajs6f
Copy link
Contributor

ajs6f commented Dec 9, 2013

@ajs6f
Copy link
Contributor

ajs6f commented Dec 9, 2013

@@ -63,9 +80,14 @@ public String getIdentifier() throws RepositoryException {
return e.getIdentifier();
}

@SuppressWarnings("unchecked")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more verbose (below) but eliminates the suppression. (Suppress all suppressions!)

@Override
public Map<?, ?> getInfo() throws RepositoryException {
    if (memoizedInfo == null) {
        memoizedInfo = new HashMap<>(getRawInfo());
        memoizedInfo.put(NODE_TYPE_KEY, this.nodeType);
    }
    return memoizedInfo;
}

public Map<?,?> getRawInfo() throws RepositoryException {
    return e.getInfo();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I would personally trade the compile warning to avoid creating the
wrapper objects for the map and entries, and re-calculating the hashes, but
I defer.

On Mon, Dec 9, 2013 at 12:25 PM, ajs6f notifications@github.com wrote:

In fcrepo-kernel/src/main/java/org/fcrepo/kernel/observer/FedoraEvent.java:

@@ -63,9 +80,14 @@ public String getIdentifier() throws RepositoryException {
return e.getIdentifier();
}

This is more verbose (below) but eliminates the suppression. (Suppress all
suppressions!)

@OverRide
public Map getInfo() throws RepositoryException {
if (memoizedInfo == null) {
memoizedInfo = new HashMap<>(getRawInfo());
memoizedInfo.put(NODE_TYPE_KEY, this.nodeType);
}
return memoizedInfo;
}

public Map getRawInfo() throws RepositoryException {
return e.getInfo();
}


Reply to this email directly or view it on GitHubhttps://github.com//pull/197/files#r8204311
.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it-- if I ever convince the rest of the team to share my neurosis about type safety, we can change it then.

@ajs6f ajs6f merged commit 24169f2 into master Dec 10, 2013
@awoods awoods deleted the versionMgrReuse branch February 7, 2014 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants