Updating from 1.17 to 1.25 breaks

Issue #465 wontfix
Chen Lingchao created an issue

When I try to upgrade snakeyaml from 1.17 to the version after 1.19. The following code breaks.

public class InputSheet {
    public static Constructor constructor() {
        Constructor constructor = new Constructor(InputSheet.class);
        TypeDescription description = new TypeDescription(InputSheet.class);
        constructor.setPropertyUtils(new PropertyUtils() {
            @Override
            public Property getProperty(Class<?> type, String name) throws IntrospectionException {
                return super.getProperty(type, name);
            }
        });
        return constructor;
    }
}

It throws an error:

getProperty(java.lang.Class<?>,java.lang.String) in <anonymous org.gurpsdomain.adapters.input.yaml.domain.InputSheet$1> cannot override getProperty(java.lang.Class<? extends java.lang.Object>,java.lang.String) in org.yaml.snakeyaml.introspector.PropertyUtils

Thanks a lot.

Comments (3)

  1. Andrey Somov

    What happens if you remove “throws IntrospectionException“ ?

    The current implementation does not throw exceptions:

    public Property getProperty(Class<? extends Object> type, String name) {
        return getProperty(type, name, beanAccess);
    }
    

  2. Chen Lingchao reporter

    Hi, thanks for replying. It could solve my issue. Should this be a backwards incompatible issue? I didn’t find any notes in the changes.

  3. Andrey Somov

    The changes in 1.19 says "Update: major improvement when parsing JavaBeans." Parsing of JavaBeans was refactored.

  4. Log in to comment