Remove unused return values

Alex Baker 13 years ago
parent 1833726c10
commit 6a5e65184d

@ -665,14 +665,13 @@ public class AndroidUtilities {
* @param args arguments
* @return method return value, or null if nothing was called or exception
*/
public static Object callApiMethod(int minSdk, Object receiver,
public static void callApiMethod(int minSdk, Object receiver,
String methodName, Class<?>[] params, Object... args) {
if (getSdkVersion() < minSdk) {
return null;
return;
}
return AndroidUtilities.callMethod(receiver.getClass(),
receiver, methodName, params, args);
AndroidUtilities.callMethod(receiver.getClass(), receiver, methodName, params, args);
}
/**

@ -80,7 +80,7 @@ public abstract class SyncProvider<TYPE extends SyncContainer> {
*
* @param task task to create
*/
abstract protected TYPE create(TYPE task) throws IOException;
abstract protected void create(TYPE task) throws IOException;
/**
* Push variables from given task to the remote server, and read the newly

@ -149,7 +149,7 @@ public class ActFmSyncThread {
return instance;
}
public static ActFmSyncThread initializeSyncComponents(TaskDao taskDao, TagDataDao tagDataDao, UserActivityDao userActivityDao,
public static void initializeSyncComponents(TaskDao taskDao, TagDataDao tagDataDao, UserActivityDao userActivityDao,
TaskAttachmentDao taskAttachmentDao, TaskListMetadataDao taskListMetadataDao) {
if (instance == null) {
synchronized (ActFmSyncThread.class) {
@ -170,7 +170,6 @@ public class ActFmSyncThread {
}
}
}
return instance;
}
private ActFmSyncThread(List<ClientToServerMessage<?>> messageQueue, Object syncMonitor) {

@ -95,7 +95,7 @@ public final class AlarmControlSet extends TaskEditControlSet {
return null;
}
private boolean addAlarm(Date alert) {
private void addAlarm(Date alert) {
final View alertItem = LayoutInflater.from(activity).inflate(R.layout.alarm_edit_row, null);
alertsContainer.addView(alertItem);
@ -141,7 +141,5 @@ public final class AlarmControlSet extends TaskEditControlSet {
alertsContainer.removeView(alertItem);
}
});
return true;
}
}

@ -457,7 +457,7 @@ public class TasksXmlImporter {
}
}
private boolean parseSync() {
private void parseSync() {
String service = xpp.getAttributeValue(null, BackupConstants.SYNC_ATTR_SERVICE);
String remoteId = xpp.getAttributeValue(null, BackupConstants.SYNC_ATTR_REMOTE_ID);
if (service != null && remoteId != null) {
@ -473,20 +473,15 @@ public class TasksXmlImporter {
metadata.setValue(Metadata.VALUE3, taskId);
metadata.setValue(Metadata.VALUE4, syncOnComplete ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$
metadataService.save(metadata);
return true;
}
return false;
}
private boolean parseAlert() {
// drop it
return false;
private void parseAlert() {
}
private boolean parseTag() {
private void parseTag() {
String tagName = xpp.getAttributeValue(null, BackupConstants.TAG_ATTR_NAME);
tags.add(tagName);
return true;
}
private void saveTags() {

@ -146,8 +146,8 @@ public class TagCaseMigrator {
}
@Deprecated
private int renameCaseSensitive(String oldTag, String newTag) { // Need this for tag case migration process
return renameHelper(oldTag, newTag, true);
private void renameCaseSensitive(String oldTag, String newTag) { // Need this for tag case migration process
renameHelper(oldTag, newTag, true);
}
@Deprecated

@ -144,7 +144,7 @@ public final class TagsControlSet extends PopupControlSet {
/**
* Adds a tag to the tag field
*/
boolean addTag(String tagName, boolean reuse) {
void addTag(String tagName, boolean reuse) {
LayoutInflater inflater = activity.getLayoutInflater();
// check if already exists
@ -153,7 +153,7 @@ public final class TagsControlSet extends PopupControlSet {
View view = newTags.getChildAt(i);
lastText = (TextView) view.findViewById(R.id.text1);
if (lastText.getText().equals(tagName)) {
return false;
return;
}
}
@ -224,8 +224,6 @@ public final class TagsControlSet extends PopupControlSet {
}
}
});
return true;
}
/**

@ -91,24 +91,20 @@ public class AlertController extends LegacyAbstractController {
/**
* Remove all alerts from the task
*/
public boolean removeAlerts(TaskIdentifier taskId)
throws SQLException {
return alertDatabase.delete(alertsTable,
String.format("%s = ?",
Alert.TASK),
new String[]{taskId.idAsString()}) > 0;
public void removeAlerts(TaskIdentifier taskId) throws SQLException {
alertDatabase.delete(alertsTable,
String.format("%s = ?", Alert.TASK),
new String[]{taskId.idAsString()});
}
/**
* Add the given tag to the task
*/
public boolean addAlert(TaskIdentifier taskId, Date date)
throws SQLException {
public void addAlert(TaskIdentifier taskId, Date date) throws SQLException {
ContentValues values = new ContentValues();
values.put(Alert.DATE, date.getTime());
values.put(Alert.TASK, taskId.getId());
return alertDatabase.insert(alertsTable, Alert.TASK,
values) >= 0;
alertDatabase.insert(alertsTable, Alert.TASK, values);
}
// --- boilerplate

@ -44,11 +44,10 @@ public class SyncDataController extends LegacyAbstractController {
/**
* Indicate that this task's properties were updated
*/
public boolean addToUpdatedList(TaskIdentifier taskId) throws SQLException {
public void addToUpdatedList(TaskIdentifier taskId) throws SQLException {
ContentValues values = new ContentValues();
values.put(SyncMapping.UPDATED, 1);
return syncDatabase.update(syncTable, values,
SyncMapping.TASK + " = " + taskId.getId(), null) > 0;
syncDatabase.update(syncTable, values, SyncMapping.TASK + " = " + taskId.getId(), null);
}
public static void taskUpdated(Context context, AbstractTaskModel task) {

@ -137,8 +137,8 @@ public class SyncMapping extends LegacyAbstractModel {
}
}
public TaskIdentifier getTask() {
return new TaskIdentifier(retrieveLong(TASK));
public void getTask() {
new TaskIdentifier(retrieveLong(TASK));
}
public int getSyncServiceId() {
@ -149,8 +149,8 @@ public class SyncMapping extends LegacyAbstractModel {
return retrieveString(REMOTE_ID);
}
public boolean isUpdated() {
return retrieveInteger(UPDATED) == 1;
public void isUpdated() {
retrieveInteger(UPDATED);
}
private void setTask(TaskIdentifier task) {

@ -260,12 +260,12 @@ public class FilterAdapter extends ArrayAdapter<Filter> {
return newCount;
}
public int incrementFilterCount(Filter filter) {
return adjustFilterCount(filter, 1);
public void incrementFilterCount(Filter filter) {
adjustFilterCount(filter, 1);
}
public int decrementFilterCount(Filter filter) {
return adjustFilterCount(filter, -1);
public void decrementFilterCount(Filter filter) {
adjustFilterCount(filter, -1);
}
public void refreshFilterCount(final Filter filter) {

@ -76,8 +76,8 @@ public class MetadataService {
*
* @param where
*/
public int deleteWhere(Criterion where) {
return metadataDao.deleteWhere(where);
public void deleteWhere(Criterion where) {
metadataDao.deleteWhere(where);
}
/**

@ -215,10 +215,10 @@ public class TaskService {
return newTask;
}
public Task cloneReusableTask(Task task, String tagName, String tagUuid) {
public void cloneReusableTask(Task task, String tagName, String tagUuid) {
Task newTask = fetchById(task.getId(), Task.PROPERTIES);
if (newTask == null) {
return new Task();
return;
}
newTask.clearValue(Task.ID);
newTask.clearValue(Task.UUID);
@ -232,7 +232,6 @@ public class TaskService {
if (!RemoteModel.isUuidEmpty(tagUuid)) {
TagService.getInstance().createLink(newTask, tagName, tagUuid);
}
return newTask;
}
/**

@ -54,7 +54,7 @@ public class AstridDialog extends Dialog {
return this;
}
public AstridDialog setButtonListeners(View.OnClickListener... listeners) {
public void setButtonListeners(View.OnClickListener... listeners) {
int index = 0;
for (View.OnClickListener l : listeners) {
buttons[index].setOnClickListener(l);
@ -63,7 +63,6 @@ public class AstridDialog extends Dialog {
break;
}
}
return this;
}
public AstridDialog setAstridText(int resId) {

@ -363,22 +363,19 @@ public class DraggableListView extends ListView {
}
}
/**
* @return true if drag was initiated
*/
protected boolean initiateDrag(MotionEvent ev) {
protected void initiateDrag(MotionEvent ev) {
int x = (int) mTouchCurrentX;
int y = (int) mTouchCurrentY;
int itemNum = pointToPosition(x, y);
if (itemNum == AdapterView.INVALID_POSITION) {
return false;
return;
}
View item = getChildAt(itemNum - getFirstVisiblePosition());
if (!isDraggableRow()) {
return false;
return;
}
mDragPoint = new Point(x - item.getLeft(), y - item.getTop());
@ -406,8 +403,6 @@ public class DraggableListView extends ListView {
Vibrator v = (Vibrator) getContext().getSystemService(Context.VIBRATOR_SERVICE);
v.vibrate(50);
return true;
}
private void startDragging(Bitmap bm, int x, int y) {

@ -1237,15 +1237,14 @@ class Entities {
* @throws NullPointerException if the key is <code>null</code>.
* @see #get(int)
*/
public Object put(int key, Object value) {
public void put(int key, Object value) {
// Makes sure the key is not already in the hashtable.
Entry tab[] = table;
int index = (key & 0x7FFFFFFF) % tab.length;
for (Entry e = tab[index]; e != null; e = e.next) {
if (e.hash == key) {
Object old = e.value;
e.value = value;
return old;
return;
}
}
@ -1261,7 +1260,6 @@ class Entities {
Entry e = new Entry(key, key, value, tab[index]);
tab[index] = e;
count++;
return null;
}
/**

@ -52,7 +52,7 @@ public class Api6VoiceOutputAssistant implements OnInitListener, VoiceOutputAssi
}
@Override
public boolean handleActivityResult(int requestCode, int resultCode) {
public void handleActivityResult(int requestCode, int resultCode) {
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
@ -63,11 +63,7 @@ public class Api6VoiceOutputAssistant implements OnInitListener, VoiceOutputAssi
installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
context.startActivity(installIntent);
}
return true;
}
return false;
}
private void initTTS() {

@ -24,7 +24,7 @@ public class VoiceOutputService {
public interface VoiceOutputAssistant {
public void checkIsTTSInstalled();
public boolean handleActivityResult(int requestCode, int resultCode);
public void handleActivityResult(int requestCode, int resultCode);
public void queueSpeak(String textToSpeak);
@ -39,8 +39,7 @@ public class VoiceOutputService {
}
@Override
public boolean handleActivityResult(int requestCode, int resultCode) {
return false;
public void handleActivityResult(int requestCode, int resultCode) {
}
@Override

Loading…
Cancel
Save