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
Conversation
@@ -63,9 +80,14 @@ public String getIdentifier() throws RepositoryException { | |||
return e.getIdentifier(); | |||
} | |||
|
|||
@SuppressWarnings("unchecked") |
There was a problem hiding this comment.
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();
}
There was a problem hiding this comment.
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();
}
- @SuppressWarnings("unchecked")
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
.
There was a problem hiding this comment.
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.
No description provided.