diff --git a/src/main/java/com/uddernetworks/newocr/OCRUtils.java b/src/main/java/com/uddernetworks/newocr/OCRUtils.java index 1dd71cc..092f9e8 100644 --- a/src/main/java/com/uddernetworks/newocr/OCRUtils.java +++ b/src/main/java/com/uddernetworks/newocr/OCRUtils.java @@ -15,6 +15,8 @@ */ public class OCRUtils { + public static final AbstractMap.SimpleEntry ZERO_PLACEHOLDER = new AbstractMap.SimpleEntry<>(0, 0); + /* * Advanced/Convenient Comparisons */ @@ -371,7 +373,7 @@ public static Stream getVerticalHalf(boolean[][] values) { * @return A stream of 3 thirds: left, middle, and right */ public static Stream> getVerticalThird(boolean[][] values) { - if (values.length == 0) return Stream.of(null, null, null); + if (values.length == 0) return Stream.of(ZERO_PLACEHOLDER, ZERO_PLACEHOLDER, ZERO_PLACEHOLDER); int leftHeight = values[0].length / 3; int middleHeight = values[0].length - leftHeight * 2;