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

add guard for non-literal titles #938

Merged
merged 1 commit into from Nov 5, 2015
Merged

add guard for non-literal titles #938

merged 1 commit into from Nov 5, 2015

Conversation

acoburn
Copy link
Contributor

@acoburn acoburn commented Nov 3, 2015

final Node object = objects.next().getObject();
if (object.isLiteral()) {
return object.getLiteral().getLexicalForm();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If !object.isLiteral() is there a sensible return value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the current default is to use the URI of the node.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, that seems pretty reasonable.

@acoburn
Copy link
Contributor Author

acoburn commented Nov 4, 2015

@ajs6f after rebasing, there's not much left to this PR -- just a unit test verifying that non-literal titles don't throw errors.

@ajs6f
Copy link
Contributor

ajs6f commented Nov 5, 2015

That's a little troubling. That implies that my PR for ViewHelpers changed the semantics of that class without us noticing, doesn't it?

@acoburn
Copy link
Contributor Author

acoburn commented Nov 5, 2015

@ajs6f not really -- the .filter(Node::isLiteral) you added did exactly what the original PR did. Incidentally, that's exactly how I wanted to implement it, but the semantics of the class made that difficult, hence #941

@acoburn
Copy link
Contributor Author

acoburn commented Nov 5, 2015

@ajs6f to add onto that, one issue with the ViewHelpers class was that there was no test for non-Literal titles. That's what this (one-line) change adds.

@ajs6f
Copy link
Contributor

ajs6f commented Nov 5, 2015

Oh, well, what the hell...

ajs6f added a commit that referenced this pull request Nov 5, 2015
add guard for non-literal titles
@ajs6f ajs6f merged commit 5bd01d6 into master Nov 5, 2015
@ajs6f ajs6f deleted the fcrepo-1811 branch November 5, 2015 13:59
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