Projects >> astrid >>f90996a0156c5a7e5609e6b7cb02294244900e62

Chunk
Conflicting content
    public static final StringProperty TAG_DESCRIPTION = new StringProperty(
            TABLE, "tagDescription");

<<<<<<< HEAD
    /** UUID proof text */
    public static final StringProperty PROOF_TEXT = new StringProperty(
            TABLE, PROOF_TEXT_PROPERTY_NAME);

    /** Pushed at date */
    public static final LongProperty PUSHED_AT = new LongProperty(
            TABLE, PUSHED_AT_PROPERTY_NAME);

    /** UUID */
    public static final StringProperty UUID = new StringProperty(
            TABLE, UUID_PROPERTY_NAME);
=======
    /** Tag ordering */
    public static final StringProperty TAG_ORDERING = new StringProperty(
            TABLE, "tagOrdering");
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3

    /** List of all properties for this model */
    public static final Property[] PROPERTIES = generateProperties(TagData.class);
Solution content
    public static final StringProperty TAG_DESCRIPTION = new StringProperty(
            TABLE, "tagDescription");

    /** UUID proof text */
    public static final StringProperty PROOF_TEXT = new StringProperty(
            TABLE, PROOF_TEXT_PROPERTY_NAME);

    /** Pushed at date */
    public static final LongProperty PUSHED_AT = new LongProperty(
            TABLE, PUSHED_AT_PROPERTY_NAME);

    /** UUID */
    public static final StringProperty UUID = new StringProperty(
            TABLE, UUID_PROPERTY_NAME);

    /** Tag ordering */
    public static final StringProperty TAG_ORDERING = new StringProperty(
            TABLE, "tagOrdering");

    /** List of all properties for this model */
    public static final Property[] PROPERTIES = generateProperties(TagData.class);
File
TagData.java
Developer's decision
Concatenation
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
        defaultValues.put(IS_UNREAD.name, 0);
        defaultValues.put(TASK_COUNT.name, 0);
        defaultValues.put(TAG_DESCRIPTION.name, "");
<<<<<<< HEAD
        defaultValues.put(PUSHED_AT.name, 0L);
=======
        defaultValues.put(TAG_ORDERING.name, "[]");
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
    }

    @Override
Solution content
        defaultValues.put(IS_UNREAD.name, 0);
        defaultValues.put(TASK_COUNT.name, 0);
        defaultValues.put(TAG_DESCRIPTION.name, "");
        defaultValues.put(PUSHED_AT.name, 0L);
        defaultValues.put(TAG_ORDERING.name, "[]");
    }

    @Override
File
TagData.java
Developer's decision
Concatenation
Kind of conflict
Method invocation
Chunk
Conflicting content
    public static final LongProperty REMOTE_ID = new LongProperty(
            TABLE, REMOTE_ID_PROPERTY_NAME);

<<<<<<< HEAD
    /** Pushed at date */
    public static final LongProperty PUSHED_AT = new LongProperty(
            TABLE, PUSHED_AT_PROPERTY_NAME);
=======
    /** Friendship status. One of the STATUS constants below */
    public static final StringProperty STATUS = new StringProperty(
            TABLE, "status");

    /** Friendship tatus that needs to be reported to the server.
     * One of the PENDING constants below */
    public static final StringProperty PENDING_STATUS = new StringProperty(
            TABLE, "pendingStatus");
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3

    /** List of all properties for this model */
    public static final Property[] PROPERTIES = generateProperties(User.class);
Solution content
    public static final LongProperty REMOTE_ID = new LongProperty(
            TABLE, REMOTE_ID_PROPERTY_NAME);

    /** Pushed at date */
    public static final LongProperty PUSHED_AT = new LongProperty(
            TABLE, PUSHED_AT_PROPERTY_NAME);

    /** Friendship status. One of the STATUS constants below */
    public static final StringProperty STATUS = new StringProperty(
            TABLE, "status");

    /** Friendship tatus that needs to be reported to the server.
     * One of the PENDING constants below */
    public static final StringProperty PENDING_STATUS = new StringProperty(
            TABLE, "pendingStatus");

    /** List of all properties for this model */
    public static final Property[] PROPERTIES = generateProperties(User.class);
