Author: dgolovin
Date: 2008-08-29 02:36:13 -0400 (Fri, 29 Aug 2008)
New Revision: 9950
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java
Log:
Fix PMD Violations
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java 2008-08-29
00:21:46 UTC (rev 9949)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/DocumentGenerator.java 2008-08-29
06:36:13 UTC (rev 9950)
@@ -10,12 +10,24 @@
******************************************************************************/
package org.jboss.tools.common.meta.impl.documentation;
-import java.io.*;
-import java.util.*;
-import org.w3c.dom.*;
-import org.jboss.tools.common.model.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.plugin.ModelPlugin;
-import org.jboss.tools.common.model.util.*;
+import org.jboss.tools.common.model.util.XMLUtil;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
+import org.w3c.dom.Element;
public class DocumentGenerator {
private XModelObject meta = null;
@@ -29,7 +41,7 @@
}
public void generate(String filename) {
- if(meta == null) throw new RuntimeException("Meta root is not set.");
+ if(meta == null) throw new IllegalStateException("Meta root is not
set.");
this.filename = filename;
Element g = XMLUtil.createDocumentElement("html");
generateTitle(g);
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java 2008-08-29
00:21:46 UTC (rev 9949)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/impl/documentation/MetaValidator.java 2008-08-29
06:36:13 UTC (rev 9950)
@@ -10,7 +10,11 @@
******************************************************************************/
package org.jboss.tools.common.meta.impl.documentation;
-import java.util.*;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.Set;
+import java.util.Vector;
+
import org.jboss.tools.common.model.XModelObject;
public class MetaValidator {
@@ -22,7 +26,7 @@
public void validate(XModelObject metaroot) {
if(!"MetaRoot".equals(metaroot.getModelEntity().getName()))
- throw new RuntimeException("Meta validator must be called with
MetaRoot.");
+ throw new IllegalArgumentException("Meta validator must be called with
MetaRoot.");
iv.validate(metaroot.getChildren("MetaIcons")[0]);
ev.validate(metaroot.getChildren("MetaEntities")[0]);
//// mv.validate(metaroot.getChildren("MetaMappings")[0]);
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2008-08-29
00:21:46 UTC (rev 9949)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ClassPathUpdate.java 2008-08-29
06:36:13 UTC (rev 9950)
@@ -38,7 +38,7 @@
String entity = model.getRoot().getModelEntity().getName();
if("RootDummy".equals(entity)) {
String pn = (project == null) ? "?" : project.getName();
- throw new RuntimeException("Struts Project " + pn + " is
corrupted.");
+ throw new IllegalArgumentException("Struts Project " + pn + " is
corrupted.");
}
this.model = model;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java 2008-08-29
00:21:46 UTC (rev 9949)
+++
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/search/impl/SearchCommandImpl.java 2008-08-29
06:36:13 UTC (rev 9950)
@@ -51,9 +51,9 @@
public void validate() {
String rootpath = getAttributeValue("root");
- if(rootpath.length() == 0) throw new RuntimeException("Attribute
'root' of search command must be set.");
+ if(rootpath.length() == 0) throw new IllegalStateException("Attribute
'root' of search command must be set.");
XModelObject root = getModel().getByPath(rootpath);
- if(root == null) throw new RuntimeException("Root of search command is not
found in model.");
+ if(root == null) throw new IllegalStateException("Root of search command is
not found in model.");
}
protected void execute(XModelObject o, ArrayList<XModelObject> list) {
Show replies by date