public class Test {

}

// package com.example.myapp;

// import android.app.Fragment;
// import android.os.Bundle;
// import android.view.LayoutInflater;
// import android.view.View;
// import android.view.ViewGroup;
// import android.widget.Button;
// import androidx.fragment.app.FragmentActivity;
// import androidx.fragment.app.FragmentTransaction;

// public class Test extends FragmentActivity {

//     @Override
//     public void onCreate(Bundle savedInstance) {
//         try {
//             super.onCreate(savedInstance);
//             final String fname = getIntent().getStringExtra("fname");
//             FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
//             Class<Fragment> fClass = (Class<Fragment>) Class.forName(fname);
//             ft.add(fClass.newInstance(), ""); // hasTaintFlow
//             ft.add(0, Fragment.instantiate(this, fname), null); // hasTaintFlow
//             ft.add(0, Fragment.instantiate(this, fname, null)); // hasTaintFlow
//             ft.add(0, fClass, null, ""); // hasTaintFlow
//             ft.add(0, fClass.newInstance(), ""); // hasTaintFlow
//             ft.attach(fClass.newInstance()); // hasTaintFlow
//             ft.replace(0, fClass, null); // hasTaintFlow
//             ft.replace(0, fClass.newInstance()); // hasTaintFlow
//             ft.replace(0, fClass, null, ""); // hasTaintFlow
//             ft.replace(0, fClass.newInstance(), ""); // hasTaintFlow

//             ft.add(Fragment.class.newInstance(), ""); // Safe
//             ft.attach(Fragment.class.newInstance()); // Safe
//             ft.replace(0, Fragment.class.newInstance(), ""); // Safe
//         } catch (Exception e) {
//         }
//     }

// }

@@ -20,1710 +20,4 @@
 %0A%0A%7D%0A
-%0A// package com.example.myapp;%0A%0A// import android.app.Fragment;%0A// import android.os.Bundle;%0A// import android.view.LayoutInflater;%0A// import android.view.View;%0A// import android.view.ViewGroup;%0A// import android.widget.Button;%0A// import androidx.fragment.app.FragmentActivity;%0A// import androidx.fragment.app.FragmentTransaction;%0A%0A// public class Test extends FragmentActivity %7B%0A%0A//     @Override%0A//     public void onCreate(Bundle savedInstance) %7B%0A//         try %7B%0A//             super.onCreate(savedInstance);%0A//             final String fname = getIntent().getStringExtra(%22fname%22);%0A//             FragmentTransaction ft = getSupportFragmentManager().beginTransaction();%0A//             Class%3CFragment%3E fClass = (Class%3CFragment%3E) Class.forName(fname);%0A//             ft.add(fClass.newInstance(), %22%22); // hasTaintFlow%0A//             ft.add(0, Fragment.instantiate(this, fname), null); // hasTaintFlow%0A//             ft.add(0, Fragment.instantiate(this, fname, null)); // hasTaintFlow%0A//             ft.add(0, fClass, null, %22%22); // hasTaintFlow%0A//             ft.add(0, fClass.newInstance(), %22%22); // hasTaintFlow%0A//             ft.attach(fClass.newInstance()); // hasTaintFlow%0A//             ft.replace(0, fClass, null); // hasTaintFlow%0A//             ft.replace(0, fClass.newInstance()); // hasTaintFlow%0A//             ft.replace(0, fClass, null, %22%22); // hasTaintFlow%0A//             ft.replace(0, fClass.newInstance(), %22%22); // hasTaintFlow%0A%0A//             ft.add(Fragment.class.newInstance(), %22%22); // Safe%0A//             ft.attach(Fragment.class.newInstance()); // Safe%0A//             ft.replace(0, Fragment.class.newInstance(), %22%22); // Safe%0A//         %7D catch (Exception e) %7B%0A//         %7D%0A//     %7D%0A%0A// %7D%0A

remove commented-out code in Test.java file