Skip to content
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

List<Date>类型字段预编译报错 #207

Open
Aliang-code opened this issue Feb 23, 2024 · 2 comments
Open

List<Date>类型字段预编译报错 #207

Aliang-code opened this issue Feb 23, 2024 · 2 comments

Comments

@Aliang-code
Copy link

Aliang-code commented Feb 23, 2024

插件版本2.2.9

类代码

public class ApiAccount{
...
@Protobuf
private List<Date> alias_create_time;
...
}

##报错信息

Caused by: java.lang.IllegalStateException: Compilation failed. class: **.ApiAccount$$JProtoBufClass, diagnostics: [ApiAccount$$JProtoBufClass.java:1739: 错误: 对于add(long), 找不到合适的方法
(ret.getAlias_create_time()).add(input.readInt64());
                            ^
    方法 java.util.Collection.add(java.util.Date)不适用
      (参数不匹配; long无法转换为java.util.Date)
    方法 java.util.List.add(java.util.Date)不适用
      (参数不匹配; long无法转换为java.util.Date), 注: ApiAccount$$JProtoBufClass.java使用了未经检查或不安全的操作。, 注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。, 注: 某些消息已经过简化; 请使用 -Xdiags:verbose 重新编译以获得完整输出]
	at com.baidu.bjf.remoting.protobuf.utils.compiler.JdkCompiler.doCompile(JdkCompiler.java:205)
	at com.baidu.bjf.remoting.protobuf.utils.compiler.AbstractCompiler.compile(AbstractCompiler.java:46)
	at com.baidu.bjf.remoting.protobuf.ProtobufProxy.doCreate(ProtobufProxy.java:274)
	at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:174)
	at com.baidu.bjf.remoting.protobuf.ProtobufProxy.create(ProtobufProxy.java:155)
	at com.baidu.jprotobuf.mojo.JprotobufPreCompileMain$1.onEntry(JprotobufPreCompileMain.java:134)
	... 14 more
@jhunters
Copy link
Owner

List 类型目前还不支持

@jhunters
Copy link
Owner

2.2.10 版本已支持该功能

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

No branches or pull requests

2 participants