From 336df1baaf3761365ba88d2bb0c512b4745a595f Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Mon, 7 Jan 2019 10:58:25 -0800 Subject: [PATCH] Replace Java code with equivalent, more concise code. --- .../io/flutter/view/ResourceExtractor.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/shell/platform/android/io/flutter/view/ResourceExtractor.java b/shell/platform/android/io/flutter/view/ResourceExtractor.java index 20a07a11f48d1..c28749b9e92d1 100644 --- a/shell/platform/android/io/flutter/view/ResourceExtractor.java +++ b/shell/platform/android/io/flutter/view/ResourceExtractor.java @@ -118,11 +118,7 @@ void waitForCompletion() { try { mExtractTask.get(); - } catch (CancellationException e) { - deleteFiles(); - } catch (ExecutionException e2) { - deleteFiles(); - } catch (InterruptedException e3) { + } catch (CancellationException | ExecutionException | InterruptedException e) { deleteFiles(); } } @@ -225,11 +221,6 @@ private boolean extractUpdate(File dataDir) { try { zipFile = new ZipFile(updateFile); - } catch (ZipException e) { - Log.w(TAG, "Exception unpacking resources: " + e.getMessage()); - deleteFiles(); - return false; - } catch (IOException e) { Log.w(TAG, "Exception unpacking resources: " + e.getMessage()); deleteFiles(); @@ -395,17 +386,10 @@ private JSONObject readUpdateManifest() { Scanner scanner = new Scanner(zipFile.getInputStream(entry)); return new JSONObject(scanner.useDelimiter("\\A").next()); - } catch (ZipException e) { + } catch (IOException | JSONException e) { Log.w(TAG, "Invalid update file: " + e); return null; - } catch (IOException e) { - Log.w(TAG, "Invalid update file: " + e); - return null; - - } catch (JSONException e) { - Log.w(TAG, "Invalid update file: " + e); - return null; } } }