Clean up error handling to make things slightly friendlier on an initial install.
[cfb.git] / prod / net / jaekl / cfb / analyze / MessageMap.java
index 0db78babfdaa2974a0c4d366841ed10c5a71f33f..635e79df21c86b2e546e3ddf36869c2b0a426467 100644 (file)
@@ -52,14 +52,14 @@ public class MessageMap {
        
        void loadCategoryIds(Connection con, DbDriver driver) throws SQLException, TypeMismatchException
        {
-               Column[] columns = { CfbSchema.CATEGORIES.getColumn(CfbSchema.CATEGORYID),
-                                            CfbSchema.CATEGORIES.getColumn(CfbSchema.CATEGORY)   };
+               Column[] columns = { CfbSchema.CATEGORYID,
+                                            CfbSchema.CATEGORY   };
                Table[] tables = { CfbSchema.CATEGORIES };
                Condition[] conditions = { };
                List<Row> rows = driver.select(con, columns, tables, conditions);
                
                for (Row row : rows) {
-                       long catId = row.getLong(0);
+                       Long catId = row.getLong(0);
                        String catName = row.getString(1);
                        
                        BugCategory cat = getColl().getCategory(catName);
@@ -74,14 +74,13 @@ public class MessageMap {
        
        void loadBugPatternIds(Connection con, DbDriver driver) throws SQLException, TypeMismatchException
        {
-               Column[] columns = { CfbSchema.BUGS.getColumn(CfbSchema.BUGID),
-                                    CfbSchema.BUGS.getColumn(CfbSchema.TYPE)   }; 
+               Column[] columns = { CfbSchema.BUGID, CfbSchema.TYPE }; 
                Table[] tables = { CfbSchema.BUGS };
                Condition[] conditions = { };
                List<Row> rows = driver.select(con, columns, tables, conditions);
                
                for (Row row: rows) {
-                       long bugId = row.getLong(0);
+                       Long bugId = row.getLong(0);
                        String type = row.getString(1);
                        
                        BugPattern bug = getColl().getPattern(type);
@@ -95,7 +94,7 @@ public class MessageMap {
        }
 
        // Load the list of bug patterns and categories from the FindBugs messages.xml file.
-       public void load(File findBugsDir, Locale locale) throws FileNotFoundException, IOException, SAXException
+       public void load(File findBugsDir, Locale locale) throws FBMsgFileNotFoundException, IOException, SAXException
        {
                m_findBugsDir = findBugsDir;
                
@@ -109,7 +108,7 @@ public class MessageMap {
                }
                
                if (! msgXml.canRead()) {
-                       throw new FileNotFoundException(msgXml.getAbsolutePath());
+                       throw new FBMsgFileNotFoundException(msgXml.getAbsolutePath());
                }
                
                parse(new InputSource(new FileInputStream(msgXml)));
@@ -117,7 +116,7 @@ public class MessageMap {
        }
        
        // Parse the FindBugs messages.xml file
-       void parse(InputSource xml) throws FileNotFoundException, IOException, SAXException 
+       public void parse(InputSource xml) throws FileNotFoundException, IOException, SAXException 
        {
                m_msgColl = new MessageCollection();