mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-15 22:58:59 +00:00
fix: Sonar report - fix blocker and critical ones (#1899)
* update SpatialPartitionBubbles - fix Sonar blocker issue * fix Sonar critical issue - Define constant instead of duplicating the literal * fix Sonar critical issue - remove unnecessary default constructor * fix Sonar critical issue - Define constant instead of duplicating the literal * fix Sonar critical issue - Define constant instead of duplicating the literal * fix Sonar critical issue - Define constant instead of duplicating the literal * fix Sonar critical issue - fix checkstyle issue * fix Sonar critical issue - fix code smells * fix Sonar critical issue - fix code smells * fix Sonar critical issue - fix code smells * fix sonarbugs - adding test cases for Commander class * sonar fix - add assert commands in CommanderTest * sonar fix - add test cases for CommanderTest * sonar fix - add test cases for CommanderTest * sonar fix - add test cases for CommanderTest * sonar fix - add test cases for CommanderTest * sonar fix - add test cases for CommanderTest * sonar fix - add test cases for CommanderTest * sonar fix - add test cases for CommanderTest * sonar bug fix & test cases * sonar bug fix & test cases * sonar bug fix & test cases * sonar bug fix & test cases * sonar bug fix & test cases * Revert "sonar bug fix & test cases" This reverts commit 640dd55e35a9730e981d14665913f3d9b5b2d3b2. * sonar bug fix & test cases * sonar bug fix & test cases * sonar bug fix & test cases * sonar bug fix : avoid Thread.sleep * sonar bug fix : cleanup Thread.sleep * sonar bug fix: test commit * sonar bug fix: test commit Co-authored-by: Subhrodip Mohanta <hello@subho.xyz> Co-authored-by: atayal <Ankush_Tayal@intuit.com>
This commit is contained in:
committed by
GitHub
parent
fee898cd27
commit
600227d2e4
+4
-4
@@ -34,11 +34,11 @@ import java.util.HashMap;
|
||||
public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
|
||||
|
||||
private final HashMap<Integer, Bubble> bubbles;
|
||||
private final QuadTree quadTree;
|
||||
private final QuadTree bubblesQuadTree;
|
||||
|
||||
SpatialPartitionBubbles(HashMap<Integer, Bubble> bubbles, QuadTree quadTree) {
|
||||
SpatialPartitionBubbles(HashMap<Integer, Bubble> bubbles, QuadTree bubblesQuadTree) {
|
||||
this.bubbles = bubbles;
|
||||
this.quadTree = quadTree;
|
||||
this.bubblesQuadTree = bubblesQuadTree;
|
||||
}
|
||||
|
||||
void handleCollisionsUsingQt(Bubble b) {
|
||||
@@ -46,7 +46,7 @@ public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
|
||||
// centre of bubble and length = radius of bubble
|
||||
var rect = new Rect(b.coordinateX, b.coordinateY, 2D * b.radius, 2D * b.radius);
|
||||
var quadTreeQueryResult = new ArrayList<Point>();
|
||||
this.quadTree.query(rect, quadTreeQueryResult);
|
||||
this.bubblesQuadTree.query(rect, quadTreeQueryResult);
|
||||
//handling these collisions
|
||||
b.handleCollision(quadTreeQueryResult, this.bubbles);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user