Skip to content

Commit

Permalink
changed to use TextUtils.isEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Tan committed Apr 20, 2014
1 parent 06d0c5d commit d0c6055
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/com/activeandroid/DatabaseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.text.TextUtils;

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

return migrationExecuted;
}

private void executeSqlScript(SQLiteDatabase db, String file) {

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

List<String> commands = SqlParser.parse(stream);

for(String command : commands) {
db.execSQL(command);
}
Expand All @@ -239,10 +240,10 @@ private void executeLegacySqlScript(SQLiteDatabase db, InputStream stream) throw
reader = new InputStreamReader(stream);
buffer = new BufferedReader(reader);
String line = null;

while ((line = buffer.readLine()) != null) {
line = line.replace(";", "").trim();
if (!line.isEmpty()) {
if (!TextUtils.isEmpty(line)) {
db.execSQL(line);
}
}
Expand Down

0 comments on commit d0c6055

Please sign in to comment.