Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bean with getter returning Stream is treating the Stream as an alternative setter #3462

Copy link
Copy link

Description

@filiphr
Issue body actions

Expected behavior

A getter returning a Stream should not be treated as an alternative setter

Actual behavior

The getter is treated as an alternative setter

Steps to reproduce the problem

public static class Foo {
    List<String> values;
    public List<String> getValues() { return values; }
    public void setValues(List<String> values) { this.values = values; }
}

public static class Bar {
    List<String> values;

    public List<String> getValues() { return this.values; }
    public void setValues(List<String> values) { this.values = values; }

    // This is the root of the problem; try replacing with any non-collection type.
    public Stream<String> getX() {
        throw new UnsupportedOperationException();
    }
}

@Mapper
public interface BarMapper {
    @Mapping(target = "values", source = "values")
    Bar toBar(Foo foo);
}

From #3425

MapStruct Version

1.5.5.Final / 1.6.0.Beta1

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.