title: Gson overflows with StackOverflow exception on "$Types.resolve"
body: <p>I have an ArrayList and an ArrayList and the gson works perfectly fine when retrieving the custom object ArrayList but causes a stackOverflow exception when retrieving the LinearLayout ArrayList.</p>
  
  <p>Code: </p>
  
  <pre><code>public Semester(JSONObject json) throws JSONException {
  
  coursesAsString = json.getString(JSON_COURSES);
  Type coursesType = new TypeToken&lt;ArrayList&lt;Course&gt;&gt;(){}.
  courses = gson.fromJson(coursesAsString, // &lt;--- THIS PART WORKS FINE
  
  courseLayoutArrayAsString = json.getString(JSON_COURSELAYOUTARRAY);
  Type courseLayoutArrayType = new TypeToken&lt;ArrayList&lt;LinearLayout&gt;&gt;(){}.getType();
  courseLayoutArray = gson.fromJson(courseLayoutArrayAsString, courseLayoutArrayType); // &lt;---- this line
  //is where the problem lies. For some reason 
  //"gson.fromJson(courseLayoutArrayAsString, courseLayoutArrayType)" causes a stackOverflow exception.
  
  }
  </code></pre>
  
  <p>Here is the exception:</p>
  
  <pre><code>java.lang.StackOverflowError
          at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
          at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
          at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:375)
          at com.google.gson.internal.$Gson$Types.resolve($Gson$Types.java:380)
  </code></pre>
  
  <p>and it keeps going on like this for a long time.</p>