Git Product home page Git Product logo

Comments (7)

cowtowncoder avatar cowtowncoder commented on June 6, 2024

Ah. Yes, this must be a regression due to an earlier rewrite that combines parsing of field names with minimal tokenization of the following value. This was done for performance reasons, but did not consider effects for token location handling.

from jackson-core.

cowtowncoder avatar cowtowncoder commented on June 6, 2024

(and by earlier, I mean something like 1.7 or 1.8 -- quite a while ago).

from jackson-core.

aborg0 avatar aborg0 commented on June 6, 2024

It gets worse when the values are not the first in an object. For example:

{
  "book" : [ {
    "year" : 1999,
    "title" : "Title",
    "author" : "Author"
  }]
}

In this case for title, the getTokenLocation() and the getCurrentLocation() select both for the FIELD_NAME and the string value the following text:

                        ,
    "author"

Please recognize no value is selected this time, and the previous , is also selected. Similar behaviour for the author.
(This is with version: 2.4.3.)

from jackson-core.

cowtowncoder avatar cowtowncoder commented on June 6, 2024

Is this with byte- or char-backed source? Or both.

from jackson-core.

aborg0 avatar aborg0 commented on June 6, 2024

@cowtowncoder I have just tested with the byte-backed source: new JsonFactory().createParser(json.getBytes("UTF-8")). Just tested with the char-based backend and it seems to work the same way.

from jackson-core.

cowtowncoder avatar cowtowncoder commented on June 6, 2024

@aborg0 Makes sense, but just wanted to verify.

from jackson-core.

complexmath avatar complexmath commented on June 6, 2024

Please see my attached pull request for a fix.

from jackson-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.