안전하게 닫히지 않은 JNDI 리소스를 보고합니다. 이 검사에서 보고되는 JNDI 리소스에는 javax.naming.InitialContext, javax.naming.NamingEnumeration이 포함됩니다.

이 검사는 기본적으로 리소스의 이름에 'close' 또는 'cleanup'이 붙는 모든 메서드에 의해 닫힐 수 있다고 가정합니다.

예:


  Object findObject(Properties properties, String name) throws NamingException {
    Context context = new InitialContext(properties); // 컨텍스트가 닫히지 않았습니다
    return context.lookup(name);
  }

다음 옵션을 사용해 검사를 구성하세요.