Fix Android loader

Invalid syntax due to missing closing brackets and
exception not being handled when calling .close()
on a stream.

Change-Id: If8f191fbc44fe1b031fd86abff5163bca434156a
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
bb10
Thiago Marcos P. Santos 2018-05-14 16:23:55 +03:00 committed by André Klitzing
parent 2fc274ddb5
commit f148580e72
1 changed files with 10 additions and 5 deletions

View File

@ -361,7 +361,7 @@ public abstract class QtLoader {
inputStream = assetsManager.open(source);
outputStream = new FileOutputStream(destinationFile);
copyFile(inputStream, outputStream);
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null)
@ -392,7 +392,7 @@ public abstract class QtLoader {
inputStream = new FileInputStream(source);
outputStream = new FileOutputStream(destinationFile);
copyFile(inputStream, outputStream);
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null)
@ -416,8 +416,13 @@ public abstract class QtLoader {
} catch (Exception e) {
e.printStackTrace();
} finally {
if (inputStream != null)
inputStream.close();
if (inputStream != null) {
try {
inputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
@ -456,7 +461,7 @@ public abstract class QtLoader {
try {
outputStream = new DataOutputStream(new FileOutputStream(versionFile));
outputStream.writeLong(packageVersion);
catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
} finally {
if (outputStream != null)