}
FileInputStream fis = null;
+ BufferedInputStream bis = null;
ObjectInputStream ois = null;
Loader loader = null;
ClassLoader classLoader = null;
try {
fis = new FileInputStream(file.getAbsolutePath());
- BufferedInputStream bis = new BufferedInputStream(fis);
+ bis = new BufferedInputStream(fis);
Container container = manager.getContainer();
if (container != null)
loader = container.getLoader();
manager.getContainer().getLogger().debug("No persisted data file found");
return (null);
} catch (IOException e) {
- if (ois != null) {
+ if (bis != null) {
try {
- ois.close();
+ bis.close();
+ } catch (IOException f) {
+ // Ignore
+ }
+ }
+ if (fis != null) {
+ try {
+ fis.close();
} catch (IOException f) {
// Ignore
}
- ois = null;
}
throw e;
}
return (session);
} finally {
// Close the input stream
- if (ois != null) {
- try {
- ois.close();
- } catch (IOException f) {
- // Ignore
- }
+ try {
+ ois.close();
+ } catch (IOException f) {
+ // Ignore
}
}
}
fos = new FileOutputStream(file.getAbsolutePath());
oos = new ObjectOutputStream(new BufferedOutputStream(fos));
} catch (IOException e) {
- if (oos != null) {
+ if (fos != null) {
try {
- oos.close();
+ fos.close();
} catch (IOException f) {
// Ignore
}
if (log.isDebugEnabled())
log.debug(sm.getString("standardManager.loading", pathname));
FileInputStream fis = null;
+ BufferedInputStream bis = null;
ObjectInputStream ois = null;
Loader loader = null;
ClassLoader classLoader = null;
try {
fis = new FileInputStream(file.getAbsolutePath());
- BufferedInputStream bis = new BufferedInputStream(fis);
+ bis = new BufferedInputStream(fis);
if (container != null)
loader = container.getLoader();
if (loader != null)
return;
} catch (IOException e) {
log.error(sm.getString("standardManager.loading.ioe", e), e);
- if (ois != null) {
+ if (fis != null) {
try {
- ois.close();
+ fis.close();
+ } catch (IOException f) {
+ // Ignore
+ }
+ }
+ if (bis != null) {
+ try {
+ bis.close();
} catch (IOException f) {
// Ignore
}
- ois = null;
}
throw e;
}
}
} catch (ClassNotFoundException e) {
log.error(sm.getString("standardManager.loading.cnfe", e), e);
- if (ois != null) {
- try {
- ois.close();
- } catch (IOException f) {
- // Ignore
- }
- ois = null;
+ try {
+ ois.close();
+ } catch (IOException f) {
+ // Ignore
}
throw e;
} catch (IOException e) {
log.error(sm.getString("standardManager.loading.ioe", e), e);
- if (ois != null) {
- try {
- ois.close();
- } catch (IOException f) {
- // Ignore
- }
- ois = null;
+ try {
+ ois.close();
+ } catch (IOException f) {
+ // Ignore
}
throw e;
} finally {
// Close the input stream
try {
- if (ois != null)
- ois.close();
+ ois.close();
} catch (IOException f) {
// ignored
}
oos = new ObjectOutputStream(new BufferedOutputStream(fos));
} catch (IOException e) {
log.error(sm.getString("standardManager.unloading.ioe", e), e);
- if (oos != null) {
+ if (fos != null) {
try {
- oos.close();
+ fos.close();
} catch (IOException f) {
// Ignore
}
- oos = null;
}
throw e;
}
}
} catch (IOException e) {
log.error(sm.getString("standardManager.unloading.ioe", e), e);
- if (oos != null) {
- try {
- oos.close();
- } catch (IOException f) {
- // Ignore
- }
- oos = null;
+ try {
+ oos.close();
+ } catch (IOException f) {
+ // Ignore
}
throw e;
}
// Flush and close the output stream
try {
oos.flush();
- oos.close();
- oos = null;
- } catch (IOException e) {
- if (oos != null) {
- try {
- oos.close();
- } catch (IOException f) {
- // Ignore
- }
- oos = null;
+ } finally {
+ try {
+ oos.close();
+ } catch (IOException f) {
+ // Ignore
}
- throw e;
}
// Expire all the sessions we just wrote