Skip to content

Removes jackson-utils dependency. #19

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

Merged
merged 8 commits into from
Dec 6, 2014
Merged

Conversation

lordofthejars
Copy link

In order to remove Google Guava from as dependency, we thought that instead of removing from jackson-utils and then adapt the code of two projects, it could be better to update to Jackson 2.4 which already implements JsonPointer.

We know that this change is a big change and the leader of the project may decide to reject the PR because of this.

For our case and for our business it fits perfectly to use Jackson 2.4,but we fully understand that this it may not be perfect for other cases.

Anyway we decided to send a PR because maybe the leader of the project may find it useful and can be accepted or do some code review to make it happens on upstream project. If not and following the ASL2.0 license we modified the code and made it available on our public github for anyone who wants to use it.

As I said our main intention is to merge this change to upstream repo.

@fge
Copy link
Collaborator

fge commented Dec 3, 2014

OK well, I didn't expect this PR to come in so fast!

There is ONE thing however: this is a huge, all in one go commit; I'd much rather, if you could spare the time, that it be separated in smaller commits.

Note that I am willing to merge it, I just cannot overlook the effort you put into it.

@lordofthejars
Copy link
Author

Hi I have fixed the parts you commented on PR and I have sent a new PR. About splitting the original commit now it would be a bit tricky. I understand your point, but the only thing I have done in first commit is remove the dependency and fix all compilation errors. To not undo all changes and do it again with different commit I am going to comment the code of the PR. Moreover currently the PR can be merged without conflicts so it should be pretty easy.

private static final ReferenceToken LAST_ARRAY_ELEMENT
= ReferenceToken.fromRaw("-");

private static final JsonPointer EMPTY = JsonPointer.compile("");
Copy link
Author

Choose a reason for hiding this comment

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

Jackson JsonPointer does not have an empty method. For this reason we created an empty JsonPointer.

@fge
Copy link
Collaborator

fge commented Dec 4, 2014

OK well, I'm ready to merge; there are other cleanups I wish to do but I'll do them after the merge.

Before that... I take it you ran all tests and they run just fine? ;)

@lordofthejars
Copy link
Author

Yes of course :D BTW I can open a new issue to add travis integration so in
PR you will see automatically that all tests has passed.

El Thu Dec 04 2014 at 12:23:14 PM, Francis Galiegue (<
[email protected]>) va escriure:

OK well, I'm ready to merge; there are other cleanups I wish to do but
I'll do them after the merge.

Before that... I take it you ran all tests and they run just fine? ;)


Reply to this email directly or view it on GitHub
#19 (comment).

@fge
Copy link
Collaborator

fge commented Dec 6, 2014

Merging now and doing cleanups -- thanks a lot for the effort, I really appreciate it! Once the cleanup is done I'll try and integrate travis as you recommend (could help for my other projects too).

fge added a commit that referenced this pull request Dec 6, 2014
Remove jackson-utils dependency
@fge fge merged commit d0c539f into java-json-tools:master Dec 6, 2014
@fge
Copy link
Collaborator

fge commented Dec 6, 2014

Uh, great; found a bug in Jackson's JsonPointer!

I was unfortunately right here; Jackson(s implementation is far from being as well tested as mine is!

@lordofthejars
Copy link
Author

No problem I am collaborating with Jackson guys as well in JsonPointer API, so you can open an issue there or simply you can explain me and I will fix there. 👍

@fge
Copy link
Collaborator

fge commented Dec 6, 2014

Well, the immediate problem we have here is that right now json-patch's master branch is non functional!

The problem is quite simple really: try and JsonPointer.compile("/1e0"). It fails miserably! All of this because it sees a 1 and expects the whole token to be a number which is of course untrue...

Ideally what should be done is a full port of my implementation in the meanwhile. At least I know this one works fine and is tested!

@lordofthejars
Copy link
Author

I will investigate and fix it :) I think that we can create a branch with
my addition and when we knew that Jackson is correct we can rebase. Also to
avoid rebase problem we can try to wrap Jackson with a fix so we don't have
to rebase the whole project ever.

BTW then we need to create more tests on json-patch, I mean a test for
detecting these problems as well.

El Sat Dec 06 2014 at 7:10:20 PM, Francis Galiegue (<
[email protected]>) va escriure:

Well, the immediate problem we have here is that right now json-patch's
master branch is non functional!

The problem is quite simple really: try and JsonPointer.compile("/1e0").
It fails miserably! All of this because it sees a1` and expects the whole
token to be a number which is of course untrue...

Ideally what should be done is a full port of my implementation in the
meanwhile. At least I know this one works fine and is tested!


Reply to this email directly or view it on GitHub
#19 (comment).

@fge
Copy link
Collaborator

fge commented Dec 6, 2014

Yeah, one solution would probably be to extend the class (since it is not final; I really wonder why, such a class should basically be immutable)...

Do you plan to work on this? While I can do it, I also have other stuff to work on ;)

@fge
Copy link
Collaborator

fge commented Dec 8, 2014

OK, well, sorry but I have reverted the master branch to before the merge; I won't merge it until the JsonPointer problem is fixed.

I have created the topic/noguava branch, so you will want to work on this branch instead.

Note that I have fixed a bug in your pull request... You didn't seem to have run all the tests since the JSON Patch test suite failed; this is because (Jackson's) JsonPointer didn't deserialize correctly. I have fixed that.

@lordofthejars
Copy link
Author

I think it has sense this approach. BTW I thought I run the whole test suite, but probably because I am not an expert of Gradle I run the incorrect goal.
BTW thebug we detected in Jackson (the /1e2) is already fixed on master branch of Jackson so next release will not contain it anymore.
So let's wait until next Jackson is released and then let's merge this branch to the master ones. I think it has sense.

@fge
Copy link
Collaborator

fge commented Dec 8, 2014

Provided no nagging bug still lies around...

A good idea would be to "port" the test suite of JsonPointer in jackson-coreutils (which is very, very complete) to the one of Jackson. Hopefully no other bugs will be found ;)

@fge
Copy link
Collaborator

fge commented Dec 8, 2014

In particular, this one:

https://github.com/fge/jackson-coreutils/blob/master/src/test/java/com/github/fge/jackson/jsonpointer/ReferenceTokenTest.java#L133

Will Jackson do the correct thing here? Not sure ;)

@lordofthejars
Copy link
Author

Really good idea I will move this test there :)
El dl., 8 de des., 2014 a les 11.41 Francis Galiegue <
[email protected]> va escriure:

In particular, this one:

https://github.com/fge/jackson-coreutils/blob/master/src/test/java/com/github/fge/jackson/jsonpointer/ReferenceTokenTest.java#L133

Will Jackson do the correct thing here? Not sure ;)


Reply to this email directly or view it on GitHub
#19 (comment).

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.

2 participants