mirror of
https://github.com/opencv/opencv.git
synced 2026-07-25 05:13:04 +04:00
1610602884
Replace System.exit(-1) with exceptions in HighGui.java (#28696) #28699 ## Summary Library code should never call System.exit() as it kills the entire JVM. Replaced all 3 instances with appropriate exceptions. Closes #28696 ## Changes - `imshow()` with empty image: `System.exit(-1)` -> `throw new IllegalArgumentException("Image is empty")` - `waitKey()` with no windows: `System.exit(-1)` -> `throw new IllegalStateException("No windows created. Call imshow() first")` - `waitKey()` with null window image: `System.exit(-1)` -> `throw new IllegalStateException("No image set for window: ... Call imshow() first")` - `InterruptedException` catch: `printStackTrace()` -> `Thread.currentThread().interrupt()`