Git Product home page Git Product logo

Comments (7)

rowstop avatar rowstop commented on June 4, 2024

是这个错误吗?

java.lang.NullPointerException
	at com.alibaba.fastjson2.reader.FieldReader.compareTo(FieldReader.java:331)
	at com.alibaba.fastjson2.reader.ObjectReaderCreator.putIfAbsent(ObjectReaderCreator.java:3160)
	at com.alibaba.fastjson2.reader.ObjectReaderCreator.createFieldReader(ObjectReaderCreator.java:1498)
	at com.alibaba.fastjson2.reader.ObjectReaderCreator.lambda$createFieldReaders$4(ObjectReaderCreator.java:1588)
	at com.alibaba.fastjson2.util.BeanUtils.setters(BeanUtils.java:564)
	at com.alibaba.fastjson2.reader.ObjectReaderCreator.createFieldReaders(ObjectReaderCreator.java:1584)
	at com.alibaba.fastjson2.reader.ObjectReaderCreatorASM.createObjectReader(ObjectReaderCreatorASM.java:259)
	at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReaderInternal(ObjectReaderProvider.java:854)
	at com.alibaba.fastjson2.reader.ObjectReaderProvider.getObjectReader(ObjectReaderProvider.java:746)
	at com.alibaba.fastjson2.JSON.parseObject(JSON.java:720)
	at com.alibaba.fastjson2.issues_2200.Issue2233.test(Issue2233.java:20)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at java.util.ArrayList.forEach(ArrayList.java:1259)

from fastjson2.

rowstop avatar rowstop commented on June 4, 2024

可以加上泛型 如List<Object>可以解决这个问题

from fastjson2.

wwulfric avatar wwulfric commented on June 4, 2024

@rowstop 不是npe,报错是我贴的代码的最后一行:throw new JSONException(jsonReader.info("TODO : " + this.getClass()));

类型没问题,List<MyType> xxx 这样写的

from fastjson2.

rowstop avatar rowstop commented on June 4, 2024

没复现,按理说如果是 null 应该走不到这里,前面就直接返回了
能否给个可复现demo

from fastjson2.

rowstop avatar rowstop commented on June 4, 2024

哦,没有无参构造方法是不?

from fastjson2.

wwulfric avatar wwulfric commented on June 4, 2024

哦,没有无参构造方法是不?

是的,估计用的lombok 的 builder,所以没有默认的无参构造方法

from fastjson2.

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.