From f148580e7299a68ca5aa50cba7fbcd098f8e907f Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 14 May 2018 16:23:55 +0300 Subject: 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 --- .../src/org/qtproject/qt5/android/bindings/QtLoader.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/android') diff --git a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java index 531802959c..fc3d7e04ce 100644 --- a/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java +++ b/src/android/java/src/org/qtproject/qt5/android/bindings/QtLoader.java @@ -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) -- cgit v1.2.3