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

not support java interface #5

Open
tangmin823 opened this issue Mar 25, 2021 · 0 comments
Open

not support java interface #5

tangmin823 opened this issue Mar 25, 2021 · 0 comments

Comments

@tangmin823
Copy link

tangmin823 commented Mar 25, 2021

If this tool convert java pojo which include Generic type parameter to proto, it will throw exception

Exception in thread "main" java.lang.RuntimeException: No parameter type is specified in generic field[results] of Class[org.cango.demo.model.Page].
	at com.dld.hll.protobuf.generator.ProtoInfoParser.validateGenericField(ProtoInfoParser.java:243)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.validateGenericField(ProtoInfoParser.java:255)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseGenericField(ProtoInfoParser.java:173)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseField(ProtoInfoParser.java:165)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.doParseObject(ProtoInfoParser.java:132)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseObjectOrEnum(ProtoInfoParser.java:105)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseObject(ProtoInfoParser.java:92)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseMethodReturnType(ProtoInfoParser.java:86)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseMethod(ProtoInfoParser.java:62)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseCurrentServiceMethods(ProtoInfoParser.java:47)
	at com.dld.hll.protobuf.generator.ProtoInfoParser.parseService(ProtoInfoParser.java:33)
	at com.dld.hll.protobuf.generator.ProtoInfoReader.load(ProtoInfoReader.java:22)
	at com.dld.hll.protobuf.generator.ProtoExecutor.executor(ProtoExecutor.java:67)
	at com.dld.hll.protobuf.generator.TestExecutor.main(TestExecutor.java:12)

Code quoted:

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
public class Page<T> {
    private Pagination page;
    private List<T> results;

    public Page(Pagination pagination) {
        this.page = pagination;
    }
}
public interface CarService {
    Page<CarModelVO> findModelListBySeriesId(CarModelCondition condition);

}
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

1 participant