Skip to content

Commit 12c6937

Browse files
committed
Merge pull request #218 from lucastan/master
changed to use TextUtils.isEmpty
2 parents 06d0c5d + d0c6055 commit 12c6937

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/com/activeandroid/DatabaseHelper.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import android.content.Context;
3131
import android.database.sqlite.SQLiteDatabase;
3232
import android.database.sqlite.SQLiteOpenHelper;
33+
import android.text.TextUtils;
3334

3435
import com.activeandroid.util.IOUtils;
3536
import com.activeandroid.util.Log;
@@ -196,7 +197,7 @@ private boolean executeMigrations(SQLiteDatabase db, int oldVersion, int newVers
196197

197198
return migrationExecuted;
198199
}
199-
200+
200201
private void executeSqlScript(SQLiteDatabase db, String file) {
201202

202203
InputStream stream = null;
@@ -224,7 +225,7 @@ private void executeSqlScript(SQLiteDatabase db, String file) {
224225
private void executeDelimitedSqlScript(SQLiteDatabase db, InputStream stream) throws IOException {
225226

226227
List<String> commands = SqlParser.parse(stream);
227-
228+
228229
for(String command : commands) {
229230
db.execSQL(command);
230231
}
@@ -239,10 +240,10 @@ private void executeLegacySqlScript(SQLiteDatabase db, InputStream stream) throw
239240
reader = new InputStreamReader(stream);
240241
buffer = new BufferedReader(reader);
241242
String line = null;
242-
243+
243244
while ((line = buffer.readLine()) != null) {
244245
line = line.replace(";", "").trim();
245-
if (!line.isEmpty()) {
246+
if (!TextUtils.isEmpty(line)) {
246247
db.execSQL(line);
247248
}
248249
}

0 commit comments

Comments
 (0)