AccessibleObject#isAccessible is deprecated from JDK-9+ #1958

isAccessible is deprecated from JDK-9+ Oracle#doc#isAccessible

Example

    if (forceAccess && !field.isAccessible()) {
      field.setAccessible(true);
    }

, suggested update

    if (forceAccess && !field.canAccess(target)) {
      field.setAccessible(true);
    }
posted @ 2022-03-12 20:04  锐洋智能  阅读(247)  评论(0编辑  收藏  举报