mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +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:
		
							parent
							
								
									715a519523
								
							
						
					
					
						commit
						5c87414390
					
				| @ -60,7 +60,7 @@ public class Log_OC { | |||||||
|     } |     } | ||||||
|      |      | ||||||
|     public static void w(String TAG, String message) { |     public static void w(String TAG, String message) { | ||||||
|         Log.w(TAG,message); |         Log.w(TAG, message); | ||||||
|         appendLog(TAG+" : "+ message); |         appendLog(TAG+" : "+ message); | ||||||
|     } |     } | ||||||
|      |      | ||||||
| @ -100,6 +100,14 @@ public class Log_OC { | |||||||
| 
 | 
 | ||||||
|         } catch (IOException e) { |         } catch (IOException e) { | ||||||
|             e.printStackTrace(); |             e.printStackTrace(); | ||||||
|  |         } finally { | ||||||
|  |             if(mBuf != null) { | ||||||
|  |                 try { | ||||||
|  |                     mBuf.close(); | ||||||
|  |                 } catch(IOException e) { | ||||||
|  |                     e.printStackTrace(); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user