From 553b5e97a30584afabb9d6683dc9496b34138e0d Mon Sep 17 00:00:00 2001 From: Sean Owen Date: Tue, 24 Apr 2018 11:31:57 -0500 Subject: [PATCH] Update JAI ImageIO for JDK 9; other trivial inspection and plugin updates --- .../client/android/camera/CameraConfigurationManager.java | 6 +++--- .../java/com/google/zxing/pdf417/PDF417ResultMetadata.java | 1 + javase/pom.xml | 2 +- pom.xml | 4 ++-- .../src/main/java/com/google/zxing/web/DecodeServlet.java | 7 ++++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java index 8bce3b66a..55d473e59 100644 --- a/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java +++ b/android/src/com/google/zxing/client/android/camera/CameraConfigurationManager.java @@ -226,9 +226,9 @@ final class CameraConfigurationManager { Camera.Parameters parameters = camera.getParameters(); if (parameters != null) { String flashMode = parameters.getFlashMode(); - return flashMode != null && - (Camera.Parameters.FLASH_MODE_ON.equals(flashMode) || - Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode)); + return + Camera.Parameters.FLASH_MODE_ON.equals(flashMode) || + Camera.Parameters.FLASH_MODE_TORCH.equals(flashMode); } } return false; diff --git a/core/src/main/java/com/google/zxing/pdf417/PDF417ResultMetadata.java b/core/src/main/java/com/google/zxing/pdf417/PDF417ResultMetadata.java index 9c51959ba..5684c3391 100644 --- a/core/src/main/java/com/google/zxing/pdf417/PDF417ResultMetadata.java +++ b/core/src/main/java/com/google/zxing/pdf417/PDF417ResultMetadata.java @@ -69,6 +69,7 @@ public final class PDF417ResultMetadata { } /** + * @param optionalData old optional data format as int array * @deprecated parse and use new fields */ @Deprecated diff --git a/javase/pom.xml b/javase/pom.xml index 96d9a533e..d317df885 100644 --- a/javase/pom.xml +++ b/javase/pom.xml @@ -34,7 +34,7 @@ com.github.jai-imageio jai-imageio-core - 1.3.1 + 1.4.0 runtime diff --git a/pom.xml b/pom.xml index e54ac74f9..dd1d1b6f4 100644 --- a/pom.xml +++ b/pom.xml @@ -82,7 +82,7 @@ UTF-8 UTF-8 1.7 - 6.0.1 + 6.0.2 2.0.14 1.7.25 @@ -465,7 +465,7 @@ com.puppycrawl.tools checkstyle - 8.8 + 8.9 diff --git a/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java b/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java index 22c53380a..269d8c8c3 100644 --- a/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java +++ b/zxingorg/src/main/java/com/google/zxing/web/DecodeServlet.java @@ -331,9 +331,10 @@ public final class DecodeServlet extends HttpServlet { BufferedImage image; try { image = ImageIO.read(is); - } catch (IOException | CMMException | IllegalArgumentException ioe) { - log.info(ioe.toString()); - // Have seen these in some logs + } catch (IOException | CMMException | IllegalArgumentException | ArrayIndexOutOfBoundsException e) { + // Have seen these in some logs, like an AIOOBE from certain GIF images + // https://github.com/zxing/zxing/issues/862#issuecomment-376159343 + log.info(e.toString()); errorResponse(request, response, "badimage"); return; }