Remove warning suppressions

Alex Baker 13 years ago
parent 04153aa764
commit fadb5381f5

@ -38,7 +38,7 @@ import java.util.ArrayList;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
abstract public class AbstractDatabase {
// --- abstract methods

@ -166,7 +166,7 @@ public abstract class AbstractModel implements Parcelable, Cloneable {
}
@Override
@SuppressWarnings("nls")
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append(getClass().getSimpleName()).append("\n")

@ -27,7 +27,7 @@ import static com.todoroo.andlib.sql.SqlConstants.SPACE;
* @param <TYPE> a database supported type, such as String or Integer
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public abstract class Property<TYPE> extends Field {
// --- implementation

@ -34,7 +34,7 @@ public final class Table extends SqlTable {
*
* @return property array
*/
@SuppressWarnings("nls")
public Property<?>[] getProperties() {
try {
return (Property<?>[]) modelClass.getField("PROPERTIES").get(null);
@ -65,7 +65,7 @@ public final class Table extends SqlTable {
* @param property
* @return
*/
@SuppressWarnings("nls")
public Field field(Property<?> property) {
if (alias != null) {
return Field.field(alias + "." + property.name);

@ -35,7 +35,7 @@ public class DependencyInjectionService {
*
* @param caller object to perform DI on
*/
@SuppressWarnings("nls")
public void inject(Object caller) {
// Traverse through class and all parent classes, looking for
// fields declared with the @Autowired annotation and using
@ -70,7 +70,7 @@ public class DependencyInjectionService {
}
}
@SuppressWarnings("nls")
private boolean isQualifiedPackage(String packageName) {
if (packageName.startsWith("com.todoroo")) {
return true;
@ -91,7 +91,7 @@ public class DependencyInjectionService {
* @param caller calling object
* @param field field to inject
*/
@SuppressWarnings("nls")
private synchronized void handleField(Object caller, Field field)
throws IllegalStateException, IllegalArgumentException,
IllegalAccessException {
@ -125,7 +125,7 @@ public class DependencyInjectionService {
// --- default dependency injector
private class DefaultDependencyInjector extends AbstractDependencyInjector {
@SuppressWarnings("nls")
@Override
protected void addInjectables() {
injectables.put("debug", false);

@ -60,7 +60,7 @@ public class HttpRestClient implements RestClient {
private int timeout = TIMEOUT_MILLIS;
@SuppressWarnings("nls")
public HttpRestClient() {
DependencyInjectionService.getInstance().inject(this);
@ -99,7 +99,7 @@ public class HttpRestClient implements RestClient {
return httpClient.get();
}
@SuppressWarnings("nls")
protected void actsAsGzippable(DefaultHttpClient client) {
client.addRequestInterceptor(new HttpRequestInterceptor() {
@Override

@ -37,7 +37,7 @@ public class Field extends DBObject<Field> {
* @param value string which field must equal
* @return the criterion
*/
@SuppressWarnings("nls")
public Criterion eqCaseInsensitive(String value) {
if (value == null) {
return UnaryCriterion.isNull(this);

@ -10,7 +10,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
@SuppressWarnings("nls")
public final class Functions {
public static String caseStatement(Criterion when, Object ifTrue, Object ifFalse) {

@ -38,7 +38,7 @@ public class Join {
}
@Override
@SuppressWarnings("nls")
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(joinType).append(SPACE).append(JOIN).append(SPACE).append(joinTable).append(SPACE).append(ON).append(SPACE).append("(");

@ -10,7 +10,7 @@ import java.util.Map;
import static com.todoroo.andlib.sql.SqlConstants.SPACE;
@SuppressWarnings("nls")
public final class Operator {
private final String operator;

@ -145,7 +145,7 @@ public final class Query {
sql.deleteCharAt(sql.length() - 1).append(SPACE);
}
@SuppressWarnings("nls")
private void visitGroupByClause(StringBuilder sql) {
if (groupBies.isEmpty()) {
return;
@ -310,7 +310,7 @@ public final class Query {
/**
* build a content resolver query
*/
@SuppressWarnings("nls")
public static void queryForContentResolver(String queryTemplate,
StringBuilder selectionClause, StringBuilder orderClause,
StringBuilder groupByClause) {

@ -74,7 +74,7 @@ public final class QueryTemplate {
sql.deleteCharAt(sql.length() - 1).append(SPACE);
}
@SuppressWarnings("nls")
private void visitGroupByClause(StringBuilder sql) {
if (groupBies.isEmpty()) {
return;

@ -5,7 +5,7 @@
*/
package com.todoroo.andlib.sql;
@SuppressWarnings("nls")
public final class SqlConstants {
public static final String SELECT = "SELECT";
public static final String DISTINCT = "DISTINCT";

@ -15,7 +15,7 @@ public class SqlTable extends DBObject<SqlTable> {
return new SqlTable(table);
}
@SuppressWarnings("nls")
protected String fieldExpression(String fieldName) {
if (hasAlias()) {
return alias + "." + fieldName;

@ -36,7 +36,7 @@ public class UnaryCriterion extends Criterion {
sb.append(operator);
}
@SuppressWarnings("nls")
protected void afterPopulateOperator(StringBuilder sb) {
if (value == null) {
return;
@ -53,7 +53,7 @@ public class UnaryCriterion extends Criterion {
* @param input
* @return
*/
@SuppressWarnings("nls")
public static String sanitize(String input) {
return input.replace("'", "''");
}
@ -112,7 +112,7 @@ public class UnaryCriterion extends Criterion {
sb.append(SPACE).append(operator).append(SPACE);
}
@SuppressWarnings("nls")
@Override
protected void afterPopulateOperator(StringBuilder sb) {
super.afterPopulateOperator(sb);

@ -425,7 +425,7 @@ public class AndroidUtilities {
public void put(T object, String key, char type, String value) throws NumberFormatException;
}
@SuppressWarnings("nls")
private static <T> void fromSerialized(String string, T object, SerializedPut<T> putter) {
String[] pairs = string.split("\\" + SERIALIZATION_SEPARATOR); //$NON-NLS-1$
for (int i = 0; i < pairs.length; i += 2) {
@ -451,7 +451,7 @@ public class AndroidUtilities {
* @param string
* @return
*/
@SuppressWarnings("nls")
public static ContentValues contentValuesFromString(String string) {
if (string == null) {
return null;
@ -686,7 +686,7 @@ public class AndroidUtilities {
* @param args arguments
* @return method return value, or null if nothing was called or exception
*/
@SuppressWarnings("nls")
public static Object callApiStaticMethod(int minSdk, String className,
String methodName, Class<?>[] params, Object... args) {
if (getSdkVersion() < minSdk) {
@ -712,7 +712,7 @@ public class AndroidUtilities {
* @param args arguments
* @return method return value, or null if nothing was called or exception
*/
@SuppressWarnings("nls")
public static Object callMethod(Class<?> cls, Object receiver,
String methodName, Class<?>[] params, Object... args) {
try {
@ -795,7 +795,7 @@ public class AndroidUtilities {
* @param input
* @return
*/
@SuppressWarnings("nls")
public static String md5(String input) {
try {
byte[] bytesOfMessage = input.getBytes("UTF-8");
@ -1042,7 +1042,7 @@ public class AndroidUtilities {
* @param file
* @return
*/
@SuppressWarnings("nls")
public static String getFileExtension(String file) {
int index = file.lastIndexOf('.');
String extension = "";
@ -1058,7 +1058,7 @@ public class AndroidUtilities {
/**
* Logs a JSONObject using in a readable way
*/
@SuppressWarnings("nls")
public static void logJSONObject(String tag, JSONObject object) {
if (object == null) {
Log.e(tag, "JSONOBject: null");

@ -115,7 +115,7 @@ public class DateUtilities {
* @param date time to format
* @return time, with hours and minutes
*/
@SuppressWarnings("nls")
public static String getTimeString(Context context, Date date, boolean excludeZeroMinutes) {
String value;
if (is24HourFormat(context)) {
@ -143,7 +143,7 @@ public class DateUtilities {
* @param date date to format
* @return date, with month, day, and year
*/
@SuppressWarnings("nls")
public static String getDateString(Context context, Date date, boolean includeYear) {
String month = DateUtils.getMonthString(date.getMonth() +
Calendar.JANUARY, DateUtils.LENGTH_MEDIUM);
@ -179,7 +179,7 @@ public class DateUtilities {
* @param date date to format
* @return date, with month, day, and year
*/
@SuppressWarnings("nls")
public static String getDateStringHideYear(Context context, Date date) {
String month = DateUtils.getMonthString(date.getMonth() +
Calendar.JANUARY, DateUtils.LENGTH_MEDIUM);
@ -210,7 +210,7 @@ public class DateUtilities {
/**
* @return date format as getDateFormat with weekday
*/
@SuppressWarnings("nls")
public static String getDateStringWithWeekday(Context context, Date date) {
String weekday = getWeekday(date);
return weekday + ", " + getDateString(context, date);
@ -236,7 +236,7 @@ public class DateUtilities {
/**
* @return date format as getDateFormat with weekday
*/
@SuppressWarnings("nls")
public static String getDateStringWithTimeAndWeekday(Context context, Date date) {
return getDateStringWithWeekday(context, date) + " " + getTimeString(context, date);
}
@ -244,7 +244,7 @@ public class DateUtilities {
/**
* @return date with time at the end
*/
@SuppressWarnings("nls")
public static String getDateStringWithTime(Context context, Date date) {
return getDateString(context, date) + " " + getTimeString(context, date);
}

@ -55,7 +55,7 @@ public class DialogUtilities {
* @param html
* @param title
*/
@SuppressWarnings("nls")
public static void htmlDialog(Context context, String html, int title) {
WebView webView = new WebView(context);
webView.loadDataWithBaseURL("file:///android_asset/", html, "text/html", "utf-8", null);

@ -13,7 +13,7 @@ import android.widget.RemoteViews;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public class AstridApiConstants {
// --- General Constants

@ -69,7 +69,7 @@ public class FilterCategoryWithNewButton extends FilterCategory {
/**
* Parcelable creator
*/
@SuppressWarnings("hiding")
public static final Parcelable.Creator<FilterCategoryWithNewButton> CREATOR = new Parcelable.Creator<FilterCategoryWithNewButton>() {
/**

@ -86,7 +86,7 @@ public class FilterWithCustomIntent extends Filter {
/**
* Parcelable Creator Object
*/
@SuppressWarnings("hiding")
public static final Parcelable.Creator<FilterWithCustomIntent> CREATOR = new Parcelable.Creator<FilterWithCustomIntent>() {
/**

@ -67,7 +67,7 @@ public class FilterWithUpdate extends FilterWithCustomIntent {
/**
* Parcelable Creator Object
*/
@SuppressWarnings("hiding")
public static final Parcelable.Creator<FilterWithUpdate> CREATOR = new Parcelable.Creator<FilterWithUpdate>() {
/**

@ -49,7 +49,7 @@ public class SortHelper {
* @param sort
* @return
*/
@SuppressWarnings("nls")
public static String adjustQueryForFlagsAndSort(String originalSql, int flags, int sort) {
// sort
if (originalSql == null) {
@ -93,7 +93,7 @@ public class SortHelper {
return flags;
}
@SuppressWarnings("nls")
public static Order orderForSortType(int sortType) {
Order order;
switch (sortType) {
@ -129,7 +129,7 @@ public class SortHelper {
*
* @return
*/
@SuppressWarnings("nls")
public static Order defaultTaskOrder() {
return Order.asc(Functions.caseStatement(Task.DUE_DATE.eq(0),
Functions.now() + "*2",
@ -137,7 +137,7 @@ public class SortHelper {
Task.IMPORTANCE + " + 2*" + Task.COMPLETION_DATE);
}
@SuppressWarnings("nls")
private static String adjustedDueDateFunction() {
return new StringBuilder("(CASE WHEN (").append(Task.DUE_DATE.name).append(" / 1000) % 60 > 0")
.append(" THEN ").append(Task.DUE_DATE.name).append(" ELSE ").append("(").append(Task.DUE_DATE.name)

@ -11,7 +11,7 @@ import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.api.AstridApiConstants;
@SuppressWarnings("nls")
public class History extends AbstractModel {
/**

@ -22,7 +22,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public class Metadata extends AbstractModel {
// --- table

@ -4,7 +4,7 @@ import com.todoroo.andlib.data.AbstractModel;
import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
@SuppressWarnings("nls")
public abstract class OutstandingEntry<TYPE extends RemoteModel> extends AbstractModel {
public static final String ENTITY_ID_PROPERTY_NAME = "entityId";

@ -155,7 +155,7 @@ abstract public class RemoteModel extends AbstractModel {
return String.format("cached::%s%s", tagData.getValue(TagData.NAME), tag_date);
}
@SuppressWarnings("nls")
public static JSONObject savePictureJson(Context context, Bitmap bitmap) {
try {
String name = DateUtilities.now() + ".jpg";
@ -207,7 +207,7 @@ abstract public class RemoteModel extends AbstractModel {
}
}
@SuppressWarnings("nls")
public static Bitmap getPictureBitmap(String value) {
try {
if (value == null) {

@ -22,7 +22,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public class StoreObject extends AbstractModel {
// --- table

@ -5,7 +5,7 @@
*/
package com.todoroo.astrid.data;
@SuppressWarnings("nls")
public class SyncFlags {
public static final String GTASKS_SUPPRESS_SYNC = "gtasks_suppress_sync";

@ -23,7 +23,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public final class TagData extends RemoteModel {
// --- table and uri

@ -11,7 +11,7 @@ import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.api.AstridApiConstants;
@SuppressWarnings("nls")
public class TagMetadata extends AbstractModel {
public static final Table TABLE = new Table("tag_metadata", TagMetadata.class);

@ -8,7 +8,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
@SuppressWarnings("nls")
public class TagOutstanding extends OutstandingEntry<TagData> {
/**

@ -28,7 +28,7 @@ import java.util.Date;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public final class Task extends RemoteModel {
// --- table and uri

@ -110,7 +110,7 @@ public class TaskApiDao extends ContentResolverDao<Task> {
/**
* @return tasks that have a blank or null title
*/
@SuppressWarnings("nls")
public static Criterion hasNoTitle() {
return Criterion.or(Task.TITLE.isNull(), Task.TITLE.eq(""));
}

@ -24,7 +24,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public final class TaskAttachment extends RemoteModel {
// --- table and uri

@ -8,7 +8,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
@SuppressWarnings("nls")
public class TaskAttachmentOutstanding extends OutstandingEntry<TaskAttachment> {
/**

@ -24,7 +24,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public final class TaskListMetadata extends RemoteModel {
// --- table and uri

@ -8,7 +8,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
@SuppressWarnings("nls")
public class TaskListMetadataOutstanding extends OutstandingEntry<TaskListMetadata> {
/**

@ -8,7 +8,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
@SuppressWarnings("nls")
public class TaskOutstanding extends OutstandingEntry<Task> {
/**

@ -22,7 +22,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
@Deprecated
public class Update extends RemoteModel {

@ -23,7 +23,7 @@ import com.todoroo.astrid.api.AstridApiConstants;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public final class User extends RemoteModel {
// --- table and uri

@ -11,7 +11,7 @@ import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.api.AstridApiConstants;
@SuppressWarnings("nls")
public class UserActivity extends RemoteModel {
// --- table

@ -8,7 +8,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
@SuppressWarnings("nls")
public class UserActivityOutstanding extends OutstandingEntry<UserActivity> {
/**

@ -12,7 +12,7 @@ import com.todoroo.andlib.data.Table;
import com.todoroo.andlib.data.TodorooCursor;
import com.todoroo.astrid.api.AstridApiConstants;
@SuppressWarnings("nls")
public class WaitingOnMe extends RemoteModel {
/**

@ -8,7 +8,7 @@ import com.todoroo.andlib.data.Property.LongProperty;
import com.todoroo.andlib.data.Property.StringProperty;
import com.todoroo.andlib.data.Table;
@SuppressWarnings("nls")
public class WaitingOnMeOutstanding extends OutstandingEntry<WaitingOnMe> {
/**

@ -239,7 +239,7 @@ public abstract class SyncProvider<TYPE extends SyncContainer> {
readRemotelyUpdated(data);
}
@SuppressWarnings("nls")
protected String getFinalSyncStatus() {
if (getUtilities().getLastError() != null || getUtilities().getLastAttemptedSyncDate() != 0) {
if (getUtilities().getLastAttemptedSyncDate() == 0) {

@ -188,7 +188,7 @@ abstract public class SyncProviderPreferences extends TodorooPreferenceActivity
preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
@Override
@SuppressWarnings("nls")
public boolean onPreferenceClick(Preference pref) {
// Show last error
new AlertDialog.Builder(SyncProviderPreferences.this)
@ -251,7 +251,7 @@ abstract public class SyncProviderPreferences extends TodorooPreferenceActivity
*/
private static HashMap<String, Integer> exceptionsToDisplayMessages;
@SuppressWarnings("nls")
private static HashMap<String, Integer> getExceptionMap() {
if (exceptionsToDisplayMessages == null) {
exceptionsToDisplayMessages = new HashMap<String, Integer>();

@ -37,7 +37,7 @@ import com.timsu.astrid.R;
import com.todoroo.andlib.utility.AndroidUtilities;
import com.todoroo.astrid.ui.ErrorCatchingListView;
@SuppressWarnings("nls")
public class TouchListView extends ErrorCatchingListView {
private ImageView mDragView;
private View mOriginalView;

@ -20,7 +20,7 @@ import com.mdimension.jchronic.utils.Token;
import java.util.LinkedList;
import java.util.List;
@SuppressWarnings("nls")
public class AstridChronic {
public static final String VERSION = "0.2.3";
@ -71,7 +71,7 @@ public class AstridChronic {
* will be made, and the first matching instance of that time will
* be used.
*/
@SuppressWarnings("unchecked")
public static Span parse(String text, Options options) {
// store now for later =)
//_now = options.getNow();

@ -25,7 +25,7 @@ import android.support.v4.util.LruCache;
public class DrawableMemCache<T> extends LruCache<T, Drawable> {
@SuppressWarnings("unused")
private static final String TAG = DrawableMemCache.class.getSimpleName();
public DrawableMemCache(int maxSize) {

@ -50,7 +50,7 @@ import com.todoroo.astrid.utility.Constants;
import java.io.IOException;
@SuppressWarnings("nls")
public class GCMIntentService extends GCMBaseIntentService {
public static final String SENDER_ID = "1003855277730"; //$NON-NLS-1$

@ -57,7 +57,7 @@ public class ActFmCameraModule {
android.R.layout.simple_spinner_dropdown_item, options.toArray(new String[options.size()]));
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@SuppressWarnings("nls")
@Override
public void onClick(DialogInterface d, int which) {
if (which == 0 && cameraAvailable) {
@ -107,7 +107,7 @@ public class ActFmCameraModule {
android.R.layout.simple_spinner_dropdown_item, options.toArray(new String[options.size()]));
DialogInterface.OnClickListener listener = new DialogInterface.OnClickListener() {
@SuppressWarnings("nls")
@Override
public void onClick(DialogInterface d, int which) {
if (which == 0 && cameraAvailable) {
@ -135,7 +135,7 @@ public class ActFmCameraModule {
.show().setOwnerActivity(fragment.getActivity());
}
@SuppressWarnings("nls")
private static File getTempFile(Activity activity) {
try {
String storageState = Environment.getExternalStorageState();

@ -243,7 +243,7 @@ public class EditPeopleControlSet extends PopupControlSet {
}
}
@SuppressWarnings("nls")
private void buildAssignedToSpinner(Task t, ArrayList<JSONObject> sharedWith) {
HashSet<String> userIds = new HashSet<String>();
HashSet<String> emails = new HashSet<String>();
@ -360,7 +360,7 @@ public class EditPeopleControlSet extends PopupControlSet {
}
}
@SuppressWarnings("nls")
private ArrayList<AssignedToUser> convertJsonUsersToAssignedUsers(ArrayList<JSONObject> jsonUsers,
HashSet<String> userIds, HashSet<String> emails, HashMap<String, AssignedToUser> names) {
ArrayList<AssignedToUser> users = new ArrayList<AssignedToUser>();
@ -412,7 +412,7 @@ public class EditPeopleControlSet extends PopupControlSet {
return users;
}
@SuppressWarnings("nls")
private int findAssignedIndex(Task t, ArrayList<AssignedToUser>... userLists) {
String assignedStr = t.getValue(Task.USER);
String assignedId = Task.USER_ID_IGNORE;
@ -495,7 +495,7 @@ public class EditPeopleControlSet extends PopupControlSet {
this.positionOffset = positionOffset;
}
@SuppressWarnings("nls")
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
@ -618,7 +618,7 @@ public class EditPeopleControlSet extends PopupControlSet {
* @param toast toast to show after saving is finished
* @return false if login is required & save should be halted
*/
@SuppressWarnings("nls")
public boolean saveSharingSettings(String toast) {
if (task == null) {
return false;
@ -665,7 +665,7 @@ public class EditPeopleControlSet extends PopupControlSet {
String taskUserId = Task.USER_ID_EMAIL;
String taskUserEmail = "";
try {
@SuppressWarnings("deprecation") // For backwards compatibility
// For backwards compatibility
JSONObject taskUser = new JSONObject(task.getValue(Task.USER));
taskUserId = getLongOrStringId(taskUser, Task.USER_ID_EMAIL);
taskUserEmail = taskUser.optString("email");

@ -292,7 +292,7 @@ public class TagSettingsActivity extends SherlockFragmentActivity {
}
}
@SuppressWarnings("nls")
private void saveSettings() {
String oldName = tagData.getValue(TagData.NAME);
String newName = tagName.getText().toString().trim();
@ -448,7 +448,7 @@ public class TagSettingsActivity extends SherlockFragmentActivity {
}
@SuppressWarnings("nls")
private void updateMembers(String peopleJson, String tagUuid) {
tagMembers.removeAllViews();
JSONArray people = null;

@ -608,7 +608,7 @@ public class TagViewFragment extends TaskListFragment {
}
}
@SuppressWarnings("nls")
private void addImageForMember(LinearLayout membersView, JSONObject member) {
DisplayMetrics displayMetrics = new DisplayMetrics();
getActivity().getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
@ -647,7 +647,7 @@ public class TagViewFragment extends TaskListFragment {
return new OnClickListener() {
final String email = member.optString("email"); //$NON-NLS-1$
@SuppressWarnings("deprecation")
@Override
public void onClick(View v) {
if (currentId.equals(id)) {
@ -693,7 +693,7 @@ public class TagViewFragment extends TaskListFragment {
setUpTaskList();
}
@SuppressWarnings("nls")
private String displayName(JSONObject user) {
String name = user.optString("name");
if (!TextUtils.isEmpty(name) && !"null".equals(name)) {
@ -719,7 +719,7 @@ public class TagViewFragment extends TaskListFragment {
// --- receivers
private final BroadcastReceiver notifyReceiver = new BroadcastReceiver() {
@SuppressWarnings("nls")
@Override
public void onReceive(Context context, Intent intent) {
if (!intent.hasExtra("tag_id")) {

@ -36,7 +36,7 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.TimeZone;
@SuppressWarnings("nls")
public class ActFmInvoker {
/**

@ -155,7 +155,7 @@ public class ActFmPreferenceService extends SyncProviderUtilities {
populateUser();
}
@SuppressWarnings("nls")
private static void populateUser() {
try {
user.put("name", Preferences.getStringValue(PREF_NAME));
@ -211,7 +211,7 @@ public class ActFmPreferenceService extends SyncProviderUtilities {
return name;
}
@SuppressWarnings("nls")
public static String thisUserName() {
JSONObject thisUser = thisUser();

@ -33,7 +33,7 @@ import java.util.List;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public final class ActFmSyncService {
// --- instance variables

@ -248,7 +248,7 @@ public class ActFmSyncThread {
public void runOnErrors(List<JSONArray> errors) {/**/}
};
@SuppressWarnings("nls")
private void sync() {
try {
int batchSize = 4;
@ -433,7 +433,7 @@ public class ActFmSyncThread {
private JSONObject clientVersion = null;
@SuppressWarnings("nls")
private JSONObject getClientVersion() {
if (clientVersion == null) {
try {

@ -104,7 +104,7 @@ public class ActFmSyncV2Provider extends SyncV2Provider {
/**
* fetch user status hash
*/
@SuppressWarnings("nls")
public void updateUserStatus() {
if (Preferences.getStringValue(GCMIntentService.PREF_NEEDS_REGISTRATION) != null) {
actFmSyncService.setGCMRegistration(Preferences.getStringValue(GCMIntentService.PREF_NEEDS_REGISTRATION));

@ -51,7 +51,7 @@ import com.todoroo.astrid.tags.TaskToTagMetadata;
import java.util.HashSet;
import java.util.Set;
@SuppressWarnings("nls")
public class AstridNewSyncMigrator {
@Autowired
@ -86,7 +86,7 @@ public class AstridNewSyncMigrator {
DependencyInjectionService.getInstance().inject(this);
}
@SuppressWarnings("deprecation")
public void performMigration() {
if (Preferences.getBoolean(PREF_SYNC_MIGRATION, false)) {
return;

@ -40,7 +40,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
@SuppressWarnings("nls")
public class ChangesHappened<TYPE extends RemoteModel, OE extends OutstandingEntry<TYPE>> extends ClientToServerMessage<TYPE> {
private static final String ERROR_TAG = "actfm-changes-happened";

@ -11,7 +11,7 @@ import org.apache.http.entity.mime.MultipartEntity;
import org.json.JSONException;
import org.json.JSONObject;
@SuppressWarnings("nls")
public abstract class ClientToServerMessage<TYPE extends RemoteModel> {
protected final Class<TYPE> modelClass;

@ -15,7 +15,7 @@ import com.todoroo.astrid.dao.RemoteModelDao;
import com.todoroo.astrid.data.OutstandingEntry;
import com.todoroo.astrid.data.RemoteModel;
@SuppressWarnings("nls")
public class ConstructOutstandingTableFromMasterTable<TYPE extends RemoteModel, OE extends OutstandingEntry<TYPE>> {
protected final String table;

@ -12,7 +12,7 @@ public class Debug extends ServerToClientMessage {
}
@Override
@SuppressWarnings("nls")
public void processMessage(String serverTime) {
String message = json.optString("message");
if (!TextUtils.isEmpty(message)) {

@ -65,7 +65,7 @@ public class FetchHistory<TYPE extends RemoteModel> {
this.done = done;
}
@SuppressWarnings("nls")
public void execute() {
new Thread(new Runnable() {
@Override

@ -17,7 +17,7 @@ import org.json.JSONException;
import org.json.JSONObject;
@SuppressWarnings("nls")
public class JSONChangeToPropertyVisitor implements PropertyVisitor<Void, String> {
private static final String ERROR_TAG = "actfm-make-changes";

@ -41,7 +41,7 @@ import java.text.ParseException;
import java.util.ArrayList;
import java.util.Iterator;
@SuppressWarnings("nls")
public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage {
private static final String ERROR_TAG = "actfm-make-changes";
@ -217,7 +217,7 @@ public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage
super(model, changes, uuid);
}
@SuppressWarnings("deprecation")
@Override
public void performChanges() {
JSONArray addMembers = changes.optJSONArray("member_added");
@ -237,7 +237,7 @@ public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage
this.oldUuid = oldUuid;
}
@SuppressWarnings("null")
@Override
public void performChanges() {
if (!TextUtils.isEmpty(oldUuid) && !oldUuid.equals(uuid)) {
@ -332,7 +332,7 @@ public class MakeChanges<TYPE extends RemoteModel> extends ServerToClientMessage
this.oldUuid = oldUuid;
}
@SuppressWarnings("null")
@Override
public void performChanges() {
if (!TextUtils.isEmpty(oldUuid) && !oldUuid.equals(uuid)) {

@ -17,7 +17,7 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@SuppressWarnings("nls")
public class NameMaps {
// --------------------------------

@ -16,7 +16,7 @@ import org.json.JSONObject;
import java.text.ParseException;
@SuppressWarnings("nls")
public class NowBriefed<TYPE extends RemoteModel> extends ServerToClientMessage {
private static final String ERROR_TAG = "actfm-now-briefed";

@ -15,7 +15,7 @@ import com.todoroo.astrid.data.OutstandingEntry;
import com.todoroo.astrid.data.RemoteModel;
import com.todoroo.astrid.data.SyncFlags;
@SuppressWarnings("nls")
public class ReplayOutstandingEntries<T extends RemoteModel, OE extends OutstandingEntry<T>> {
private static final String ERROR_TAG = "actfm-replay-outstanding";

@ -11,7 +11,7 @@ import com.todoroo.astrid.data.WaitingOnMe;
import org.json.JSONObject;
@SuppressWarnings("nls")
public abstract class ServerToClientMessage {
public abstract void processMessage(String serverTime);

@ -19,7 +19,7 @@ public class UserData extends ServerToClientMessage {
}
@Override
@SuppressWarnings("nls")
public void processMessage(String serverTime) {
String uuid = json.optString("uuid");
String email = json.optString("email");

@ -186,7 +186,7 @@ public class AlarmService {
*
* @param shouldPerformPropertyCheck whether to check if task has requisite properties
*/
@SuppressWarnings("nls")
private void scheduleAlarm(Metadata alarm) {
if (alarm == null) {
return;

@ -14,7 +14,7 @@ import java.io.File;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public class BackupConstants {
// Do NOT edit the constants in this file! You will break compatibility with old backups

@ -17,7 +17,7 @@ import java.util.Date;
*
* @author Tim Su <tim@todoroo.com>
*/
@SuppressWarnings("nls")
public class BackupDateUtilities {
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ssz";

@ -16,7 +16,7 @@ import com.todoroo.andlib.utility.AndroidUtilities;
import java.io.File;
import java.io.FilenameFilter;
@SuppressWarnings("nls")
public class FilePickerBuilder extends AlertDialog.Builder implements DialogInterface.OnClickListener {
public interface OnFilePickedListener {

@ -157,7 +157,7 @@ public class TasksXmlExporter {
}
@SuppressWarnings("nls")
private void doTasksExport(String output) throws IOException {
File xmlFile = new File(output);
xmlFile.createNewFile();

@ -133,7 +133,7 @@ public class TasksXmlImporter {
}).start();
}
@SuppressWarnings("nls")
private void performImport() throws IOException, XmlPullParserException {
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
XmlPullParser xpp = factory.newPullParser();
@ -248,7 +248,7 @@ public class TasksXmlImporter {
}
}
@SuppressWarnings("nls")
private void parseTask() {
taskCount++;
setProgressMessage(context.getString(R.string.import_progress_read,
@ -496,7 +496,7 @@ public class TasksXmlImporter {
tags.clear();
}
@SuppressWarnings("nls")
private Task parseTask() {
taskCount++;
setProgressMessage(context.getString(R.string.import_progress_read,
@ -559,7 +559,7 @@ public class TasksXmlImporter {
/**
* helper method to set field on a task
*/
@SuppressWarnings("nls")
private boolean setTaskField(Task task, String field, String value) {
if (field.equals(LegacyTaskModel.ID)) {
// ignore

@ -23,7 +23,7 @@ import com.todoroo.andlib.utility.Preferences;
import java.util.Date;
@SuppressWarnings("nls")
public class PhoneStateChangedReceiver extends BroadcastReceiver {
private static final String PREF_LAST_INCOMING_NUMBER = "last_incoming_number";

@ -17,7 +17,7 @@ public class CorePlugin extends BroadcastReceiver {
static final String IDENTIFIER = "core"; //$NON-NLS-1$
@Override
@SuppressWarnings("nls")
public void onReceive(Context context, Intent intent) {
Addon plugin = new Addon(IDENTIFIER, "Core Filters", "Todoroo",
"Provides 'Inbox', 'Search', and 'More...' Filters");

@ -108,7 +108,7 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
*/
public int start, end, max;
@SuppressWarnings("nls")
public String getTitleFromCriterion() {
if (criterion instanceof MultipleSelectCriterion) {
if (selectedIndex >= 0 && ((MultipleSelectCriterion) criterion).entryTitles != null &&
@ -199,7 +199,7 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
* Populate criteria list with built in and plugin criteria. The request is sent to every application
* registered to listen for this broadcast. Each plugin can then add criteria to this activity.
*/
@SuppressWarnings("nls")
private void populateCriteria() {
Intent broadcastIntent = new Intent(AstridApiConstants.BROADCAST_REQUEST_CUSTOM_FILTER_CRITERIA);
sendOrderedBroadcast(broadcastIntent, AstridApiConstants.PERMISSION_READ);
@ -387,7 +387,7 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
}
}
@SuppressWarnings("nls")
void saveAndView() {
StringBuilder sql = new StringBuilder(" WHERE ");
StringBuilder suggestedTitle = new StringBuilder();
@ -456,7 +456,7 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
/**
* Recalculate all sizes
*/
@SuppressWarnings("nls")
void updateList() {
int max = 0, last = -1;
@ -512,7 +512,7 @@ public class CustomFilterActivity extends SherlockFragmentActivity {
adapter.notifyDataSetInvalidated();
}
@SuppressWarnings("nls")
private <V> V getNth(int index, Map<?, V> map) {
int i = 0;
for (V v : map.values()) {

@ -184,7 +184,7 @@ public class CustomFilterAdapter extends ArrayAdapter<CriterionInstance> {
public FilterView filterView;
}
@SuppressWarnings("nls")
private void initializeView(View convertView) {
ViewHolder viewHolder = (ViewHolder) convertView.getTag();
CriterionInstance item = viewHolder.item;

@ -79,7 +79,7 @@ public class LinkActionExposer {
return null;
}
@SuppressWarnings("nls")
private static TaskAction createLinkAction(Context context, long id, String url, String text, PackageManager pm) {
Intent itemIntent = new Intent(Intent.ACTION_VIEW);
itemIntent.setData(Uri.parse(url));

@ -27,7 +27,7 @@ public class FileUtilities {
return DateUtilities.getDateStringHideYear(context, date) + ", " + getTimeStringForFilename(context, date); //$NON-NLS-1$
}
@SuppressWarnings("nls")
private static String getTimeStringForFilename(Context context, Date date) {
String value;
if (DateUtilities.is24HourFormat(context)) {

@ -19,7 +19,7 @@ public class FilesAction extends TaskAction {
// /**
// * Parcelable creator
// */
// @SuppressWarnings("hiding")
//
// public static final Parcelable.Creator<FilesAction> CREATOR = new Parcelable.Creator<FilesAction>() {
// /**
// * {@inheritDoc}

@ -314,7 +314,7 @@ public class FilesControlSet extends PopupControlSet {
}, null);
}
@SuppressWarnings("nls")
private void downloadFile(final TaskAttachment m) {
final ProgressDialog pd = new ProgressDialog(activity);
pd.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
@ -434,7 +434,7 @@ public class FilesControlSet extends PopupControlSet {
return name.substring(0, extension);
}
@SuppressWarnings("nls")
private String getTypeString(String name) {
int extension = name.lastIndexOf('.');
if (extension < 0 || extension + 1 >= name.length()) {

@ -22,7 +22,7 @@ import java.util.ArrayList;
import java.util.HashSet;
import java.util.Set;
@SuppressWarnings("nls")
public class CalendarAlarmReceiver extends BroadcastReceiver {
public static final int REQUEST_CODE_CAL_REMINDER = 100;

@ -16,7 +16,7 @@ import com.todoroo.astrid.utility.Constants;
import java.util.Date;
@SuppressWarnings("nls")
public class CalendarAlarmScheduler {
public static final String TAG = "calendar-alarm";

@ -33,7 +33,7 @@ import com.todoroo.astrid.utility.Constants;
import java.util.Date;
@SuppressWarnings("nls")
public class CalendarReminderActivity extends Activity {
public static final String TOKEN_NAMES = "names";

@ -22,7 +22,7 @@ import com.todoroo.andlib.utility.Preferences;
import java.util.ArrayList;
import java.util.Arrays;
@SuppressWarnings("nls")
public class Calendars {
public static final String CALENDAR_CONTENT_CALENDARS = "calendars";

@ -135,7 +135,7 @@ public class GCalControlSet extends PopupControlSet {
}
}
@SuppressWarnings("nls")
@Override
protected String writeToModelAfterInitialized(Task task) {
if (!task.hasDueDate()) {
@ -200,7 +200,7 @@ public class GCalControlSet extends PopupControlSet {
return null;
}
@SuppressWarnings("nls")
private void viewCalendarEvent() {
if (calendarUri == null) {
return;

@ -70,7 +70,7 @@ public class GCalHelper {
return createTaskEvent(task, cr, values, true);
}
@SuppressWarnings("nls")
public static Uri createTaskEvent(Task task, ContentResolver cr, ContentValues values, boolean deleteEventIfExists) {
String eventuri = getTaskEventUri(task);
@ -143,7 +143,7 @@ public class GCalHelper {
}
}
@SuppressWarnings("nls")
public static boolean deleteTaskEvent(Task task) {
boolean eventDeleted = false;
String uri;
@ -184,7 +184,7 @@ public class GCalHelper {
return eventDeleted;
}
@SuppressWarnings("nls")
static void createStartAndEndDate(Task task, ContentValues values) {
long dueDate = task.getValue(Task.DUE_DATE);
long tzCorrectedDueDate = dueDate + TimeZone.getDefault().getOffset(dueDate);
@ -219,7 +219,7 @@ public class GCalHelper {
adjustDateForIcs(values);
}
@SuppressWarnings("nls")
private static void adjustDateForIcs(ContentValues values) {
if (AndroidUtilities.getSdkVersion() >= 14) {
if ("1".equals(values.get("allDay"))) {

@ -22,7 +22,7 @@ import com.todoroo.astrid.data.Task;
public class GCalTaskCompleteListener extends BroadcastReceiver {
@SuppressWarnings("nls")
@Override
public void onReceive(Context context, Intent intent) {
ContextManager.setContext(context);

@ -42,7 +42,7 @@ public class GtasksCustomFilterCriteriaExposer extends BroadcastReceiver {
AstridDependencyInjector.initialize();
}
@SuppressWarnings("nls")
@Override
public void onReceive(Context context, Intent intent) {
ContextManager.setContext(context);

@ -90,7 +90,7 @@ public class GtasksListService {
*
* @param remoteLists remote information about your lists
*/
@SuppressWarnings("nls")
public synchronized void updateLists(TaskLists remoteLists) {
readLists();

@ -141,7 +141,7 @@ public final class GtasksMetadataService extends SyncMetadataService<GtasksTaskC
iterateThroughList(listId, iterator, 0, false);
}
@SuppressWarnings("nls")
public void iterateThroughList(String listId, OrderedListIterator iterator, long startAtOrder, boolean reverse) {
Field orderField = Functions.cast(GtasksMetadata.ORDER, "LONG");
Order order = reverse ? Order.desc(orderField) : Order.asc(orderField);

@ -10,7 +10,7 @@ import com.google.api.client.util.DateTime;
import java.util.Date;
import java.util.TimeZone;
@SuppressWarnings("nls")
public class GtasksApiUtilities {
public static DateTime unixTimeToGtasksCompletionTime(long time) {

@ -30,7 +30,7 @@ import java.io.IOException;
*
* @author Sam Bosley
*/
@SuppressWarnings("nls")
public class GtasksInvoker {
private Tasks service;
private GoogleAccessProtectedResource accessProtectedResource;

@ -23,7 +23,7 @@ import com.todoroo.astrid.gtasks.api.GtasksInvoker;
import java.io.IOException;
@SuppressWarnings("nls")
public class GtasksTokenValidator {
private static final String TOKEN_INTENT_RECEIVED = "intent!"; //$NON-NLS-1$

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save