From 34a79f9d4a19aee68ec6f80d51e1111e4b8df9c5 Mon Sep 17 00:00:00 2001 From: Marco Kaufmann <83189575+kaufco@users.noreply.github.com> Date: Tue, 30 Jan 2024 16:33:51 +0100 Subject: [PATCH] Update rules/S6877/java/rule.adoc Co-authored-by: leonardo-pilastri-sonarsource <115481625+leonardo-pilastri-sonarsource@users.noreply.github.com> --- rules/S6877/java/rule.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rules/S6877/java/rule.adoc b/rules/S6877/java/rule.adoc index 4702a3ea0c4..e7f29188837 100644 --- a/rules/S6877/java/rule.adoc +++ b/rules/S6877/java/rule.adoc @@ -11,7 +11,7 @@ On the other hand, `Collection.reverse(List)` creates a completely new list that `SequencedCollection.reversed()` should be the preferred method for two reasons: 1. It returns a more lightweight object, as it does not need to recreate the underlying data structure as `Collection.reverse(List)` does. It merely provides a wrapper for element access and the iterator. -2. It abstracts from the fact that the instance to which the call is applied is a list. This results in more generic code that is easier to port, for instance, when you want to use another collection data structure. +2. It abstracts from the fact that the collection instance is a list. This results in more generic code that is easier to port, for instance, when you want to use another collection data structure. == How to fix it