mirror of
https://github.com/alibaba/arthas.git
synced 2024-04-21 10:21:39 +00:00
init
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.alibaba.arthas;
|
||||
|
||||
public class Pojo {
|
||||
String name;
|
||||
int age;
|
||||
String hobby;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String getHobby() {
|
||||
return hobby;
|
||||
}
|
||||
|
||||
public void setHobby(String hobby) {
|
||||
this.hobby = hobby;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.alibaba.arthas;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author diecui1202 on 2017/9/13.
|
||||
*/
|
||||
public class Test {
|
||||
|
||||
public static final Map m = new HashMap();
|
||||
public static final Map n = new HashMap();
|
||||
|
||||
public static final Map p = null;
|
||||
|
||||
static {
|
||||
m.put("a", "aaa");
|
||||
m.put("b", "bbb");
|
||||
|
||||
n.put(Type.RUN, "aaa");
|
||||
n.put(Type.STOP, "bbb");
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws InterruptedException {
|
||||
List<Pojo> list = new ArrayList<Pojo>();
|
||||
|
||||
for (int i = 0; i < 40; i ++) {
|
||||
Pojo pojo = new Pojo();
|
||||
pojo.setName("name " + i);
|
||||
pojo.setAge(i + 2);
|
||||
|
||||
list.add(pojo);
|
||||
}
|
||||
|
||||
System.out.println(p);
|
||||
|
||||
while (true) {
|
||||
int random = new Random().nextInt(40);
|
||||
String name = list.get(random).getName();
|
||||
list.get(random).setName(null);
|
||||
test(list);
|
||||
list.get(random).setName(name);
|
||||
Thread.sleep(1000l);
|
||||
}
|
||||
}
|
||||
|
||||
public static void test(List<Pojo> list) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public static void invoke(String a) {
|
||||
System.out.println(a);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package com.alibaba.arthas;
|
||||
|
||||
public enum Type {
|
||||
RUN, STOP;
|
||||
}
|
||||
Reference in New Issue
Block a user