|
From: <caw...@us...> - 2007-02-28 14:43:56
|
Revision: 2066
http://svn.sourceforge.net/rubyeclipse/?rev=2066&view=rev
Author: cawilliams
Date: 2007-02-28 06:21:13 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/VariableReader.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/VariableReader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/VariableReader.java 2007-02-28 14:18:45 UTC (rev 2065)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/VariableReader.java 2007-02-28 14:21:13 UTC (rev 2066)
@@ -1,7 +1,9 @@
package org.rubypeople.rdt.internal.debug.core.parsing;
import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.debug.core.model.IVariable;
import org.rubypeople.rdt.internal.debug.core.RdtDebugCorePlugin;
import org.rubypeople.rdt.internal.debug.core.model.RubyProcessingException;
import org.rubypeople.rdt.internal.debug.core.model.RubyStackFrame;
@@ -11,10 +13,10 @@
public class VariableReader extends XmlStreamReader {
private RubyStackFrame stackFrame;
- private RubyVariable parent ;
- private ArrayList variables ;
- private String exceptionMessage ;
- private String exceptionType ;
+ private RubyVariable parent;
+ private List<IVariable> variables;
+ private String exceptionMessage;
+ private String exceptionType;
public VariableReader(XmlPullParser xpp) {
super(xpp);
@@ -25,29 +27,28 @@
}
public RubyVariable[] readVariables(RubyVariable variable) throws RubyProcessingException {
- return readVariables(variable.getStackFrame(), variable) ;
+ return readVariables(variable.getStackFrame(), variable);
}
public RubyVariable[] readVariables(RubyStackFrame stackFrame) throws RubyProcessingException {
- return readVariables(stackFrame, null) ;
-
+ return readVariables(stackFrame, null);
}
public RubyVariable[] readVariables(RubyStackFrame stackFrame, RubyVariable parent) throws RubyProcessingException {
- this.stackFrame = stackFrame ;
- this.parent = parent ;
- this.variables = new ArrayList() ;
+ this.stackFrame = stackFrame;
+ this.parent = parent;
+ this.variables = new ArrayList<IVariable>();
try {
// TODO: timeout should be configurable
this.read(10000);
} catch (Exception ex) {
- RdtDebugCorePlugin.log(ex) ;
- return new RubyVariable[0] ;
+ RdtDebugCorePlugin.log(ex);
+ return new RubyVariable[0];
}
if (exceptionMessage != null) {
- throw new RubyProcessingException(exceptionType, exceptionMessage) ;
+ throw new RubyProcessingException(exceptionType, exceptionMessage);
} else if (isWaitTimeExpired()) {
- throw new RubyProcessingException("Timeout: Could not read result.") ;
+ throw new RubyProcessingException("Timeout: Could not read result.");
}
RubyVariable[] variablesArray = new RubyVariable[variables.size()];
variables.toArray(variablesArray);
@@ -58,37 +59,35 @@
protected boolean processStartElement(XmlPullParser xpp) {
String name = xpp.getName();
if (name.equals("variables")) {
- return true ;
+ return true;
}
if (name.equals("variable")) {
String varName = xpp.getAttributeValue("", "name");
String varValue = xpp.getAttributeValue("", "value");
String kind = xpp.getAttributeValue("", "kind");
- RubyVariable newVariable ;
+ RubyVariable newVariable;
if (varValue == null) {
newVariable = new RubyVariable(stackFrame, varName, kind);
}
else {
- String typeName = xpp.getAttributeValue("", "type") ;
- boolean hasChildren = xpp.getAttributeValue("", "hasChildren").equals("true") ;
- String objectId = xpp.getAttributeValue("", "objectId") ;
+ String typeName = xpp.getAttributeValue("", "type");
+ boolean hasChildren = xpp.getAttributeValue("", "hasChildren").equals("true");
+ String objectId = xpp.getAttributeValue("", "objectId");
newVariable = new RubyVariable(stackFrame, varName, kind, varValue, typeName, hasChildren, objectId);
}
- newVariable.setParent(parent) ;
- variables.add(newVariable) ;
- return true ;
+ newVariable.setParent(parent);
+ variables.add(newVariable);
+ return true;
}
if (name.equals("processingException")) {
- exceptionMessage = xpp.getAttributeValue("", "message") ;
- exceptionType = xpp.getAttributeValue("", "type") ;
- return true ;
+ exceptionMessage = xpp.getAttributeValue("", "message");
+ exceptionType = xpp.getAttributeValue("", "type");
+ return true;
}
- return false ;
+ return false;
}
- protected boolean processEndElement(XmlPullParser xpp) {
-
- return !xpp.getName().equals("variable") ;
+ protected boolean processEndElement(XmlPullParser xpp) {
+ return !xpp.getName().equals("variable");
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|