Author: dgolovin
Date: 2007-12-19 19:12:12 -0500 (Wed, 19 Dec 2007)
New Revision: 5388
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java
Log:
Cleanup the code:
1. new Long(value) replaced for Long.valueOf(value)
2. new String() removed
3. new Boolean(true/false) replaced to Boolean.TRUE/FALSE
4. Unused packages were removed from seam.plugins
5. Throwing of NullPointerException replaced to IllegalArgument Exception
6. catch Exception replaced to particular Exception types in several places
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java 2007-12-20
00:12:06 UTC (rev 5387)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/TreeFormPage.java 2007-12-20
00:12:12 UTC (rev 5388)
@@ -171,7 +171,8 @@
String actionListName = actionList.getName();
String actionListDisplayName = actionList.getDisplayName();
String actionListPath = actionList.getPath();
- System.out.println(level+"ActionList ["+actionListName+"]
["+actionListDisplayName+"] ["+actionListPath+"]");
+ // TBD switch to trace support
+ // System.out.println(level+"ActionList ["+actionListName+"]
["+actionListDisplayName+"] ["+actionListPath+"]");
XActionItem[] items = actionList.getActionItems();
for (int i=0;i<items.length;++i) {
if (items[i] instanceof XActionList) {
@@ -180,7 +181,8 @@
String actionItemName = items[i].getName();
String actionItemDisplayName = items[i].getDisplayName();
String actionItemPath = items[i].getPath();
- System.out.println(level+" "+"ActionItem
["+actionItemName+"] ["+actionItemDisplayName+"]
["+actionItemPath+"]");
+ // TBD switch to trace support
+ // System.out.println(level+" "+"ActionItem
["+actionItemName+"] ["+actionItemDisplayName+"]
["+actionItemPath+"]");
}
}
}
@@ -194,6 +196,7 @@
XModelObject xmo = getModelObject(event.getSelection());
if(selection == xmo) return;
selection = xmo;
+
if (xmo!=null && xmo.getModelEntity()!=null) printActionList("",
xmo.getModelEntity().getActionList());
IForm form = (xmo == null) ? null : getFormFactory(xmo).getForm();
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java 2007-12-20
00:12:06 UTC (rev 5387)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/ModelUIImages.java 2007-12-20
00:12:12 UTC (rev 5388)
@@ -85,7 +85,7 @@
ModelUIPlugin.getPluginLog().logInfo("parent = " +
(parent==null?"null":parent.getClass().getName()));
}
- if(registryUrl == null) throw new NullPointerException("Base url for image
registry cannot be null.");
+ if(registryUrl == null) throw new IllegalArgumentException("Base url for image
registry cannot be null.");
baseUrl = registryUrl;
parentRegistry = parent;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2007-12-20
00:12:06 UTC (rev 5387)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/XAttributeSupport.java 2007-12-20
00:12:12 UTC (rev 5388)
@@ -76,7 +76,7 @@
}
public XAttributeSupport(XModelObject xmo) {
- if(xmo==null) throw new NullPointerException("XModelObject cannot be
null.");
+ if(xmo==null) throw new IllegalArgumentException("XModelObject cannot be
null.");
init(xmo);
}
@@ -85,7 +85,7 @@
}
public XAttributeSupport(XModelObject xmo, XEntityData data, boolean useObject) {
- if(data==null) throw new NullPointerException("XEntityData cannot be
null.");
+ if(data==null) throw new IllegalArgumentException("XEntityData cannot be
null.");
init(xmo, data, useObject);
}
@@ -375,16 +375,16 @@
}
public void load() {
- if(xmo == null) throw new NullPointerException("" +
+ if(xmo == null) throw new IllegalArgumentException("" +
"Init support with XModelObject before saving");
for (int i = 0; i < editors.size(); i++)
((IModelPropertyEditorAdapter)adapters.get(i)).load();
}
public void save() {
- if(xmo == null) throw new NullPointerException("" +
+ if(xmo == null) throw new IllegalArgumentException("" +
"Init support with XModelObject before saving");
- if(xmo.getModel()==null) throw new NullPointerException("Cannot store deleted or
removed XModel object");
+ if(xmo.getModel()==null) throw new IllegalArgumentException("Cannot store deleted
or removed XModel object");
xmo.getModel().saveOptions();
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java 2007-12-20
00:12:06 UTC (rev 5387)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/util/StringUtilities.java 2007-12-20
00:12:12 UTC (rev 5388)
@@ -50,7 +50,7 @@
str = tmp;
}
} else {
- str = new String(source);
+ str = source;
}
gc.dispose();
return str;
Show replies by date