Clear Sonar Blockers (#1643)

* remove debt from CachingTest

https://sonarcloud.io/project/issues?fileUuids=AW3G0SevwB6UiZzQNqXR&id=iluwatar_java-design-patterns&open=AXK0Ozo--CiGJS70dLl0&resolved=false
 
Signed-off-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com>

* fixed few debts for Spatial Partition module

Mainly convertig Hashtable to HashMaps

Signed-off-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com>

* fixed some logger norms

Signed-off-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com>

* fixed few errors as it got mixed with the stash

Signed-off-by: Subhrodip Mohanta <subhrodipmohanta@gmail.com>
This commit is contained in:
Subhrodip Mohanta
2021-01-30 17:07:52 +05:30
committed by GitHub
parent 663dbd298e
commit 3f09fb70bb
7 changed files with 40 additions and 34 deletions
@@ -24,7 +24,7 @@
package com.iluwatar.spatialpartition;
import java.util.Collection;
import java.util.Hashtable;
import java.util.HashMap;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -58,13 +58,13 @@ public class Bubble extends Point<Bubble> {
<= (this.radius + b.radius) * (this.radius + b.radius);
}
void pop(Hashtable<Integer, Bubble> allBubbles) {
LOGGER.info("Bubble " + this.id
+ " popped at (" + this.coordinateX + "," + this.coordinateY + ")!");
void pop(HashMap<Integer, Bubble> allBubbles) {
LOGGER.info("Bubble ", this.id,
" popped at (", this.coordinateX, ",", this.coordinateY, ")!");
allBubbles.remove(this.id);
}
void handleCollision(Collection<? extends Point> toCheck, Hashtable<Integer, Bubble> allBubbles) {
void handleCollision(Collection<? extends Point> toCheck, HashMap<Integer, Bubble> allBubbles) {
var toBePopped = false; //if any other bubble collides with it, made true
for (var point : toCheck) {
var otherId = point.id;