pingidentity / scim2

The UnboundID SCIM 2.0 SDK for Java
175 stars 72 forks source link

Add Nullability Annotations. #220

Closed kqarryzada closed 2 months ago

kqarryzada commented 2 months ago

This PR updates the SCIM SDK to utilize the @NotNull and @Nullable annotations on member variables, input parameters, and method return types to match the form of the LDAP SDK.

This PR is split up into multiple commits due to the volume of changes. I would recommend reviewing this one commit at a time. The purpose of the first three commits are:

  1. The initial copy of the LDAP SDK's unit test to ensure that these annotations are maintained for all future commits
  2. All updates required to make the test work with the SCIM SDK's common module
  3. Alternate versions of the tests for the other modules, e.g., scim2-sdk-client

I tried very hard to avoid copying and pasting the test into all of the separate modules. I initially came up with a solution that built a test-jar of the scim2-sdk-common tests so that the other modules could extend the NullabilityAnnotationTest as a parent class. But this added complexity, because all of the modules now depended on the common module's tests being run first. This is more akin to an integration test, but adding the Maven plugin to support this as an integration test seemed like too much effort when this test isn't a true integration test anyway. In the end, I decided to just copy the test, since it's unlikely that it will be changed much at all, so upkeep is not really a major concern.

kqarryzada commented 2 months ago

Thanks for the suggestion, @braveulysses. I set this up locally and it helped identify some mistakes. I'll add a README update explaining this soon.