On Tue, 30 Jun 2015, Ethan Aubin wrote:

Can I get JCC to omit the binding for a particular constructor? I've
wrapping a java class that looks like:

package eg;
public class Eg {
   public Eg() {}
   public <T extends Eg> Eg(T event) {}
   public String foo() { return "foo"; }
}


and the generated bindings generate a constructor redeclaration error:

python -m jcc --classpath ./src --package eg eg.Eg --python Test --build

In file included from build/_Test/__init__.cpp:44:
build/_Test/eg/Eg.h:37:5: error: constructor cannot be redeclared
   Eg(const Eg &);
   ^
build/_Test/eg/Eg.h:34:5: note: previous declaration is here
   Eg(const Eg& obj) : ::java::lang::Object(obj) {}

It looks like you found a bug here.
You can exclude a class via --exclude but not an individual method.
Your options:
  - add such a flag (excluding by signature, should be easy enough)
  - make the constructor non public
  - disable generics support with --no-generics
  - fix the bug that causes the failure (a check needs to be added to
    exclude the double-declared constructor)

Andi..

Reply via email to