JDK-7057061 : Support autocloseable for javax.naming.Context
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2011-06-20
  • Updated: 2019-08-31
  • Resolved: 2019-08-31
Related Reports
Relates :  
Relates :  
Description
Add support for AutoCloseable to javax.naming.Context.
Will enable the use of try-with-resourses constructs, for example:

    try (DirContext ctx = new InitialDirContext(env)) {
        NamingEnumeration<SearchResult> answer =
            ctx.search("ou=People,o=JNDITutorial", "(objectClass=*)", null);

    }

Comments
Closing as will not fix; re-open if there is interest in belated retrofitting.
31-08-2019