Apply inspections

pull/189/head
Alex Baker 12 years ago
parent 2ad63acef9
commit de251be167

@ -115,10 +115,6 @@ public class UserActivity extends RemoteModel {
setValue(ACTION, action); setValue(ACTION, action);
} }
public void setUUID(String uuid) {
setValue(UUID, uuid);
}
public void setPicture(String picture) { public void setPicture(String picture) {
setValue(PICTURE, picture); setValue(PICTURE, picture);
} }

@ -320,7 +320,7 @@ abstract public class TranslationTests extends AndroidTestCase {
/** /**
* @return an array of all string resource id's * @return an array of all string resource id's
*/ */
public int[] getResourceIds(Class<?> resources) throws Exception { public int[] getResourceIds(Class<?> resources) {
Field[] fields = resources.getDeclaredFields(); Field[] fields = resources.getDeclaredFields();
List<Integer> ids = new ArrayList<>(fields.length); List<Integer> ids = new ArrayList<>(fields.length);
for (Field field : fields) { for (Field field : fields) {

@ -82,7 +82,7 @@ public class MetadataDaoTests extends DatabaseTestCase {
/** /**
* Test metadata bound to task * Test metadata bound to task
*/ */
public void disabled_testMetadataConditions() throws Exception { public void disabled_testMetadataConditions() {
// create "happy" // create "happy"
Metadata metadata = new Metadata(); Metadata metadata = new Metadata();
metadata.setKey("with1"); metadata.setKey("with1");

@ -27,7 +27,7 @@ public class TaskDaoTests extends DatabaseTestCase {
/** /**
* Test basic task creation, fetch, and save * Test basic task creation, fetch, and save
*/ */
public void disabled_testTaskCreation() throws Exception { public void disabled_testTaskCreation() {
TodorooCursor<Task> cursor = taskDao.query( TodorooCursor<Task> cursor = taskDao.query(
Query.select(IDS)); Query.select(IDS));
assertEquals(0, cursor.getCount()); assertEquals(0, cursor.getCount());
@ -75,7 +75,7 @@ public class TaskDaoTests extends DatabaseTestCase {
/** /**
* Test various task fetch conditions * Test various task fetch conditions
*/ */
public void disabled_testTaskConditions() throws Exception { public void disabled_testTaskConditions() {
// create normal task // create normal task
Task task = new Task(); Task task = new Task();
task.setTitle("normal"); task.setTitle("normal");
@ -133,7 +133,7 @@ public class TaskDaoTests extends DatabaseTestCase {
/** /**
* Test task deletion * Test task deletion
*/ */
public void disabled_testTDeletion() throws Exception { public void disabled_testTDeletion() {
TodorooCursor<Task> cursor = taskDao.query( TodorooCursor<Task> cursor = taskDao.query(
Query.select(IDS)); Query.select(IDS));
assertEquals(0, cursor.getCount()); assertEquals(0, cursor.getCount());
@ -160,7 +160,7 @@ public class TaskDaoTests extends DatabaseTestCase {
/** /**
* Test save without prior create doesn't work * Test save without prior create doesn't work
*/ */
public void disabled_testSaveWithoutCreate() throws Exception { public void disabled_testSaveWithoutCreate() {
TodorooCursor<Task> cursor; TodorooCursor<Task> cursor;
// try to save task "happy" // try to save task "happy"
@ -179,7 +179,7 @@ public class TaskDaoTests extends DatabaseTestCase {
/** /**
* Test passing invalid task indices to various things * Test passing invalid task indices to various things
*/ */
public void disabled_testInvalidIndex() throws Exception { public void disabled_testInvalidIndex() {
TodorooCursor<Task> cursor; TodorooCursor<Task> cursor;
cursor = taskDao.query( cursor = taskDao.query(

@ -13,7 +13,7 @@ public class SubtasksMovingTest extends SubtasksTestCase {
private Task A, B, C, D, E, F; private Task A, B, C, D, E, F;
// @Override // @Override
protected void disabled_setUp() throws Exception { protected void disabled_setUp() {
super.setUp(); super.setUp();
createTasks(); createTasks();
TaskListMetadata m = new TaskListMetadata(); TaskListMetadata m = new TaskListMetadata();

@ -30,7 +30,8 @@ public class Freeze {
DateTimeUtils.setCurrentMillisSystem(); DateTimeUtils.setCurrentMillisSystem();
} }
public void thawAfter(@SuppressWarnings("UnusedParameters") Snippet snippet) { @SuppressWarnings("UnusedParameters")
public void thawAfter(Snippet snippet) {
thaw(); thaw();
} }
} }

@ -648,14 +648,9 @@ public class TaskListFragment extends InjectingListFragment implements OnSortSel
syncActionHelper.request(); syncActionHelper.request();
} }
public static int getTaskRowResource() {
return R.layout.task_adapter_row_simple;
}
protected TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor) { protected TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor) {
return new TaskAdapter(preferences, taskAttachmentDao, taskService, this, getTaskRowResource(), return new TaskAdapter(preferences, taskAttachmentDao, taskService, this, cursor, sqlQueryTemplate,
cursor, sqlQueryTemplate,
new OnCompletedTaskListener() { new OnCompletedTaskListener() {
@Override @Override
public void onCompletedTask(Task item, boolean newState) { public void onCompletedTask(Task item, boolean newState) {

@ -157,7 +157,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
protected final Resources resources; protected final Resources resources;
protected final HashMap<Object, Boolean> completedItems = new HashMap<>(0); protected final HashMap<Object, Boolean> completedItems = new HashMap<>(0);
protected OnCompletedTaskListener onCompletedTaskListener = null; protected OnCompletedTaskListener onCompletedTaskListener = null;
protected final int resource; protected final int resource = R.layout.task_adapter_row_simple;
protected final LayoutInflater inflater; protected final LayoutInflater inflater;
private int fontSize; private int fontSize;
private final ScaleAnimation scaleAnimation; private final ScaleAnimation scaleAnimation;
@ -172,17 +172,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
private final Map<Long, TaskAction> taskActionLoader = Collections.synchronizedMap(new HashMap<Long, TaskAction>()); private final Map<Long, TaskAction> taskActionLoader = Collections.synchronizedMap(new HashMap<Long, TaskAction>());
/** public TaskAdapter(ActivityPreferences preferences, TaskAttachmentDao taskAttachmentDao, TaskService taskService, TaskListFragment fragment,
* Constructor
*
* @param resource
* layout resource to inflate
* @param c
* database cursor
* @param onCompletedTaskListener
* task listener. can be null
*/
public TaskAdapter(ActivityPreferences preferences, TaskAttachmentDao taskAttachmentDao, TaskService taskService, TaskListFragment fragment, int resource,
Cursor c, AtomicReference<String> query, OnCompletedTaskListener onCompletedTaskListener) { Cursor c, AtomicReference<String> query, OnCompletedTaskListener onCompletedTaskListener) {
super(ContextManager.getContext(), c, false); super(ContextManager.getContext(), c, false);
this.preferences = preferences; this.preferences = preferences;
@ -190,7 +180,6 @@ public class TaskAdapter extends CursorAdapter implements Filterable {
this.taskService = taskService; this.taskService = taskService;
this.context = ContextManager.getContext(); this.context = ContextManager.getContext();
this.query = query; this.query = query;
this.resource = resource;
this.fragment = fragment; this.fragment = fragment;
this.resources = fragment.getResources(); this.resources = fragment.getResources();
this.onCompletedTaskListener = onCompletedTaskListener; this.onCompletedTaskListener = onCompletedTaskListener;

@ -175,7 +175,7 @@ public class TasksXmlExporter {
fos.close(); fos.close();
} }
private void serializeTagDatas() throws IOException { private void serializeTagDatas() {
tagDataDao.allTags(new Callback<TagData>() { tagDataDao.allTags(new Callback<TagData>() {
@Override @Override
public void apply(TagData tag) { public void apply(TagData tag) {

@ -29,12 +29,9 @@ import javax.inject.Singleton;
@Singleton @Singleton
public class MetadataDao extends DatabaseDao<Metadata> { public class MetadataDao extends DatabaseDao<Metadata> {
private final Database database;
@Inject @Inject
public MetadataDao(Database database) { public MetadataDao(Database database) {
super(Metadata.class); super(Metadata.class);
this.database = database;
setDatabase(database); setDatabase(database);
} }

@ -171,8 +171,7 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
public TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor, public TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor,
AtomicReference<String> sqlQueryTemplate) { AtomicReference<String> sqlQueryTemplate) {
taskAdapter = new DraggableTaskAdapter(preferences, fragment, TaskListFragment.getTaskRowResource(), taskAdapter = new DraggableTaskAdapter(preferences, fragment, cursor, sqlQueryTemplate);
cursor, sqlQueryTemplate);
getTouchListView().setItemHightNormal(taskAdapter.computeFullRowHeight()); getTouchListView().setItemHightNormal(taskAdapter.computeFullRowHeight());
@ -188,9 +187,9 @@ public class AstridOrderedListFragmentHelper<LIST> implements OrderedListFragmen
private final class DraggableTaskAdapter extends TaskAdapter { private final class DraggableTaskAdapter extends TaskAdapter {
private DraggableTaskAdapter(ActivityPreferences preferences, TaskListFragment activity, int resource, private DraggableTaskAdapter(ActivityPreferences preferences, TaskListFragment activity,
Cursor c, AtomicReference<String> query) { Cursor c, AtomicReference<String> query) {
super(preferences, taskAttachmentDao, taskService, activity, resource, c, query, null); super(preferences, taskAttachmentDao, taskService, activity, c, query, null);
} }
@Override @Override

@ -182,8 +182,7 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
public TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor, public TaskAdapter createTaskAdapter(TodorooCursor<Task> cursor,
AtomicReference<String> sqlQueryTemplate) { AtomicReference<String> sqlQueryTemplate) {
taskAdapter = new DraggableTaskAdapter(preferences, fragment, TaskListFragment.getTaskRowResource(), taskAdapter = new DraggableTaskAdapter(preferences, fragment, cursor, sqlQueryTemplate);
cursor, sqlQueryTemplate);
taskAdapter.addOnCompletedTaskListener(new OnCompletedTaskListener() { taskAdapter.addOnCompletedTaskListener(new OnCompletedTaskListener() {
@Override @Override
@ -197,9 +196,9 @@ public class OrderedMetadataListFragmentHelper<LIST> implements OrderedListFragm
private final class DraggableTaskAdapter extends TaskAdapter { private final class DraggableTaskAdapter extends TaskAdapter {
private DraggableTaskAdapter(ActivityPreferences preferences, TaskListFragment activity, int resource, private DraggableTaskAdapter(ActivityPreferences preferences, TaskListFragment activity,
Cursor c, AtomicReference<String> query) { Cursor c, AtomicReference<String> query) {
super(preferences, taskAttachmentDao, taskService, activity, resource, c, query, null); super(preferences, taskAttachmentDao, taskService, activity, c, query, null);
} }
@Override @Override

Loading…
Cancel
Save