<commit_before>package de.fau.cs.mad.fablab.android.cart;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.Toast;

import com.j256.ormlite.dao.RuntimeExceptionDao;

import java.util.Random;

import de.fau.cs.mad.fablab.android.db.DatabaseHelper;
import de.fau.cs.mad.fablab.rest.CartApiClient;
import de.fau.cs.mad.fablab.rest.core.Cart;
import de.fau.cs.mad.fablab.rest.core.CartStatusEnum;
import de.greenrobot.event.EventBus;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class CheckoutActivity2 extends ActionBarActivity {

    private String cartID;
    private RuntimeExceptionDao<Cart,Long> cartDao;

    private EventBus eventBus = EventBus.getDefault();

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //create random ID
        Random random = new Random();
        long cartIDLong = random.nextLong();
        cartID = Long.toString(cartIDLong);

        //create cart
        Cart cart = CartSingleton.MYCART.getCart();
        cart.setStatus(CartStatusEnum.PENDING);
        cart.setCartCode(cartID);

        //save cart in database
        cartDao = DatabaseHelper.getHelper(getApplicationContext()).getCartDao();
        cartDao.create(cart);

        CartApiClient cartApiClient = new CartApiClient((this));
        cartApiClient.get().create(cart, new Callback<Response>() {
            @Override
            public void success(Response response1, Response response2) {
                Toast.makeText(getApplicationContext(), "bezahlen!", Toast.LENGTH_SHORT).show();
                eventBus.register(this);
            }

            @Override
            public void failure(RetrofitError error) {
                Toast.makeText(getApplicationContext(), "Retrofit error", Toast.LENGTH_SHORT).show();
            }
        });


    }

}<commit_msg>removed artifacts from try with eventBus<commit_after>package de.fau.cs.mad.fablab.android.cart;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.widget.Toast;

import com.j256.ormlite.dao.RuntimeExceptionDao;

import java.util.Random;

import de.fau.cs.mad.fablab.android.db.DatabaseHelper;
import de.fau.cs.mad.fablab.rest.CartApiClient;
import de.fau.cs.mad.fablab.rest.core.Cart;
import de.fau.cs.mad.fablab.rest.core.CartStatusEnum;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

public class CheckoutActivity2 extends ActionBarActivity {

    private String cartID;
    private RuntimeExceptionDao<Cart,Long> cartDao;

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        //create random ID
        Random random = new Random();
        long cartIDLong = random.nextLong();
        cartID = Long.toString(cartIDLong);

        //create cart
        Cart cart = CartSingleton.MYCART.getCart();
        cart.setStatus(CartStatusEnum.PENDING);
        cart.setCartCode(cartID);

        //save cart in database
        cartDao = DatabaseHelper.getHelper(getApplicationContext()).getCartDao();
        cartDao.create(cart);

        CartApiClient cartApiClient = new CartApiClient((this));
        cartApiClient.get().create(cart, new Callback<Response>() {
            @Override
            public void success(Response response1, Response response2) {
                Toast.makeText(getApplicationContext(), "bezahlen!", Toast.LENGTH_SHORT).show();
            }

            @Override
            public void failure(RetrofitError error) {
                Toast.makeText(getApplicationContext(), "Retrofit error", Toast.LENGTH_SHORT).show();
            }
        });


    }

}
{'fraction_non_alphanumeric': 0.10466649090429739, 'fraction_numerical': 0.003691009754811495, 'mean_word_length': 3.070815450643777, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '260729', 'n_tokens_mistral': 1123, 'n_tokens_neox': 1094, 'n_words': 204}