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

Remove nested try-catch blocks #716

Closed
wants to merge 3 commits into from
Closed

Conversation

@@ -305,6 +289,32 @@ private Node getFrozenNodeByLabel(final String baseResourcePath, final String la
}
}

private Node getNode(final String baseResourcePath, final String label) throws RepositoryException {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a future-aimed note that after Java 8, this is the kind of work that should be done by returning an Optional, not a value which might be null.

final String mixinName = getPropertyNameFromPredicate(node, mixinResource, nsPrefixMap);
if (repositoryHasType(session, mixinName) && node.isNodeType(mixinName)) {
node.removeMixin(mixinName);
try {
Copy link

Choose a reason for hiding this comment

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

Since JcrRdfTools.removeMixin() already throws a RepositoyException, the try|catch you have added can be safely removed.

@awoods
Copy link

awoods commented Feb 19, 2015

Resolved with: 3fa9652

@awoods awoods closed this Feb 19, 2015
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

3 participants