modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/i18n/PropertiesGenerator.java
| 53 +++++-----
1 file changed, 30 insertions(+), 23 deletions(-)
New commits:
commit 59a739e6a77f05d48ede89e5dc416ea670ad478c
Author: John Mazzitelli <mazz(a)redhat.com>
Date: Thu Jul 28 15:13:36 2011 -0400
[coverity] this isn't used anywhere, but we may revive it later. close the input
stream properly.
diff --git
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/i18n/PropertiesGenerator.java
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/i18n/PropertiesGenerator.java
index 93a9c56..3c9d64f 100644
---
a/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/i18n/PropertiesGenerator.java
+++
b/modules/core/client-api/src/main/java/org/rhq/core/clientapi/agent/metadata/i18n/PropertiesGenerator.java
@@ -1,25 +1,25 @@
- /*
- * RHQ Management Platform
- * Copyright (C) 2005-2008 Red Hat, Inc.
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License, version 2, as
- * published by the Free Software Foundation, and/or the GNU Lesser
- * General Public License, version 2.1, also as published by the Free
- * Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License and the GNU Lesser General Public License
- * for more details.
- *
- * You should have received a copy of the GNU General Public License
- * and the GNU Lesser General Public License along with this program;
- * if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation, and/or the GNU Lesser
+ * General Public License, version 2.1, also as published by the Free
+ * Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License and the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * and the GNU Lesser General Public License along with this program;
+ * if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
package org.rhq.core.clientapi.agent.metadata.i18n;
import java.io.File;
@@ -34,9 +34,11 @@ import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
+
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
@@ -106,7 +108,12 @@ public class PropertiesGenerator {
if (update) {
// First load into properties we can check for existence
previousProperties = new Properties();
- previousProperties.load(new FileInputStream(propertiesFile));
+ FileInputStream is = new FileInputStream(propertiesFile);
+ try {
+ previousProperties.load(is);
+ } finally {
+ is.close();
+ }
this.contentWriter.println("\n\n# Contents added " + new Date()
+ "\n\n");
}
Show replies by date