{"id":4072,"date":"2019-04-02T11:05:23","date_gmt":"2019-04-02T03:05:23","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=4072"},"modified":"2019-04-02T11:05:23","modified_gmt":"2019-04-02T03:05:23","slug":"%e6%89%8b%e6%8a%8a%e6%89%8b%e6%95%99%e4%bd%a0%e7%94%a8%e4%bb%a3%e7%a0%81%e5%ae%9e%e7%8e%b0-unsafe-%e7%9a%84-9-%e5%a4%a7%e4%bd%bf%e7%94%a8%e5%9c%ba%e6%99%af","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=4072","title":{"rendered":"\u624b\u628a\u624b\u6559\u4f60\u7528\u4ee3\u7801\u5b9e\u73b0 Unsafe \u7684 9 \u5927\u4f7f\u7528\u573a\u666f"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Unsafe \u8fd9\u4e2a\u7c7b\u662f\u4f60\u7528\u5c31\u89c9\u5f97\u597d\u7528\u7684\u7c7b\u3002\u4eca\u5929\u6211\u501f\u52a9\u5b83\uff0c\u8fb9\u4ecb\u7ecd\u5b83\u7684\u4f7f\u7528\u573a\u666f\u4fbf\u7ed9\u5927\u5bb6\u8bb2\u5b9e\u73b0\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/wx1.sinaimg.cn\/large\/8fa5dcfcgy1g1n2bdwqs1j20sd0cnabk.jpg\" alt=\"\" \/><figcaption>Unsafe \u76848\u5927\u4e3b\u8981\u529f\u80fd<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u4e00\uff1aUnsafe \u53ef\u4ee5\u7528\u5728\u907f\u514d\u7c7b\u521d\u59cb\u5316\u7684\u573a\u666f\u3002\u4e5f\u5c31\u662f\u4e0d\u9700\u8981\u6267\u884c\u7c7b\u6784\u9020\u51fd\u6570\u7684\u573a\u666f\uff0c\u8df3\u8fc7\u5bf9\u8c61\u521d\u59cb\u5316\u9636\u6bb5\uff0c\u6216\u7ed5\u8fc7\u6784\u9020\u5668\u7684\u5b89\u5168\u68c0\u67e5\uff0c\u6216\u5b9e\u4f8b\u5316\u4e00\u4e2a\u6ca1\u6709\u4efb\u4f55\u516c\u5171\u6784\u9020\u5668\u7684\u7c7b\u3002\u770b\u4e0b\u9762\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Xttblog {\n    private long xttblog; \/\/ not initialized value\n    public Xttblog() {\n        this.xttblog = 1; \/\/ initialization\n    }\n    public long xttblog() {\n        return this.xttblog;\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u9762\u5206\u522b\u4f7f\u7528\u6784\u9020\u5668\u3001\u53cd\u5c04\u548c Unsafe \u521d\u59cb\u5316\u5b83\uff0c\u770b\u770b\u6700\u7ec8\u7684\u7ed3\u679c\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Xttblog obj1 = new Xttblog(); \/\/ constructor\nobj1.xttblog(); \/\/ prints 1\nXttblog obj2 = Xttblog.class.newInstance(); \/\/ reflection\nobj2.xttblog(); \/\/ prints 1\nXttblog obj3 = (Xttblog) unsafe.allocateInstance(Xttblog.class); \/\/ unsafe\nobj3.xttblog(); \/\/ prints 0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c\u7ed3\u679c\u8868\u660e\uff0c\u901a\u8fc7 Unsafe \u521d\u59cb\u5316\u7684\u7c7b\uff0c\u80fd\u8df3\u8fc7\u6784\u9020\u51fd\u6570\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u4e8c\uff1a\u4e0d\u901a\u8fc7\u53cd\u5c04\u6765\u6539\u53d8\u67d0\u4e9b\u8bbf\u95ee\u89c4\u5219\u3002\u6bd4\u5982\u7ed5\u8fc7\u5b89\u5168\u7684\u5e38\u7528\u6280\u672f\u7b49\uff0c\u9ed1\u5ba2\u5e38\u7528\u7684\u4f0e\u4fe9\u3002\u6a21\u62df\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Access {\n   private int ACCESS_ALLOWED = 66;\n   public boolean giveAccess() {\n          return 88 == ACCESS_ALLOWED;\n   }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0c\u6211\u4eec\u8c03\u7528 giveAccess \u65b9\u6cd5\uff0c\u8fd4\u56de\u7684\u4e00\u5b9a\u662f false\u3002\u73b0\u5728\uff0c\u6211\u4eec\u901a\u8fc7 Unsafe \u8ba9\u5b83\u8fd4\u56de true\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Access xttblog = new Access();\nxttblog.giveAccess();   \/\/ false\nUnsafe unsafe = getUnsafe();\nField f = xttblog.getClass().getDeclaredField(\"ACCESS_ALLOWED\");\nunsafe.putInt(xttblog, unsafe.objectFieldOffset(f), 88);\nxttblog.giveAccess(); \/\/ true<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6837\u505a\u4e4b\u540e ACCESS_ALLOWED \u7684\u503c\u5c31\u5f7b\u5e95\u7684\u53d8\u6210 88 \u4e86\uff0c\u540e\u9762\u6240\u6709\u7684\u8bbf\u95ee\u90fd\u4f1a\u662f true\uff0c\u5f53\u7136\u4f60\u8fd8\u53ef\u4ee5\u518d\u628a\u503c\u6539\u8fc7\u6765\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u4e09\uff1a\u6d45\u62f7\u8d1d\u3002\u666e\u901a\u7684\u505a\u6cd5\u662f\u4f7f\u7528 Cloneable\u3002\u4f46\u662f\u5982\u679c\u6709\u592a\u591a\u7684\u7c7b\uff0c\u6bcf\u4e2a\u7c7b\u90fd\u7528 Cloneable \u5c31\u592a\u9ebb\u70e6\uff0c\u8fd9\u65f6\u5c31\u53ef\u4ee5\u501f\u52a9 Unsafe \u6765\u5b9e\u73b0\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>static Object shallowCopy(Object obj) {\n    long size = sizeOf(obj);\n    long start = toAddress(obj);\n    long address = getUnsafe().allocateMemory(size);\n    getUnsafe().copyMemory(start, address, size);\n    return fromAddress(address);\n}\nstatic long toAddress(Object obj) {\n    Object[] array = new Object[] {obj};\n    long baseOffset = getUnsafe().arrayBaseOffset(Object[].class);\n    return normalize(getUnsafe().getInt(array, baseOffset));\n}\nstatic Object fromAddress(long address) {\n    Object[] array = new Object[] {null};\n    long baseOffset = getUnsafe().arrayBaseOffset(Object[].class);\n    getUnsafe().putLong(array, baseOffset, address);\n    return array[0];\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u56db\uff1a\u7834\u89e3\u67d0\u4e9b\u5bc6\u7801\uff0c\u83b7\u53d6\u5185\u5b58\u4e2d\u7684\u5bc6\u7801\u3002\u901a\u8fc7 Unsafe \u53ef\u4ee5\u8bbf\u95ee\u5230\u67d0\u4e9b\u6ca1\u6709\u88ab\u56de\u6536\u7684\u5185\u5b58\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u68c0\u7d22\u7528\u6237\u5bc6\u7801\u7684\u5927\u591a\u6570 API \u7684\u7b7e\u540d\u4e3a byte[] \u6216 char[]\uff0c\u4e3a\u4ec0\u4e48\u662f\u6570\u7ec4\u5462\uff1f\u8fd9\u662f\u51fa\u4e8e\u5b89\u5168\u7684\u7f18\u6545\uff0c\u56e0\u4e3a\u6211\u4eec\u53ef\u4ee5\u5220\u9664\u4e0d\u9700\u8981\u7684\u6570\u7ec4\u5143\u7d20\u3002\u5982\u679c\u5c06\u7528\u6237\u5bc6\u7801\u68c0\u7d22\u6210\u5b57\u7b26\u4e32\uff0c\u8fd9\u53ef\u4ee5\u50cf\u4e00\u4e2a\u5bf9\u8c61\u4e00\u6837\u5728\u5185\u5b58\u4e2d\u4fdd\u5b58\uff0c\u800c\u5220\u9664\u8be5\u5bf9\u8c61\u53ea\u9700\u6267\u884c\u89e3\u9664\u5f15\u7528\u7684\u64cd\u4f5c\u3002\u4f46\u662f\uff0c\u8fd9\u4e2a\u5bf9\u8c61\u4ecd\u7136\u5728\u5185\u5b58\u4e2d\uff0c\u7531 GC \u51b3\u5b9a\u7684\u65f6\u95f4\u6765\u6267\u884c\u6e05\u9664\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>String password = new String(\"www.xttblog.com\");\nString fake = new String(password.replaceAll(\".\", \"?\"));\nSystem.out.println(password); \/\/ www.xttblog.com\nSystem.out.println(fake); \/\/ ????????????\n\ngetUnsafe().copyMemory(fake, \n    0L, null, toAddress(password), sizeOf(password));\nSystem.out.println(password); \/\/ ????????????\nSystem.out.println(fake); \/\/ ????????????\n\nField stringValue = String.class.getDeclaredField(\"value\");\nstringValue.setAccessible(true);\nchar[] mem = (char[]) stringValue.get(password);\nfor (int i=0; i &lt; mem.length; i++) {\n  mem[i] = '?';\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u4e94\uff1aJava \u591a\u7ee7\u627f\u3002Java \u4e2d\u867d\u7136\u6ca1\u6709\u591a\u7ee7\u627f\uff0c\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 Unsafe \u6765\u7834\u574f\u8fd9\u4e2a\u89c4\u5219\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>long intClassAddress = normalize(getUnsafe().getInt(new Integer(0), 4L));\nlong strClassAddress = normalize(getUnsafe().getInt(\"\", 4L));\ngetUnsafe().putAddress(intClassAddress + 36, strClassAddress);\n\n(String) (Object) (new Integer(666))<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u4ee3\u7801\u7247\u6bb5\u5c06 String \u7c7b\u578b\u6dfb\u52a0\u5230 Integer \u8d85\u7c7b\u4e2d\uff0c\u56e0\u6b64\u6211\u4eec\u53ef\u4ee5\u5f3a\u5236\u8f6c\u6362\uff0c\u4e14\u6ca1\u6709\u8fd0\u884c\u65f6\u5f02\u5e38\u3002\u4f46\u662f\u6211\u4eec\u5fc5\u987b\u9884\u5148\u5f3a\u5236\u8f6c\u6362\u5bf9\u8c61\uff0c\u4ee5\u6b3a\u9a97\u7f16\u8bd1\u5668\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u516d\uff1a\u52a8\u6001\u7c7b\u3002\u4ece\u5df2\u7f16\u8bd1\u7684 .class \u6587\u4ef6\u4e2d\u3002\u5c06\u7c7b\u5185\u5bb9\u8bfb\u53d6\u4e3a\u5b57\u8282\u6570\u7ec4\uff0c\u5e76\u6b63\u786e\u5730\u4f20\u9012\u7ed9 defineClass \u65b9\u6cd5\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>byte[] classContents = getClassContent();\nClass c = getUnsafe().defineClass(\n              null, classContents, 0, classContents.length);\n    c.getMethod(\"xttblog\").invoke(c.newInstance(), null); \/\/ 1\n    \nprivate static byte[] getClassContent() throws Exception {\n    File f = new File(\"\/www\/xttblog\/newclass\/Xttblog.class\");\n    FileInputStream input = new FileInputStream(f);\n    byte[] content = new byte[(int)f.length()];\n    input.read(content);\n    input.close();\n    return content;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u4e03\uff1a\u629b\u51fa\u5f02\u5e38\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>getUnsafe().throwException(new IOException());<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8be5\u65b9\u6cd5\u629b\u51fa\u53d7\u68c0\u5f02\u5e38\uff0c\u4f46\u4f60\u7684\u4ee3\u7801\u4e0d\u5fc5\u6355\u6349\u6216\u91cd\u65b0\u629b\u51fa\u5b83\uff0c\u6b63\u5982\u8fd0\u884c\u65f6\u5f02\u5e38\u4e00\u6837\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u516b\uff1a\u5feb\u901f\u5e8f\u5217\u5316\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6807\u51c6 Java \u7684 Serializable \u7684\u5e8f\u5217\u5316\u80fd\u529b\u662f\u975e\u5e38\u6162\u7684\u3002\u5b83\u540c\u65f6\u8981\u6c42\u7c7b\u5fc5\u987b\u6709\u4e00\u4e2a\u516c\u5171\u7684\u3001\u65e0\u53c2\u6570\u7684\u6784\u9020\u5668\u3002Externalizable \u6bd4\u8f83\u597d\uff0c\u4f46\u5b83\u9700\u8981\u5b9a\u4e49\u7c7b\u5e8f\u5217\u5316\u7684\u6a21\u5f0f\u3002\u6d41\u884c\u7684\u9ad8\u6027\u80fd\u5e93\uff0c\u6bd4\u5982 kryo \u5177\u6709\u4f9d\u8d56\u6027\uff0c\u8fd9\u5bf9\u4e8e\u4f4e\u5185\u5b58\u8981\u6c42\u6765\u8bf4\u662f\u4e0d\u53ef\u63a5\u53d7\u7684\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u65f6\u5019 unsafe \u7c7b\u5c31\u53ef\u4ee5\u6d3e\u4e0a\u7528\u573a\uff0c\u5927\u663e\u8eab\u624b\u4e86\u3002Gson\u3001Fastjson\u3001commons-collections \u7b49\u4e2d\u90fd\u6709\u4f7f\u7528\uff0c\u6211\u5c31\u4e0d\u8d34\u4ee3\u7801\u4e86\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u4e5d\uff1a\u8d85\u8d8a Integer.MAX_VALUE \u9650\u5236\u7684\u5927\u6570\u7ec4\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class SuperArray {\n    private final static int BYTE = 1;\n    private long size;\n    private long address;\n    public SuperArray(long size) {\n        this.size = size;\n        address = getUnsafe().allocateMemory(size * BYTE);\n    }\n    public void set(long i, byte value) {\n        getUnsafe().putByte(address + i * BYTE, value);\n    }\n    public int get(long idx) {\n        return getUnsafe().getByte(address + idx * BYTE);\n    }\n    public long size() {\n        return size;\n    }\n}\nclass SuperArray {\n    private final static int BYTE = 1;\n    private long size;\n    private long address;\n    public SuperArray(long size) {\n        this.size = size;\n        address = getUnsafe().allocateMemory(size * BYTE);\n    }\n    public void set(long i, byte value) {\n        getUnsafe().putByte(address + i * BYTE, value);\n    }\n    public int get(long idx) {\n        return getUnsafe().getByte(address + idx * BYTE);\n    }\n    public long size() {\n        return size;\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\u5806\u5916\u5185\u5b58\uff08off-heap memory\uff09\u6280\u672f\uff0c\u5728 java.nio \u5305\u4e2d\u90e8\u5206\u53ef\u7528\u3002\u8fd9\u79cd\u65b9\u5f0f\u7684\u5185\u5b58\u5206\u914d\u4e0d\u5728\u5806\u4e0a\uff0c\u4e14\u4e0d\u53d7 GC \u7ba1\u7406\uff0c\u6240\u4ee5\u5fc5\u987b\u5c0f\u5fc3 Unsafe.freeMemory() \u7684\u4f7f\u7528\u3002\u5b83\u4e5f\u4e0d\u6267\u884c\u4efb\u4f55\u8fb9\u754c\u68c0\u67e5\uff0c\u6240\u4ee5\u4efb\u4f55\u975e\u6cd5\u8bbf\u95ee\u53ef\u80fd\u4f1a\u5bfc\u81f4 JVM \u5d29\u6e83\u3002\u8fd9\u53ef\u7528\u4e8e\u6570\u5b66\u8ba1\u7b97\uff0c\u4ee3\u7801\u53ef\u64cd\u4f5c\u5927\u6570\u7ec4\u7684\u6570\u636e\u3002\u6b64\u5916\uff0c\u8fd9\u53ef\u5f15\u8d77\u5b9e\u65f6\u7a0b\u5e8f\u5458\u7684\u5174\u8da3\uff0c\u53ef\u6253\u7834 GC \u5728\u5927\u6570\u7ec4\u4e0a\u5ef6\u8fdf\u7684\u9650\u5236\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\u573a\u666f\u5341\uff1a\u65e0\u9501\u9ad8\u5e76\u53d1\u3002\u8fd9\u4e00\u7c7b\u7684\u6bd4\u5982\uff1aAtomicInteger\u3001AtomicLong \u7b49 java.util.concurrent.atomic \u5305\u4e0b\u7684\u7c7b\u3002\u5f53\u7136\u6211\u4eec\u8fd8\u53ef\u4ee5\u6269\u5c55\u81ea\u5df1\u7684\u5b9e\u73b0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0a 10 \u79cd\u573a\u666f\uff0c\u5e73\u5e38\u4f60\u4f7f\u7528\u7684\u591a\u5c11\u6846\u67b6\u4e2d\u53ef\u80fd\u90fd\u6709\u4f7f\u7528\uff0c\u4f60\u53ea\u662f\u4e0d\u77e5\u9053\u7f62\u4e86\uff01<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=4072\">\u624b\u628a\u624b\u6559\u4f60\u7528\u4ee3\u7801\u5b9e\u73b0 Unsafe \u7684 9 \u5927\u4f7f\u7528\u573a\u666f<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>Unsafe \u8fd9\u4e2a\u7c7b\u662f\u4f60\u7528\u5c31\u89c9\u5f97\u597d\u7528\u7684\u7c7b\u3002\u4eca\u5929\u6211\u501f\u52a9\u5b83\uff0c\u8fb9\u4ecb\u7ecd\u5b83\u7684\u4f7f\u7528\u573a\u666f\u4fbf\u7ed9\u5927\u5bb6\u8bb2\u5b9e\u73b0\u3002 \u4f7f\u7528\u573a\u666f\u4e00\uff1aUns [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1753,1174,731,314,1751],"class_list":["post-4072","post","type-post","status-publish","format-standard","hentry","category-java","tag-cas","tag-gc","tag-jvm","tag-taobaojvm","tag-unsafe"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4072","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4072"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4072\/revisions"}],"predecessor-version":[{"id":4073,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/4072\/revisions\/4073"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4072"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4072"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4072"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}