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

MODE-1267 Correct setting property to Value containing null #200

Merged
merged 1 commit into from Sep 22, 2011

Conversation

rhauch
Copy link
Contributor

@rhauch rhauch commented Sep 22, 2011

The JCR specification is not terribly clear on the behavior when null references are passed into the ValueFactory.create(…) methods. According to the JavaDoc, the spec, and the reference implementation, no error should be thrown. However, a ValueFormatException must be thrown when a non-null Value object (containing a null reference) is passed to Property.setValue(Value) or Property.setValues(Value[]) or Node.setProperty(String,Value) or Node.setProperty(String,Value[]). (Note that setting a property to a null Value reference is equivalent to removing the property.)

This change enables this behavior in ModeShape. Prior to this, ModeShape would allow setting a Value for a property even if that Value contained a null reference.

The JCR specification is not terribly clear on the behavior when null references are passed into the ValueFactory.create(…) methods. According to the JavaDoc, the spec, and the reference implementation, no error should be thrown. However, a ValueFormatException must be thrown when a non-null Value object (containing a null reference) is passed to Property.setValue(Value) or Property.setValues(Value[]) or Node.setProperty(String,Value) or Node.setProperty(String,Value[]). (Note that setting a property to a null Value reference is equivalent to removing the property.)

This change enables this behavior in ModeShape. Prior to this, ModeShape would allow setting a Value for a property even if that Value contained a null reference.
@rhauch rhauch merged commit 161b25e into ModeShape:master Sep 22, 2011
@rhauch
Copy link
Contributor Author

rhauch commented Sep 22, 2011

Merged onto the 'master' and '2.5.x' branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant