美文网首页
if (a == (Integer) 1 && a == (In

if (a == (Integer) 1 && a == (In

作者: 莫夏_b560 | 来源:发表于2021-06-01 11:28 被阅读0次
@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";
    }
}

相关文章

网友评论

      本文标题:if (a == (Integer) 1 && a == (In

      本文链接:https://www.haomeiwen.com/subject/qvswsltx.html