Skip to content

Commit 9385d4b

Browse files
committed
Take into account Sonar comments
1 parent d97460a commit 9385d4b

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

org.restlet/src/main/java/org/restlet/util/Series.java

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
22
* Copyright 2005-2024 Qlik
3-
*<p>
3+
* <p>
44
* The content of this file is subject to the terms of the Apache 2.0 open
55
* source license available at https://www.opensource.org/licenses/apache-2.0
6-
*<p>
6+
* <p>
77
* Restlet is a registered trademark of QlikTech International AB.
88
*/
99
package org.restlet.util;
@@ -16,6 +16,7 @@
1616
import java.util.Map;
1717
import java.util.Set;
1818
import java.util.logging.Level;
19+
1920
import org.restlet.Context;
2021

2122
/**
@@ -114,7 +115,7 @@ public void copyTo(Map<String, Object> params) {
114115
} else {
115116
// Second value found for this entry
116117
// Create a list of values
117-
values = new ArrayList<Object>();
118+
values = new ArrayList<>();
118119
values.add(currentValue);
119120
params.put(param.getName(), values);
120121
}
@@ -162,19 +163,15 @@ public T createEntry(String name, String value) {
162163
* @return True if both values are equal.
163164
*/
164165
private boolean equals(String value1, String value2, boolean ignoreCase) {
165-
boolean result = (value1 == value2);
166-
167-
if (!result) {
168-
if ((value1 != null) && (value2 != null)) {
169-
if (ignoreCase) {
170-
result = value1.equalsIgnoreCase(value2);
171-
} else {
172-
result = value1.equals(value2);
173-
}
166+
if ((value1 != null) && (value2 != null)) {
167+
if (ignoreCase) {
168+
return value1.equalsIgnoreCase(value2);
169+
} else {
170+
return value1.equals(value2);
174171
}
175172
}
176173

177-
return result;
174+
return false;
178175
}
179176

180177
/**

0 commit comments

Comments
 (0)