Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

SWARM-992: Set a modifiable List to a field in var-args mutator method of List type model to enable the field to mutate #30

Merged
merged 1 commit into from Jan 11, 2017

Conversation

emag
Copy link
Contributor

@emag emag commented Jan 11, 2017

Motivation

The var-args mutator for some models whose type is List sets
an unmodifiable List(jva.util.Arrays$ArrayList) to the field.

If the field initializes as
java.util.Arrays$ArrayList, we can't add elements to the field.

Modifications

Use java.util.stream.Collectors#toList() to get a modifiable List(java.util.ArrayList).

Result

You can add elements to the initialized field.

…d of List type model to enable the field to mutate

Motivation
----------
The var-args mutator for some models whose type is List sets
an unmodifiable List(jva.util.Arrays$ArrayList) to the field.

If the field initializes as
java.util.Arrays$ArrayList, we can't add elements to the field.

Modifications
-------------
Use java.util.stream.Collectors#toList() to get a modifiable List(java.util.ArrayList).

Result
------
You can add elements to the initialized field.
@thorntail-ci
Copy link
Contributor

Can one of the admins verify this patch?

1 similar comment
@thorntail-ci
Copy link
Contributor

Can one of the admins verify this patch?

@heiko-braun
Copy link
Contributor

add to whitelist

@bobmcwhirter bobmcwhirter merged commit 43375cf into thorntail:master Jan 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
5 participants