1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-08 08:26:10 +00:00

Close resource in finally block

I don't quite get the reason for `mBuf` here as in `com.owncloud.android.lib.common.utils.Log_OC#appendLog` anyways a new `BufferedWriter` is started but it might make sense to close this here as this will otherwise cause warnings in static code scanners.

Didn't test this as I don't have a Java device and so it requires extensive testing.
This commit is contained in:
Lukas Reschke 2015-06-02 17:29:57 +02:00 committed by David A. Velasco
parent 715a519523
commit 5c87414390

View File

@ -60,7 +60,7 @@ public class Log_OC {
}
public static void w(String TAG, String message) {
Log.w(TAG,message);
Log.w(TAG, message);
appendLog(TAG+" : "+ message);
}
@ -99,8 +99,16 @@ public class Log_OC {
}
} catch (IOException e) {
e.printStackTrace();
}
e.printStackTrace();
} finally {
if(mBuf != null) {
try {
mBuf.close();
} catch(IOException e) {
e.printStackTrace();
}
}
}
}
/**