File
User.java
Developer's decision
Concatenation
Kind of conflict
Attribute
Comment
Method invocation
Chunk
Conflicting content
        defaultValues.put(NAME.name, "");
        defaultValues.put(EMAIL.name, "");
        defaultValues.put(PICTURE.name, "");
<<<<<<< HEAD
        defaultValues.put(PUSHED_AT.name, 0L);
=======
        defaultValues.put(STATUS.name, "");
        defaultValues.put(PENDING_STATUS.name, "");
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
    }

    @Override
Solution content
        defaultValues.put(NAME.name, "");
        defaultValues.put(EMAIL.name, "");
        defaultValues.put(PICTURE.name, "");
        defaultValues.put(PUSHED_AT.name, 0L);
        defaultValues.put(STATUS.name, "");
        defaultValues.put(PENDING_STATUS.name, "");
    }

    @Override
File
User.java
Developer's decision
Concatenation
Kind of conflict
Method invocation
Chunk
Conflicting content
    protected void setLastViewed() {
        //
    }
<<<<<<< HEAD:astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesFragment.java
    private void populateListHeader(ViewGroup header) {
        if (header == null) return;
        TextView tagTitle = (TextView) header.findViewById(R.id.tag_title);
        String tagName = tagData.getValue(TagData.NAME);
        tagTitle.setText(tagName);
        TextView descriptionTitle = (TextView) header.findViewById(R.id.tag_description);
        String description = tagData.getValue(TagData.TAG_DESCRIPTION);
        if (!TextUtils.isEmpty(description)) {
            descriptionTitle.setText(description);
            descriptionTitle.setVisibility(View.VISIBLE);
        }
        else {
            descriptionTitle.setVisibility(View.GONE);
        }

        AsyncImageView imageView = (AsyncImageView) header.findViewById(R.id.tag_picture);
        imageView.setDefaultImageResource(TagService.getDefaultImageIDForTag(tagData.getValue(TagData.UUID)));
        imageView.setUrl(tagData.getValue(TagData.PICTURE));
    }

    public void setLastViewed() {
        if(tagData != null && !RemoteModel.NO_UUID.equals(tagData.getValue(TagData.UUID))) {
            Preferences.setLong(UPDATES_LAST_VIEWED + tagData.getValue(TagData.UUID), DateUtilities.now());
            Activity activity = getActivity();
            if (activity instanceof TaskListActivity)
                ((TaskListActivity) activity).setCommentsCount(0);
=======

    protected void refreshActivity(boolean manual) {
        if (actFmPreferenceService.isLoggedIn()) {
            final ProgressBarSyncResultCallback callback = new ProgressBarSyncResultCallback(
                    getActivity(), this, R.id.comments_progressBar, new Runnable() {
                        @Override
                        public void run() {
                            refreshUpdatesList();
                        }
                    });

            callback.started();
            callback.incrementMax(100);
            Runnable doneRunnable = new Runnable() {
                @Override
                public void run() {
                    callback.incrementProgress(50);
                    callback.finished();
                }
            };
            if (hasModel()) {
                performFetch(manual, doneRunnable);
            } else {
                actFmSyncService.fetchPersonalUpdates(manual, doneRunnable);
            }
            callback.incrementProgress(50);
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3:astrid/plugin-src/com/todoroo/astrid/actfm/CommentsFragment.java
        }
    }
Solution content
    protected void setLastViewed() {
        //
    }

    protected void refreshActivity(boolean manual) {
        if (actFmPreferenceService.isLoggedIn()) {
            final ProgressBarSyncResultCallback callback = new ProgressBarSyncResultCallback(
                    getActivity(), this, R.id.comments_progressBar, new Runnable() {
                        @Override
                        public void run() {
                            refreshUpdatesList();
                        }
                    });

            callback.started();
            callback.incrementMax(100);
            Runnable doneRunnable = new Runnable() {
                @Override
                public void run() {
                    callback.incrementProgress(50);
                    callback.finished();
                }
            };
            if (hasModel()) {
                performFetch(manual, doneRunnable);
            } else {
                actFmSyncService.fetchPersonalUpdates(manual, doneRunnable);
            }
            callback.incrementProgress(50);
        }
    }
File
CommentsFragment.java
Developer's decision
Version 2
Kind of conflict
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
        return s;
    }

    protected void addComment() {
        Update update = createUpdate();

<<<<<<< HEAD:astrid/plugin-src/com/todoroo/astrid/actfm/TagUpdatesFragment.java
            callback.started();
            callback.incrementMax(100);
            Runnable doneRunnable = new Runnable() {
                @Override
                public void run() {
                    callback.incrementProgress(50);
                    callback.finished();
                }
            };
            if (tagData != null) {
                actFmSyncService.fetchUpdatesForTag(tagData, manual, doneRunnable);
            } else {
                actFmSyncService.fetchPersonalUpdates(manual, doneRunnable);
            }
            callback.incrementProgress(50);
        }
    }


    private String getPictureHashForUpdate(Update u) {
        String s = u.getValue(Update.TASK_UUID) + u.getValue(Update.CREATION_DATE);
    @SuppressWarnings("nls")
    private void addComment() {
        Update update = new Update();
        update.setValue(Update.MESSAGE, addCommentField.getText().toString());
        update.setValue(Update.ACTION_CODE, "tag_comment");
        update.setValue(Update.USER_ID, 0L);
        update.setValue(Update.TAGS, "," + tagData.getValue(TagData.UUID) + ",");
        update.setValue(Update.TAGS_LOCAL, "," + tagData.getId() + ",");
        update.setValue(Update.CREATION_DATE, DateUtilities.now());
        update.setValue(Update.TARGET_NAME, tagData.getValue(TagData.NAME));
=======
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3:astrid/plugin-src/com/todoroo/astrid/actfm/CommentsFragment.java
        if (picture != null) {
            update.setValue(Update.PICTURE, Update.PICTURE_LOADING);
            try {
Solution content
    private String getPictureHashForUpdate(Update u) {
        String s = u.getValue(Update.TASK_UUID) + u.getValue(Update.CREATION_DATE);
        return s;
    }
    protected void addComment() {
        Update update = createUpdate();
        if (picture != null) {
            update.setValue(Update.PICTURE, Update.PICTURE_LOADING);
            try {
File
CommentsFragment.java
Developer's decision
Manual
Kind of conflict
Annotation
If statement
Method declaration
Method invocation
Method signature
Variable
Chunk
Conflicting content
    private void updateCommentCount() {
        if (tagData != null) {
<<<<<<< HEAD
            long lastViewedComments = Preferences.getLong(TagUpdatesFragment.UPDATES_LAST_VIEWED + tagData.getValue(TagData.UUID), 0);
=======
            long lastViewedComments = Preferences.getLong(CommentsFragment.UPDATES_LAST_VIEWED + tagData.getValue(TagData.REMOTE_ID), 0);
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
            int unreadCount = 0;
            TodorooCursor commentCursor = tagDataService.getUpdatesWithExtraCriteria(tagData, Update.CREATION_DATE.gt(lastViewedComments));
            try {
Solution content
    private void updateCommentCount() {
        if (tagData != null) {
            long lastViewedComments = Preferences.getLong(CommentsFragment.UPDATES_LAST_VIEWED + tagData.getValue(TagData.UUID), 0);
            int unreadCount = 0;
            TodorooCursor commentCursor = tagDataService.getUpdatesWithExtraCriteria(tagData, Update.CREATION_DATE.gt(lastViewedComments));
            try {
File
TagViewFragment.java
Developer's decision
Manual
Kind of conflict
Method invocation
Variable
Chunk
Conflicting content
    }

    /**
<<<<<<< HEAD
     * Reads task notes out of a task
     */
    public TodorooCursor getTaskNotesCursor(long taskId) {
        TodorooCursor cursor = metadataService.query(Query.select(Metadata.PROPERTIES).
                where(MetadataCriteria.byTaskAndwithKey(taskId, NoteMetadata.METADATA_KEY)));
        return cursor;
    }

    /**
=======
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
     * Save / Merge JSON tagData
     * @param tagObject
     * @throws JSONException
Solution content
    }

    /**
     * Save / Merge JSON tagData
     * @param tagObject
     * @throws JSONException
File
ActFmDataService.java
Developer's decision
Version 2
Kind of conflict
Comment
Method declaration
Chunk
Conflicting content
        return metadataDao.query(query);
    }

<<<<<<< HEAD
    public TodorooCursor getTagDataForTask(long taskId, boolean includeEmergent, Property... properties) {
        Criterion criterion = TagData.UUID.in(Query.select(TagMetadata.TAG_UUID)
                .from(Metadata.TABLE)
                .where(Criterion.and(MetadataCriteria.withKey(TagMetadata.KEY),
                        Metadata.DELETION_DATE.eq(0),
                        Metadata.TASK.eq(taskId))));
        if (!includeEmergent)
            criterion = Criterion.and(Criterion.not(TagData.ID.in(getEmergentTagIds())), criterion);

        return tagDataService.query(Query.select(properties).where(criterion));
=======
    public TodorooCursor getTagDataForTask(long taskId, Criterion additionalCriterion, Property... properties) {
        Criterion criterion = TagData.NAME.in(Query.select(TAG).from(Metadata.TABLE).where(MetadataCriteria.byTaskAndwithKey(taskId, KEY)));
        return tagDataService.query(Query.select(properties).where(Criterion.and(criterion, additionalCriterion)));
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
    }

    /**
Solution content
        return metadataDao.query(query);
    }

    public TodorooCursor getTagDataForTask(long taskId, boolean includeEmergent, Property... properties) {
        Criterion criterion = TagData.UUID.in(Query.select(TagMetadata.TAG_UUID)
                .from(Metadata.TABLE)
                .where(Criterion.and(MetadataCriteria.withKey(TagMetadata.KEY),
                        Metadata.DELETION_DATE.eq(0),
                        Metadata.TASK.eq(taskId))));
        if (!includeEmergent)
            criterion = Criterion.and(Criterion.not(TagData.ID.in(getEmergentTagIds())), criterion);

        return tagDataService.query(Query.select(properties).where(criterion));
    }

    public TodorooCursor getTagDataForTask(long taskId, Criterion additionalCriterion, Property... properties) {
        Criterion criterion = TagData.NAME.in(Query.select(TagMetadata.TAG_NAME).from(Metadata.TABLE).where(MetadataCriteria.byTaskAndwithKey(taskId, TagMetadata.KEY)));
        return tagDataService.query(Query.select(properties).where(Criterion.and(criterion, additionalCriterion)));
    }

    /**
File
TagService.java
Developer's decision
Manual
Kind of conflict
If statement
Method invocation
Method signature
Return statement
Variable
Chunk
Conflicting content
     * Database version number. This variable must be updated when database
     * tables are updated, as it determines whether a database needs updating.
     */
<<<<<<< HEAD
    public static final int VERSION = 26;
=======
    public static final int VERSION = 28;
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3

    /**
     * Database name (must be unique)
Solution content
     * Database version number. This variable must be updated when database
     * tables are updated, as it determines whether a database needs updating.
     */
    public static final int VERSION = 29;

    /**
     * Database name (must be unique)
File
Database.java
Developer's decision
Manual
Kind of conflict
Attribute
Chunk
Conflicting content
        }

        case 25: try {
<<<<<<< HEAD
            database.execSQL(createTableSql(visitor, TaskOutstanding.TABLE.name, TaskOutstanding.PROPERTIES));
            database.execSQL(createTableSql(visitor, TagOutstanding.TABLE.name, TagOutstanding.PROPERTIES));

            database.execSQL(addColumnSql(Task.TABLE, Task.PROOF_TEXT, visitor, null));
            database.execSQL(addColumnSql(Task.TABLE, Task.PUSHED_AT, visitor, null));
            database.execSQL(addColumnSql(Task.TABLE, Task.UUID, visitor, null));
            database.execSQL(addColumnSql(TagData.TABLE, TagData.PROOF_TEXT, visitor, null));
            database.execSQL(addColumnSql(TagData.TABLE, TagData.PUSHED_AT, visitor, null));
            database.execSQL(addColumnSql(TagData.TABLE, TagData.UUID, visitor, null));
            database.execSQL(addColumnSql(Update.TABLE, Update.PROOF_TEXT, visitor, null));
            database.execSQL(addColumnSql(Update.TABLE, Update.PUSHED_AT, visitor, null));
            database.execSQL(addColumnSql(Update.TABLE, Update.UUID, visitor, null));
            database.execSQL(addColumnSql(Update.TABLE, Update.TASK_UUID, visitor, null));
            database.execSQL(addColumnSql(Metadata.TABLE, Metadata.DELETION_DATE, visitor, "0"));
            database.execSQL(addColumnSql(User.TABLE, User.PUSHED_AT, visitor, null));
=======
            database.execSQL("ALTER TABLE " + User.TABLE.name + " ADD " +
                    User.STATUS.accept(visitor, null));

            database.execSQL("ALTER TABLE " + User.TABLE.name + " ADD " +
                    User.PENDING_STATUS.accept(visitor, null));
        } catch (SQLiteException e) {
            Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
        }
        case 26: try {
            database.execSQL("ALTER TABLE " + TagData.TABLE.name + " ADD " +
                    TagData.TAG_ORDERING.accept(visitor, null));
        } catch (SQLiteException e) {
            Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
        }
        case 27: try {
            database.execSQL("ALTER TABLE " + Task.TABLE.name + " ADD " +
                    Task.SOCIAL_REMINDER.accept(visitor, null));
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
        } catch (SQLiteException e) {
            Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
        }
Solution content
        }

        case 25: try {
            database.execSQL("ALTER TABLE " + User.TABLE.name + " ADD " +
                    User.STATUS.accept(visitor, null));

            database.execSQL("ALTER TABLE " + User.TABLE.name + " ADD " +
                    User.PENDING_STATUS.accept(visitor, null));
        } catch (SQLiteException e) {
            Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
        }
        case 26: try {
            database.execSQL("ALTER TABLE " + TagData.TABLE.name + " ADD " +
                    TagData.TAG_ORDERING.accept(visitor, null));
        } catch (SQLiteException e) {
            Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
        }
        case 27: try {
            database.execSQL("ALTER TABLE " + Task.TABLE.name + " ADD " +
                    Task.SOCIAL_REMINDER.accept(visitor, null));
        } catch (SQLiteException e) {
            Log.e("astrid", "db-upgrade-" + oldVersion + "-" + newVersion, e);
        }
File
Database.java
Developer's decision
Version 2
Kind of conflict
Case statement
Catch clause
Method invocation
Try statement
Chunk
Conflicting content
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;
<<<<<<< HEAD
import android.os.Looper;
=======
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3

import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property.LongProperty;
Solution content
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.os.Bundle;

import com.timsu.astrid.R;
import com.todoroo.andlib.data.Property.LongProperty;
File
UpgradeService.java
Developer's decision
Version 2
Kind of conflict
Import
Chunk
Conflicting content
import com.todoroo.astrid.notes.NoteMetadata;
import com.todoroo.astrid.producteev.sync.ProducteevDataService;
import com.todoroo.astrid.service.abtesting.ABChooser;
<<<<<<< HEAD
import com.todoroo.astrid.tags.Astrid44SyncMigrator;
=======
import com.todoroo.astrid.subtasks.SubtasksMetadataMigration;
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
import com.todoroo.astrid.tags.TagCaseMigrator;
import com.todoroo.astrid.utility.AstridPreferences;
Solution content
import com.todoroo.astrid.notes.NoteMetadata;
import com.todoroo.astrid.producteev.sync.ProducteevDataService;
import com.todoroo.astrid.service.abtesting.ABChooser;
import com.todoroo.astrid.subtasks.SubtasksMetadataMigration;
import com.todoroo.astrid.tags.Astrid44SyncMigrator;
import com.todoroo.astrid.tags.TagCaseMigrator;
import com.todoroo.astrid.utility.AstridPreferences;
File
UpgradeService.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
public final class UpgradeService {

<<<<<<< HEAD
    public static final int V4_4_0 = 285;
=======
    public static final int V4_4_2 = 287;
    public static final int V4_4_1 = 286;
    public static final int V4_4 = 285;
    public static final int V4_3_4_2 = 284;
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
    public static final int V4_3_4_1 = 283;
    public static final int V4_3_4 = 282;
    public static final int V4_3_3 = 281;
Solution content
public final class UpgradeService {

    public static final int V4_5_0 = 300;
    public static final int V4_4_2 = 287;
    public static final int V4_4_1 = 286;
    public static final int V4_4 = 285;
    public static final int V4_3_4_2 = 284;
    public static final int V4_3_4_1 = 283;
    public static final int V4_3_4 = 282;
    public static final int V4_3_3 = 281;
File
UpgradeService.java
Developer's decision
Manual
Kind of conflict
Attribute
Chunk
Conflicting content
    }
    private static void startUpgradeThread(final Activity context, final int from, final String lastSetVersionName, final Runnable done) {
     // long running tasks: pop up a progress dialog
        final ProgressDialog dialog;
<<<<<<< HEAD
        if(from < V4_4_0)
            dialog = DialogUtilities.progressDialog(context,
                    context.getString(R.string.DLG_upgrading));
        else
            dialog = null;
        new Thread(new Runnable() {
            @Override
            public void run() {
                try {
                    // NOTE: These lines should be uncommented whenever any new version requires a data migration
                    Looper.prepare();
                    TasksXmlExporter.exportTasks(context, TasksXmlExporter.ExportType.EXPORT_TYPE_ON_UPGRADE, null, null, lastSetVersionName);

                    if(from < V3_0_0)
                        new Astrid2To3UpgradeHelper().upgrade2To3(context, from);

                    if(from < V3_1_0)
                        new Astrid2To3UpgradeHelper().upgrade3To3_1(context, from);

                    if(from < V3_8_3_1)
                        new TagCaseMigrator().performTagCaseMigration(context);

                    if(from < V3_8_4 && Preferences.getBoolean(R.string.p_showNotes, false))
                        PluginServices.getTaskService().clearDetails(Task.NOTES.neq("")); //$NON-NLS-1$

                    if (from < V4_0_6)
                        new DueDateTimeMigrator().migrateDueTimes();

                    if (from < V4_4_0)
                        new Astrid44SyncMigrator().performMigration();

                } finally {
                    DialogUtilities.dismissDialog((Activity)context, dialog);
                    context.sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
                    if (done != null)
                        context.runOnUiThread(done);
                }
=======

        int maxWithUpgrade = V4_4_2; // The last version that required a migration

        final String lastSetVersionName = AstridPreferences.getCurrentVersionName();

        Preferences.setInt(AstridPreferences.P_UPGRADE_FROM, from);

        if(from < maxWithUpgrade) {
            Intent upgrade = new Intent(context, UpgradeActivity.class);
            upgrade.putExtra(UpgradeActivity.TOKEN_FROM_VERSION, from);
            context.startActivityForResult(upgrade, 0);
        }
    }

    public static class UpgradeActivity extends Activity {
        @Autowired
        private TaskService taskService;
        private ProgressDialog dialog;

        public static final String TOKEN_FROM_VERSION = "from_version"; //$NON-NLS-1$
        private int from;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            DependencyInjectionService.getInstance().inject(this);
            from = getIntent().getIntExtra(TOKEN_FROM_VERSION, -1);
            if (from > 0) {
                dialog = DialogUtilities.progressDialog(this,
                        getString(R.string.DLG_upgrading));
                new Thread() {
                    @Override
                    public void run() {
                        try {
                            if(from < V3_0_0)
                                new Astrid2To3UpgradeHelper().upgrade2To3(UpgradeActivity.this, from);

                            if(from < V3_1_0)
                                new Astrid2To3UpgradeHelper().upgrade3To3_1(UpgradeActivity.this, from);

                            if(from < V3_8_3_1)
                                new TagCaseMigrator().performTagCaseMigration(UpgradeActivity.this);

                            if(from < V3_8_4 && Preferences.getBoolean(R.string.p_showNotes, false))
                                taskService.clearDetails(Task.NOTES.neq("")); //$NON-NLS-1$

                            if (from < V4_0_6)
                                new DueDateTimeMigrator().migrateDueTimes();

                            if (from < V4_4_2)
                                new SubtasksMetadataMigration().performMigration();

                        } finally {
                            DialogUtilities.dismissDialog(UpgradeActivity.this, dialog);
                            sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
                            setResult(AstridActivity.RESULT_RESTART_ACTIVITY);
                            finish();
                        }
                    };
                }.start();
            } else {
                finish();
>>>>>>> 61d080bcc42af5e2221f08fa801cf864d4ed05c3
            }
        }
Solution content
        Preferences.setInt(AstridPreferences.P_UPGRADE_FROM, from);

        if(from < maxWithUpgrade) {
            Intent upgrade = new Intent(context, UpgradeActivity.class);
            upgrade.putExtra(UpgradeActivity.TOKEN_FROM_VERSION, from);
            context.startActivityForResult(upgrade, 0);
        }
    }

    public static class UpgradeActivity extends Activity {
        @Autowired
        private TaskService taskService;
        private ProgressDialog dialog;

        public static final String TOKEN_FROM_VERSION = "from_version"; //$NON-NLS-1$
        private int from;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            DependencyInjectionService.getInstance().inject(this);
            from = getIntent().getIntExtra(TOKEN_FROM_VERSION, -1);
            if (from > 0) {
                dialog = DialogUtilities.progressDialog(this,
                        getString(R.string.DLG_upgrading));
                new Thread() {
                    @Override
                    public void run() {
                        try {
                            if(from < V3_0_0)
                                new Astrid2To3UpgradeHelper().upgrade2To3(UpgradeActivity.this, from);

                            if(from < V3_1_0)
                                new Astrid2To3UpgradeHelper().upgrade3To3_1(UpgradeActivity.this, from);

                            if(from < V3_8_3_1)
                                new TagCaseMigrator().performTagCaseMigration(UpgradeActivity.this);

                            if(from < V3_8_4 && Preferences.getBoolean(R.string.p_showNotes, false))
                                taskService.clearDetails(Task.NOTES.neq("")); //$NON-NLS-1$

                            if (from < V4_0_6)
                                new DueDateTimeMigrator().migrateDueTimes();

                            if (from < V4_4_2)
                                new SubtasksMetadataMigration().performMigration();

                            if (from < V4_5_0)
                                new Astrid44SyncMigrator().performMigration();

                        } finally {
                            DialogUtilities.dismissDialog(UpgradeActivity.this, dialog);
                            sendBroadcast(new Intent(AstridApiConstants.BROADCAST_EVENT_REFRESH));
                            setResult(AstridActivity.RESULT_RESTART_ACTIVITY);
                            finish();
                        }
                    };
                }.start();
            } else {
                finish();
            }
        }
    }
File
UpgradeService.java
Developer's decision
Manual
Kind of conflict
Annotation
Attribute
Class signature
Comment
If statement
Method invocation
Method signature
Variable