Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:03
    radarsh commented #2589
  • 12:50
    radarsh commented #2589
  • 08:16
    joschi commented #2960
  • 05:10
    cowtowncoder commented #1296
  • 05:10
    cowtowncoder commented #1296
  • 05:09
    cowtowncoder edited #1296
  • 05:07
    cowtowncoder edited #1296
  • 05:04
    kilink labeled #2968
  • 05:04
    kilink opened #2968
  • 04:23
    cowtowncoder commented #2807
  • 03:22
    retrodaredevil commented #2807
  • 03:20
    retrodaredevil commented #2807
  • 03:07
    retrodaredevil commented #2807
  • 02:53
    retrodaredevil commented #2807
  • 01:45
    quaff commented #2961
  • 01:44

    cowtowncoder on master

    Another tweak for #2807 debuggi… Merge branch '2.11' into 2.12 Merge branch '2.12' (compare)

  • 01:44

    cowtowncoder on 2.12

    Another tweak for #2807 debuggi… Merge branch '2.11' into 2.12 (compare)

  • 01:44

    cowtowncoder on 2.11

    Another tweak for #2807 debuggi… (compare)

  • 01:41
    cowtowncoder commented #2807
  • 01:20
    cowtowncoder commented #2961
Tatu Saloranta
@cowtowncoder
@ucarion thank you!
Carter Kozak
@carterkozak
Hi @cowtowncoder, I'm curious if you have used error-prone and might consider a contribution to enable it for additional static analysis? I realize I may be over-stepping and would understand reluctance, the tool has saved me from shipping a ton of bugs.
Tatu Saloranta
@cowtowncoder
@carterkozak I think I may run it once or twice -- I have occasionally run FindBugs at least. I am against running most of similar tools with every builds, due to noisiness, but +1 for adding profile to make it easy to occasionally run. I think these tools are good for regular checking: first time you run it for new project, often find issues
Carter Kozak
@carterkozak
Sounds good, there are a few more findings I'd like to fix before the branch is ready. I should have time to finish up the branch tomorrow.
1 reply
Carter Kozak
@carterkozak
I've gotten all my tests passing on the 2.12-rc2 snapshots on an internal project. I've found a couple changes that required code modification:
  1. Some RuntimeExceptions are no longer wrapped in JsonMappingException, despite the WRAP_EXCEPTIONS feature being enabled (default). It's not clear if this was intentional or not, I don't think it's problematic, but it did require some code changes. Not all paths are modified, possibly only deserialization using builders (unsubstantiated). It's possible a mapper is used with wrap-exceptions disabled and a bug was simply fixed between 2.11 and 2.12.
  2. Beans with a single string (or string-ish) field could be created from a json string in 2.11, however 2.12 requires an object. I consider this an improvement, but it did require adding string-based jsoncreators on a few types to avoid backcompat breaks.
7 replies
Tatu Saloranta
@cowtowncoder
Thinking of going ahead and getting 2.12.0-rc2 released sooner than this weekend, possibly tonight. Getting bit itchy, taken much longer than anticipated originally
mplain
@mplain

Hi!
I'm using JavaPropsMapper (jackson-properties) to deserialize this:

employees.71=Bill
employees.72=Bob

to this:

Map<String, String> employees

Mapper fails because it thinks 'employees' is a list and 71 & 72 are indices
Is there a way to make it serialize this as map?

4 replies
Marc Magon
@GedMarc
@cowtowncoder is it possible to please release with the jakarta and moditect fixes?????
4 replies
Sebastian Roland
@flix-
Hi! I Need to serialize huge amounts of data. I tried with StreamSerializer but unfortunately it uses forEarchOrdered() which executes in one thread even with a parallel stream. Is there an out-of-the-box solution for parallelization when serializing?
Or any other idea how to speed it up
Marc Magon
@GedMarc
create a class that extends StreamSerializer, and remove the forEachOrdered?
Tatu Saloranta
@cowtowncoder
@flix- in what way is this related to Jackson?
Sebastian Roland
@flix-
@cowtowncoder StreamSerializer is part of Jackson and currently does not support parallel processing. How is that not related to Jackson?!
@GedMarc I don't think it's that easy. You cannot just e.g. replace forEachOrdered with forEach. How do you synchronize the output of each thread?
Carter Kozak
@carterkozak
@flix- "How do you synchronize the output of each thread?" I think that's really the problem, isn't it? If you need to write a lot of data to one place, it's often the I/O that's far more expensive than the serialization work. Splitting serialization across threads means you end up spending cpu cycles orchestrating threads and memory (or additional I/O) buffering serialized data that's not ready to be written to the final location yet.
Tatu Saloranta
@cowtowncoder
@flix- StreamSerializer is not part of core Jackson. Maybe it is included by Java 8 module?
but as to changing behavior; you'd probably need to reimplement it on your own -- serialization is fundamentally single-threaded operation and even if access was changed to parallel, output must be serial (in order). If you wanted to go through that rat hole, you'd have to have parallel output, and then something to stitch together output in synchronized manner.
basically, what @carterkozak said :)
Tatu Saloranta
@cowtowncoder
@GedMarc one last (? :) ) question on jakarta-changes to jaxb, jax-rs modules: I assume there can't be collisions between 2 types, as one can only have dependency to one of qualified types? So that all dependencies are to "default" (no qualifier) version of, say, jackson-module-jaxb-annotations, but user can explicitly override it with qualifier on dependency
1 reply
Sebastian Roland
@flix-
@carterkozak, @cowtowncoder thank you!
John Antypas
@jantypas
Good evening (at least in California :-)). I'm looking for a way to read YAML files in Kotlin and Jackson seems to be the way. I've looked at others like Hoplite, but most of the libraries assume I want databinding. I actually don't need databinding, I just want a large map structure so I can do the complex object work myself. Is there a way to do this in Jackson (no databinding)
4 replies
Carter Kozak
@carterkozak
Testing with the 2.12.0-rc2 snapshots, I don't see a way to disable numeric coercion from strings while allowing the quoted special case values "NaN", "Infinity" and "-Infinity". Is this an intentional change?
Tatu Saloranta
@cowtowncoder
@carterkozak Not intentional. Would be good to get test case for 2.11 vs 2.12 here, if possible. I think that coercion is at databind (not parser) level which at least gives enough control to enforce coercion allowance or not. Actually, there is probably both "coerce from token NaN" and "coerce from String value "NaN"" -- former is controlled by parser settings, latter by databind
Carter Kozak
@carterkozak
Thanks, this does appear to be isolated to the databind layer. I'm not familiar with anything that expects unquoted 'NaN' since I'm not confident that's valid JSON
unsure how the binary protocols would interpret that sort of thing
I'll have a test ready shortly
Tatu Saloranta
@cowtowncoder
those are tricky: IEEE standard has representation for NaN for double/float, but not f.ex BigDecimal.
2 replies
Marc Magon
@GedMarc

