1
0
mirror of https://github.com/nerzhul/ownCloud-SMS-App.git synced 2025-06-08 08:26:09 +00:00

Remove a useless try/catch

This commit is contained in:
Loic Blot 2017-09-04 22:28:42 +02:00
parent 0407f719ef
commit 56eecb98bc
No known key found for this signature in database
GPG Key ID: EFAA458E8C153987
2 changed files with 21 additions and 32 deletions

View File

@ -48,7 +48,6 @@ public class AndroidSmsFetcher {
do { do {
SmsEntry entry = new SmsEntry(); SmsEntry entry = new SmsEntry();
try {
for (int idx = 0; idx < c.getColumnCount(); idx++) { for (int idx = 0; idx < c.getColumnCount(); idx++) {
handleProviderColumn(c, idx, entry); handleProviderColumn(c, idx, entry);
} }
@ -56,10 +55,6 @@ public class AndroidSmsFetcher {
// Mailbox ID is required by server // Mailbox ID is required by server
entry.mailboxId = mbID.ordinal(); entry.mailboxId = mbID.ordinal();
smsBuffer.push(mbID, entry); smsBuffer.push(mbID, entry);
} catch (JSONException e) {
Log.e(AndroidSmsFetcher.TAG, "JSON Exception when reading SMS Mailbox", e);
}
} }
while (c.moveToNext()); while (c.moveToNext());
} }
@ -106,7 +101,6 @@ public class AndroidSmsFetcher {
SmsEntry entry = new SmsEntry(); SmsEntry entry = new SmsEntry();
SmsBuffer results = new SmsBuffer(); SmsBuffer results = new SmsBuffer();
try {
Integer mboxId = -1; Integer mboxId = -1;
for (int idx = 0; idx < c.getColumnCount(); idx++) { for (int idx = 0; idx < c.getColumnCount(); idx++) {
Integer rid = handleProviderColumn(c, idx, entry); Integer rid = handleProviderColumn(c, idx, entry);
@ -122,9 +116,6 @@ public class AndroidSmsFetcher {
*/ */
entry.mailboxId = mboxId - 1; entry.mailboxId = mboxId - 1;
results.push(mbID, entry); results.push(mbID, entry);
} catch (JSONException e) {
Log.e(AndroidSmsFetcher.TAG, "JSON Exception when reading SMS Mailbox", e);
}
c.close(); c.close();
@ -160,7 +151,7 @@ public class AndroidSmsFetcher {
c.close(); c.close();
} }
private Integer handleProviderColumn(Cursor c, int idx, SmsEntry entry) throws JSONException { private Integer handleProviderColumn(Cursor c, int idx, SmsEntry entry) {
String colName = c.getColumnName(idx); String colName = c.getColumnName(idx);
// Id column is must be an integer // Id column is must be an integer

View File

@ -1,7 +1,5 @@
package fr.unix_experience.owncloud_sms.jni; package fr.unix_experience.owncloud_sms.jni;
import org.json.JSONException;
import fr.unix_experience.owncloud_sms.engine.SmsEntry; import fr.unix_experience.owncloud_sms.engine.SmsEntry;
import fr.unix_experience.owncloud_sms.enums.MailboxID; import fr.unix_experience.owncloud_sms.enums.MailboxID;
@ -48,7 +46,7 @@ public class SmsBuffer {
public native void print(); public native void print();
public native String asRawJsonString(); public native String asRawJsonString();
public void push(MailboxID mbid, SmsEntry smsEntry) throws JSONException { public void push(MailboxID mbid, SmsEntry smsEntry) {
push(smsEntry.id, push(smsEntry.id,
mbid.ordinal(), mbid.ordinal(),
smsEntry.type, smsEntry.type,