未验证 提交 4487d392 编写于 作者: T Todd Volkert 提交者: GitHub

Replace Java code with equivalent, more concise code. (#7398)

上级 395b7852
......@@ -118,11 +118,7 @@ class ResourceExtractor {
try {
mExtractTask.get();
} catch (CancellationException e) {
deleteFiles();
} catch (ExecutionException e2) {
deleteFiles();
} catch (InterruptedException e3) {
} catch (CancellationException | ExecutionException | InterruptedException e) {
deleteFiles();
}
}
......@@ -225,11 +221,6 @@ class ResourceExtractor {
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 @@ class ResourceExtractor {
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;
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册