junfan / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Gson fails with Logger (log4j) #489

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a POJO with a reference to Log4j Logger
2. Convert this POJO using Gson 
3.

What is the expected output? What do you see instead?
Since Logger is not serializable it should throw an exception with the name of 
the field saying that it is not serializable 

What version of the product are you using? On what operating system?
2.0

Please provide any additional information below.

Try to serialize below object:

public class TestBean {

    private Logger LOG = Logger.getLogger(TestBean.class); 
    private int i;
    public int getI() {
        return i;
    }
    public void setI(int i) {
        this.i = i;
    }

}

Original issue reported on code.google.com by achatter...@gmail.com on 26 Nov 2012 at 7:34

GoogleCodeExporter commented 9 years ago
Register a type adapter for this.

Original comment by limpbizkit on 4 Feb 2013 at 3:56