Skip to content

ObjectMapper#canSerialize(Object.class) returns false even though FAIL_ON_EMPTY_BEANS is disabled #978

@flexfrank

Description

@flexfrank

Version: 2.5.x, 2.6.x

When FAIL_ON_EMPTY_BEANS is disabled, ObjectMapper#writeValueAsString(new Object()) succeeds.
However, ObjectMapper#canSerialize(Object.class) returns false.

ObjectMapper mapper = new ObjectMapper();
mapper.disable(SerializationFeature.FAIL_ON_EMPTY_BEANS);
System.err.println(mapper.canSerialize(Object.class));
System.err.println(mapper.writeValueAsString(new Object()));
false
{}

I suppose 152aabb caused this problem.

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