package com.alibaba.json.bvt.bug;

import java.util.List;

import org.junit.Assert;

import com.alibaba.fastjson.JSON;

import junit.framework.TestCase;

public class Bug_for_issue_470 extends TestCase {
    
    public void test_for_issue() throws Exception {
        List<VO> list = JSON.parseArray("[{\"value\":null}]", VO.class);
        Assert.assertEquals(1, list.size());
        Assert.assertEquals(false, list.get(0).value);
    }
    
    public void test_for_issue_1() throws Exception {
        List<V1> list = JSON.parseArray("[{\"value\":null}]", V1.class);
        Assert.assertEquals(1, list.size());
        Assert.assertEquals(false, list.get(0).value);
    }

    public static class VO {
        public boolean value;
    }
    
    private static class V1 {
        public boolean value;
    }
}

@@ -469,17 +469,23 @@
 r_issue_
-1
+private
 () throw
@@ -681,138 +681,639 @@
   %7D%0A
-%0A    public static class VO %7B%0A        public boolean value;%0A    %7D%0A    %0A    private static class V1 %7B%0A        public boolean value;
+    %0A    public void test_for_issue_method() throws Exception %7B%0A        List%3CV2%3E list = JSON.parseArray(%22%5B%7B%5C%22value%5C%22:null%7D%5D%22, V2.class);%0A        Assert.assertEquals(1, list.size());%0A        Assert.assertEquals(false, list.get(0).value);%0A    %7D%0A%0A    public static class VO %7B%0A        public boolean value;%0A    %7D%0A    %0A    private static class V1 %7B%0A        public boolean value;%0A    %7D%0A    %0A    public static class V2 %7B%0A        private boolean value;%0A        %0A        public boolean isValue() %7B%0A            return value;%0A        %7D%0A%0A        %0A        public void setValue(boolean value) %7B%0A            this.value = value;%0A        %7D%0A        
 %0A   

add testcase for issue 470. https://github.com/alibaba/fastjson/issues/470