if (a == (Integer) 1 && a == (In
2021-06-01 本文已影响0人
莫夏_b560
@RequestMapping("/get")
@RestController
public class DemoController {
@GetMapping("/1")
public Object get1(){
Class<?> cache = Integer.class.getDeclaredClasses()[0];
Field c;
try {
c = cache.getDeclaredField("cache");
c.setAccessible(true);
Integer[] array = (Integer[]) c.get(cache);
array[130] = array[129];
int a = 1;
if (a == (Integer) 1 && a == (Integer) 2) {
System.out.println("true");
}
System.out.println(Thread.currentThread().getName());
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
return "1";
}
@GetMapping("/2")
public Object get2(){
System.out.println(Thread.currentThread().getName());
System.out.println(Integer.valueOf(2));
return "2";
}
}