This commit is contained in:
@@ -25,6 +25,8 @@ public class TestEntry {
|
|||||||
|
|
||||||
private List<String> lists;
|
private List<String> lists;
|
||||||
|
|
||||||
|
private String[] strings;
|
||||||
|
|
||||||
private Map<String, Integer> map;
|
private Map<String, Integer> map;
|
||||||
|
|
||||||
public static TestEntry create() {
|
public static TestEntry create() {
|
||||||
@@ -32,6 +34,7 @@ public class TestEntry {
|
|||||||
v.setName("this is name\n \"test");
|
v.setName("this is name\n \"test");
|
||||||
v.setId(1000000001);
|
v.setId(1000000001);
|
||||||
v.setAddrs(new int[]{22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999});
|
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<String> list = new ArrayList<>();
|
||||||
list.add("aaaa");
|
list.add("aaaa");
|
||||||
list.add("bbbb");
|
list.add("bbbb");
|
||||||
@@ -111,4 +114,12 @@ public class TestEntry {
|
|||||||
this.desc = desc;
|
this.desc = desc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String[] getStrings() {
|
||||||
|
return strings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStrings(String[] strings) {
|
||||||
|
this.strings = strings;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ public class TestEntry2 extends TestEntry {
|
|||||||
v.setName("this is name\n \"test");
|
v.setName("this is name\n \"test");
|
||||||
v.setId(1000000001);
|
v.setId(1000000001);
|
||||||
v.setAddrs(new int[]{22222, 33333, 44444, 55555, 66666, 77777, 88888, 99999});
|
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<String> list = new ArrayList<>();
|
||||||
list.add("aaaa");
|
list.add("aaaa");
|
||||||
list.add("bbbb");
|
list.add("bbbb");
|
||||||
|
|||||||
@@ -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"));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user