diff --git a/findbugs/src/java/edu/umd/cs/findbugs/AddMessages.java b/findbugs/src/java/edu/umd/cs/findbugs/AddMessages.java
index <HASH>..<HASH> 100644
--- a/findbugs/src/java/edu/umd/cs/findbugs/AddMessages.java
+++ b/findbugs/src/java/edu/umd/cs/findbugs/AddMessages.java
@@ -118,6 +118,9 @@ public class AddMessages {
 			System.exit(1);
 		}
 		
+		// Load plugins, in order to get message files
+		DetectorFactoryCollection.instance();
+		
 		String inputFile = args[0];
 		String outputFile = args[1];
 		Project project = new Project();
@@ -127,9 +130,6 @@ public class AddMessages {
 		
 		Document document = inputCollection.toDocument(project);
 		
-		// Load plugins, in order to get message files
-		DetectorFactoryCollection.instance();
-		
 		AddMessages addMessages = new AddMessages(inputCollection, document);
 		addMessages.execute();
Make sure plugins are loaded before building the dom4j tree.  Otherwise,
the BugInstance elements won't get category attributes.


git-svn-id: <URL>