I20210916-2150
"Using remove is safer to avoid memory leak in some scenarios" see https://rules.sonarsource.com/java/RSPEC-5164 Change-Id: Id3b1d7f21f9699fc12c179b98ba08c096df209e7 Signed-off-by: Joerg Kubitz <jkubitz-eclipse@gmx.de> Reviewed-on: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/182387 Tested-by: JDT Bot <jdt-bot@eclipse.org> Tested-by: Jeff Johnston <jjohnstn@redhat.com> Reviewed-by: Jeff Johnston <jjohnstn@redhat.com>