Description
Model package classes like RangerPolicy initialize collection members with a new collection object (ArrayList/HashMap/HashSet). Many of these members would likely remain empty, resulting in the initialization to be unnecessary. Instead of creating a new collection object, it will help to initialize with Collections.emptyList()/emptySet()/emptyMap() - to save memory while retaining non-null value for collection members.
Also, set() on these members currently create a new collection object with a copy of the value to be set. This can be avoided by using the given value.
Attachments
Issue Links
- causes
-
RANGER-4822 Policy creation/updation fails when validity period is added
- Resolved