Close resources after reading keystore

Description

For description and patch see:

http://www.igniterealtime.org/forum/thread.jspa?threadID=24470

Pasted text:

------------------------ Hi guys,

Smack opens a new file for the trust store every time a connection is created, but it never cleans up after itself once KeyLoad.load has done its job. The fix, of course, is simple and I've attached it.

Here is a simple block of code that will illustrate the problem (i.e., that the file remains open):
KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
FileInputStream is = new FileInputStream("/etc/java-6-sun/security/cacerts");
System.out.println(is.getChannel().isOpen()); // expected true
trustStore.load(is, "changeit".toCharArray());
System.out.println(is.getChannel().isOpen()); // expected true, desired false

Environment

None

Activity

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created February 8, 2007 at 7:36 AM
Updated February 12, 2007 at 11:08 AM
Resolved February 12, 2007 at 11:08 AM