[jitsi-dev] [jitsi-android] PresenceStatusActivity: Close FileInputStream after use (#5)


#1

You can merge this Pull Request by running:

  git pull https://github.com/sandy-8925/jitsi-android fixJavaProblems

Or you can view, comment on it, or merge it online at:

  https://github.com/jitsi/jitsi-android/pull/5

-- Commit Summary --

  * PresenceStatusActivity: Close FileInputStream after use

-- File Changes --

    M src/org/jitsi/android/gui/account/PresenceStatusActivity.java (1)

-- Patch Links --

https://github.com/jitsi/jitsi-android/pull/5.patch
https://github.com/jitsi/jitsi-android/pull/5.diff

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-android/pull/5


#2

Nice catch ! But as we're on fixing it... Can we also move the check for Avatar operation set to the front before we start any processing ? And "fin" should be probably closed in finally block(with check for null value of "fin"). Thanks !

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-android/pull/5#issuecomment-34846254


#3

Ok.

I tried placing fin.close inside the finally block at first, but since it
wouldn't have been initialized and initializing throws an exception, I
thought that the statement would be better off at the end of the try block.

I will make the change.

I am also of the opinion that this code to read the avatar file should be
moved out into a separate method and called from here.

- Sandeep

···

On Tue, Feb 11, 2014 at 11:48 PM, Paweł Domas <notifications@github.com>wrote:

Nice catch ! But as we're on fixing it... Can we also move the check for
Avatar operation set to the front before we start any processing ? And
"fin" should be probably closed in finally block(with check for null value
of "fin"). Thanks !


Reply to this email directly or view it on GitHub<https://github.com/jitsi/jitsi-android/pull/5#issuecomment-34846254>
.

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-android/pull/5#issuecomment-34929265


#4

Closed #5.

···

---
Reply to this email directly or view it on GitHub:
https://github.com/jitsi/jitsi-android/pull/5