Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java

Issue 29398555: Issue 5058 - Fix code style in Utils class (Closed)
Patch Set: Created March 30, 2017, 5:38 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
diff --git a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
index 949f206f32ea879b5a91587f7e45d0c6e5464fa3..93611101a97382b42a3dc8f75e682bc741c5a103 100644
--- a/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
+++ b/libadblockplus-android/src/org/adblockplus/libadblockplus/android/Utils.java
@@ -99,26 +99,38 @@ public final class Utils
public static String readAssetAsString(Context context, String filename) throws IOException
{
BufferedReader in = null;
- try {
+ try
+ {
StringBuilder buf = new StringBuilder();
InputStream is = context.getAssets().open(filename);
in = new BufferedReader(new InputStreamReader(is));
String str;
boolean isFirst = true;
- while ( (str = in.readLine()) != null ) {
+ while ((str = in.readLine()) != null)
+ {
if (isFirst)
+ {
isFirst = false;
+ }
else
+ {
buf.append('\n');
+ }
buf.append(str);
}
return buf.toString();
- } finally {
- if (in != null) {
- try {
+ }
+ finally
+ {
+ if (in != null)
+ {
+ try
+ {
in.close();
- } catch (IOException e) {
+ }
+ catch (IOException e)
+ {
// ignored
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld