|
From: <caw...@us...> - 2007-07-20 17:34:56
|
Revision: 2815
http://svn.sourceforge.net/rubyeclipse/?rev=2815&view=rev
Author: cawilliams
Date: 2007-07-20 10:34:52 -0700 (Fri, 20 Jul 2007)
Log Message:
-----------
avoid stack overflows
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-07-20 16:30:47 UTC (rev 2814)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-07-20 17:34:52 UTC (rev 2815)
@@ -38,6 +38,7 @@
List<SearchMatch> matches = requestor.getResults();
for (SearchMatch match : matches) {
IType type = (IType) match.getElement();
+ if (!type.getFullyQualifiedName().equals(fullyQualifiedName)) continue;
types.add(type);
}
return types.toArray(new IType[types.size()]);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java 2007-07-20 16:30:47 UTC (rev 2814)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/hierarchy/HierarchyResolver.java 2007-07-20 17:34:52 UTC (rev 2815)
@@ -52,6 +52,8 @@
// Grab the types from the script and then connect them up!
IType[] types = cu.getAllTypes();
for (int j = 0; j < types.length; j++) {
+ IType type = types[j];
+ if (!type.getFullyQualifiedName().equals(builder.focusQualifiedName)) continue;
try {
reportHierarchy(types[j]);
} catch (RubyModelException e) {
@@ -79,7 +81,7 @@
this.builder.connect(type, superclass, superinterfaces);
if (type.isClass() && superclass != null) {
reportHierarchy(superclass);
- } // FIXME What about Modules!? How do we recurse through those?
+ }
}
private IType[] findSuperInterfaces(IType type) throws RubyModelException {
@@ -99,7 +101,9 @@
private IType getLogicalType(IType type, String name) {
RubyElementRequestor requestor = new RubyElementRequestor(type.getRubyScript());
- return new LogicalType(requestor.findType(name));
+ IType[] types = requestor.findType(name);
+ if (types == null || types.length == 0) return null;
+ return new LogicalType(types);
}
private void reset() {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|