This commit is contained in:
kamhung
2015-12-03 13:29:29 +08:00
parent 85e0271265
commit 93c4360137
3 changed files with 12 additions and 38 deletions

View File

@@ -25,6 +25,8 @@ public class TestEntry {
private List<String> lists;
private String[] strings;
private Map<String, Integer> map;
public static TestEntry create() {
@@ -32,6 +34,7 @@ public class TestEntry {
v.setName("this is name\n \"test");
v.setId(1000000001);
v.setAddrs(new int[]{22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999});
v.setStrings(new String[]{"zzz","yyy","xxx"});
List<String> list = new ArrayList<>();
list.add("aaaa");
list.add("bbbb");
@@ -111,4 +114,12 @@ public class TestEntry {
this.desc = desc;
}
public String[] getStrings() {
return strings;
}
public void setStrings(String[] strings) {
this.strings = strings;
}
}

View File

@@ -22,6 +22,7 @@ public class TestEntry2 extends TestEntry {
v.setName("this is name\n \"test");
v.setId(1000000001);
v.setAddrs(new int[]{22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999});
v.setStrings(new String[]{"zzz","yyy","xxx"});
List<String> list = new ArrayList<>();
list.add("aaaa");
list.add("bbbb");

View File

@@ -1,38 +0,0 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.wentch.redkale.test.util;
import java.util.*;
/**
*
* @author zhangjx
*/
public class Test {
public static void main(String args[]) {
List<String> list = new ArrayList<String>();
test1(list);
System.out.println(list.size()); // 1处
test2(list);
System.out.println(list.size()); // 2处
test3(list);
System.out.println(list.size()); // 3处
}
public static void test1(List list) {
list = null;
}
public static void test2(List list) {
list.add("3wyc");
}
public static void test3(List list) {
list.add(new StringBuilder("3wyc"));
}
}