Hi Frank
I just noticed that JSONWriter has been filling up my logs with IllegalAccessExceptions. It looks like this happens because, after serializing all of the properties, it tries to serialize the fields but without checking to see if they have public access.
Here is a small test case:
package com;
import org.stringtree.json.*;
public class Bean{
private String name = "myName";
public String getName(){ return this.name; }
public void setName(String name){ this.name = name; }
public static void main(String ... args)throws Exception{
String json = new JSONWriter().write(new Bean());
System.out.println(json);
}
}
Have you considered adding checks to prevent it from attempting to access non-public fields?
-Ben
Hi Frank
I just noticed that JSONWriter has been filling up my logs with IllegalAccessExceptions. It looks like this happens because, after serializing all of the properties, it tries to serialize the fields but without checking to see if they have public access.
Here is a small test case:
Have you considered adding checks to prevent it from attempting to access non-public fields?
-Ben