For firebase, how do you get @exclude to work?
<p>I have a a simple User class. The user has an arrayList of followers, where each follower is a user object. Now, i make user object 1 and user object 2. I add user object 1 to user object 2's follwers array and vice versa. So now user object 2 has a follower that is user object 2, which has a follower user object 1. </p>

<p>I can't for the life of me figure out why firebase keeps on crashing when i send user object 1 to be sent to my firebase database. I put @Exclude on the getters and the arrayList and nothing seems to work. Must my firebase security be changed? Because if I put user object 1 with user object 2 as a follower AND make sure user object 2 DOES NOT have user object 1 as a follower THEN IT WORKS. But, I want user 1 to follow user 2 and vice versa.</p>

<p>Here is my main activity code:</p>

<pre><code>    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mRef = new Firebase("Fire base reference...");
        dummyUser();
    } 

private void dummyUser()
{
    UserFinal finalDummyUser = new UserFinal();
    finalDummyUser.setUserName("chris");
    finalDummyUser.setLocation("Netherlands");

    UserFinal finalDummyUser2 = new UserFinal();
    finalDummyUser2.setUserName("Andie");
    finalDummyUser2.setLocation("Germany");
    finalDummyUser2.addFollower(finalDummyUser);
    finalDummyUser.addFollower(finalDummyUser2);
    mRef.child("users").child("user3").setValue(finalDummyUser);
}
</code></pre>

<p>Here is my UserFinal class:</p>

<pre><code>public class UserFinal
{
    private String userName;
    private String location;
    private int userID;
    //Arrays
    private ArrayList&lt;UserFinal&gt; userFollowers = new ArrayList&lt;&gt;();

    //Empty Constructor
    public UserFinal()
    {

    }
    //adders
    public void addFollower(UserFinal follower)
    {
        userFollowers.add(follower);
    }

    //setters
    public void setUserName(String userName)
    {
        this.userName = userName;
    }
    public void setLocation(String location)
    {
        this.location = location;
    }
    public void setUserID(int id)
    {
        this.userID = id;
    }
    public void setUserFollowers(ArrayList&lt;UserFinal&gt; followers)
    {
        this.userFollowers = followers;
    }

    //getters
    public String getUserName()
    {
        return userName;
    }
    public String getLocation()
    {
        return location;
    }
    public int getUserID()
    {
        return userID;
    }
    @Exclude
    public ArrayList&lt;UserFinal&gt; getUserFollowers()
    {
        return userFollowers;
    }
}
</code></pre>

<p>Here is my stack trace:</p>

<pre><code>08-24 19:07:26.549 23384-23384/com.daprlabs.swipedeck E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.daprlabs.swipedeck, PID: 23384
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.daprlabs.swipedeck/com.daprlabs.swipedeck.ActivityCenter}: com.firebase.client.FirebaseException: Failed to parse to snapshot
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2434)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494)
at android.app.ActivityThread.access$900(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5525)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620)
Caused by: com.firebase.client.FirebaseException: Failed to parse to snapshot
at com.firebase.client.Firebase.setValueInternal(Firebase.java:357)
at com.firebase.client.Firebase.setValue(Firebase.java:248)
at com.daprlabs.swipedeck.ActivityCenter.dummyUser(ActivityCenter.java:165)
at com.daprlabs.swipedeck.ActivityCenter.onCreate(ActivityCenter.java:122)
at android.app.Activity.performCreate(Activity.java:6272)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2387)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2494) 
at android.app.ActivityThread.access$900(ActivityThread.java:157) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:148) 
at android.app.ActivityThread.main(ActivityThread.java:5525) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:730) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:620) 
Caused by: java.lang.IllegalArgumentException: Infinite recursion (StackOverflowError) (through reference chain: java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowing"]-&gt;java.util.ArrayList[0]-&gt;com.daprlabs.swipedeck.Globals.User["userFollowers"]-&gt;java.util.Arra

08-24 19:07:26.577 23384-23394/com.daprlabs.swipedeck W/art: Suspending all threads took: 32.173ms
</code></pre>