@@ -128,11 +128,11 @@ public static boolean outputOccupiedRanges(Raster raster, RangesOutput out) {
128128 * @return true if the output succeeded, false otherwise
129129 */
130130 public static boolean outputOccupiedRangesOfBinaryPixels (byte [] binaryBits , int w , int h , RangesOutput out ) {
131- Set <Rectangle > rects = new HashSet <Rectangle >();
131+ Set <Rectangle > rects = new HashSet <>();
132132 Set <Rectangle > prevLine = Collections .<Rectangle >emptySet ();
133133 int scanlineBytes = binaryBits .length / h ;
134134 for (int row = 0 ; row < h ; row ++) {
135- Set <Rectangle > curLine = new TreeSet <Rectangle >(COMPARATOR );
135+ Set <Rectangle > curLine = new TreeSet <>(COMPARATOR );
136136 int rowOffsetBytes = row * scanlineBytes ;
137137 int startCol = -1 ;
138138 // Look at each batch of 8 columns in this row
@@ -201,10 +201,10 @@ public static boolean outputOccupiedRangesOfBinaryPixels(byte[] binaryBits, int
201201 * @return true if the output succeeded, false otherwise
202202 */
203203 public static boolean outputOccupiedRanges (int [] pixels , int w , int h , int occupationMask , RangesOutput out ) {
204- Set <Rectangle > rects = new HashSet <Rectangle >();
204+ Set <Rectangle > rects = new HashSet <>();
205205 Set <Rectangle > prevLine = Collections .<Rectangle >emptySet ();
206206 for (int row = 0 ; row < h ; row ++) {
207- Set <Rectangle > curLine = new TreeSet <Rectangle >(COMPARATOR );
207+ Set <Rectangle > curLine = new TreeSet <>(COMPARATOR );
208208 int idxOffset = row * w ;
209209 int startCol = -1 ;
210210
@@ -241,7 +241,7 @@ public static boolean outputOccupiedRanges(int[] pixels, int w, int h, int occup
241241 }
242242
243243 private static Set <Rectangle > mergeRects (Set <Rectangle > prev , Set <Rectangle > current ) {
244- Set <Rectangle > unmerged = new HashSet <Rectangle >(prev );
244+ Set <Rectangle > unmerged = new HashSet <>(prev );
245245 if (!prev .isEmpty () && !current .isEmpty ()) {
246246 Rectangle [] pr = prev .toArray (new Rectangle [0 ]);
247247 Rectangle [] cr = current .toArray (new Rectangle [0 ]);
0 commit comments