Committed by
Gerrit Code Review
Duplicate Null Check not required
Change-Id: Ifd7a6678674f9858e33c43d8f210e42964859b3e
Showing
1 changed file
with
1 additions
and
6 deletions
... | @@ -202,7 +202,6 @@ public class FloatingIpManager implements FloatingIpService { | ... | @@ -202,7 +202,6 @@ public class FloatingIpManager implements FloatingIpService { |
202 | public boolean updateFloatingIps(Collection<FloatingIp> floatingIps) { | 202 | public boolean updateFloatingIps(Collection<FloatingIp> floatingIps) { |
203 | checkNotNull(floatingIps, FLOATINGIP_NOT_NULL); | 203 | checkNotNull(floatingIps, FLOATINGIP_NOT_NULL); |
204 | boolean result = true; | 204 | boolean result = true; |
205 | - if (floatingIps != null) { | ||
206 | for (FloatingIp floatingIp : floatingIps) { | 205 | for (FloatingIp floatingIp : floatingIps) { |
207 | verifyFloatingIpData(floatingIp); | 206 | verifyFloatingIpData(floatingIp); |
208 | if (floatingIp.portId() != null) { | 207 | if (floatingIp.portId() != null) { |
... | @@ -213,8 +212,7 @@ public class FloatingIpManager implements FloatingIpService { | ... | @@ -213,8 +212,7 @@ public class FloatingIpManager implements FloatingIpService { |
213 | result = false; | 212 | result = false; |
214 | } | 213 | } |
215 | } else { | 214 | } else { |
216 | - FloatingIp oldFloatingIp = floatingIpStore.get(floatingIp | 215 | + FloatingIp oldFloatingIp = floatingIpStore.get(floatingIp.id()); |
217 | - .id()); | ||
218 | if (oldFloatingIp != null) { | 216 | if (oldFloatingIp != null) { |
219 | floatingIpStore.remove(floatingIp.id(), oldFloatingIp); | 217 | floatingIpStore.remove(floatingIp.id(), oldFloatingIp); |
220 | if (floatingIpStore.containsKey(floatingIp.id())) { | 218 | if (floatingIpStore.containsKey(floatingIp.id())) { |
... | @@ -225,7 +223,6 @@ public class FloatingIpManager implements FloatingIpService { | ... | @@ -225,7 +223,6 @@ public class FloatingIpManager implements FloatingIpService { |
225 | } | 223 | } |
226 | } | 224 | } |
227 | } | 225 | } |
228 | - } | ||
229 | return result; | 226 | return result; |
230 | } | 227 | } |
231 | 228 | ||
... | @@ -233,7 +230,6 @@ public class FloatingIpManager implements FloatingIpService { | ... | @@ -233,7 +230,6 @@ public class FloatingIpManager implements FloatingIpService { |
233 | public boolean removeFloatingIps(Collection<FloatingIpId> floatingIpIds) { | 230 | public boolean removeFloatingIps(Collection<FloatingIpId> floatingIpIds) { |
234 | checkNotNull(floatingIpIds, FLOATINGIP_ID_NOT_NULL); | 231 | checkNotNull(floatingIpIds, FLOATINGIP_ID_NOT_NULL); |
235 | boolean result = true; | 232 | boolean result = true; |
236 | - if (floatingIpIds != null) { | ||
237 | for (FloatingIpId floatingIpId : floatingIpIds) { | 233 | for (FloatingIpId floatingIpId : floatingIpIds) { |
238 | if (!floatingIpStore.containsKey(floatingIpId)) { | 234 | if (!floatingIpStore.containsKey(floatingIpId)) { |
239 | log.debug("The floatingIp is not exist whose identifier is {}", | 235 | log.debug("The floatingIp is not exist whose identifier is {}", |
... | @@ -249,7 +245,6 @@ public class FloatingIpManager implements FloatingIpService { | ... | @@ -249,7 +245,6 @@ public class FloatingIpManager implements FloatingIpService { |
249 | result = false; | 245 | result = false; |
250 | } | 246 | } |
251 | } | 247 | } |
252 | - } | ||
253 | return result; | 248 | return result; |
254 | } | 249 | } |
255 | 250 | ... | ... |
-
Please register or login to post a comment