Author: dgolovin
Date: 2007-10-24 20:21:48 -0400 (Wed, 24 Oct 2007)
New Revision: 4496
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dialog/MessageAndCheckboxDialog.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Memento.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/MementoDOM.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/problem/ResourceProblemManager.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/DefaultSettings.java
Log:
Code clean up.
new Integer() replaced for Integer.valueOf()
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -17,6 +17,7 @@
import java.util.Properties;
import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;
+import org.jboss.tools.common.CommonPlugin;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
import org.jboss.tools.common.model.util.XModelTreeListenerSWTSync;
import org.jboss.tools.common.model.ui.outline.XModelObjectContentOutlineProvider;
@@ -152,8 +153,10 @@
String q = file.getPersistentProperty(persistentTabQualifiedName);
selectedPageIndex = (q == null) ? 0 : Integer.parseInt(q);
}
- } catch (Exception e) {
+ } catch (NumberFormatException e) {
selectedPageIndex = 0;
+ } catch (CoreException e) {
+ selectedPageIndex = 0;
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dialog/MessageAndCheckboxDialog.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dialog/MessageAndCheckboxDialog.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dialog/MessageAndCheckboxDialog.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -58,7 +58,7 @@
String title = p.getProperty("title", "Confirmation");
MessageAndCheckboxDialog dialog = new MessageAndCheckboxDialog(parent, title, QUESTION,
p);
int result = dialog.open();
- p.put(RETURN_CODE, new Integer(result));
+ p.put(RETURN_CODE, Integer.valueOf(result));
return result == 0;
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -327,8 +327,8 @@
DnDUtil.paste(o, p);
}
if(provider instanceof IControlDropListener) {
- p.put("drop.x", new Integer(event.x));
- p.put("drop.y", new Integer(event.y));
+ p.put("drop.x", Integer.valueOf(event.x));
+ p.put("drop.y", Integer.valueOf(event.y));
if(draggedObject != null) p.put("draggedObject", draggedObject);
((IControlDropListener)provider).drop(p);
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editor/EditorPartWrapperExtension.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -93,7 +93,7 @@
int tp = (p == null) ? Integer.MAX_VALUE : p.intValue();
if(priority < tp) {
factories.put(t, f);
- priorities.put(t, new Integer(priority));
+ priorities.put(t, Integer.valueOf(priority));
}
}
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/AnyElementForm.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -187,7 +187,7 @@
return attributes == null ? null : attributes[r][c];
}
public Object getDataAt(int r) {
- return new Integer(r);
+ return Integer.valueOf(r);
}
public Color getColor(int r) {
return null;
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Memento.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Memento.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/Memento.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -133,7 +133,7 @@
* @see org.eclipse.ui.IMemento#putInteger(java.lang.String, int)
*/
public void putInteger(String key, int value) {
- map.put(key, new Integer(value));
+ map.put(key, Integer.valueOf(value));
}
/* (non-Javadoc)
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/MementoDOM.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/MementoDOM.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/forms/MementoDOM.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -115,7 +115,7 @@
* @see org.eclipse.ui.IMemento#getInteger(java.lang.String)
*/
public Integer getInteger(String key) {
- return new Integer(element.getAttribute(key));
+ return Integer.valueOf(element.getAttribute(key));
}
/* (non-Javadoc)
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/objecteditor/XChildrenEditor.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -270,7 +270,7 @@
Properties p = new Properties();
p.put("shell", bar.getControl().getShell());
int i = xtable.getSelectionIndex();
- p.put("insertAfter", new Integer(i));
+ p.put("insertAfter", Integer.valueOf(i));
XActionInvoker.invoke(path, o, getTargets(), p);
} catch (Exception e) {
ModelUIPlugin.getPluginLog().logError(e);
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/problem/ResourceProblemManager.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/problem/ResourceProblemManager.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/problem/ResourceProblemManager.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -85,12 +85,12 @@
HashMap<String,Object> markerData = new HashMap<String,Object>();
markerData.put(IMarker.MESSAGE, problem.getMessage());
markerData.put(IMarker.LOCATION, resource.getLocation().toOSString());
- markerData.put(IMarker.LINE_NUMBER, new Integer(problem.getLine()));
- markerData.put(IMarker.SEVERITY, new Integer(IMarker.SEVERITY_ERROR));
+ markerData.put(IMarker.LINE_NUMBER, Integer.valueOf(problem.getLine()));
+ markerData.put(IMarker.SEVERITY, Integer.valueOf(IMarker.SEVERITY_ERROR));
int position = problem.getPosition();
if(position != Problem.NONE) {
- markerData.put(IMarker.CHAR_START, new Integer(position));
- markerData.put(IMarker.CHAR_END, new Integer(position + 1));
+ markerData.put(IMarker.CHAR_START, Integer.valueOf(position));
+ markerData.put(IMarker.CHAR_END, Integer.valueOf(position + 1));
}
this.addMarker(markerData);
}
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/DefaultSettings.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/DefaultSettings.java 2007-10-25
00:21:39 UTC (rev 4495)
+++
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/widgets/DefaultSettings.java 2007-10-25
00:21:48 UTC (rev 4496)
@@ -221,7 +221,7 @@
settings.put(key, object);
}
protected void put(String key, int i) {
- settings.put(key, new Integer(i));
+ settings.put(key, Integer.valueOf(i));
}
protected void put(String key, Color color) {
settings.put(key, color);