Skip to content

Java data flow: Identify side effects on captured variable in lambda callback. #6906

Closed
@aschackmull

Description

@aschackmull

Identify through-flow from params to defaults in

static void filterAndMerge_2(MultiValueMap<String, String> params, Map<String, Object> defaults, Predicate<String> filter) {
    params.asMultimap().asMap().forEach((name, values) -> {
        if (!isEmptyAndHasDefault(name, values, defaults) && !filter.test(name)) {
            defaults.put(name, extractSingleValueIfPossible(values));
        }
    });
}

This involves tracking post-update-based reverse flow on the captured instance of defaults back out of forEach such that the call context is maintained. Lots of moving parts here, so not likely to be fixed in the short term.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions