You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public class TimelineParameter implements HasEffectiveDate, ReverseIndexInter {
public DateTime effectiveDate;
public String data;
public List<InnerParameter> paramList;
public TimelineParameter(String data, DateTime effectiveDate)
{
this.effectiveDate = effectiveDate;
this.data = data;
}
@Override
public Date getEffectiveDate()
{
return effectiveDate.toDate();
}
@Override
public void setEffectiveDate(Date effectiveDate)
{
this.effectiveDate = new DateTime(effectiveDate);
}
@Override
public List<Field> fillIndexFields() {
List<Field> fields = Lists.newArrayList();
try {
fields.add(TimelineParameter.class.getField("data"));
fields.add(TimelineParameter.class.getField("effectiveDate"));
} catch (NoSuchFieldException e) {
// do nothing
}
return fields;
}
}
环境信息
请填写以下信息:
OS信息: windows
JDK信息:Openjdk 17
版本信息:2.0.39
重现步骤
如上图,该方法断点处发生异常
换成1.2.83 可正常处理;
期待的正确结果
同1版本兼容,可正确转换
相关日志输出
Caused by: com.alibaba.fastjson.JSONException: can not cast to org.joda.time.DateTime, from class java.util.Date at com.alibaba.fastjson.JSON.parseObject(JSON.java:520) at net.engining.pg.parameter.JsonGuavaCachedParameterFacility.convertParameterObject(JsonGuavaCachedParameterFacility.java:93) at net.engining.pg.parameter.JsonGuavaCachedParameterFacility$1.load(JsonGuavaCachedParameterFacility.java:77) at net.engining.pg.parameter.JsonGuavaCachedParameterFacility$1.load(JsonGuavaCachedParameterFacility.java:1) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3571) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2313) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2190) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2080) ... 80 more Caused by: com.alibaba.fastjson2.JSONException: can not cast to org.joda.time.DateTime, from class java.util.Date at com.alibaba.fastjson2.util.TypeUtils.cast(TypeUtils.java:1522) at com.alibaba.fastjson2.util.TypeUtils.cast(TypeUtils.java:1404) at com.alibaba.fastjson2.reader.ConstructorFunction.apply(ConstructorFunction.java:172) at com.alibaba.fastjson2.reader.ConstructorFunction.apply(ConstructorFunction.java:18) at com.alibaba.fastjson2.reader.ObjectReaderNoneDefaultConstructor.readObject(ObjectReaderNoneDefaultConstructor.java:313) at com.alibaba.fastjson.JSON.parseObject(JSON.java:510) ... 87 more
The text was updated successfully, but these errors were encountered:
问题描述
当将如下json转换为包含org.joda.time.DateTime的对象时,发生如题异常;
该对象定义如下:
环境信息
请填写以下信息:
重现步骤
如上图,该方法断点处发生异常
换成1.2.83 可正常处理;
期待的正确结果
同1版本兼容,可正确转换
相关日志输出
Caused by: com.alibaba.fastjson.JSONException: can not cast to org.joda.time.DateTime, from class java.util.Date at com.alibaba.fastjson.JSON.parseObject(JSON.java:520) at net.engining.pg.parameter.JsonGuavaCachedParameterFacility.convertParameterObject(JsonGuavaCachedParameterFacility.java:93) at net.engining.pg.parameter.JsonGuavaCachedParameterFacility$1.load(JsonGuavaCachedParameterFacility.java:77) at net.engining.pg.parameter.JsonGuavaCachedParameterFacility$1.load(JsonGuavaCachedParameterFacility.java:1) at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3571) at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2313) at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2190) at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2080) ... 80 more Caused by: com.alibaba.fastjson2.JSONException: can not cast to org.joda.time.DateTime, from class java.util.Date at com.alibaba.fastjson2.util.TypeUtils.cast(TypeUtils.java:1522) at com.alibaba.fastjson2.util.TypeUtils.cast(TypeUtils.java:1404) at com.alibaba.fastjson2.reader.ConstructorFunction.apply(ConstructorFunction.java:172) at com.alibaba.fastjson2.reader.ConstructorFunction.apply(ConstructorFunction.java:18) at com.alibaba.fastjson2.reader.ObjectReaderNoneDefaultConstructor.readObject(ObjectReaderNoneDefaultConstructor.java:313) at com.alibaba.fastjson.JSON.parseObject(JSON.java:510) ... 87 more
The text was updated successfully, but these errors were encountered: