From 61d913c3e83eeca85187df54e9a572e135b7fa42 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Mon, 5 Oct 2020 15:22:46 +0200 Subject: [PATCH] Reviewed code. --- src/fr/devinsy/strings/StringSet.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/fr/devinsy/strings/StringSet.java b/src/fr/devinsy/strings/StringSet.java index ababa36..9fc30f7 100644 --- a/src/fr/devinsy/strings/StringSet.java +++ b/src/fr/devinsy/strings/StringSet.java @@ -22,9 +22,8 @@ import java.util.Collection; import java.util.HashSet; /** - * This class is a set of String objects with specific methods. It makes - * possible to build a string without any copy. The goal is to make easier the - * use of set of strings. + * This class is a set of String objects with specific methods. It makes possible to build a string without any copy. + * The goal is to make easier the use of set of strings. */ public class StringSet extends HashSet { @@ -39,8 +38,8 @@ public class StringSet extends HashSet } /** - * Constructs a list of string of the specified collection, in the order they - * are returned by the collection's iterator. + * Constructs a list of string of the specified collection, in the order they are returned by the collection's + * iterator. * * @param source * the source @@ -82,7 +81,6 @@ public class StringSet extends HashSet if (source != null) { - // for (String string : source) { this.add(string); @@ -102,7 +100,6 @@ public class StringSet extends HashSet if (source != null) { - // for (String string : source) { this.add(string); @@ -122,15 +119,13 @@ public class StringSet extends HashSet { boolean result; - if (string != null) + if (string == null) { - // - result = super.add(string); + result = false; } else { - // - result = false; + result = super.add(string); } //