Revision: 1919
http://svn.sourceforge.net/rubyeclipse/?rev=1919&view=rev
Author: cawilliams
Date: 2007-02-06 12:21:30 -0800 (Tue, 06 Feb 2007)
Log Message:
-----------
handle case where object being compared in compareTo might be a string (apparently comes from a couple calls to setInput(""), but changing that to setInput(null) doesn't fix it)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/generateaccessors/AccessorsGenerator.java
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/generateaccessors/AccessorsGenerator.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/generateaccessors/AccessorsGenerator.java 2007-02-06 18:36:21 UTC (rev 1918)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/generateaccessors/AccessorsGenerator.java 2007-02-06 20:21:30 UTC (rev 1919)
@@ -275,9 +275,14 @@
public int compareTo(Object arg0) {
String thisStr = classNode.getName() + name;
- TreeAttribute otherAttr = (TreeAttribute) arg0;
- ClassNodeWrapper otherClassNode = otherAttr.getTreeClass().getClassNode();
- String otherStr = otherClassNode.getName() + otherAttr.toString();
+ String otherStr;
+ if (arg0 instanceof String) {
+ otherStr = (String) arg0;
+ } else {
+ TreeAttribute otherAttr = (TreeAttribute) arg0;
+ ClassNodeWrapper otherClassNode = otherAttr.getTreeClass().getClassNode();
+ otherStr = otherClassNode.getName() + otherAttr.toString();
+ }
return thisStr.compareTo(otherStr);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|