<commit_before>import android.app.Activity;
import android.content.Context;
import android.content.Intent;

public class TestStartActivityToGetIntent {

    static Object source(String kind) {
        return null;
    }

    static void sink(Object sink) {}

    public void test(Context ctx, Activity act) {

        // test methods that start an activity
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("ctx-start"));
            ctx.startActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("act-start"));
            act.startActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-for-result"));
            act.startActivityForResult(intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-if-needed"));
            act.startActivityIfNeeded(intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-matching"));
            act.startNextMatchingActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-from-child"));
            act.startActivityFromChild(null, intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-from-frag"));
            act.startActivityFromFragment(null, intent, 0);
        }

        // test 4-arg Intent constructor
        {
            Intent intent = new Intent(null, null, null, SomeActivity.class);
            intent.putExtra("data", (String) source("4-arg"));
            ctx.startActivity(intent);
        }

        // safe test
        {
            Intent intent = new Intent(null, SafeActivity.class);
            intent.putExtra("data", "safe");
            ctx.startActivity(intent);
        }
    }

    static class SomeActivity extends Activity {

        public void test() {
            sink(getIntent().getStringExtra("data")); // $ hasValueFlow=ctx-start hasValueFlow=act-start hasValueFlow=start-for-result hasValueFlow=start-if-needed hasValueFlow=start-matching hasValueFlow=start-from-child hasValueFlow=start-from-frag hasValueFlow=4-arg
        }

    }

    static class SafeActivity extends Activity {

        public void test() {
            sink(getIntent().getStringExtra("data")); // Safe
        }
    }
}<commit_msg>add missing expectation to tests<commit_after>import android.app.Activity;
import android.content.Context;
import android.content.Intent;

public class TestStartActivityToGetIntent {

    static Object source(String kind) {
        return null;
    }

    static void sink(Object sink) {}

    public void test(Context ctx, Activity act) {

        // test all methods that start an activity
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("ctx-start"));
            ctx.startActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("ctx-start-acts"));
            Intent[] intents = new Intent[] {intent};
            ctx.startActivities(intents);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("act-start"));
            act.startActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("act-start-acts"));
            Intent[] intents = new Intent[] {intent};
            act.startActivities(intents);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-for-result"));
            act.startActivityForResult(intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-if-needed"));
            act.startActivityIfNeeded(intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-matching"));
            act.startNextMatchingActivity(intent);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-from-child"));
            act.startActivityFromChild(null, intent, 0);
        }
        {
            Intent intent = new Intent(null, SomeActivity.class);
            intent.putExtra("data", (String) source("start-from-frag"));
            act.startActivityFromFragment(null, intent, 0);
        }

        // test 4-arg Intent constructor
        {
            Intent intent = new Intent(null, null, null, SomeActivity.class);
            intent.putExtra("data", (String) source("4-arg"));
            ctx.startActivity(intent);
        }

        // safe test
        {
            Intent intent = new Intent(null, SafeActivity.class);
            intent.putExtra("data", "safe");
            ctx.startActivity(intent);
        }
    }

    static class SomeActivity extends Activity {

        public void test() {
            sink(getIntent().getStringExtra("data")); // $ hasValueFlow=ctx-start hasValueFlow=act-start hasValueFlow=start-for-result hasValueFlow=start-if-needed hasValueFlow=start-matching hasValueFlow=start-from-child hasValueFlow=start-from-frag hasValueFlow=4-arg MISSING: hasValueFlow=ctx-start-acts hasValueFlow=act-start-acts
        }

    }

    static class SafeActivity extends Activity {

        public void test() {
            sink(getIntent().getStringExtra("data")); // Safe
        }
    }
}
{'fraction_non_alphanumeric': 0.12053861129136924, 'fraction_numerical': 0.0022712524334847503, 'mean_word_length': 2.189342990170719, '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': '380476', 'n_tokens_mistral': 1616, 'n_tokens_neox': 1578, 'n_words': 340}