pingidentity / scim

SCIM 1.1 SDK for Java
42 stars 10 forks source link

Returning null instead of empty collection for SCIMAttribute #5

Open jackychen-okta opened 8 years ago

jackychen-okta commented 8 years ago

Hi,

I notice that since a commit to fix the null strings, we return null instead of an empty collection. So if I do group.getMembers() on a GroupResource, it would be null and I can get a NPE on a foreach statement, e.g. for (Collection<Entry<String>> entry : group.getMembers()).

http://stackoverflow.com/questions/6077909/is-there-a-way-to-avoid-null-check-before-the-for-each-loop-iteration-starts

I can do a null check, but it seems extraneous to do that before a foreach.

coulbeck commented 8 years ago

You have a good point - it’s somewhat burdensome and not very friendly to return null. That said, we are unlikely to change the behavior because we are working on an entirely new SCIM v2 client library.

asaf commented 8 years ago

@coulbeck out of the context of this issue, what's the state of the v2 client library ? is it going to be public under the same license, and if so, when?

Thank you for your great effort !

coulbeck commented 8 years ago

@asaf Currently it's planned to be public under the same license, sometime over summer (northern hemisphere!). Sorry I can't be any more specific right now.

jwilleke commented 7 years ago

So can the v2 client library work against PINGFederate? (Which appears to support SCIM v1.1)

richardcardona commented 7 years ago

No, the SCIM 2 standard is not backward-compatible with SCIM 1.x hence two different libraries.