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

Overriding only a setXXX method isn't supported #742

Open
jpobst opened this issue Oct 20, 2020 · 0 comments
Open

Overriding only a setXXX method isn't supported #742

jpobst opened this issue Oct 20, 2020 · 0 comments
Labels
bug Component does not function as intended generator Issues binding a Java library (generator, class-parse, etc.)

Comments

@jpobst
Copy link
Contributor

jpobst commented Oct 20, 2020

If you have a Java type that has both a getter and a setter, we combine them into a property:

bool getEnabled ();
void setEnabled (bool value);

becomes:

public virtual bool Enabled { get; set; }

If a Java subclass overrides the setter, we will generate a method instead of a property because generator does not support setter-only properties:

public override void SetEnabled (bool value)

This causes a C# error because the method does not actually override anything in the base class.

Some possible fixes:

  1. skip it: we don't need to bind overrides
  2. bind both the getter & setter, and delegate the "non-present" one to the base property
@jpobst jpobst added bug Component does not function as intended generator Issues binding a Java library (generator, class-parse, etc.) labels Oct 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Component does not function as intended generator Issues binding a Java library (generator, class-parse, etc.)
Projects
None yet
Development

No branches or pull requests

1 participant