|
1 | 1 | /** |
2 | 2 | * Copyright 2005-2024 Qlik |
3 | | - *<p> |
| 3 | + * <p> |
4 | 4 | * The content of this file is subject to the terms of the Apache 2.0 open |
5 | 5 | * source license available at https://www.opensource.org/licenses/apache-2.0 |
6 | | - *<p> |
| 6 | + * <p> |
7 | 7 | * Restlet is a registered trademark of QlikTech International AB. |
8 | 8 | */ |
9 | 9 | package org.restlet.util; |
|
16 | 16 | import java.util.Map; |
17 | 17 | import java.util.Set; |
18 | 18 | import java.util.logging.Level; |
| 19 | + |
19 | 20 | import org.restlet.Context; |
20 | 21 |
|
21 | 22 | /** |
@@ -114,7 +115,7 @@ public void copyTo(Map<String, Object> params) { |
114 | 115 | } else { |
115 | 116 | // Second value found for this entry |
116 | 117 | // Create a list of values |
117 | | - values = new ArrayList<Object>(); |
| 118 | + values = new ArrayList<>(); |
118 | 119 | values.add(currentValue); |
119 | 120 | params.put(param.getName(), values); |
120 | 121 | } |
@@ -162,19 +163,15 @@ public T createEntry(String name, String value) { |
162 | 163 | * @return True if both values are equal. |
163 | 164 | */ |
164 | 165 | 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); |
174 | 171 | } |
175 | 172 | } |
176 | 173 |
|
177 | | - return result; |
| 174 | + return false; |
178 | 175 | } |
179 | 176 |
|
180 | 177 | /** |
|
0 commit comments