<commit_before>package cz.muni.fi.a2p06.stolencardatabase.adapters;

import android.content.Context;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;

import com.stepstone.stepper.Step;
import com.stepstone.stepper.adapter.AbstractFragmentStepAdapter;
import com.stepstone.stepper.viewmodel.StepViewModel;

import cz.muni.fi.a2p06.stolencardatabase.entity.Car;
import cz.muni.fi.a2p06.stolencardatabase.fragments.BasicCarInfoStepFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarDetailFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarLocationStepFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarPhotoStepFragment;

/**
 * Created by robert on 18.3.2017.
 */

public class StepperAdapter extends AbstractFragmentStepAdapter {

    private Car mCar;


    public StepperAdapter(@NonNull FragmentManager fm, @NonNull Context context, Car car) {
        super(fm, context);
        this.mCar = car;
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public Step createStep(@IntRange(from = 0L) int position) {
        Step step = null;

        switch (position) {
            case 0:
                step = BasicCarInfoStepFragment.newInstance(mCar);
                break;
            case 1:
                step = CarPhotoStepFragment.newInstance(mCar);
                break;
            case 2:
                step = CarLocationStepFragment.newInstance(mCar);
                break;
            case 3:
                step = CarDetailFragment.newInstance(mCar);
                break;
            default:
                throw new IllegalArgumentException("Unsupported position " + position);
        }

        return step;
    }

    @NonNull
    @Override
    public StepViewModel getViewModel(@IntRange(from = 0L) int position) {
        StepViewModel.Builder builder = new StepViewModel.Builder(context);

        switch (position) {
            case 0:
                builder.setTitle("Basic Car Info");
                break;
            case 1:
                builder.setTitle("Car photo");
                break;
            case 2:
                builder.setTitle("Location");
                break;
            case 3:
                builder.setTitle("Summary");
            default:
                throw new IllegalArgumentException("Unsupported position " + position);
        }
<commit_msg>StepperAdapter.java - getViewModel() break after case 3<commit_after>package cz.muni.fi.a2p06.stolencardatabase.adapters;

import android.content.Context;
import android.support.annotation.IntRange;
import android.support.annotation.NonNull;
import android.support.v4.app.FragmentManager;

import com.stepstone.stepper.Step;
import com.stepstone.stepper.adapter.AbstractFragmentStepAdapter;
import com.stepstone.stepper.viewmodel.StepViewModel;

import cz.muni.fi.a2p06.stolencardatabase.entity.Car;
import cz.muni.fi.a2p06.stolencardatabase.fragments.BasicCarInfoStepFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarDetailFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarLocationStepFragment;
import cz.muni.fi.a2p06.stolencardatabase.fragments.CarPhotoStepFragment;

/**
 * Created by robert on 18.3.2017.
 */

public class StepperAdapter extends AbstractFragmentStepAdapter {

    private Car mCar;


    public StepperAdapter(@NonNull FragmentManager fm, @NonNull Context context, Car car) {
        super(fm, context);
        this.mCar = car;
    }

    @Override
    public int getCount() {
        return 4;
    }

    @Override
    public Step createStep(@IntRange(from = 0L) int position) {
        Step step = null;

        switch (position) {
            case 0:
                step = BasicCarInfoStepFragment.newInstance(mCar);
                break;
            case 1:
                step = CarPhotoStepFragment.newInstance(mCar);
                break;
            case 2:
                step = CarLocationStepFragment.newInstance(mCar);
                break;
            case 3:
                step = CarDetailFragment.newInstance(mCar);
                break;
            default:
                throw new IllegalArgumentException("Unsupported position " + position);
        }

        return step;
    }

    @NonNull
    @Override
    public StepViewModel getViewModel(@IntRange(from = 0L) int position) {
        StepViewModel.Builder builder = new StepViewModel.Builder(context);

        switch (position) {
            case 0:
                builder.setTitle("Basic Car Info");
                break;
            case 1:
                builder.setTitle("Car photo");
                break;
            case 2:
                builder.setTitle("Location");
                break;
            case 3:
                builder.setTitle("Summary");
                break;
            default:
                throw new IllegalArgumentException("Unsupported position " + position);
        }

{'fraction_non_alphanumeric': 0.08592974796586625, 'fraction_numerical': 0.01488390553681286, 'mean_word_length': 2.202033036848793, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7062835', 'n_tokens_mistral': 1468, 'n_tokens_neox': 1364, 'n_words': 278}