junkdog / artemis-odb

A continuation of the popular Artemis ECS framework
BSD 2-Clause "Simplified" License
777 stars 112 forks source link

[BUG] Fluid interface does not interpret generic getter methods properly. #568

Closed DaanVanYperen closed 5 years ago

DaanVanYperen commented 5 years ago

Fluid interface does not interpret generic method properly.

Source component

public class Properties extends Component {
    public ObjectMap<String, Object> properties = new ObjectMap<>();
    @SuppressWarnings("unchecked")
    public <T extends Enum> T getEnum(String key, Class<T> enumClazz) {
        return (T) properties.get(key);
    }
}

Exposed on E as:

  public T propertiesEnum(String p0, Class p1) {
    return mappers.mProperties.create(entityId).getEnum(p0, p1);
  }

Expected:

  public <T extends Enum> T propertiesEnum(String p0, Class<T> p1) {
    return mappers.mProperties.create(entityId).getEnum(p0, p1);
  }

or a way to exclude methods from the fluid interface.

DaanVanYperen commented 5 years ago

see also https://stackoverflow.com/questions/30969986/javapoet-add-generic-parameter

DaanVanYperen commented 5 years ago

Provided workaround via new @FluidMethod(exclude=true) feature.