@cowtowncoder It looks really good for the Jakarta namespaces - even the shaded moditect jaxrs seems to have gotten done (which is unexpected, but welcome)
Also got confirmation that nothing more than dependency version setting is all that is needed for JAXB (https://github.com/FasterXML/jackson-modules-base/issues/112#issuecomment-729042778)

JAX-RS is fine as it is right now as long as it's not java native imaging, i'm trying to see if i can fix that for jlink on the service loader provides clause - otherwise - really good

1 reply
Marc Magon
@GedMarc

Hi Guys - Sorry for spamming!!! xD

I have a SubTypes deserializing beautifully, but when serializing a sub type, it isn't populating the key specied, is there a step that i'm missing?

@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
        property = "pxObjClass",
        include = JsonTypeInfo.As.EXTERNAL_PROPERTY)
@JsonSubTypes.Type(value = Payslip.class,
                name = "Data-Payslip"),
private Payslip payslip;

payslip type determinator pxObjClass field is null on serialization :(

1 reply
Matt Pavlovich
@mattrpav
I’m getting a weird behavior out of Jackson when marshalling a Java object to JSON— the fields are being prefixed with an “@“.
when i run a standalone use case, the JSON is generated as expected. When run through jackson-jaxrs provider.. i’m getting the “@“ prefixes. I have several other jax-rs service using similar patterns for models and this behavior is not observed
data comes out like this… { "@name”:"testName”, … }
Matt Pavlovich
@mattrpav
Anyone come across this issue?
Tatu Saloranta
@cowtowncoder
@mattrpav tbh sounds like you are using library other than Jackson: this used to be a thing with libraries like Jettison that were based on XML originally... and @ was to signify attributes
so perhaps JAX-RS implementation is not configured with JAckson but Jettison or ... what was the name of that Oracle's JAXB implementation that also tries to do json....
ah. MOXy. It's fine for xml but due to xml background, not that good for json (IMO of course :) ).
Matt Pavlovich
@mattrpav
@cowtowncoder thanks, good tip, i’ll dig into that
@cowtowncoder that was is
damn transitive dependencies
thanks!
Tatu Saloranta
@cowtowncoder
@mattrpav ok glad I was able to help. Sometimes JAX-RS/Spring etc have bit too much of magic wrt auto-configs. :)
Matt Pavlovich
@mattrpav
@cowtowncoder tell me about it. We punted on Spring a long time ago. This is the case of other frameworks that leverage too many dependencies
sharipovshoxrux
@sharipovshoxrux
Can somebody tell me how to fix this ,
Cannot construct instance of java.util.ImmutableCollections$List12 (no Creators, like default constructor, exist): no default no-arguments constructor found
at [Source: (PushbackInputStream); line: 1, column: 1]
Tatu Saloranta
@cowtowncoder
@sharipovshoxrux that is not enough to know much about your situation, but I guess it might be this: FasterXML/jackson-databind#2900
Dewei Xu
@deweixu
String str = mapper.writeValueAsString("foo");
str is ""foo"", I want to "foo"
Tatu Saloranta
@cowtowncoder
@deweixu Either strip quotes from around String, or just... print as-is? I am not sure I understand the use case here.
Dewei Xu
@deweixu
@cowtowncoder Covert object to json string,some times object type is String
Tatu Saloranta
@cowtowncoder
@deweixu I am not sure I see the problem: if you want to retain specified String value in JSON, it needs to be quoted. If you want to remove quotes String has, you need to do before calling writeValueAsString()
HerrDerb
@HerrDerb
Hi
HerrDerb
@HerrDerb
I try to use a mixin to use a custom deserializer for a class (Lets say Pet) . Inside of the custom deserializer, I deserialize the class with a regular BeanDeserializer and then set an additional value, which I retrieve from an annotation. Deserializing Pet with a BeanDeserializer, causes a BeanDeserializer to be cached for the typ Pet.class. From this point on, the custom deserializer from the mixin is simply ignored. Is this supposed to be like that?
3 replies