wangliang 3 年 前
コミット
a256f1f393
1 ファイル変更14 行追加14 行削除
  1. 14 14
      src/main/java/com/qmth/eds/EdsServiceApplication.java

+ 14 - 14
src/main/java/com/qmth/eds/EdsServiceApplication.java

@@ -29,22 +29,22 @@ import java.lang.reflect.Field;
 @EnableCaching // 开启缓存注解
 public class EdsServiceApplication {
 
-    public static void disableWarning() {
-        try {
-            Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
-            theUnsafe.setAccessible(true);
-            Unsafe u = (Unsafe) theUnsafe.get(null);
-
-            Class cls = Class.forName("jdk.internal.module.IllegalAccessLogger");
-            Field logger = cls.getDeclaredField("logger");
-            u.putObjectVolatile(cls, u.staticFieldOffset(logger), null);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
+//    public static void disableWarning() {
+//        try {
+//            Field theUnsafe = Unsafe.class.getDeclaredField("theUnsafe");
+//            theUnsafe.setAccessible(true);
+//            Unsafe u = (Unsafe) theUnsafe.get(null);
+//
+//            Class cls = Class.forName("jdk.internal.module.IllegalAccessLogger");
+//            Field logger = cls.getDeclaredField("logger");
+//            u.putObjectVolatile(cls, u.staticFieldOffset(logger), null);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
 
     public static void main(String[] args) {
-        disableWarning();
+//        disableWarning();
         SpringApplication.run(EdsServiceApplication.class, args);
     }