gizmo icon indicating copy to clipboard operation
gizmo copied to clipboard

Simplify creating constructors

Open metacosm opened this issue 4 years ago • 3 comments

The syntax is quite arcane and is difficult to get right, in particular when needing to call super constructors.

metacosm avatar Dec 18 '20 16:12 metacosm

I think we need some general infrastructure to easily generate proxy methods, be it constructors or regular methods.

gsmet avatar Dec 18 '20 16:12 gsmet

hmm, I have seen the message on zulip and Thinking to implement few stuff. Indeed I face same issue with cxf ;-) wdyt about adding in ClassCreator:


    public MethodCreator getConstructor(String... parameters) {
        return getMethodCreator(MethodDescriptor.ofConstructor(className, parameters));
    }

    public MethodCreator getSuperConstructor(String... parameters) {
        return getMethodCreator(MethodDescriptor.ofConstructor(superClass, parameters));
    }

dufoli avatar Dec 19 '20 09:12 dufoli

I implement a part in #69 and another in #68

dufoli avatar Dec 20 '20 18:12 dufoli