mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Replace Java code with equivalent, more concise code. (#7398)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user