Gson : StackOverflowError
问题 The below codes causing StackOverflowError . purpose of the code is to create a json string from java class. for (ControlTransaction crt : ctrList) { crt= new ControlTransaction();// for test, Still issue final Gson gson = new GsonBuilder().registerTypeAdapter( ControlTransaction.class, new ControlTransactionSerializer()).create(); String jsonControlTransactionString = gson.toJson(crt); strList.add(jsonControlTransactionString); } My class looks like public class ControlTransaction implements