Skip to content

MixIn @JsonProperty for Object.hashCode() is ignored #1990

Closed
@freddyboucher

Description

@freddyboucher

Hi,

The following code works well in 2.8.10 but not anymore with 2.8.11, neither with 2.9.x

public class MixinTest {

    @Test
    public void testMixin() throws Exception {
        ObjectMapper objectMapper = new ObjectMapper();
        objectMapper.addMixIn( Object.class, ObjectMixIn.class );

        Assert.assertEquals( "{\"hashCode\":1864350231}", objectMapper.writeValueAsString( new Bean() ) );
    }

    public class Bean {
    }

    @JsonPropertyOrder( alphabetic = true )
    public interface ObjectMixIn {

        @Override
        @JsonProperty
        int hashCode();
    }
}

Is it expected? I didn't see anything in the release notes.
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions