Java 11 migrate all remaining s (#1120)

* Moves saga to Java 11

* Moves semaphore to Java 11

* Moves servant to Java 11

* Moves serverless to Java 11

* Moves service-layer to Java 11

* Moves service-locator to Java 11

* Moves sharding to Java 11

* Moves singleton to Java 11

* Moves spatial-partition to Java 11

* Moves specification to Java 11

* Moves state to Java 11

* Moves step-builder to Java 11

* Moves strategy to Java 11

* Moves subclass-sandbox to Java 11

* Fixes checkstyle issues
This commit is contained in:
Anurag Agarwal
2020-01-04 22:06:08 +05:30
committed by Ilkka Seppälä
parent 310ae50248
commit cd2a2e7711
98 changed files with 718 additions and 855 deletions

View File

@ -24,6 +24,7 @@
package com.iluwatar.spatialpartition;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Hashtable;
/**
@ -44,8 +45,8 @@ public class SpatialPartitionBubbles extends SpatialPartitionGeneric<Bubble> {
void handleCollisionsUsingQt(Bubble b) {
// finding points within area of a square drawn with centre same as
// centre of bubble and length = radius of bubble
Rect rect = new Rect(b.coordinateX, b.coordinateY, 2 * b.radius, 2 * b.radius);
ArrayList<Point> quadTreeQueryResult = new ArrayList<Point>();
var rect = new Rect(b.coordinateX, b.coordinateY, 2 * b.radius, 2 * b.radius);
var quadTreeQueryResult = new ArrayList<Point>();
this.quadTree.query(rect, quadTreeQueryResult);
//handling these collisions
b.handleCollision(quadTreeQueryResult, this.bubbles);