Author: sebb
Date: Sat Aug 20 10:41:32 2011
New Revision: 1159868
URL: http://svn.apache.org/viewvc?rev=1159868&view=rev
Log:
Localize and document SuppressWarnings
Modified:
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
Modified:
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
URL:
http://svn.apache.org/viewvc/commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java?rev=1159868&r1=1159867&r2=1159868&view=diff
==============================================================================
---
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
(original)
+++
commons/proper/dbutils/trunk/src/java/org/apache/commons/dbutils/QueryLoader.java
Sat Aug 20 10:41:32 2011
@@ -91,7 +91,6 @@ public class QueryLoader {
* @since DbUtils 1.1
* @return Map of query names to SQL values
*/
- @SuppressWarnings("unchecked")
protected Map<String,String> loadQueries(String path) throws IOException {
// Findbugs flags getClass().getResource as a bad practice; maybe we
should change the API?
InputStream in = getClass().getResourceAsStream(path);
@@ -104,7 +103,10 @@ public class QueryLoader {
props.load(in);
// Copy to HashMap for better performance
- return new HashMap(props);
+
+ @SuppressWarnings({ "rawtypes", "unchecked" }) // load() always
creates <String,String> entries
+ HashMap<String,String> hashMap = new HashMap(props);
+ return hashMap;
}
/**