diff options
author | Andrew Niefer | 2009-03-03 13:45:49 +0000 |
---|---|---|
committer | Andrew Niefer | 2009-03-03 13:45:49 +0000 |
commit | 0e271128c6c844bb5803a41d7bf8b9855e286a9c (patch) | |
tree | dbffa7c83af942ea5e27ea612f099dc63798fc67 /bundles/org.eclipse.equinox.p2.publisher | |
parent | b33c58399532d46f517c96757cde2c9a5ffe8bff (diff) | |
download | rt.equinox.p2-0e271128c6c844bb5803a41d7bf8b9855e286a9c.tar.gz rt.equinox.p2-0e271128c6c844bb5803a41d7bf8b9855e286a9c.tar.xz rt.equinox.p2-0e271128c6c844bb5803a41d7bf8b9855e286a9c.zip |
bug 266816 - close input stream
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java index 76e8c01af..78d13743b 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java @@ -153,21 +153,17 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { public ProductFile(String location) throws Exception { super(); this.location = new File(location); - // try { + parserFactory.setNamespaceAware(true); parser = parserFactory.newSAXParser(); InputStream in = new BufferedInputStream(new FileInputStream(location)); - parser.parse(new InputSource(in), this); + try { + parser.parse(new InputSource(in), this); + } finally { + if (in != null) + in.close(); + } parser = null; - // } catch (ParserConfigurationException e) { - // throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, NLS.bind(Messages.exception_productParse, location), e)); - // } catch (SAXException e) { - // throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, NLS.bind(Messages.exception_productParse, location), e)); - // } catch (FileNotFoundException e) { - // throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FILE, NLS.bind(Messages.exception_missingElement, location), null)); - // } catch (IOException e) { - // throw new CoreException(new Status(IStatus.ERROR, PI_PDEBUILD, EXCEPTION_PRODUCT_FORMAT, NLS.bind(Messages.exception_productParse, location), e)); - // } } /** |