Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: MetamodelProperty#containerKindOf knows Collection now #2705

Merged
merged 2 commits into from
Oct 23, 2018

Conversation

pvojtechovsky
Copy link
Collaborator

Little change needed by #2702

There is no way how to test it. The "test" comes with #2702 after spoon model starts use Collection in some API methods.

@@ -600,7 +601,7 @@ private static ContainerKind containerKindOf(Class<?> valueClass) {
if (Map.class.isAssignableFrom(valueClass)) {
return ContainerKind.MAP;
}
if (Set.class.isAssignableFrom(valueClass)) {
if (Set.class.isAssignableFrom(valueClass) || Collection.class.isAssignableFrom(valueClass)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set is a subtype of Collection so only the second part is necessary

Suggested change
if (Set.class.isAssignableFrom(valueClass) || Collection.class.isAssignableFrom(valueClass)) {
if (Collection.class.isAssignableFrom(valueClass)) {

@monperrus monperrus merged commit 03a9c47 into INRIA:master Oct 23, 2018
@pvojtechovsky pvojtechovsky deleted the fixMMPropCollection branch October 23, 2018 19:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants