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-1308 Fixed ModeShape to allow any javax.jcr.Binary implementation #232

Merged
merged 2 commits into from Dec 1, 2011

Conversation

hchiorean
Copy link
Member

I did look through the code a bit on this one. I've noticed that only -jcr depends on the -graph module, not the other around, so the fix should go inside -jcr.

However, I'm not 100% sure about it (from the design point of view) - there is a test nevertheless which validates it.

If the fix is ok, I can also fix 3.x - will probably be a separate pull request.

case PropertyType.BINARY:
return valueFactories.getBinaryFactory().create(value);
case PropertyType.BINARY: {
//fix for MODE-1308 - any implementations for javax.jcr.Binary should produce valid values
Copy link
Contributor

Choose a reason for hiding this comment

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

The if-else should be reversed, because our JcrBinary implements javax.jcr.Binary. So as it stands, we're always converting all Binary implementations to new Binary instances. By checking explicitly for JcrBinary, we'll be able to use the instance directly.

One more minor nit pick: the comment above should probably be moved into the if (value instanceof javax.jcr.Binary) block, and say something like "Support any implementation of javax.jcr.Binary (see MODE-1308)". I know this is a subtle change, but it de-emphasizes this as a 'fix' and emphasizes that this is just part of the logic.

@rhauch rhauch merged commit 94fdad6 into ModeShape:master Dec 1, 2011
@rhauch
Copy link
Contributor

rhauch commented Dec 1, 2011

Merged both commits onto the 'master' branch and cherry-picked onto the '3.x' branch.

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