You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(41) |
Apr
(9) |
May
|
Jun
|
Jul
(39) |
Aug
(38) |
Sep
(135) |
Oct
(220) |
Nov
(75) |
Dec
(74) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(44) |
Feb
(160) |
Mar
(49) |
Apr
(69) |
May
(40) |
Jun
(52) |
Jul
(47) |
Aug
(51) |
Sep
(19) |
Oct
(22) |
Nov
(36) |
Dec
(76) |
| 2007 |
Jan
(154) |
Feb
(165) |
Mar
(186) |
Apr
(143) |
May
(175) |
Jun
(133) |
Jul
(203) |
Aug
(177) |
Sep
(136) |
Oct
|
Nov
|
Dec
|
|
From: <caw...@us...> - 2007-03-01 15:19:50
|
Revision: 2072
http://svn.sourceforge.net/rubyeclipse/?rev=2072&view=rev
Author: cawilliams
Date: 2007-03-01 07:19:46 -0800 (Thu, 01 Mar 2007)
Log Message:
-----------
by default do _not_fold inner types, since it is so common in Ruby
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-03-01 15:19:27 UTC (rev 2071)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-03-01 15:19:46 UTC (rev 2072)
@@ -735,7 +735,7 @@
store.setDefault(PreferenceConstants.EDITOR_FOLDING_ENABLED, true);
store.setDefault(PreferenceConstants.EDITOR_FOLDING_PROVIDER, "org.rubypeople.rdt.ui.text.defaultFoldingProvider"); //$NON-NLS-1$
store.setDefault(PreferenceConstants.EDITOR_FOLDING_RDOC, false);
- store.setDefault(PreferenceConstants.EDITOR_FOLDING_INNERTYPES, true);
+ store.setDefault(PreferenceConstants.EDITOR_FOLDING_INNERTYPES, false);
store.setDefault(PreferenceConstants.EDITOR_FOLDING_METHODS, false);
store.setDefault(PreferenceConstants.EDITOR_SHOW_TEXT_HOVER_AFFORDANCE, true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-01 15:19:29
|
Revision: 2071
http://svn.sourceforge.net/rubyeclipse/?rev=2071&view=rev
Author: cawilliams
Date: 2007-03-01 07:19:27 -0800 (Thu, 01 Mar 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/folding/IRubyFoldingPreferenceBlock.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/folding/IRubyFoldingPreferenceBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/folding/IRubyFoldingPreferenceBlock.java 2007-03-01 15:19:25 UTC (rev 2070)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/text/folding/IRubyFoldingPreferenceBlock.java 2007-03-01 15:19:27 UTC (rev 2071)
@@ -22,7 +22,7 @@
* Clients may implement this interface.
* </p>
*
- * @since 3.0
+ * @since 0.8.0
*/
public interface IRubyFoldingPreferenceBlock {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-03-01 15:19:26
|
Revision: 2070
http://svn.sourceforge.net/rubyeclipse/?rev=2070&view=rev
Author: cawilliams
Date: 2007-03-01 07:19:25 -0800 (Thu, 01 Mar 2007)
Log Message:
-----------
fix todo marker
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingPreferencePage.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingPreferencePage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingPreferencePage.java 2007-02-28 22:29:31 UTC (rev 2069)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/FoldingPreferencePage.java 2007-03-01 15:19:25 UTC (rev 2070)
@@ -26,7 +26,7 @@
*/
protected String getHelpId() {
return null;
- // TOD) Uncomment when we have IRubyHelpContextIds
+ // TODO Uncomment when we have IRubyHelpContextIds
// return IRubyHelpContextIds.RUBY_EDITOR_PREFERENCE_PAGE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mba...@us...> - 2007-02-28 22:29:55
|
Revision: 2069
http://svn.sourceforge.net/rubyeclipse/?rev=2069&view=rev
Author: mbarchfe
Date: 2007-02-28 14:29:31 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
use rdebug.cmd if it exists
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-02-28 21:40:19 UTC (rev 2068)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RDebugVMDebugger.java 2007-02-28 22:29:31 UTC (rev 2069)
@@ -1,5 +1,6 @@
package org.rubypeople.rdt.internal.launching;
+import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -32,7 +33,8 @@
// Set it up to use rdebug executable
Map map = config.getVMSpecificAttributesMap();
if (map == null) map = new HashMap();
- map.put(IRubyLaunchConfigurationConstants.ATTR_RUBY_COMMAND, "rdebug");
+ String executable = findRDebugExecutable(fVMInstance.getInstallLocation()) ;
+ map.put(IRubyLaunchConfigurationConstants.ATTR_RUBY_COMMAND, executable);
config.setVMSpecificAttributesMap(map);
super.run(config, launch, monitor);
@@ -58,5 +60,15 @@
protected RubyDebuggerProxy getDebugProxy(RubyDebugTarget debugTarget) {
return new RubyDebuggerProxy(debugTarget, RDebugVMDebugger.getDirectoryOfRubyDebuggerFile(), true);
}
+
+ public static String findRDebugExecutable(File vmInstallLocation) {
+ // see StandardVMRunner.constructProgramString
+ String cmd = "rdebug" ;
+ String path = vmInstallLocation + File.separator + "bin" + File.separator + "rdebug.cmd" ;
+ if (new File(path).exists()) {
+ cmd = "rdebug.cmd" ;
+ }
+ return cmd ;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 21:40:21
|
Revision: 2068
http://svn.sourceforge.net/rubyeclipse/?rev=2068&view=rev
Author: cawilliams
Date: 2007-02-28 13:40:19 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
update upgrade() to add the default loadpath when it looks like tehre's an old project without the RUBY_CONTAINER path in it (so it won't ever get linked to the std and core libraries)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-28 14:33:13 UTC (rev 2067)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-28 21:40:19 UTC (rev 2068)
@@ -120,6 +120,17 @@
}
public boolean upgrade() throws CoreException {
+ ILoadpathEntry[] entries = getRawLoadpath();
+ if (entries == null || entries.length <= 1) {
+ ILoadpathEntry[] loadpathEntries = new ILoadpathEntry[2];
+ loadpathEntries[0] = RubyCore.newSourceEntry(getProject().getFullPath());
+ loadpathEntries[1] = RubyCore.newContainerEntry(new Path("org.rubypeople.rdt.launching.RUBY_CONTAINER")); //$NON-NLS-1$
+ try {
+ setRawLoadpath(loadpathEntries, null);
+ } catch (RubyModelException e) {
+ RubyCore.log(e);
+ }
+ }
return addToBuildSpec(RubyCore.BUILDER_ID);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 14:43:58
|
Revision: 2067
http://svn.sourceforge.net/rubyeclipse/?rev=2067&view=rev
Author: cawilliams
Date: 2007-02-28 06:33:13 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-02-28 14:21:13 UTC (rev 2066)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/DeltaProcessor.java 2007-02-28 14:33:13 UTC (rev 2067)
@@ -29,6 +29,7 @@
import org.rubypeople.rdt.core.IRubyElementDelta;
import org.rubypeople.rdt.core.IRubyModel;
import org.rubypeople.rdt.core.IRubyProject;
+import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.ISourceFolderRoot;
import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
@@ -122,18 +123,18 @@
private final ModelUpdater modelUpdater = new ModelUpdater();
/* A set of IRubyProject whose caches need to be reset */
- private HashSet projectCachesToReset = new HashSet();
+ private HashSet<IRubyProject> projectCachesToReset = new HashSet<IRubyProject>();
- /* A table from IRubyProject to an array of IPackageFragmentRoot.
- * This table contains the pkg fragment roots of the project that are being deleted.
+ /* A table from IRubyProject to an array of ISourceFolderRoot.
+ * This table contains the src folder roots of the project that are being deleted.
*/
- public Map removedRoots;
+ public Map<IRubyProject, ISourceFolderRoot[]> removedRoots;
/*
* A list of IRubyElement used as a scope for external archives refresh
* during POST_CHANGE. This is null if no refresh is needed.
*/
- private HashSet refreshedElements;
+ private HashSet<IRubyElement> refreshedElements;
private DeltaProcessingState state;
private RubyModelManager manager;
@@ -147,13 +148,13 @@
* Queue of deltas created explicily by the Ruby Model that have yet to be
* fired.
*/
- public ArrayList rubyModelDeltas = new ArrayList();
+ public ArrayList<IRubyElementDelta> rubyModelDeltas = new ArrayList<IRubyElementDelta>();
/*
* Queue of reconcile deltas on working copies that have yet to be fired.
- * This is a table form IWorkingCopy to IRubyElementDelta
+ * This is a table from IWorkingCopy to IRubyElementDelta
*/
- public HashMap reconcileDeltas = new HashMap();
+ public HashMap<IRubyScript, IRubyElementDelta> reconcileDeltas = new HashMap<IRubyScript, IRubyElementDelta>();
/*
* The ruby element that was last created (see createElement(IResource)).
@@ -163,7 +164,7 @@
private Openable currentElement;
/* A set of IRubyProject whose source folder roots need to be refreshed */
- private HashSet rootsToRefresh = new HashSet();
+ private HashSet<IRubyProject> rootsToRefresh = new HashSet<IRubyProject>();
/*
* The <code>RubyElementDelta</code> corresponding to the <code>IResourceDelta</code>
@@ -325,7 +326,7 @@
if (deltaToNotify != null) {
// flush now so as to keep listener reactions to post their own
// deltas for subsequent iteration
- this.reconcileDeltas = new HashMap();
+ this.reconcileDeltas = new HashMap<IRubyScript, IRubyElementDelta>();
notifyListeners(deltaToNotify, ElementChangedEvent.POST_RECONCILE, listeners,
listenerMask, listenerCount);
@@ -336,7 +337,7 @@
* Flushes all deltas without firing them.
*/
public void flush() {
- this.rubyModelDeltas = new ArrayList();
+ this.rubyModelDeltas = new ArrayList<IRubyElementDelta>();
}
private void notifyListeners(IRubyElementDelta deltaToNotify, int eventType,
@@ -471,9 +472,9 @@
*/
private void updateLoadpathMarkers(IResourceDelta delta, DeltaProcessingState.ProjectUpdateInfo[] updates) {
- Map preferredClasspaths = new HashMap(5);
+ Map<RubyProject, ILoadpathEntry[]> preferredClasspaths = new HashMap<RubyProject, ILoadpathEntry[]>(5);
Map preferredOutputs = new HashMap(5);
- HashSet affectedProjects = new HashSet(5);
+ HashSet<IPath> affectedProjects = new HashSet<IPath>(5);
// read .loadpath files that have changed, and create markers if format is wrong or if an entry cannot be found
RubyModel.flushExternalFileCache();
@@ -538,7 +539,7 @@
* Creates/removes problem markers if needed.
* Remember the affected projects in the given set.
*/
- private void updateLoadpathMarkers(IResourceDelta delta, HashSet affectedProjects, Map preferredClasspaths, Map preferredOutputs) {
+ private void updateLoadpathMarkers(IResourceDelta delta, HashSet<IPath> affectedProjects, Map preferredClasspaths, Map preferredOutputs) {
IResource resource = delta.getResource();
boolean processChildren = false;
@@ -747,7 +748,7 @@
private void resetProjectCaches() {
Iterator iterator = this.projectCachesToReset.iterator();
HashMap projectDepencies = this.state.projectDependencies;
- HashSet affectedDependents = new HashSet();
+ HashSet<IRubyProject> affectedDependents = new HashSet<IRubyProject>();
while (iterator.hasNext()) {
RubyProject project = (RubyProject) iterator.next();
project.resetCaches();
@@ -766,7 +767,7 @@
* update.
*/
private void addDependentProjects(IRubyProject project, HashMap projectDependencies,
- HashSet result) {
+ HashSet<IRubyProject> result) {
IRubyProject[] dependents = (IRubyProject[]) projectDependencies.get(project);
if (dependents == null) return;
for (int i = 0, length = dependents.length; i < length; i++) {
@@ -843,7 +844,7 @@
// remember roots of this project
if (this.removedRoots == null) {
- this.removedRoots = new HashMap();
+ this.removedRoots = new HashMap<IRubyProject, ISourceFolderRoot[]>();
}
if (rubyProject.isOpen()) {
this.removedRoots.put(rubyProject, rubyProject.getSourceFolderRoots());
@@ -1099,9 +1100,9 @@
/*
* Adds the given project and its dependents to the list of the roots to refresh.
*/
- private void addToRootsToRefreshWithDependents(IRubyProject javaProject) {
- this.rootsToRefresh.add(javaProject);
- this.addDependentProjects(javaProject, this.state.projectDependencies, this.rootsToRefresh);
+ private void addToRootsToRefreshWithDependents(IRubyProject rubyProject) {
+ this.rootsToRefresh.add(rubyProject);
+ this.addDependentProjects(rubyProject, this.state.projectDependencies, this.rootsToRefresh);
}
/*
@@ -1110,7 +1111,7 @@
*/
public void addForRefresh(IRubyElement element) {
if (this.refreshedElements == null) {
- this.refreshedElements = new HashSet();
+ this.refreshedElements = new HashSet<IRubyElement>();
}
this.refreshedElements.add(element);
}
@@ -1357,8 +1358,8 @@
this.state.updateRoots(element.getPath(), delta, this);
// refresh src folder roots and caches of the project (and its dependents)
- this.rootsToRefresh.add(element);
- this.projectCachesToReset.add(element);
+ this.rootsToRefresh.add((IRubyProject)element);
+ this.projectCachesToReset.add((IRubyProject)element);
// this.manager.indexManager.indexAll(res);
}
@@ -1544,8 +1545,8 @@
// refresh pkg fragment roots and caches of the project (and its
// dependents)
- this.rootsToRefresh.add(element);
- this.projectCachesToReset.add(element);
+ this.rootsToRefresh.add((IRubyProject)element);
+ this.projectCachesToReset.add((IRubyProject)element);
}
} else {
if (delta == null || (delta.getFlags() & IResourceDelta.MOVED_FROM) == 0) {
@@ -1718,8 +1719,8 @@
this.state.updateRoots(element.getPath(), delta, this);
// refresh pkg fragment roots and caches of the project (and its dependents)
- this.rootsToRefresh.add(element);
- this.projectCachesToReset.add(element);
+ this.rootsToRefresh.add((IRubyProject)element);
+ this.projectCachesToReset.add((IRubyProject)element);
break;
case IRubyElement.SOURCE_FOLDER_ROOT :
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java 2007-02-28 14:21:13 UTC (rev 2066)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelOperation.java 2007-02-28 14:33:13 UTC (rev 2067)
@@ -58,7 +58,7 @@
/*
* A HashMap of attributes that can be used by operations
*/
- protected HashMap attributes;
+ protected HashMap<Object, Object> attributes;
public static final String HAS_MODIFIED_RESOURCE_ATTR = "hasModifiedResource"; //$NON-NLS-1$
public static final String TRUE = "true"; //$NON-NLS-1$
@@ -104,9 +104,9 @@
protected boolean force = false;
/*
- * A per thread stack of java model operations (PerThreadObject of ArrayList).
+ * A per thread stack of ruby model operations (PerThreadObject of ArrayList).
*/
- protected static ThreadLocal operationStacks = new ThreadLocal();
+ protected static ThreadLocal<ArrayList<RubyModelOperation>> operationStacks = new ThreadLocal<ArrayList<RubyModelOperation>>();
protected RubyModelOperation() {
// default constructor used in subclasses
}
@@ -173,7 +173,7 @@
* Registers the given reconcile delta with the Ruby Model Manager.
*/
protected void addReconcileDelta(IRubyScript workingCopy, IRubyElementDelta delta) {
- HashMap reconcileDeltas = RubyModelManager.getRubyModelManager().getDeltaProcessor().reconcileDeltas;
+ HashMap<IRubyScript, IRubyElementDelta> reconcileDeltas = RubyModelManager.getRubyModelManager().getDeltaProcessor().reconcileDeltas;
RubyElementDelta previousDelta = (RubyElementDelta)reconcileDeltas.get(workingCopy);
if (previousDelta != null) {
IRubyElementDelta[] children = delta.getAffectedChildren();
@@ -347,16 +347,15 @@
} catch (CoreException ce) {
if (ce instanceof RubyModelException) {
throw (RubyModelException)ce;
- } else {
- // translate the core exception to a java model exception
- if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
- Throwable e = ce.getStatus().getException();
- if (e instanceof RubyModelException) {
- throw (RubyModelException) e;
- }
- }
- throw new RubyModelException(ce);
}
+ // translate the core exception to a ruby model exception
+ if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
+ Throwable e = ce.getStatus().getException();
+ if (e instanceof RubyModelException) {
+ throw (RubyModelException) e;
+ }
+ }
+ throw new RubyModelException(ce);
}
}
/**
@@ -373,9 +372,8 @@
RubyModelOperation topLevelOp = (RubyModelOperation)stack.get(0);
if (topLevelOp.attributes == null) {
return null;
- } else {
- return topLevelOp.attributes.get(key);
}
+ return topLevelOp.attributes.get(key);
}
/**
* Returns the compilation unit the given element is contained in,
@@ -390,10 +388,10 @@
* Returns the stack of operations running in the current thread.
* Returns an empty stack if no operations are currently running in this thread.
*/
- protected ArrayList getCurrentOperationStack() {
- ArrayList stack = (ArrayList)operationStacks.get();
+ protected ArrayList<RubyModelOperation> getCurrentOperationStack() {
+ ArrayList<RubyModelOperation> stack = (ArrayList<RubyModelOperation>)operationStacks.get();
if (stack == null) {
- stack = new ArrayList();
+ stack = new ArrayList<RubyModelOperation>();
operationStacks.set(stack);
}
return stack;
@@ -430,9 +428,8 @@
public IRubyModel getRubyModel() {
if (elementsToProcess == null || elementsToProcess.length == 0) {
return getParentElement().getRubyModel();
- } else {
- return elementsToProcess[0].getRubyModel();
}
+ return elementsToProcess[0].getRubyModel();
}
/**
@@ -562,9 +559,8 @@
operationStacks.set(null); // release reference (see http://bugs.eclipse.org/bugs/show_bug.cgi?id=33927)
}
return (RubyModelOperation)stack.remove(size-1);
- } else {
- return null;
}
+ return null;
}
/*
* Registers the given action to be run when the outer most java model operation has finished.
@@ -738,15 +734,14 @@
} catch (CoreException ce) {
if (ce instanceof RubyModelException) {
throw (RubyModelException)ce;
- } else {
- if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
- Throwable e= ce.getStatus().getException();
- if (e instanceof RubyModelException) {
- throw (RubyModelException) e;
- }
- }
- throw new RubyModelException(ce);
}
+ if (ce.getStatus().getCode() == IResourceStatus.OPERATION_FAILED) {
+ Throwable e= ce.getStatus().getException();
+ if (e instanceof RubyModelException) {
+ throw (RubyModelException) e;
+ }
+ }
+ throw new RubyModelException(ce);
}
}
protected void runPostActions() throws RubyModelException {
@@ -764,7 +759,7 @@
protected void setAttribute(Object key, Object attribute) {
RubyModelOperation topLevelOp = (RubyModelOperation)this.getCurrentOperationStack().get(0);
if (topLevelOp.attributes == null) {
- topLevelOp.attributes = new HashMap();
+ topLevelOp.attributes = new HashMap<Object, Object>();
}
topLevelOp.attributes.put(key, attribute);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
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.
|
|
From: <caw...@us...> - 2007-02-28 14:43:53
|
Revision: 2065
http://svn.sourceforge.net/rubyeclipse/?rev=2065&view=rev
Author: cawilliams
Date: 2007-02-28 06:18:45 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings, make ThreadInfo immutable value object
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/ThreadInfo.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/FramesReader.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/ThreadInfo.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/ThreadInfo.java 2007-02-28 14:14:21 UTC (rev 2064)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/model/ThreadInfo.java 2007-02-28 14:18:45 UTC (rev 2065)
@@ -1,8 +1,14 @@
package org.rubypeople.rdt.internal.debug.core.model;
public class ThreadInfo {
- private int id ;
- private String status ;
+ private int id;
+ private String status;
+
+ public ThreadInfo(int id, String status) {
+ this.id = id;
+ this.status = status;
+ }
+
public int getId() {
return id;
}
@@ -10,13 +16,4 @@
public String getStatus() {
return status;
}
-
- public void setId(int id) {
- this.id = id;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/FramesReader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/FramesReader.java 2007-02-28 14:14:21 UTC (rev 2064)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/FramesReader.java 2007-02-28 14:18:45 UTC (rev 2065)
@@ -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.IStackFrame;
import org.rubypeople.rdt.internal.debug.core.RdtDebugCorePlugin;
import org.rubypeople.rdt.internal.debug.core.model.RubyStackFrame;
import org.rubypeople.rdt.internal.debug.core.model.RubyThread;
@@ -11,8 +13,8 @@
public class FramesReader extends XmlStreamReader {
private RubyThread thread;
- int index = 1 ;
- private ArrayList frames ;
+ int index = 1;
+ private List<IStackFrame> frames;
public FramesReader(XmlPullParser xpp) {
super(xpp);
@@ -24,18 +26,18 @@
public RubyStackFrame[] readFrames(RubyThread thread) {
- this.thread = thread ;
- this.frames = new ArrayList() ;
+ this.thread = thread;
+ this.frames = new ArrayList<IStackFrame>();
try {
this.read();
} catch (Exception ex) {
- RdtDebugCorePlugin.log(ex) ;
- return new RubyStackFrame[0] ;
+ RdtDebugCorePlugin.log(ex);
+ return new RubyStackFrame[0];
}
- RubyStackFrame[] frameArray = new RubyStackFrame[frames.size()] ;
- frames.toArray(frameArray) ;
- thread.setStackFrames(frameArray) ;
- return frameArray ;
+ RubyStackFrame[] frameArray = new RubyStackFrame[frames.size()];
+ frames.toArray(frameArray);
+ thread.setStackFrames(frameArray);
+ return frameArray;
}
@@ -43,21 +45,18 @@
String name = xpp.getName();
if (name.equals("frames")) {
- return true ;
+ return true;
}
if (name.equals("frame")) {
int line = Integer.parseInt(xpp.getAttributeValue("", "line"));
String file = xpp.getAttributeValue("", "file");
- this.frames.add(new RubyStackFrame(thread, file, line, index++)) ;
- return true ;
+ this.frames.add(new RubyStackFrame(thread, file, line, index++));
+ return true;
}
- return false ;
+ return false;
}
- protected boolean processEndElement(XmlPullParser xpp) {
-
- return xpp.getName().equals("frames") ;
+ protected boolean processEndElement(XmlPullParser xpp) {
+ return xpp.getName().equals("frames");
}
-
-
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java 2007-02-28 14:14:21 UTC (rev 2064)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/parsing/ThreadInfoReader.java 2007-02-28 14:18:45 UTC (rev 2065)
@@ -2,6 +2,7 @@
import java.io.IOException;
import java.util.ArrayList;
+import java.util.List;
import org.rubypeople.rdt.internal.debug.core.model.ThreadInfo;
import org.xmlpull.v1.XmlPullParser;
@@ -9,7 +10,7 @@
public class ThreadInfoReader extends XmlStreamReader {
- private ArrayList threads = new ArrayList();
+ private List<ThreadInfo> threads = new ArrayList<ThreadInfo>();
public ThreadInfoReader(XmlPullParser xpp) {
super(xpp);
@@ -21,27 +22,25 @@
public ThreadInfo[] readThreads() throws XmlPullParserException, IOException, XmlStreamReaderException {
this.read();
- return (ThreadInfo[]) threads.toArray(new ThreadInfo[threads.size()]) ;
+ return (ThreadInfo[]) threads.toArray(new ThreadInfo[threads.size()]);
}
protected boolean processStartElement(XmlPullParser xpp) {
String name = xpp.getName();
if (name.equals("threads")) {
- return true ;
+ return true;
}
if (name.equals("thread")) {
- ThreadInfo info = new ThreadInfo() ;
- info.setId(Integer.parseInt(xpp.getAttributeValue("", "id")));
- info.setStatus(xpp.getAttributeValue("", "status")) ;
- threads.add(info) ;
- return true ;
+ int id = Integer.parseInt(xpp.getAttributeValue("", "id"));
+ String status = xpp.getAttributeValue("", "status");
+ threads.add(new ThreadInfo(id, status));
+ return true;
}
- return false ;
+ return false;
}
- protected boolean processEndElement(XmlPullParser xpp) {
-
- return xpp.getName().equals("threads") ;
+ protected boolean processEndElement(XmlPullParser xpp) {
+ return xpp.getName().equals("threads");
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 14:14:23
|
Revision: 2064
http://svn.sourceforge.net/rubyeclipse/?rev=2064&view=rev
Author: cawilliams
Date: 2007-02-28 06:14:21 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
remove unused imports
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java 2007-02-28 14:13:21 UTC (rev 2063)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/rubyvms/LibraryContentProvider.java 2007-02-28 14:14:21 UTC (rev 2064)
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.rubypeople.rdt.internal.debug.ui.rubyvms;
-import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
@@ -19,7 +18,6 @@
import java.util.Set;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeContentProvider;
import org.eclipse.jface.viewers.StructuredSelection;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 14:13:22
|
Revision: 2063
http://svn.sourceforge.net/rubyeclipse/?rev=2063&view=rev
Author: cawilliams
Date: 2007-02-28 06:13:21 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-02-28 14:10:11 UTC (rev 2062)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-02-28 14:13:21 UTC (rev 2063)
@@ -67,7 +67,7 @@
/**
* Runtime classpath extensions
*/
- private HashMap fClasspathEntryExtensions = null;
+ private HashMap<String, IConfigurationElement> fClasspathEntryExtensions = null;
/**
* Identifier for 'runtimeLoadpathEntries' extension point
@@ -79,7 +79,7 @@
* Mapping of top-level VM installation directories to library info for that
* VM.
*/
- private static Map fgLibraryInfoMap = null;
+ private static Map<String, LibraryInfo> fgLibraryInfoMap = null;
/**
* Whether changes in VM preferences are being batched. When being batched
@@ -227,9 +227,9 @@
// Generate the current
VMDefinitionsContainer newResults = getVMDefinitions(newPrefString);
- // Determine the deteled VMs
- List deleted = oldResults.getVMList();
- List current = newResults.getValidVMList();
+ // Determine the deleted VMs
+ List<IVMInstall> deleted = oldResults.getVMList();
+ List<IVMInstall> current = newResults.getValidVMList();
deleted.removeAll(current);
// Dispose deleted VMs. The 'disposeVMInstall' method fires notification of the
@@ -501,7 +501,7 @@
* Restores library information for VMs
*/
private static void restoreLibraryInfo() {
- fgLibraryInfoMap = new HashMap(10);
+ fgLibraryInfoMap = new HashMap<String, LibraryInfo>(10);
IPath libPath = getDefault().getStateLocation();
libPath = libPath.append("libraryInfos.xml"); //$NON-NLS-1$
File file = libPath.toFile();
@@ -545,7 +545,7 @@
}
private static String[] getPathsFromXML(Element lib, String pathType) {
- List paths = new ArrayList();
+ List<String> paths = new ArrayList<String>();
NodeList list = lib.getChildNodes();
int length = list.getLength();
for (int i = 0; i < length; ++i) {
@@ -601,7 +601,7 @@
private void initializeRuntimeLoadpathExtensions() {
IExtensionPoint extensionPoint= Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.PLUGIN_ID, ID_EXTENSION_POINT_RUNTIME_CLASSPATH_ENTRIES);
IConfigurationElement[] configs= extensionPoint.getConfigurationElements();
- fClasspathEntryExtensions = new HashMap(configs.length);
+ fClasspathEntryExtensions = new HashMap<String, IConfigurationElement>(configs.length);
for (int i= 0; i < configs.length; i++) {
fClasspathEntryExtensions.put(configs[i].getAttribute("id"), configs[i]); //$NON-NLS-1$
}
@@ -655,7 +655,7 @@
private boolean fDefaultChanged = false;
// old container ids to new
- private HashMap fRenamedContainerIds = new HashMap();
+ private HashMap<IPath, IPath> fRenamedContainerIds = new HashMap<IPath, IPath>();
/**
* Returns the JRE container id that the given VM would map to, or
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java 2007-02-28 14:10:11 UTC (rev 2062)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RubyVMRuntimeLoadpathEntryResolver.java 2007-02-28 14:13:21 UTC (rev 2063)
@@ -90,10 +90,10 @@
if (vmInstallLocation != null) {
LibraryInfo libraryInfo= LaunchingPlugin.getLibraryInfo(vmInstallLocation.getAbsolutePath());
if (libraryInfo != null) {
- // only return endorsed and bootstrap classpath entries if we have the info
+ // only return endorsed and bootstrap loadpath entries if we have the info
// libs in the ext dirs are not loaded by the boot class loader
- List resolvedEntries = new ArrayList(libs.length);
+ List<IRuntimeLoadpathEntry> resolvedEntries = new ArrayList<IRuntimeLoadpathEntry>(libs.length);
for (int i = 0; i < libs.length; i++) {
IPath location = libs[i];
IPath libraryPath = location;
@@ -104,7 +104,7 @@
}
}
}
- List resolvedEntries = new ArrayList(libs.length);
+ List<IRuntimeLoadpathEntry> resolvedEntries = new ArrayList<IRuntimeLoadpathEntry>(libs.length);
for (int i = 0; i < libs.length; i++) {
IPath systemLibraryPath = libs[i];
if (systemLibraryPath.toFile().exists()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 14:10:19
|
Revision: 2062
http://svn.sourceforge.net/rubyeclipse/?rev=2062&view=rev
Author: cawilliams
Date: 2007-02-28 06:10:11 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRuntimeLoadpathEntry.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java 2007-02-28 14:02:16 UTC (rev 2061)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java 2007-02-28 14:10:11 UTC (rev 2062)
@@ -124,12 +124,12 @@
}
/* (non-Rubydoc)
- * @see org.eclipse.jdt.launching.IRuntimeLoadpathEntry2#getRuntimeLoadpathEntries(org.eclipse.debug.core.ILaunchConfiguration)
+ * @see org.rubypeople.rdt.launching.IRuntimeLoadpathEntry2#getRuntimeLoadpathEntries(org.eclipse.debug.core.ILaunchConfiguration)
*/
public IRuntimeLoadpathEntry[] getRuntimeLoadpathEntries(ILaunchConfiguration configuration) throws CoreException {
ILoadpathEntry entry = RubyCore.newProjectEntry(getRubyProject().getProject().getFullPath());
List classpathEntries = new ArrayList(5);
- List expanding = new ArrayList(5);
+ List<ILoadpathEntry> expanding = new ArrayList<ILoadpathEntry>(5);
expandProject(entry, classpathEntries, expanding);
IRuntimeLoadpathEntry[] runtimeEntries = new IRuntimeLoadpathEntry[classpathEntries.size()];
for (int i = 0; i < runtimeEntries.length; i++) {
@@ -141,8 +141,8 @@
runtimeEntries[i] = (IRuntimeLoadpathEntry)e;
}
}
- // remove bootpath entries - this is a default user classpath
- List ordered = new ArrayList(runtimeEntries.length);
+ // remove bootpath entries - this is a default user loadpath
+ List<IRuntimeLoadpathEntry> ordered = new ArrayList<IRuntimeLoadpathEntry>(runtimeEntries.length);
for (int i = 0; i < runtimeEntries.length; i++) {
if (runtimeEntries[i].getLoadpathProperty() == IRuntimeLoadpathEntry.USER_CLASSES) {
ordered.add(runtimeEntries[i]);
@@ -162,7 +162,7 @@
* expanded (to detect cycles)
* @exception CoreException if unable to expand the classpath
*/
- private void expandProject(ILoadpathEntry projectEntry, List expandedPath, List expanding) throws CoreException {
+ private void expandProject(ILoadpathEntry projectEntry, List expandedPath, List<ILoadpathEntry> expanding) throws CoreException {
expanding.add(projectEntry);
// 1. Get the raw classpath
// 2. Replace source folder entries with a project entry
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-02-28 14:02:16 UTC (rev 2061)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-02-28 14:10:11 UTC (rev 2062)
@@ -80,7 +80,7 @@
return buf.toString();
}
- protected void addArguments(String[] args, List v) {
+ protected void addArguments(String[] args, List<String> v) {
if (args == null) {
return;
}
@@ -188,7 +188,7 @@
String program= constructProgramString(config);
- List arguments= new ArrayList();
+ List<String> arguments= new ArrayList<String>();
arguments.add(program);
// VM args are the first thing after the ruby program so that users can specify
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRuntimeLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRuntimeLoadpathEntry.java 2007-02-28 14:02:16 UTC (rev 2061)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/IRuntimeLoadpathEntry.java 2007-02-28 14:10:11 UTC (rev 2062)
@@ -18,7 +18,7 @@
import org.rubypeople.rdt.core.IRubyProject;
/**
- * Represents an entry on a runtime classpath. A runtime classpath entry
+ * Represents an entry on a runtime loadpath. A runtime loadpath entry
* may refer to one of the following:
* <ul>
* <li>A Ruby project (type <code>PROJECT</code>) - a project entry refers
@@ -28,22 +28,22 @@
* folder in the workspace or in the local file system containing class
* files. An archive may have attached source.</li>
* <li>A variable (type <code>VARIABLE</code>) - a variable refers to a
- * classpath variable, which may refer to a jar.</li>
- * <li>A library (type <code>CONTAINER</code>) - a container refers to classpath
+ * loadpath variable, which may refer to a jar.</li>
+ * <li>A library (type <code>CONTAINER</code>) - a container refers to loadpath
* container variable which refers to a collection of archives derived
* dynamically, on a per project basis.</li>
- * <li>A contributed classpath entry (type <code>OTHER</code>) - a contributed
- * classpath entry is an extension contributed by a plug-in. The resolution
- * of a contributed classpath entry is client defined. See
+ * <li>A contributed loadpath entry (type <code>OTHER</code>) - a contributed
+ * loadpath entry is an extension contributed by a plug-in. The resolution
+ * of a contributed loadpath entry is client defined. See
* <code>IRuntimeLoadpathEntry2</code>.
* </ul>
* <p>
- * Clients may implement this interface for contributed a classpath entry
- * types (i.e. type <code>OTHER</code>). Note, contributed classpath entries
+ * Clients may implement this interface for contributed a loadpath entry
+ * types (i.e. type <code>OTHER</code>). Note, contributed loadpath entries
* are new in 3.0, and are only intended to be contributed by the Ruby debugger.
* </p>
* @since 2.0
- * @see org.eclipse.jdt.launching.IRuntimeLoadpathEntry2
+ * @see org.rubypeople.rdt.launching.IRuntimeLoadpathEntry2
*/
public interface IRuntimeLoadpathEntry {
@@ -87,12 +87,12 @@
/**
* Loadpath property identifier for entries that should appear on the
- * user classpath.
+ * user loadpath.
*/
public static final int USER_CLASSES = 3;
/**
- * Returns this classpath entry's type. The type of a runtime classpath entry is
+ * Returns this loadpath entry's type. The type of a runtime loadpath entry is
* identified by one of the following constants:
* <ul>
* <li><code>PROJECT</code></li>
@@ -104,14 +104,14 @@
* <p>
* Since 3.0, a type of <code>OTHER</code> may be returned.
* </p>
- * @return this classpath entry's type
+ * @return this loadpath entry's type
*/
public int getType();
/**
- * Returns a memento for this classpath entry.
+ * Returns a memento for this loadpath entry.
* <p>
- * Since 3.0, the memento for a contributed classpath entry (i.e. of
+ * Since 3.0, the memento for a contributed loadpath entry (i.e. of
* type <code>OTHER</code>), must be in the form of an XML document,
* with the following element structure:
* <pre>
@@ -123,15 +123,15 @@
* </runtimeLoadpathEntry>
* </pre>
* The <code>id</code> attribute is the unique identifier of the extension
- * that contributed this runtime classpath entry type, via the extension
+ * that contributed this runtime loadpath entry type, via the extension
* point <code>org.eclipse.jdt.launching.runtimeLoadpathEntries</code>.
* The <code>memento</code> element will be used to initialize a
- * restored runtime classpath entry, via the method
+ * restored runtime loadpath entry, via the method
* <code>IRuntimeLoadpathEntry2.initializeFrom(Element memento)</code>. The
* attributes of the <code>memento</code> element are client defined.
* </p>
*
- * @return a memento for this classpath entry
+ * @return a memento for this loadpath entry
* @exception CoreException if an exception occurs generating a memento
*/
public String getMemento() throws CoreException;
@@ -146,9 +146,9 @@
* <li><code>ARCHIVE</code> - the absolute path of the associated archive,
* which may or may not be in the workspace.</li>
* <li><code>VARIABLE</code> - the path corresponding to the associated
- * classpath variable entry.</li>
+ * loadpath variable entry.</li>
* <li><code>CONTAINER</code> - the path corresponding to the associated
- * classpath container variable entry.</li>
+ * loadpath container variable entry.</li>
* <li><code>OTHER</code> - the path returned is client defined.</li>
* </ul>
* <p>
@@ -170,29 +170,29 @@
/**
* Returns a constant indicating where this entry should appear on the
- * runtime classpath by default.
+ * runtime loadpath by default.
* The value returned is one of the following:
* <ul>
* <li><code>STANDARD_CLASSES</code> - a standard entry does not need to appear
- * on the runtime classpath</li>
+ * on the runtime loadpath</li>
* <li><code>BOOTSTRAP_CLASSES</code> - a bootstrap entry should appear on the
* boot path</li>
* <li><code>USER_CLASSES</code> - a user entry should appear on the path
* containing user or application classes</li>
* </ul>
*
- * @return where this entry should appear on the runtime classpath
+ * @return where this entry should appear on the runtime loadpath
*/
public int getLoadpathProperty();
/**
- * Sets whether this entry should appear on the bootstrap classpath,
- * the user classpath, or whether this entry is a standard bootstrap entry
- * that does not need to appear on the classpath.
+ * Sets whether this entry should appear on the bootstrap loadpath,
+ * the user loadpath, or whether this entry is a standard bootstrap entry
+ * that does not need to appear on the loadpath.
* The location is one of:
* <ul>
* <li><code>STANDARD_CLASSES</code> - a standard entry does not need to appear
- * on the runtime classpath</li>
+ * on the runtime loadpath</li>
* <li><code>BOOTSTRAP_CLASSES</code> - a bootstrap entry should appear on the
* boot path</li>
* <li><code>USER_CLASSES</code> - a user entry should appear on the path
@@ -222,21 +222,21 @@
public String getVariableName();
/**
- * Returns a classpath entry equivalent to this runtime classpath entry,
+ * Returns a loadpath entry equivalent to this runtime loadpath entry,
* or <code>null</code> if none.
- * @return a classpath entry equivalent to this runtime classpath entry,
+ * @return a loadpath entry equivalent to this runtime loadpath entry,
* or <code>null</code>
* @since 0.9.0
*/
public ILoadpathEntry getLoadpathEntry();
/**
- * Returns the Ruby project associated with this runtime classpath entry
- * or <code>null</code> if none. Runtime classpath entries of type
+ * Returns the Ruby project associated with this runtime loadpath entry
+ * or <code>null</code> if none. Runtime loadpath entries of type
* <code>CONTAINER</code> may be associated with a project for the
* purposes of resolving the entries in a container.
*
- * @return the Ruby project associated with this runtime classpath entry
+ * @return the Ruby project associated with this runtime loadpath entry
* or <code>null</code> if none
* @since 0.9.0
*/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 14:02:17
|
Revision: 2061
http://svn.sourceforge.net/rubyeclipse/?rev=2061&view=rev
Author: cawilliams
Date: 2007-02-28 06:02:16 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-02-28 13:59:28 UTC (rev 2060)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/VMDefinitionsContainer.java 2007-02-28 14:02:16 UTC (rev 2061)
@@ -64,17 +64,17 @@
/**
* Map of VMInstallTypes to Lists of corresponding VMInstalls.
*/
- private Map fVMTypeToVMMap;
+ private Map<IVMInstallType, List<IVMInstall>> fVMTypeToVMMap;
/**
* Cached list of VMs in this container
*/
- private List fVMList;
+ private List<IVMInstall> fVMList;
/**
* VMs managed by this container whose install locations don't actually exist.
*/
- private List fInvalidVMList;
+ private List<IVMInstall> fInvalidVMList;
/**
* The composite identifier of the default VM. This consists of the install type ID
@@ -86,9 +86,9 @@
* Constructs an empty VM container
*/
public VMDefinitionsContainer() {
- fVMTypeToVMMap = new HashMap(10);
- fInvalidVMList = new ArrayList(10);
- fVMList = new ArrayList(10);
+ fVMTypeToVMMap = new HashMap<IVMInstallType, List<IVMInstall>>(10);
+ fInvalidVMList = new ArrayList<IVMInstall>(10);
+ fVMList = new ArrayList<IVMInstall>(10);
}
/**
@@ -104,9 +104,9 @@
public void addVM(IVMInstall vm) {
if (!fVMList.contains(vm)) {
IVMInstallType vmInstallType = vm.getVMInstallType();
- List vmList = (List) fVMTypeToVMMap.get(vmInstallType);
+ List<IVMInstall> vmList = (List<IVMInstall>) fVMTypeToVMMap.get(vmInstallType);
if (vmList == null) {
- vmList = new ArrayList(3);
+ vmList = new ArrayList<IVMInstall>(3);
fVMTypeToVMMap.put(vmInstallType, vmList);
}
vmList.add(vm);
@@ -154,7 +154,7 @@
*
* @return List the data structure containing all VMs managed by this container
*/
- public List getVMList() {
+ public List<IVMInstall> getVMList() {
return fVMList;
}
@@ -164,9 +164,9 @@
*
* @return List
*/
- public List getValidVMList() {
- List vms = getVMList();
- List resultList = new ArrayList(vms.size());
+ public List<IVMInstall> getValidVMList() {
+ List<IVMInstall> vms = getVMList();
+ List<IVMInstall> resultList = new ArrayList<IVMInstall>(vms.size());
resultList.addAll(vms);
resultList.removeAll(fInvalidVMList);
return resultList;
@@ -482,7 +482,7 @@
private static void setLibraryLocations(IVMInstall vm, Element libLocationsElement) {
NodeList list = libLocationsElement.getChildNodes();
int length = list.getLength();
- List locations = new ArrayList(length);
+ List<IPath> locations = new ArrayList<IPath>(length);
for (int i = 0; i < length; ++i) {
Node node = list.item(i);
short type = node.getNodeType();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 13:59:30
|
Revision: 2060
http://svn.sourceforge.net/rubyeclipse/?rev=2060&view=rev
Author: cawilliams
Date: 2007-02-28 05:59:28 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-02-28 13:54:01 UTC (rev 2059)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-02-28 13:59:28 UTC (rev 2060)
@@ -130,8 +130,8 @@
* cycles in project dependencies when resolving loadpath container entries.
* Counters used to know when entering/exiting to clear cache
*/
- private static ThreadLocal fgProjects = new ThreadLocal(); // Lists
- private static ThreadLocal fgEntryCount = new ThreadLocal(); // Integers
+ private static ThreadLocal<List<IRubyProject>> fgProjects = new ThreadLocal<List<IRubyProject>>(); // Lists
+ private static ThreadLocal<Integer> fgEntryCount = new ThreadLocal<Integer>(); // Integers
/**
* Default loadpath provider.
@@ -141,7 +141,7 @@
/**
* Path providers keyed by id
*/
- private static Map fgPathProviders = null;
+ private static Map<String, RuntimeLoadpathProvider> fgPathProviders = null;
/**
* Set of IDs of VMs contributed via vmInstalls extension point.
@@ -152,9 +152,9 @@
* Resolvers keyed by variable name, container id,
* and runtime loadpath entry id.
*/
- private static Map fgVariableResolvers = null;
- private static Map fgContainerResolvers = null;
- private static Map fgRuntimeLoadpathEntryResolvers = null;
+ private static Map<String, RuntimeLoadpathEntryResolver> fgVariableResolvers = null;
+ private static Map<String, RuntimeLoadpathEntryResolver> fgContainerResolvers = null;
+ private static Map<String, RuntimeLoadpathEntryResolver> fgRuntimeLoadpathEntryResolvers = null;
protected RubyRuntime() {
super();
@@ -780,12 +780,11 @@
IRuntimeLoadpathEntryResolver2 resolver = getVariableResolver(rubyVmPath.segment(0));
if (resolver != null) {
return resolver.resolveVMInstall(entry);
- } else {
- resolver = getContainerResolver(rubyVmPath.segment(0));
- if (resolver != null) {
- return resolver.resolveVMInstall(entry);
- }
}
+ resolver = getContainerResolver(rubyVmPath.segment(0));
+ if (resolver != null) {
+ return resolver.resolveVMInstall(entry);
+ }
}
return getDefaultVMInstall();
@@ -873,9 +872,9 @@
private static void initializeResolvers() {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.PLUGIN_ID, EXTENSION_POINT_RUNTIME_CLASSPATH_ENTRY_RESOLVERS);
IConfigurationElement[] extensions = point.getConfigurationElements();
- fgVariableResolvers = new HashMap(extensions.length);
- fgContainerResolvers = new HashMap(extensions.length);
- fgRuntimeLoadpathEntryResolvers = new HashMap(extensions.length);
+ fgVariableResolvers = new HashMap<String, RuntimeLoadpathEntryResolver>(extensions.length);
+ fgContainerResolvers = new HashMap<String, RuntimeLoadpathEntryResolver>(extensions.length);
+ fgRuntimeLoadpathEntryResolvers = new HashMap<String, RuntimeLoadpathEntryResolver>(extensions.length);
for (int i = 0; i < extensions.length; i++) {
RuntimeLoadpathEntryResolver res = new RuntimeLoadpathEntryResolver(extensions[i]);
String variable = res.getVariableName();
@@ -1072,7 +1071,7 @@
private static void initializeProviders() {
IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(LaunchingPlugin.PLUGIN_ID, EXTENSION_POINT_RUNTIME_CLASSPATH_PROVIDERS);
IConfigurationElement[] extensions = point.getConfigurationElements();
- fgPathProviders = new HashMap(extensions.length);
+ fgPathProviders = new HashMap<String, RuntimeLoadpathProvider>(extensions.length);
for (int i = 0; i < extensions.length; i++) {
RuntimeLoadpathProvider res = new RuntimeLoadpathProvider(extensions[i]);
fgPathProviders.put(res.getIdentifier(), res);
@@ -1259,7 +1258,7 @@
*/
public static IRuntimeLoadpathEntry[] computeUnresolvedRuntimeLoadpath(IRubyProject project) throws CoreException {
ILoadpathEntry[] entries = project.getRawLoadpath();
- List loadpathEntries = new ArrayList(3);
+ List<IRuntimeLoadpathEntry> loadpathEntries = new ArrayList<IRuntimeLoadpathEntry>(3);
for (int i = 0; i < entries.length; i++) {
ILoadpathEntry entry = entries[i];
switch (entry.getEntryKind()) {
@@ -1424,11 +1423,11 @@
property = IRuntimeLoadpathEntry.BOOTSTRAP_CLASSES;
break;
}
- List resolved = new ArrayList(cpes.length);
- List projects = (List) fgProjects.get();
+ List<IRuntimeLoadpathEntry> resolved = new ArrayList<IRuntimeLoadpathEntry>(cpes.length);
+ List<IRubyProject> projects = (List<IRubyProject>) fgProjects.get();
Integer count = (Integer) fgEntryCount.get();
if (projects == null) {
- projects = new ArrayList();
+ projects = new ArrayList<IRubyProject>();
fgProjects.set(projects);
count = new Integer(0);
}
@@ -1440,11 +1439,11 @@
ILoadpathEntry cpe = cpes[i];
if (cpe.getEntryKind() == ILoadpathEntry.CPE_PROJECT) {
IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(cpe.getPath().segment(0));
- IRubyProject jp = RubyCore.create(p);
- if (!projects.contains(jp)) {
- projects.add(jp);
- IRuntimeLoadpathEntry loadpath = newDefaultProjectLoadpathEntry(jp);
- IRuntimeLoadpathEntry[] entries = resolveRuntimeLoadpathEntry(loadpath, jp);
+ IRubyProject rp = RubyCore.create(p);
+ if (!projects.contains(rp)) {
+ projects.add(rp);
+ IRuntimeLoadpathEntry loadpath = newDefaultProjectLoadpathEntry(rp);
+ IRuntimeLoadpathEntry[] entries = resolveRuntimeLoadpathEntry(loadpath, rp);
for (int j = 0; j < entries.length; j++) {
IRuntimeLoadpathEntry e = entries[j];
if (!resolved.contains(e)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 13:54:09
|
Revision: 2059
http://svn.sourceforge.net/rubyeclipse/?rev=2059&view=rev
Author: cawilliams
Date: 2007-02-28 05:54:01 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up type safety warnings
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestunitPlugin.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/RubyClassSelector.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestSearchEngine.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-02-28 13:42:58 UTC (rev 2058)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestHierarchyTab.java 2007-02-28 13:54:01 UTC (rev 2059)
@@ -81,11 +81,11 @@
/**
* Vector of SuiteInfo items
*/
- private Vector fSuiteInfos = new Vector();
+ private Vector<SuiteInfo> fSuiteInfos = new Vector<SuiteInfo>();
/**
* Maps test Ids to TreeItems.
*/
- private Map fTreeItemMap = new HashMap();
+ private Map<String, TreeItem> fTreeItemMap = new HashMap<String, TreeItem>();
private TestUnitView fTestRunnerPart;
@@ -209,7 +209,7 @@
}
private void updatePath(TreeItem parent) {
- List newPath = new ArrayList();
+ List<TreeItem> newPath = new ArrayList<TreeItem>();
while (parent != null) {
newPath.add(parent);
parent = parent.getParentItem();
@@ -367,7 +367,7 @@
public void aboutToStart() {
fTree.removeAll();
fSuiteInfos.removeAllElements();
- fTreeItemMap = new HashMap();
+ fTreeItemMap = new HashMap<String, TreeItem>();
fCachedParent = null;
fCachedItems = null;
fMoveSelection = false;
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java 2007-02-28 13:42:58 UTC (rev 2058)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestUnitView.java 2007-02-28 13:54:01 UTC (rev 2059)
@@ -84,12 +84,12 @@
/**
* The collection of ITestRunTabs
*/
- protected Vector fTestRunTabs = new Vector();
+ protected Vector<TestRunTab> fTestRunTabs = new Vector<TestRunTab>();
/**
* Map storing TestInfos for each executed test keyed by the test name.
*/
- private Map fTestInfos = new HashMap();
+ private Map<String, TestRunInfo> fTestInfos = new HashMap<String, TestRunInfo>();
/**
* Is the UI disposed
@@ -132,7 +132,7 @@
* The first failure of a test run. Used to reveal the first failed tests at
* the end of a run.
*/
- private List fFailures = new ArrayList();
+ private List<TestRunInfo> fFailures = new ArrayList<TestRunInfo>();
protected boolean fShowOnErrorOnly = false;
@@ -561,7 +561,7 @@
fTestCount = testCount;
aboutToStart();
fTestInfos.clear();
- fFailures = new ArrayList();
+ fFailures = new ArrayList<TestRunInfo>();
}
protected void start(final int total) {
@@ -802,8 +802,7 @@
* @see ITestRunListener#testRunStopped
*/
public void testRunStopped(final long elapsedTime) {
- String msg = TestUnitMessages.TestRunnerViewPart_message_stopped;
- setInfoMessage(msg);
+ setInfoMessage(TestUnitMessages.TestRunnerViewPart_message_stopped);
handleStopped();
}
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestunitPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestunitPlugin.java 2007-02-28 13:42:58 UTC (rev 2058)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/ui/TestunitPlugin.java 2007-02-28 13:54:01 UTC (rev 2059)
@@ -48,7 +48,7 @@
* TestRunner once to a launch. Once a test runner is connected it is
* removed from the set.
*/
- private AbstractSet fTrackedLaunches = new HashSet(20);
+ private AbstractSet<ILaunch> fTrackedLaunches = new HashSet<ILaunch>(20);
private static URL fgIconBaseURL;
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/RubyClassSelector.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/RubyClassSelector.java 2007-02-28 13:42:58 UTC (rev 2058)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/RubyClassSelector.java 2007-02-28 13:54:01 UTC (rev 2059)
@@ -138,7 +138,7 @@
* @return
*/
private IRubyElement[] getAllTypes() {
- List typeList = new ArrayList();
+ List<IRubyElement> typeList = new ArrayList<IRubyElement>();
IProject[] projects = RubyCore.getRubyProjects();
for (int i = 0; i < projects.length; i++) {
IRubyElement[] types = TestSearchEngine.findTests(projects[i]);
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestSearchEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestSearchEngine.java 2007-02-28 13:42:58 UTC (rev 2058)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestSearchEngine.java 2007-02-28 13:54:01 UTC (rev 2059)
@@ -49,9 +49,9 @@
try {
script.reconcile();
IRubyElement[] children = script.getChildren();
- List types = new ArrayList();
+ List<IRubyElement> types = new ArrayList<IRubyElement>();
for (int i = 0; i < children.length; i++) {
- if (children[i].isType(IRubyElement.TYPE) ) types.add(children[i]);
+ if (children[i].isType(IRubyElement.TYPE)) types.add(children[i]);
}
IRubyElement[] array = new IRubyElement[types.size()];
System.arraycopy(types.toArray(), 0, array, 0, types.size());
@@ -68,7 +68,7 @@
public static IRubyElement[] findTests(IProject rubyProject) {
if (rubyProject == null) { return new IRubyElement[0]; }
try {
- List tests = new ArrayList();
+ List<IRubyElement> tests = new ArrayList<IRubyElement>();
RubyElementVisitor visitor = new RubyElementVisitor();
rubyProject.accept(visitor);
Object[] rubyFiles = visitor.getCollectedRubyFiles();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
Revision: 2058
http://svn.sourceforge.net/rubyeclipse/?rev=2058&view=rev
Author: cawilliams
Date: 2007-02-28 05:42:58 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
remove unnecessary else
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/wizards/MethodStubsSelectionButtonGroup.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/wizards/MethodStubsSelectionButtonGroup.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/wizards/MethodStubsSelectionButtonGroup.java 2007-02-28 13:42:17 UTC (rev 2057)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/internal/testunit/wizards/MethodStubsSelectionButtonGroup.java 2007-02-28 13:42:58 UTC (rev 2058)
@@ -111,13 +111,12 @@
gd.horizontalSpan= nColumns - 1;
buttonsgroup.setLayoutData(gd);
return new Control[] { label, buttonsgroup };
- } else {
- Composite buttonsgroup= getSelectionButtonsGroup(parent);
- GridData gd= new GridData();
- gd.horizontalSpan= nColumns;
- buttonsgroup.setLayoutData(gd);
- return new Control[] { buttonsgroup };
}
+ Composite buttonsgroup= getSelectionButtonsGroup(parent);
+ GridData gd= new GridData();
+ gd.horizontalSpan= nColumns;
+ buttonsgroup.setLayoutData(gd);
+ return new Control[] { buttonsgroup };
}
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 13:42:19
|
Revision: 2057
http://svn.sourceforge.net/rubyeclipse/?rev=2057&view=rev
Author: cawilliams
Date: 2007-02-28 05:42:17 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up calls to deprecated code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitMainTab.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitMainTab.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitMainTab.java 2007-02-28 13:41:47 UTC (rev 2056)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitMainTab.java 2007-02-28 13:42:17 UTC (rev 2057)
@@ -45,7 +45,6 @@
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.internal.debug.ui.RdtDebugUiMessages;
-import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.testunit.ui.TestUnitMessages;
import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
@@ -211,7 +210,7 @@
}
}
- configuration.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, projectName);
+ configuration.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
configuration.setAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, fileName);
configuration.setAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, type);
configuration.setAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, "");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-28 13:41:58
|
Revision: 2056
http://svn.sourceforge.net/rubyeclipse/?rev=2056&view=rev
Author: cawilliams
Date: 2007-02-28 05:41:47 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
clean up calls to deprecated code
Modified Paths:
--------------
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-02-28 13:35:02 UTC (rev 2055)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-02-28 13:41:47 UTC (rev 2056)
@@ -31,10 +31,10 @@
import org.rubypeople.rdt.core.IRubyElement;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.debug.ui.launcher.RubyApplicationShortcut;
-import org.rubypeople.rdt.internal.launching.RubyLaunchConfigurationAttribute;
import org.rubypeople.rdt.internal.testunit.ui.TestUnitMessages;
import org.rubypeople.rdt.internal.testunit.ui.TestunitPlugin;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
+import org.rubypeople.rdt.launching.IRubyLaunchConfigurationConstants;
import org.rubypeople.rdt.launching.RubyRuntime;
public class TestUnitLaunchShortcut extends RubyApplicationShortcut {
@@ -66,7 +66,7 @@
if ((config.getAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, "").equals(container))
&& (config.getAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, "").equals(""))
&& (config.getAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, "").equals(testName))
- && (config.getAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, "").equals(rubyFile.getProject().getName()))) {
+ && (config.getAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, "").equals(rubyFile.getProject().getName()))) {
candidateConfigs.add(config);
}
}
@@ -135,10 +135,10 @@
try {
ILaunchConfigurationType configType = getRubyLaunchConfigType();
ILaunchConfigurationWorkingCopy wc = configType.newInstance(null, getLaunchManager().generateUniqueLaunchConfigurationNameFrom(rubyFile.getName()));
- wc.setAttribute(RubyLaunchConfigurationAttribute.PROJECT_NAME, rubyFile.getProject().getName());
- wc.setAttribute(RubyLaunchConfigurationAttribute.FILE_NAME, TestUnitLaunchConfigurationDelegate.getTestRunnerPath());
- wc.setAttribute(RubyLaunchConfigurationAttribute.WORKING_DIRECTORY, TestUnitLaunchShortcut.getDefaultWorkingDirectory(rubyFile.getProject()));
- wc.setAttribute(RubyLaunchConfigurationAttribute.SELECTED_INTERPRETER, RubyRuntime.getCompositeIdFromVM(RubyRuntime.getDefaultVMInstall()));
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_PROJECT_NAME, rubyFile.getProject().getName());
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_FILE_NAME, TestUnitLaunchConfigurationDelegate.getTestRunnerPath());
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, TestUnitLaunchShortcut.getDefaultWorkingDirectory(rubyFile.getProject()));
+ wc.setAttribute(IRubyLaunchConfigurationConstants.ATTR_RUBY_CONTAINER_PATH, RubyRuntime.getCompositeIdFromVM(RubyRuntime.getDefaultVMInstall()));
wc.setAttribute(TestUnitLaunchConfigurationDelegate.LAUNCH_CONTAINER_ATTR, container);
wc.setAttribute(TestUnitLaunchConfigurationDelegate.TESTNAME_ATTR, testName);
wc.setAttribute(TestUnitLaunchConfigurationDelegate.TESTTYPE_ATTR, "");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-28 13:35:10
|
Revision: 2055
http://svn.sourceforge.net/rubyeclipse/?rev=2055&view=rev
Author: mirkostocker
Date: 2007-02-28 05:35:02 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
Replace the code that checks for a valid class name with a regex. The previous implementation didn't work correctly and was more complicated.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java 2007-02-28 13:16:56 UTC (rev 2054)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/NewTypeWizardPage.java 2007-02-28 13:35:02 UTC (rev 2055)
@@ -864,17 +864,11 @@
private boolean isConstant(String className) {
if (className == null || className.length() == 0) return false;
- if (!Character.isLowerCase(className.charAt(0)) && !Character.isLetter(className.charAt(0)))
- return false;
int namespaceDelimeterIndex = className.indexOf("::");
if (namespaceDelimeterIndex != -1) {
return isConstant(className.substring(0, namespaceDelimeterIndex)) && isConstant(className.substring(namespaceDelimeterIndex+2));
}
- for (int i = 0; i < className.length(); i++) {
- char c = className.charAt(i);
- if (!Character.isLetterOrDigit(c) && c != '_') return false;
- }
- return true;
+ return className.matches("^[A-Z]\\w*");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mir...@us...> - 2007-02-28 13:16:59
|
Revision: 2054
http://svn.sourceforge.net/rubyeclipse/?rev=2054&view=rev
Author: mirkostocker
Date: 2007-02-28 05:16:56 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
fixd a lot of warnings, we are now almost < 100 for the whole project.
Modified Paths:
--------------
trunk/org.epic.regexp/src/org/epic/regexp/views/RegExpView.java
trunk/org.kxml2/build.properties
trunk/org.kxml2/src/org/kxml2/io/KXmlParser.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java
trunk/org.rubypeople.rdt.core.tests/src/RubyParserCmd.java
trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java
trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstallType.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyLaunchDelegate.java
trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/WorkspaceDocumentProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/SClassNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NameHelper.java
trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
Modified: trunk/org.epic.regexp/src/org/epic/regexp/views/RegExpView.java
===================================================================
--- trunk/org.epic.regexp/src/org/epic/regexp/views/RegExpView.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.epic.regexp/src/org/epic/regexp/views/RegExpView.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -494,8 +494,6 @@
REMatch[] matches = re.getAllMatches(matchText.getText());
- String matchesString = "";
-
result = matches.length > 0 ? true : false;
// Reset style
Modified: trunk/org.kxml2/build.properties
===================================================================
--- trunk/org.kxml2/build.properties 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.kxml2/build.properties 2007-02-28 13:16:56 UTC (rev 2054)
@@ -2,5 +2,4 @@
kxml2.jar
plugin = org.kxml2
plugin.name = kxml2
-plugin.classpath =
source.kxml2.jar = src/
\ No newline at end of file
Modified: trunk/org.kxml2/src/org/kxml2/io/KXmlParser.java
===================================================================
--- trunk/org.kxml2/src/org/kxml2/io/KXmlParser.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.kxml2/src/org/kxml2/io/KXmlParser.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -72,7 +72,6 @@
// Event-related
private int type;
- private String text;
private boolean isWhitespace;
private String namespace;
private String prefix;
@@ -252,7 +251,6 @@
prefix = null;
name = null;
namespace = null;
- text = null;
type = peekType();
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -2,7 +2,6 @@
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
@@ -26,7 +25,6 @@
import org.jruby.ast.MethodDefNode;
import org.jruby.ast.ModuleNode;
import org.jruby.ast.Node;
-import org.jruby.ast.types.INameNode;
import org.jruby.lexer.yacc.SyntaxException;
import org.jruby.parser.StaticScope;
import org.rubypeople.rdt.core.CompletionProposal;
@@ -532,11 +530,7 @@
}
public String getElementName() {
- // TODO Auto-generated method stub
- if (node instanceof INameNode) {
- return ((INameNode)node).getName();
- }
- return null;
+ return node.getName();
}
public int getElementType() {
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-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/RubyElementRequestor.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -53,7 +53,7 @@
} catch (RubyModelException e) {
RubyCore.log(e);
}
- return (IType[]) types.toArray(new IType[types.size()]);
+ return types.toArray(new IType[types.size()]);
}
private List<IType> filterToMatches(String typeName, List<IType> types) {
@@ -100,7 +100,7 @@
}
if (tokens.isEmpty()) return new ArrayList<IType>();
String name = tokens.remove(tokens.size() - 1) + RUBY_FILE_EXTENSION;
- String[] pckgs = (String[]) tokens.toArray(new String[tokens.size()]);
+ String[] pckgs = tokens.toArray(new String[tokens.size()]);
ISourceFolder folder = root.getSourceFolder(pckgs);
if (!folder.exists()) return new ArrayList<IType>();
IRubyScript otherScript = folder.getRubyScript(name);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/ExternalRubyScript.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -8,7 +8,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
import org.jruby.ast.Node;
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.core.IBuffer;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyModelManager.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -780,9 +780,9 @@
Platform.getContentTypeManager().addContentTypeChangeListener(this);
// retrieve variable values
- long start = -1;
- if (VERBOSE)
- start = System.currentTimeMillis();
+// long start = -1;
+// if (VERBOSE)
+// start = System.currentTimeMillis();
loadVariablesAndContainers();
// if (VERBOSE)
// traceVariableAndContainers("Loaded", start); //$NON-NLS-1$
@@ -981,7 +981,7 @@
Iterator projectIterator = this.containers.keySet().iterator();
while (projectIterator.hasNext()){
IRubyProject project = (IRubyProject)projectIterator.next();
- Map projectContainers = (Map)this.containers.get(project);
+ Map projectContainers = this.containers.get(project);
if (projectContainers != null){
Iterator containerIterator = projectContainers.keySet().iterator();
while (containerIterator.hasNext()){
@@ -1115,7 +1115,7 @@
public void saving(ISaveContext context) throws CoreException {
// save variable and container values on snapshot/full save
- long start = -1;
+// long start = -1;
// if (VERBOSE)
// start = System.currentTimeMillis();
saveVariablesAndContainers();
@@ -2553,7 +2553,7 @@
saveString(project.getElementName());
- Map containerMap = (Map) RubyModelManager.this.containers.get(project);
+ Map containerMap = RubyModelManager.this.containers.get(project);
if (containerMap == null) {
containerMap = Collections.EMPTY_MAP;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptProblemFinder.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -16,8 +16,6 @@
import org.rubypeople.rdt.core.IProblemRequestor;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.core.parser.IProblem;
-import org.rubypeople.rdt.internal.core.builder.ProblemRequestorMarkerManager;
-import org.rubypeople.rdt.internal.core.parser.Error;
import org.rubypeople.rdt.internal.core.parser.RdtWarnings;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
import org.rubypeople.rdt.internal.core.parser.TaskParser;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyScriptStructureBuilder.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -505,7 +505,7 @@
String name = getFullyQualifiedName(iVisited.getCPath());
RubyType handle = new RubyType(modelStack.peek(), name);
RubyElement parent = modelStack.peek();
- RubyType existing = (RubyType) findChild(parent, IRubyElement.TYPE, name);
+ RubyType existing = findChild(parent, IRubyElement.TYPE, name);
if (existing != null) {
// FIXME Should we just increment the occurence count like I do here, or should we conglomerate the types into one LogicalType?
handle.occurrenceCount = existing.occurrenceCount + 1;
@@ -1323,7 +1323,7 @@
String name = getFullyQualifiedName(iVisited.getCPath());
RubyModule module = new RubyModule(modelStack.peek(), name);
RubyElement parent = modelStack.peek();
- RubyType existing = (RubyType) findChild(parent, IRubyElement.TYPE, name);
+ RubyType existing = findChild(parent, IRubyElement.TYPE, name);
if (existing != null) {
// FIXME Should we just increment the occurence count like I do here, or should we conglomerate the types into one LogicalType?
module.occurrenceCount = existing.occurrenceCount + 1;
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/ti/TypeInferenceVisitor.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -20,7 +20,7 @@
private Scope globalScope;
private Scope currentScope;
- // todo: init globalScope to null, push in first non-null node as
+ // TODO: init globalScope to null, push in first non-null node as
// globalScope
public TypeInferenceVisitor( Node rootNode ) {
System.out.println("Instantiating new TypeInferenceVisitor with root node " + stringifyNode(rootNode) );
@@ -31,15 +31,15 @@
public Instruction handleNode(Node iVisited) {
- if ( iVisited != null )
- {
- String pos = "";
- String cls = "";
- if ( iVisited.getPosition() != null ) pos = Integer.toString(iVisited.getPosition().getStartLine());
- if ( iVisited.getClass() != null ) cls = iVisited.getClass().getName();
+// if ( iVisited != null )
+// {
+// String pos = "";
+// String cls = "";
+// if ( iVisited.getPosition() != null ) pos = Integer.toString(iVisited.getPosition().getStartLine());
+// if ( iVisited.getClass() != null ) cls = iVisited.getClass().getName();
// System.out.println("Visiting " + iVisited.getClass().getSimpleName() + "\tat line " + pos + " of class " + cls );
- System.out.println(" - Spanning " + iVisited.getPosition().getStartOffset() + "-" + iVisited.getPosition().getEndOffset());
- }
+// System.out.println(" - Spanning " + iVisited.getPosition().getStartOffset() + "-" + iVisited.getPosition().getEndOffset());
+// }
return super.handleNode(iVisited);
}
@@ -70,7 +70,7 @@
public Instruction visitDefnNode(DefnNode iVisited) {
Scope newScope = pushScope( iVisited );
Variable.insertLocalsFromScopeNode(iVisited.getScope(), newScope);
- // todo: insert from argsNodes
+ // TODO: insert from argsNodes
return super.visitDefnNode(iVisited);
}
@@ -81,7 +81,7 @@
public Instruction visitDefsNode(DefsNode iVisited) {
Scope newScope = pushScope( iVisited );
Variable.insertLocalsFromScopeNode(iVisited.getScope(), newScope);
- // todo: insert from argsNodes
+ // TODO: insert from argsNodes
return super.visitDefsNode(iVisited);
}
@@ -89,10 +89,10 @@
* Visit an IterNode, and extract variable references from it
*/
public Instruction visitIterNode(IterNode iVisited) {
- // todo: push iterator var into the iter's scope.
- Scope newScope = pushScope(iVisited);
+ // TODO: push iterator var into the iter's scope.
+// Scope newScope = pushScope(iVisited);
// newScope.getVariables().add( new Variable( newScope, ))
- // todo: insert from varNode; either DAsgnNode or LocalAsgnNode
+ // TODO: insert from varNode; either DAsgnNode or LocalAsgnNode
// depending... (see: block local var ambiguity)
pushScope( iVisited );
return super.visitIterNode(iVisited);
@@ -112,8 +112,8 @@
return newScope;
}
- // todo: how to tell when to do this?
- // todo: perhaps model IndexUpdater rather than InOrderVisitor
+ // TODO: how to tell when to do this?
+ // TODO: perhaps model IndexUpdater rather than InOrderVisitor
private void popScope()
{
currentScope = currentScope.getParentScope();
@@ -128,7 +128,7 @@
if ( var != null )
{
// System.out.println("Call: " + var.getName() + "." + iVisited.getName() );
- // todo: add call to list
+ // TODO: add call to list
}
return super.visitCallNode(iVisited);
}
@@ -148,10 +148,10 @@
LocalVarNode localVarNode = (LocalVarNode) node;
return currentScope.getLocalVariableByCount(localVarNode.getIndex());
}
- // todo: InstVarNode
- // todo: GlobalVarNode
- // todo: ClassVarNode
- // todo: DVarNode
+ // TODO: InstVarNode
+ // TODO: GlobalVarNode
+ // TODO: ClassVarNode
+ // TODO: DVarNode
return null;
}
@@ -168,7 +168,7 @@
if ( currentScope == globalScope )
{
// Yes - stick this variable into the global scope.
- // todo: Shouldn't JRuby give a ScopeNode w/ a .getLocalNames()
+ // TODO: Shouldn't JRuby give a ScopeNode w/ a .getLocalNames()
// for the global script?
var = new Variable( globalScope, iVisited.getName(), iVisited.getIndex() );
currentScope.getVariables().add(var);
@@ -186,7 +186,7 @@
var.getTypeGuesses().add( new BasicTypeGuess( concreteGuess, 100 ) );
}
// else if ( valueNode instanceof LocalVarNode ) {
-// // todo: this method needs to be fixed... see
+// // TODO: this method needs to be fixed... see
// // ReferenceTypeGuess.java
// LocalVarNode rhsNode = (LocalVarNode)valueNode;
// Variable rhsVar = currentScope.getLocalVariableByCount(rhsNode.getCount());
Modified: trunk/org.rubypeople.rdt.core.tests/src/RubyParserCmd.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/RubyParserCmd.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core.tests/src/RubyParserCmd.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -14,12 +14,9 @@
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.eclipse.shams.resources.ShamFile;
import org.rubypeople.rdt.internal.core.DefaultWorkingCopyOwner;
-import org.rubypeople.rdt.internal.core.RubyProject;
import org.rubypeople.rdt.internal.core.RubyScript;
import org.rubypeople.rdt.internal.core.RubyScriptElementInfo;
import org.rubypeople.rdt.internal.core.RubyScriptStructureBuilder;
-import org.rubypeople.rdt.internal.core.SourceFolder;
-import org.rubypeople.rdt.internal.core.SourceFolderRoot;
import org.rubypeople.rdt.internal.core.parser.RdtWarnings;
import org.rubypeople.rdt.internal.core.parser.RubyParser;
Modified: trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java
===================================================================
--- trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.core.tests/src/org/rubypeople/rdt/internal/core/builder/TC_MassIndexUpdater.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -53,9 +53,7 @@
ShamMonitor monitor = new ShamMonitor();
massUpdater.updateProjects(projects, monitor);
- RubySourceFileCollectingVisitor expectedVisitor =
- new RubySourceFileCollectingVisitor(new ArrayList());
-
+
parser.assertParsed(file1);
parser.assertParsed(file2);
parser.assertParsed(file3);
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_ClassicDebuggerCommunicationTest.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -122,7 +122,7 @@
sendRuby("th l");
threadInfos = getThreadInfoReader().readThreads();
assertEquals(1, threadInfos.length);
- assertNotSame(point1.getThreadId(), point2.getThreadId());
+ assertNotSame(Integer.valueOf(point1.getThreadId()), Integer.valueOf(point2.getThreadId()));
}
public void testThreadIdsAndResume() throws Exception {
Modified: trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.debug.core.tests/src/org/rubypeople/rdt/debug/core/tests/FTC_RubyDebugCommunicationTest.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -1,17 +1,8 @@
package org.rubypeople.rdt.debug.core.tests;
-import java.io.PrintWriter;
-import java.net.ConnectException;
-import java.net.Socket;
-
import org.rubypeople.rdt.core.RubyCore;
-import org.rubypeople.rdt.internal.debug.core.SuspensionPoint;
import org.rubypeople.rdt.internal.debug.core.commands.AbstractDebuggerConnection;
-import org.rubypeople.rdt.internal.debug.core.commands.EvalCommand;
import org.rubypeople.rdt.internal.debug.core.commands.RubyDebugConnection;
-import org.rubypeople.rdt.internal.debug.core.parsing.AbstractReadStrategy;
-import org.rubypeople.rdt.internal.debug.core.parsing.EvalReader;
-import org.rubypeople.rdt.internal.debug.core.parsing.MultiReaderStrategy;
import org.rubypeople.rdt.internal.launching.LaunchingPlugin;
public class FTC_RubyDebugCommunicationTest extends FTC_ClassicDebuggerCommunicationTest {
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/DefaultProjectLoadpathEntry.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -306,9 +306,9 @@
*/
public String getName() {
if (isExportedEntriesOnly()) {
- return MessageFormat.format(LaunchingMessages.DefaultProjectLoadpathEntry_2, new String[] {getRubyProject().getElementName()});
+ return MessageFormat.format(LaunchingMessages.DefaultProjectLoadpathEntry_2, getRubyProject().getElementName());
}
- return MessageFormat.format(LaunchingMessages.DefaultProjectLoadpathEntry_4, new String[] {getRubyProject().getElementName()});
+ return MessageFormat.format(LaunchingMessages.DefaultProjectLoadpathEntry_4, getRubyProject().getElementName());
}
/* (non-Rubydoc)
* @see java.lang.Object#equals(java.lang.Object)
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/LaunchingPlugin.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -590,7 +590,7 @@
}
IConfigurationElement config = (IConfigurationElement) fClasspathEntryExtensions.get(id);
if (config == null) {
- abort(MessageFormat.format(LaunchingMessages.LaunchingPlugin_32, new String[]{id}), null);
+ abort(MessageFormat.format(LaunchingMessages.LaunchingPlugin_32, id), null);
}
return (IRuntimeLoadpathEntry2) config.createExecutableExtension("class"); //$NON-NLS-1$
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/RuntimeLoadpathEntry.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -96,7 +96,7 @@
setType(VARIABLE);
break;
default:
- throw new IllegalArgumentException(MessageFormat.format(LaunchingMessages.RuntimeLoadpathEntry_Illegal_classpath_entry__0__1, new String[] {entry.toString()}));
+ throw new IllegalArgumentException(MessageFormat.format(LaunchingMessages.RuntimeLoadpathEntry_Illegal_classpath_entry__0__1, entry.toString()));
}
setLoadpathEntry(entry);
initializeLoadpathProperty();
@@ -114,7 +114,7 @@
setType(CONTAINER);
break;
default:
- throw new IllegalArgumentException(MessageFormat.format(LaunchingMessages.RuntimeLoadpathEntry_Illegal_classpath_entry__0__1, new String[] {entry.toString()}));
+ throw new IllegalArgumentException(MessageFormat.format(LaunchingMessages.RuntimeLoadpathEntry_Illegal_classpath_entry__0__1,entry.toString()));
}
setLoadpathEntry(entry);
setLoadpathProperty(classpathProperty);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMRunner.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -42,13 +42,13 @@
protected String renderDebugTarget(String classToRun, int host) {
String format= LaunchingMessages.StandardVMRunner__0__at_localhost__1__1;
- return MessageFormat.format(format, new String[] { classToRun, String.valueOf(host) });
+ return MessageFormat.format(format, classToRun, String.valueOf(host));
}
public static String renderProcessLabel(String[] commandLine) {
String format= LaunchingMessages.StandardVMRunner__0____1___2;
String timestamp= DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM).format(new Date(System.currentTimeMillis()));
- return MessageFormat.format(format, new String[] { commandLine[0], timestamp });
+ return MessageFormat.format(format, commandLine[0], timestamp);
}
protected static String renderCommandLine(String[] commandLine) {
@@ -105,7 +105,7 @@
}
File dir = new File(path);
if (!dir.isDirectory()) {
- abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Specified_working_directory_does_not_exist_or_is_not_a_directory___0__3, new String[] {path}), null, IRubyLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
+ abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Specified_working_directory_does_not_exist_or_is_not_a_directory___0__3, path), null, IRubyLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
return dir;
}
@@ -137,7 +137,7 @@
if (command == null) {
File exe = StandardVMType.findRubyExecutable(fVMInstance.getInstallLocation());
if (exe == null) {
- abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Unable_to_locate_executable_for__0__1, new String[]{fVMInstance.getName()}), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Unable_to_locate_executable_for__0__1, fVMInstance.getName()), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
}
return exe.getAbsolutePath();
}
@@ -154,7 +154,7 @@
}
// not found
- abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Specified_executable__0__does_not_exist_for__1__4, new String[]{command, fVMInstance.getName()}), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
+ abort(MessageFormat.format(LaunchingMessages.StandardVMRunner_Specified_executable__0__does_not_exist_for__1__4, command, fVMInstance.getName()), null, IRubyLaunchConfigurationConstants.ERR_INTERNAL_ERROR);
// NOTE: an exception will be thrown - null cannot be returned
return null;
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/internal/launching/StandardVMType.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -174,7 +174,7 @@
}
if (info == null) {
// log error that we were unable to generate library info - see bug 70011
- LaunchingPlugin.log(MessageFormat.format("Failed to retrieve default libraries for {0}", new String[]{rubyHome.getAbsolutePath()})); //$NON-NLS-1$
+ LaunchingPlugin.log(MessageFormat.format("Failed to retrieve default libraries for {0}", rubyHome.getAbsolutePath())); //$NON-NLS-1$
}
return info;
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractRubyLaunchConfigurationDelegate.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -120,7 +120,7 @@
abort(
MessageFormat.format(
LaunchingMessages.AbstractJavaLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12,
- new String[]{dir.toString()}),
+ dir.toString()),
null,
IRubyLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
@@ -143,7 +143,7 @@
MessageFormat
.format(
LaunchingMessages.AbstractJavaLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12,
- new String[]{path.toString()}),
+ path.toString()),
null,
IRubyLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
} else {
@@ -156,7 +156,7 @@
MessageFormat
.format(
LaunchingMessages.AbstractJavaLaunchConfigurationDelegate_Working_directory_does_not_exist___0__12,
- new String[]{path.toString()}),
+ path.toString()),
null,
IRubyLaunchConfigurationConstants.ERR_WORKING_DIRECTORY_DOES_NOT_EXIST);
}
@@ -287,7 +287,7 @@
IVMInstall vm = verifyVMInstall(configuration);
IVMRunner runner = vm.getVMRunner(mode);
if (runner == null) {
- abort(MessageFormat.format(LaunchingMessages.JavaLocalApplicationLaunchConfigurationDelegate_0, new String[]{vm.getName(), mode}), null, IRubyLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST);
+ abort(MessageFormat.format(LaunchingMessages.JavaLocalApplicationLaunchConfigurationDelegate_0, vm.getName(), mode), null, IRubyLaunchConfigurationConstants.ERR_VM_RUNNER_DOES_NOT_EXIST);
}
return runner;
}
@@ -319,7 +319,7 @@
MessageFormat
.format(
LaunchingMessages.AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_not_specified_for__0__5,
- new String[]{vm.getName()}),
+ vm.getName()),
null,
IRubyLaunchConfigurationConstants.ERR_VM_INSTALL_DOES_NOT_EXIST);
}
@@ -328,8 +328,7 @@
MessageFormat
.format(
LaunchingMessages.AbstractJavaLaunchConfigurationDelegate_JRE_home_directory_for__0__does_not_exist___1__6,
- new String[]{vm.getName(),
- location.getAbsolutePath()}),
+ vm.getName(), location.getAbsolutePath()),
null,
IRubyLaunchConfigurationConstants.ERR_VM_INSTALL_DOES_NOT_EXIST);
}
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstallType.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstallType.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/AbstractVMInstallType.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -88,7 +88,7 @@
public IVMInstall createVMInstall(String id) throws IllegalArgumentException {
if (findVMInstall(id) != null) {
String format= LaunchingMessages.vmInstallType_duplicateVM;
- throw new IllegalArgumentException(MessageFormat.format(format, new String[] { id }));
+ throw new IllegalArgumentException(MessageFormat.format(format, id));
}
IVMInstall vm= doCreateVMInstall(id);
fVMs.add(vm);
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyLaunchDelegate.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyLaunchDelegate.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyLaunchDelegate.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -39,7 +39,7 @@
monitor = new NullProgressMonitor();
}
- monitor.beginTask(MessageFormat.format("{0}...", new String[]{configuration.getName()}), 3); //$NON-NLS-1$
+ monitor.beginTask(MessageFormat.format("{0}...", configuration.getName()), 3); //$NON-NLS-1$
// check for cancellation
if (monitor.isCanceled()) {
return;
Modified: trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java
===================================================================
--- trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.launching/src/org/rubypeople/rdt/launching/RubyRuntime.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -804,21 +804,24 @@
IVMInstallType vt = getVMInstallType(type);
if (vt == null) {
// error type does not exist
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Specified_VM_install_type_does_not_exist___0__2, new String[] {type}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Specified_VM_install_type_does_not_exist___0__2, type), null);
}
IVMInstall vm = null;
// look for a name
if (name == null) {
// error - type specified without a specific install (could be an old config that specified a VM ID)
// log the error, but choose the default VM.
- IStatus status = new Status(IStatus.WARNING, LaunchingPlugin.getUniqueIdentifier(), IRubyLaunchConfigurationConstants.ERR_UNSPECIFIED_VM_INSTALL, MessageFormat.format(LaunchingMessages.JavaRuntime_VM_not_fully_specified_in_launch_configuration__0____missing_VM_name__Reverting_to_default_VM__1, new String[] {configuration.getName()}), null);
+ IStatus status = new Status(IStatus.WARNING, LaunchingPlugin.getUniqueIdentifier(),
+ IRubyLaunchConfigurationConstants.ERR_UNSPECIFIED_VM_INSTALL,
+ MessageFormat.format(LaunchingMessages.JavaRuntime_VM_not_fully_specified_in_launch_configuration__0____missing_VM_name__Reverting_to_default_VM__1, configuration.getName()),
+ null);
LaunchingPlugin.log(status);
return getDefaultVMInstall();
}
vm = vt.findVMInstallByName(name);
if (vm == null) {
// error - install not found
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Specified_VM_install_not_found__type__0___name__1__2, new String[] {vt.getName(), name}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Specified_VM_install_not_found__type__0___name__1__2, vt.getName(), name), null);
} else {
return vm;
}
@@ -942,10 +945,10 @@
}
IRubyProject javaProject = getRubyModel().getRubyProject(projectName);
if (javaProject != null && javaProject.getProject().exists() && !javaProject.getProject().isOpen()) {
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_28, new String[] {configuration.getName(), projectName}), IRubyLaunchConfigurationConstants.ERR_PROJECT_CLOSED, null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_28, configuration.getName(), projectName), IRubyLaunchConfigurationConstants.ERR_PROJECT_CLOSED, null);
}
if ((javaProject == null) || !javaProject.exists()) {
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Launch_configuration__0__references_non_existing_project__1___1, new String[] {configuration.getName(), projectName}), IRubyLaunchConfigurationConstants.ERR_NOT_A_RUBY_PROJECT, null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Launch_configuration__0__references_non_existing_project__1___1,configuration.getName(), projectName), IRubyLaunchConfigurationConstants.ERR_NOT_A_RUBY_PROJECT, null);
}
return javaProject;
}
@@ -1050,7 +1053,7 @@
} else {
provider = (IRuntimeLoadpathProvider)getLoadpathProviders().get(providerId);
if (provider == null) {
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_26, new String[]{providerId}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_26, providerId), null);
}
}
return provider;
@@ -1342,7 +1345,7 @@
}
} else {
// could not resolve project
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_project___0__3, new String[]{entry.getPath().lastSegment()}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_project___0__3, entry.getPath().lastSegment()), null);
}
break;
case IRuntimeLoadpathEntry.VARIABLE:
@@ -1365,11 +1368,11 @@
// verify the archive exists
String location = entry.getLocation();
if (location == null) {
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_archive___0__4, new String[]{entry.getPath().toString()}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_archive___0__4, entry.getPath().toString()), null);
}
File file = new File(location);
if (!file.exists()) {
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_archive___0__4, new String[]{entry.getPath().toString()}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Classpath_references_non_existant_archive___0__4, entry.getPath().toString()), null);
}
break;
case IRuntimeLoadpathEntry.OTHER:
@@ -1404,7 +1407,7 @@
}
ILoadpathContainer container = RubyCore.getLoadpathContainer(entry.getPath(), project);
if (container == null) {
- abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Could_not_resolve_classpath_container___0__1, new String[]{entry.getPath().toString()}), null);
+ abort(MessageFormat.format(LaunchingMessages.JavaRuntime_Could_not_resolve_classpath_container___0__1,entry.getPath().toString()), null);
// execution will not reach here - exception will be thrown
return null;
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractedMethodHelper.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -111,7 +111,7 @@
int aktStartOffset = aktNode.getPosition().getStartOffset();
if (aktStartOffset > endPostOfLastSelectedNode) {
LocalNodeWrapper localNode = new LocalNodeWrapper(aktNode);
- afterSelectionNodes.put(localNode.getId(), localNode);
+ afterSelectionNodes.put(Integer.valueOf(localNode.getId()), localNode);
}
}
}
@@ -174,7 +174,7 @@
}
private boolean localNodeNeededAfterSelectedNodes(LocalNodeWrapper localNode) {
- return afterSelectionNodes.containsKey(localNode.getId());
+ return afterSelectionNodes.containsKey(Integer.valueOf(localNode.getId()));
}
public Node getMethodNode(boolean needsNewLineAtBeginOfBlock, boolean needsNewLineAtEndOfBlock) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/WorkspaceDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/WorkspaceDocumentProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/WorkspaceDocumentProvider.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -40,6 +40,7 @@
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Path;
+import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.core.util.Util;
public class WorkspaceDocumentProvider extends DocumentProvider {
@@ -106,9 +107,10 @@
IFile currentFile = getIFile(fileName);
try {
return new String(Util.getResourceContentsAsCharArray(currentFile));
- } catch (CoreException e) {
- e.printStackTrace();
}
+ catch (RubyModelException e) {
+ /** Resource does not exist, that happens if a library file is included from an external location.**/
+ }
return null;
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/SClassNodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/SClassNodeWrapper.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/SClassNodeWrapper.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -79,8 +79,8 @@
}
private Node getReferencedNode(int id, Map<Integer, Node> references) throws UnknownReferenceException {
- if (references.containsKey(id)) {
- return references.get(id);
+ if (references.containsKey(Integer.valueOf(id))) {
+ return references.get(Integer.valueOf(id));
}
throw new UnknownReferenceException();
}
@@ -101,7 +101,7 @@
for (Node node : referencedNodes) {
if (node instanceof LocalAsgnNode) {
LocalAsgnNode localAsgnNode = (LocalAsgnNode) node;
- references.put(localAsgnNode.getIndex(), node);
+ references.put(Integer.valueOf(localAsgnNode.getIndex()), node);
}
}
return references;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/ui/pages/ExtractMethodPage.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -202,7 +202,7 @@
}
public void setComplete(Object source, boolean complete) {
- completedValidators.put(source, complete);
+ completedValidators.put(source, Boolean.valueOf(complete));
boolean allOk = true;
for (boolean ok : completedValidators.values()) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NameHelper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NameHelper.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/util/NameHelper.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -48,7 +48,7 @@
public static String createName(String string) {
Matcher matcher = Pattern.compile("([@]{0,2}\\w*[a-zA-Z_])(\\d+)").matcher(string);
if (matcher.matches()) {
- return matcher.group(1) + String.valueOf(Integer.valueOf(matcher.group(2)) + 1);
+ return matcher.group(1) + String.valueOf(Integer.valueOf(matcher.group(2)).intValue() + 1);
}
return string + 1;
}
Modified: trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java
===================================================================
--- trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.testunit/src/org/rubypeople/rdt/testunit/launcher/TestUnitLaunchShortcut.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -74,7 +74,7 @@
case 0:
return createConfiguration(rubyFile, container, testName);
case 1:
- return (ILaunchConfiguration) candidateConfigs.get(0);
+ return candidateConfigs.get(0);
default:
ILaunchConfiguration config = chooseConfiguration(candidateConfigs, mode);
if (config != null) { return config; }
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/infoviews/RIView.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -182,7 +182,7 @@
}
private void updatePage() {
- IVMInstall interpreter = RubyRuntime.getDefault().getDefaultVMInstall();
+ IVMInstall interpreter = RubyRuntime.getDefaultVMInstall();
if (interpreter != null) {
initSearchList();
if( riFound ){
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-02-28 11:57:16 UTC (rev 2053)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-02-28 13:16:56 UTC (rev 2054)
@@ -782,7 +782,7 @@
}
private static String getDefaultPath(String programName) {
- IVMInstall interpreter = RubyRuntime.getDefault().getDefaultVMInstall();
+ IVMInstall interpreter = RubyRuntime.getDefaultVMInstall();
if (interpreter == null) {
return programName;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <cal...@us...> - 2007-02-28 12:32:21
|
Revision: 2053
http://svn.sourceforge.net/rubyeclipse/?rev=2053&view=rev
Author: callandor1983
Date: 2007-02-28 03:57:16 -0800 (Wed, 28 Feb 2007)
Log Message:
-----------
all generated ASTs will now be cached in DocumentProvider. (generation of ASTs in test run reduced from around 3000 to 850)
Modified Paths:
--------------
trunk/org.rubypeople.rdt.refactoring/build.properties
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormattedSourceEditProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ReturnStatementReplacer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/ClassInstanciationFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariableRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/LocalVarFinder.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/IDocumentProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java
trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodCallNodeWrapper.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/FileTestCase.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/RefactoringTestCase.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/classnodeprovider/ClassNodeProviderTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/MultipleDocumentsInOneProvider.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_RefactoringConditionChecker.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/TC_SelectionNodeProvider.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/generateaccessors/TC_AccessorsGeneratorTreeTest.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/generateconstructor/TC_ConstructorGeneratorTreeTest.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlineclass/ClassInlinerTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/inlineclass/conditionchecks/InlineClassConditionTester.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/overridemethod/TC_MethodOverriderTreeTest.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/overridemethod/TC_OverridenMethodEditTest.java
trunk/org.rubypeople.rdt.refactoring.tests/src/org/rubypeople/rdt/refactoring/tests/core/pushdown/TC_MethodDownPusherTreeTest.java
Modified: trunk/org.rubypeople.rdt.refactoring/build.properties
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/build.properties 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/build.properties 2007-02-28 11:57:16 UTC (rev 2053)
@@ -1,6 +1,4 @@
jars.compile.order = .
-source.. = src/
-output.. = bin/
bin.includes = refactoring.jar,\
plugin.xml,\
META-INF/,\
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/ClassNodeProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -64,7 +64,7 @@
}
public void addSource(String sourceName) {
- Node rootNode = NodeProvider.getRootNode(sourceName, documentProvider.getFileContent(sourceName));
+ Node rootNode = documentProvider.getRootNode(sourceName);
createClassNodes(rootNode);
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/classnodeprovider/IncludedClassesProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -63,7 +63,7 @@
private void prepareIncludedFileNames() {
includeFilePaths = new ArrayList<IPath>();
- Node rootNode = documentProvider.getRootNode();
+ Node rootNode = documentProvider.getActiveFileRootNode();
Collection<FCallNode> loadAndRequireNodes = NodeProvider.getLoadAndRequireNodes(rootNode);
for (FCallNode fCallNode : loadAndRequireNodes) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/NodeProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -294,11 +294,6 @@
return getNodeBefore(parentNode, node) != null;
}
- public static Collection<Node> getAllNodesFromFile(String fileName, String fileContent) {
-
- return getAllNodes(getRootNode(fileName, fileContent));
- }
-
public static Collection<Node> getAllNodes(Node parentNode) {
Collection<Node> allNodes = new ArrayList<Node>();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/RefactoringConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -110,7 +110,7 @@
}
for(String aktFileName : docProvider.getFileNames()) {
fileName = aktFileName;
- NodeProvider.getRootNode(aktFileName, docProvider.getFileContent(aktFileName));
+ docProvider.getRootNode(aktFileName);
}
} catch(SyntaxException se) {
String activeFileName = docProvider.getActiveFileName();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/SelectionNodeProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -60,7 +60,6 @@
import org.rubypeople.rdt.refactoring.exception.NoClassNodeException;
import org.rubypeople.rdt.refactoring.nodewrapper.AttrAccessorNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.ClassNodeWrapper;
-import org.rubypeople.rdt.refactoring.nodewrapper.FieldNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.INodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.PartialClassNodeWrapper;
import org.rubypeople.rdt.refactoring.util.NodeUtil;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/converttemptofield/TempToFieldConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -60,7 +60,7 @@
public void init(Object configObj) {
config = (TempToFieldConfig) configObj;
- rootNode = config.getDocProvider().getRootNode();
+ rootNode = config.getDocProvider().getActiveFileRootNode();
Node selectedNode = findSelectedNode(LocalAsgnNode.class, LocalVarNode.class, DVarNode.class, DAsgnNode.class);
if (selectedNode != null) {
config.setSelectedNode(new LocalNodeWrapper(selectedNode));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/encapsulatefield/EncapsulateFieldConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -53,7 +53,7 @@
public void init(Object configObj) {
config = (EncapsulateFieldConfig) configObj;
- rootNode = config.getDocProvider().getRootNode();
+ rootNode = config.getDocProvider().getActiveFileRootNode();
config.setSelectedInstNode(findSelectedInstNode(config.getCaretPosition()));
if (!config.hasSelectedInstNode()) {
return;
@@ -101,11 +101,11 @@
}
private boolean selectedNodeIsInstVarNodeAndNotInMethod() {
- Node selectedVarNode = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getRootNode(), config.getCaretPosition(), InstVarNode.class, InstAsgnNode.class);
+ Node selectedVarNode = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), InstVarNode.class, InstAsgnNode.class);
if (selectedVarNode == null) {
return false;
}
- Node enclosingMethod = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getRootNode(), config.getCaretPosition(), DefnNode.class);
+ Node enclosingMethod = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), DefnNode.class);
return enclosingMethod == null;
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/extractmethod/ExtractMethodConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -73,7 +73,7 @@
}
private void initEnclosingNodes() {
- RootNode rootNode = config.getDocumentProvider().getRootNode();
+ RootNode rootNode = config.getDocumentProvider().getActiveFileRootNode();
config.setRootNode(rootNode);
config.setEnclosingScopeNode(SelectionNodeProvider.getEnclosingScope(rootNode, config.getSelection().getStartOfSelection()));
config.setEnclosingMethodNode((MethodDefNode) SelectionNodeProvider.getEnclosingNode(rootNode, config.getSelection(), MethodDefNode.class));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormattedSourceEditProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormattedSourceEditProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/formatsource/FormattedSourceEditProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -38,7 +38,7 @@
public FormattedSourceEditProvider(FormatSourceConfig config) {
super(true);
- this.fileRootNode = config.getDocumentProvider().getRootNode();
+ this.fileRootNode = config.getDocumentProvider().getActiveFileRootNode();
}
@Override
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/ClassInliner.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -75,11 +75,11 @@
@Override
protected Node getInsertNode(int offset, String document) {
try {
- Node rootNode = provider.getRootNode();
+ Node rootNode = provider.getActiveFileRootNode();
return SelectionNodeProvider.getSelectedClassNode(rootNode, 1).getFirstPartialClassNode().getClassBodyNode();
} catch (NoClassNodeException e) {
- return provider.getRootNode();
+ return provider.getActiveFileRootNode();
}
}
@@ -299,7 +299,7 @@
public PartialClassNodeWrapper getInlinedClassPart(){
DocumentProvider docProvider = config.getDocProvider();
- Node rootNode = docProvider.getRootNode();
+ Node rootNode = docProvider.getActiveFileRootNode();
try {
return SelectionNodeProvider.getSelectedClassNode(rootNode, config.getCaretPosition()).getFirstPartialClassNode();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InlineClassConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -66,7 +66,7 @@
private void intiSourceClass() {
int caretPosition = config.getCaretPosition();
- Node rootNode = docProvider.getRootNode();
+ Node rootNode = docProvider.getActiveFileRootNode();
try {
selectedClass = SelectionNodeProvider.getSelectedClassNode(rootNode, caretPosition);
config.setSourceClass(selectedClass);
@@ -116,7 +116,7 @@
ArrayList<ClassNodeWrapper> possibleClassNodes = new ArrayList<ClassNodeWrapper>();
- Node rootNode = config.getDocProvider().getRootNode();
+ Node rootNode = config.getDocProvider().getActiveFileRootNode();
try {
ClassNodeWrapper selectedClass = SelectionNodeProvider.getSelectedClassNode(rootNode, config.getCaretPosition());
for(ClassNodeWrapper currentClass : classNodes){
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlineclass/InsertClassBuilder.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -84,7 +84,7 @@
prechanges.addChildren(getFieldRenameEdits(conflictingFields, inlinedClassDocumentProvider));
prechanges.addChildren(getConstructorDeleteEdits(inlinedClassDocumentProvider));
- return new StringDocumentProvider(applyPrechanges(prechanges, inlinedClassDocumentProvider));
+ return new StringDocumentProvider(inlinedClassDocumentProvider.getActiveFileName() + "_with_applied_prechanges", applyPrechanges(prechanges, inlinedClassDocumentProvider));
}
@@ -200,13 +200,14 @@
ISourcePosition classPartPosition = inlinedClassPart.getWrappedNode().getPosition();
String activeFileContent = config.getDocProvider().getActiveFileContent();
String inlinedClassDocument = activeFileContent.substring(classPartPosition.getStartOffset(), classPartPosition.getEndOffset());
- StringDocumentProvider inlinedClassDocumentProvider = new StringDocumentProvider(inlinedClassDocument);
+ String fileName = "part_of_" + config.getDocProvider().getActiveFileName();
+ StringDocumentProvider inlinedClassDocumentProvider = new StringDocumentProvider(fileName, inlinedClassDocument);
return inlinedClassDocumentProvider;
}
private TextEdit[] getConstructorDeleteEdits(StringDocumentProvider inlinedClassDocument) {
ArrayList<TextEdit> constructorDeleters = new ArrayList<TextEdit>();
- Node rootNode = inlinedClassDocument.getRootNode();
+ Node rootNode = inlinedClassDocument.getActiveFileRootNode();
ClassNodeWrapper classNode;
try {
classNode = SelectionNodeProvider.getSelectedClassNode(rootNode, 1);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -60,7 +60,7 @@
if(!(findSelectedCall(config.getPos()) && findTargetClass(config.getTargetClassFinder()) && findMethodDefinition())) {
return;
}
- config.setCellParent(NodeProvider.findParentNode(config.getDocumentProvider().getRootNode(), config.getSelectedCall().getWrappedNode()));
+ config.setCallParent(NodeProvider.findParentNode(config.getDocumentProvider().getActiveFileRootNode(), config.getSelectedCall().getWrappedNode()));
replaceParameters();
@@ -73,7 +73,7 @@
}
private void renameDuplicates(DocumentProvider doc) {
- StaticScope parent = NodeUtil.getScope(SelectionNodeProvider.getEnclosingScope(doc.getRootNode(), config.getSelectedCall().getWrappedNode()));
+ StaticScope parent = NodeUtil.getScope(SelectionNodeProvider.getEnclosingScope(doc.getActiveFileRootNode(), config.getSelectedCall().getWrappedNode()));
ArrayList<String> localNames = new ArrayList<String>();
if(parent.getVariables() != null) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/InlineMethodConfig.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -46,7 +46,7 @@
private int pos;
private ITargetClassFinder targetClassFinder;
private Collection<String> usedMembers;
- private Node cellParent;
+ private Node callParent;
public InlineMethodConfig(DocumentProvider doc, int pos, ITargetClassFinder targetClassFinder) {
@@ -56,11 +56,11 @@
}
public Node getCallParent() {
- return cellParent;
+ return callParent;
}
- public void setCellParent(Node cellParent) {
- this.cellParent = cellParent;
+ public void setCallParent(Node cellParent) {
+ this.callParent = cellParent;
}
public String getClassName() {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/MethodBodyStatementReplacer.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -52,7 +52,7 @@
Collection<Node> selfNodes = null;
DocumentProvider result = new StringDocumentProvider(doc);
do {
- selfNodes = NodeProvider.gatherNodesOfTypeInAktScopeNode(result.getRootNode().getBodyNode(), SelfNode.class);
+ selfNodes = NodeProvider.gatherNodesOfTypeInAktScopeNode(result.getActiveFileRootNode().getBodyNode(), SelfNode.class);
if(selfNodes.isEmpty()) {
continue;
}
@@ -61,8 +61,9 @@
tempResult.append(result.getActiveFileContent().substring(0, node.getPosition().getStartOffset()));
tempResult.append(object);
tempResult.append(result.getActiveFileContent().substring(node.getPosition().getEndOffset()));
- result = new StringDocumentProvider(tempResult.toString());
+ result = new StringDocumentProvider("part_of_" + doc.getActiveFileName(), tempResult.toString());
+
} while(!selfNodes.isEmpty());
return result;
@@ -73,7 +74,7 @@
DocumentProvider result = new StringDocumentProvider(doc);
Collection<Node> varNodes = null;
do {
- varNodes = NodeProvider.gatherNodesOfTypeInAktScopeNode(result.getRootNode().getBodyNode(), InstVarNode.class, InstAsgnNode.class);
+ varNodes = NodeProvider.gatherNodesOfTypeInAktScopeNode(result.getActiveFileRootNode().getBodyNode(), InstVarNode.class, InstAsgnNode.class);
if(varNodes.isEmpty()) {
continue;
@@ -85,7 +86,7 @@
src.replace(varNode.getPosition().getStartOffset(),
varNode.getPosition().getStartOffset() + name.length(),
object + '.' + name.substring(1));
- result = new StringDocumentProvider(src.toString());
+ result = new StringDocumentProvider("part_of_" + doc.getActiveFileName(), src.toString());
} while(!varNodes.isEmpty());
@@ -100,7 +101,7 @@
while((call = findCallToMethodInClass(result, provider, className)) != null) {
StringBuilder src = new StringBuilder(result.getActiveFileContent());
src.insert(call.getWrappedNode().getPosition().getStartOffset(), object + '.');
- result = new StringDocumentProvider(src.toString());
+ result = new StringDocumentProvider("part_of_" + doc.getActiveFileName(), src.toString());
}
return result;
@@ -121,7 +122,7 @@
private Collection<MethodCallNodeWrapper> findFAndVCalls(DocumentProvider doc) {
Collection<MethodCallNodeWrapper> methodCalls = new ArrayList<MethodCallNodeWrapper>();
- for (Node node : NodeProvider.gatherNodesOfTypeInAktScopeNode(doc.getRootNode().getBodyNode(), VCallNode.class, FCallNode.class)) {
+ for (Node node : NodeProvider.gatherNodesOfTypeInAktScopeNode(doc.getActiveFileRootNode().getBodyNode(), VCallNode.class, FCallNode.class)) {
methodCalls.add(new MethodCallNodeWrapper(node));
}
return methodCalls;
@@ -131,12 +132,12 @@
Collection<Node> nodes = null;
StringDocumentProvider result = new StringDocumentProvider(doc);
do {
- nodes = NodeProvider.getSubNodes(NodeProvider.getRootNode("", result.getActiveFileContent()), ReturnNode.class);
+ nodes = NodeProvider.getSubNodes(result.getActiveFileRootNode(), ReturnNode.class);
if(nodes.isEmpty()) break;
StringBuilder newBody = new StringBuilder(result.getActiveFileContent());
int startOffset = nodes.iterator().next().getPosition().getStartOffset();
newBody.replace(startOffset, startOffset + "return ".length(), "");
- result = new StringDocumentProvider(newBody.toString());
+ result = new StringDocumentProvider("part_of_" + doc.getActiveFileName(), newBody.toString());
} while(!nodes.isEmpty());
return result;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ParameterReplacer.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -53,7 +53,7 @@
public DocumentProvider replace(IDocumentProvider doc, MethodCallNodeWrapper call, MethodDefNode definition) {
- DocumentProvider strDoc = new StringDocumentProvider(doc.getActiveFileContent().substring(definition.getPosition().getStartOffset(), definition.getPosition().getEndOffset() + 1));
+ DocumentProvider strDoc = new StringDocumentProvider("part_of_" + doc.getActiveFileName(), doc.getActiveFileContent().substring(definition.getPosition().getStartOffset(), definition.getPosition().getEndOffset() + 1));
ArrayNode headList = new ArrayNode(new SourcePosition());
ArrayNode tailList = new ArrayNode(new SourcePosition());
@@ -83,12 +83,12 @@
createAssignments(headList, tailList, insert, lineDelimiter);
}
- MethodDefNode newDefinition = (MethodDefNode) ((NewlineNode) strDoc.getRootNode().getBodyNode()).getNextNode();
+ MethodDefNode newDefinition = (MethodDefNode) ((NewlineNode) strDoc.getActiveFileRootNode().getBodyNode()).getNextNode();
insert.append(strDoc.getActiveFileContent().substring(
newDefinition.getBodyNode().getPosition().getStartOffset(),
newDefinition.getBodyNode().getPosition().getEndOffset() + 1).trim());
- return new StringDocumentProvider(insert.toString());
+ return new StringDocumentProvider("subpart_of_" + doc.getActiveFileName(), insert.toString());
}
private void createAssignments(ArrayNode headList, ArrayNode tailList, StringBuffer insert, String lineDelimiter) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/RenameDuplicatedVariables.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -31,15 +31,14 @@
import org.jruby.ast.RootNode;
import org.rubypeople.rdt.refactoring.core.renamelocalvariable.LocalVariableRenamer;
import org.rubypeople.rdt.refactoring.documentprovider.DocumentProvider;
-import org.rubypeople.rdt.refactoring.documentprovider.StringDocumentProvider;
import org.rubypeople.rdt.refactoring.util.NameHelper;
public class RenameDuplicatedVariables implements IRenameDuplicatedVariables {
public DocumentProvider rename(DocumentProvider doc, String[] localNames) {
- RootNode rootNode = doc.getRootNode();
- DocumentProvider result = new StringDocumentProvider(doc.getActiveFileContent());
+ RootNode rootNode = doc.getActiveFileRootNode();
+ DocumentProvider result = doc;
for (String name : NameHelper.findDuplicates(rootNode.getStaticScope().getVariables(), localNames)) {
if("$~".equals(name) || "$_".equals(name)) continue;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ReturnStatementReplacer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ReturnStatementReplacer.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/ReturnStatementReplacer.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -56,7 +56,7 @@
private int countReturnNodes(DocumentProvider doc) {
int returnNodes = 0;
- for (Node node : NodeProvider.getAllNodesFromFile(doc.getActiveFileName(), doc.getActiveFileContent())) {
+ for (Node node : NodeProvider.getAllNodes(doc.getActiveFileRootNode())) {
if(node instanceof ReturnNode) {
returnNodes++;
}
@@ -65,7 +65,7 @@
}
private ReturnNode getReturnNode(DocumentProvider doc) {
- for (Node node : NodeProvider.getAllNodesFromFile(doc.getActiveFileName(), doc.getActiveFileContent())) {
+ for (Node node : NodeProvider.getAllNodes(doc.getActiveFileRootNode())) {
if(node instanceof ReturnNode) {
return (ReturnNode) node;
}
@@ -89,13 +89,13 @@
replaceReturnStatementWithAssignment(doc, target, result, returnNode);
}
- return new StringDocumentProvider(result.append(ReWriteVisitor.createCodeFromNode(target, doc.getActiveFileContent())).toString());
+ return new StringDocumentProvider("part_of_" + doc.getActiveFileName(), result.append(ReWriteVisitor.createCodeFromNode(target, doc.getActiveFileContent())).toString());
}
private void insertLastLineToAssignment(DocumentProvider doc, AssignableNode target, StringBuilder result) {
String[] lines = doc.getActiveFileContent().split("(\\r)?\\n");
- target.setValueNode(NodeProvider.getRootNode("", lines[lines.length - 1]).getBodyNode());
+ target.setValueNode(NodeProvider.getRootNode("last_line_of_" + doc.getActiveFileName() + "_for_ReturnStatementReplacer", lines[lines.length - 1]).getBodyNode());
String lineDelimiter = FileHelper.getLineDelimiter(doc.getActiveFileContent());
for(int i = 0; i < lines.length - 1; i++) {
@@ -108,5 +108,4 @@
target.setValueNode(returnNode.getValueNode());
result.append(doc.getActiveFileContent().substring(0, returnNode.getPosition().getStartOffset()));
}
-
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinemethod/TargetClassFinder.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -72,7 +72,7 @@
}
private String getSurroundingClass(final MethodCallNodeWrapper call, final DocumentProvider doc) {
- ClassNode classNode = ((ClassNode) NodeProvider.getEnclosingNodeOfType(doc.getRootNode(), call.getWrappedNode(), new Class<?>[]{ClassNode.class}));
+ ClassNode classNode = ((ClassNode) NodeProvider.getEnclosingNodeOfType(doc.getActiveFileRootNode(), call.getWrappedNode(), new Class<?>[]{ClassNode.class}));
if(classNode != null) {
return classNode.getCPath().getName();
}
@@ -103,7 +103,7 @@
InstAsgnNode decoratedNode = null;
try {
- final ClassNodeWrapper selectedClassNode = SelectionNodeProvider.getSelectedClassNode(doc.getRootNode(), node.getPosition().getStartOffset());
+ final ClassNodeWrapper selectedClassNode = SelectionNodeProvider.getSelectedClassNode(doc.getActiveFileRootNode(), node.getPosition().getStartOffset());
final ClassNodeWrapper allClassNodes = new ClassNodeProvider(doc).getClassNode((selectedClassNode.getName()));
if(allClassNodes == null) {
@@ -123,7 +123,7 @@
}
private InstAsgnNode findInstVarInScope(final InstVarNode node, final DocumentProvider doc, InstAsgnNode decoratedNode) {
- Collection<Node> assignments = NodeProvider.getSubNodes(doc.getRootNode(), InstAsgnNode.class);
+ Collection<Node> assignments = NodeProvider.getSubNodes(doc.getActiveFileRootNode(), InstAsgnNode.class);
for (Node assignment : assignments) {
if(((InstAsgnNode) assignment).getName().equals(node.getName()) && assignment.getPosition().getStartOffset() < node.getPosition().getStartOffset()) {
decoratedNode = (InstAsgnNode) assignment;
@@ -137,14 +137,14 @@
*/
public LocalAsgnNode localAsgnFromLocalVar(final LocalVarNode node, final DocumentProvider doc) {
- Node enclosingScope = SelectionNodeProvider.getEnclosingScope(doc.getRootNode(), node);
+ Node enclosingScope = SelectionNodeProvider.getEnclosingScope(doc.getActiveFileRootNode(), node);
LocalAsgnNode asgnNode = findLastAssignmentToVar(node, NodeUtil.getBody(enclosingScope));
if(asgnNode != null) {
return asgnNode;
}
do {
- enclosingScope = SelectionNodeProvider.getEnclosingScope(doc.getRootNode(), NodeProvider.findParentNode(doc.getRootNode(), enclosingScope));
+ enclosingScope = SelectionNodeProvider.getEnclosingScope(doc.getActiveFileRootNode(), NodeProvider.findParentNode(doc.getActiveFileRootNode(), enclosingScope));
asgnNode = findLastAssignmentToVar(node, NodeUtil.getBody(enclosingScope));
} while(!(enclosingScope instanceof RootNode || enclosingScope instanceof MethodDefNode) && asgnNode == null);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/inlinetemp/InlineTempConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -58,7 +58,7 @@
public void init(Object configObj) {
this.config = (InlineTempConfig) configObj;
- rootNode = config.getDocProvider().getRootNode();
+ rootNode = config.getDocProvider().getActiveFileRootNode();
int caretPosition = config.getCaretPosition();
config.setEnclosingMethod((MethodDefNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, caretPosition, MethodDefNode.class));
@@ -149,7 +149,7 @@
private boolean isNewMethodNameUnique() {
- Node environment = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getRootNode(), config.getCaretPosition(), ClassNode.class, RootNode.class);
+ Node environment = SelectionNodeProvider.getSelectedNodeOfType(config.getDocProvider().getActiveFileRootNode(), config.getCaretPosition(), ClassNode.class, RootNode.class);
Collection<MethodDefNode> methodNodes = NodeProvider.gatherMethodDefinitionNodes(NodeUtil.getBody(environment));
for (MethodDefNode currentDefnNode : methodNodes) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movefield/MoveFieldConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -53,7 +53,7 @@
config = (MoveFieldConfig) configObj;
try {
- selectedClassNode = SelectionNodeProvider.getSelectedClassNode(config.getDoc().getRootNode(), config.getPos());
+ selectedClassNode = SelectionNodeProvider.getSelectedClassNode(config.getDoc().getActiveFileRootNode(), config.getPos());
} catch (NoClassNodeException e) {
selectedClassNode = null;
return;
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/movemethod/MoveMethodConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -57,7 +57,7 @@
@Override
protected void init(Object configObj) {
this.config = (MoveMethodConfig) configObj;
- Node rootNode = config.getDocProvider().getRootNode();
+ Node rootNode = config.getDocProvider().getActiveFileRootNode();
int caretPos = config.getCaretPosition();
config.setAllClassesNodeProvider(config.getDocProvider().getProjectClassNodeProvider());
try {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/ClassInstanciationFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/ClassInstanciationFinder.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/ClassInstanciationFinder.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -61,7 +61,7 @@
}
private void addIfCreatesInstance(String name, Collection<ConstructorCall> found, DocumentProvider file) {
- for(Node node : NodeProvider.getSubNodes(file.getRootNode(), CallNode.class)) {
+ for(Node node : NodeProvider.getSubNodes(file.getActiveFileRootNode(), CallNode.class)) {
CallNode call = (CallNode) node;
if(isConstructorFor(name, call)) {
found.add(new ConstructorCall(call));
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renameclass/RenameClassConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -50,7 +50,7 @@
config.setDocumentWithIncludingProvider(new DocumentWithIncluding(config.getDocProvider()));
ClassNodeWrapper classNode = null;
try {
- classNode = SelectionNodeProvider.getSelectedClassNode(config.getDocProvider().getRootNode(), config.getOffset());
+ classNode = SelectionNodeProvider.getSelectedClassNode(config.getDocProvider().getActiveFileRootNode(), config.getOffset());
int nameStart = ((ClassNode) classNode.getWrappedNode()).getCPath().getPosition().getStartOffset();
int nameEnd = ((ClassNode) classNode.getWrappedNode()).getCPath().getPosition().getEndOffset();
if(config.getOffset() < nameStart || config.getOffset() > nameEnd) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamefield/RenameFieldConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -37,7 +37,6 @@
import org.jruby.ast.Node;
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
import org.rubypeople.rdt.refactoring.classnodeprovider.IncludedClassesProvider;
-import org.rubypeople.rdt.refactoring.core.NodeProvider;
import org.rubypeople.rdt.refactoring.core.RefactoringConditionChecker;
import org.rubypeople.rdt.refactoring.core.SelectionNodeProvider;
import org.rubypeople.rdt.refactoring.core.renamefield.fielditems.FieldCallItem;
@@ -62,7 +61,7 @@
this.config = (RenameFieldConfig) configObj;
config.setDocProvider(new DocumentWithIncluding(config.getDocProvider()));
- Node rootNode = config.getDocProvider().getRootNode();
+ Node rootNode = config.getDocProvider().getActiveFileRootNode();
try {
ClassNodeWrapper enclosingClassNode = SelectionNodeProvider.getSelectedClassNode(rootNode, config.getCaretPosition());
@@ -119,7 +118,7 @@
CallNode callNode = (CallNode) candidateNode;
if (callNode.getName().replaceAll("=", "").equals(config.getSelectedName())) {
String fileName = callNode.getPosition().getFile();
- Node rootNode = NodeProvider.getRootNode(fileName, config.getDocProvider().getFileContent(fileName));
+ Node rootNode = config.getDocProvider().getRootNode(fileName);
try {
SelectionNodeProvider.getSelectedClassNode(rootNode, callNode.getPosition().getStartOffset());
} catch (NoClassNodeException e) {
@@ -150,7 +149,7 @@
@Override
protected void checkInitialConditions() {
- Collection<FieldNodeWrapper> fields = PartialClassNodeWrapper.getFieldsFromNode(config.getDocProvider().getRootNode());
+ Collection<FieldNodeWrapper> fields = PartialClassNodeWrapper.getFieldsFromNode(config.getDocProvider().getActiveFileRootNode());
FieldNodeWrapper selectedFieldNode = SelectionNodeProvider.getSelectedWrappedNode(fields, config.getCaretPosition());
if (config.getWholeClassNode() == null) {
if (selectedFieldNode != null) {
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariableRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariableRenamer.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/LocalVariableRenamer.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -71,6 +71,6 @@
} catch (BadLocationException e) {
assert false;
}
- return new StringDocumentProvider(result.get());
+ return new StringDocumentProvider("modified_" + doc.getActiveFileName(), result.get());
}
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamelocalvariable/RenameLocalConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -71,7 +71,7 @@
public void init(Object configObj) {
config = (RenameLocalConfig) configObj;
- RootNode rootNode = config.getDocumentProvider().getRootNode();
+ RootNode rootNode = config.getDocumentProvider().getActiveFileRootNode();
Node selectedNode = SelectionNodeProvider.getSelectedNodeOfType(rootNode, config.getCaretPosition(), SELECTED_NODE_TYPES);
if(selectedNode instanceof AssignableNode) {
int start = selectedNode.getPosition().getStartOffset();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/MethodRenamer.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -170,7 +170,7 @@
}
public Collection<MethodCallNodeWrapper> getSubsequentCalls(){
- Node fileRoot = docProvider.getRootNode();
+ Node fileRoot = docProvider.getActiveFileRootNode();
int methodEndPos = config.getTargetMethod().getWrappedNode().getPosition().getEndOffset();
ArrayList<MethodCallNodeWrapper> subsequentCalls = new ArrayList<MethodCallNodeWrapper>();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConditionChecker.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -48,7 +48,6 @@
import org.rubypeople.rdt.refactoring.nodewrapper.MethodCallNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.MethodNodeWrapper;
import org.rubypeople.rdt.refactoring.nodewrapper.PartialClassNodeWrapper;
-import org.rubypeople.rdt.refactoring.util.NodeUtil;
public class RenameMethodConditionChecker extends RefactoringConditionChecker{
@@ -65,7 +64,7 @@
this.config = (RenameMethodConfig)configObj;
config.setDocProvider(new DocumentWithIncluding(config.getDocProvider()));
- Node rootNode = config.getDocProvider().getRootNode();
+ Node rootNode = config.getDocProvider().getActiveFileRootNode();
try {
this.config.setClassNode(SelectionNodeProvider.getSelectedClassNode(rootNode, this.config.getCaretPosition()));
} catch (NoClassNodeException e) {/* ClassNode stays null */}
@@ -101,15 +100,15 @@
ArrayList<MethodCallNodeWrapper> possibleCalls = new ArrayList<MethodCallNodeWrapper>();
for(Node currentNode : allNodes){
- if(isPossibleCall(currentNode)){
- possibleCalls.add(new MethodCallNodeWrapper(currentNode));
+ MethodCallNodeWrapper callNode = new MethodCallNodeWrapper(currentNode);
+ if(isPossibleCall(callNode)){
+ possibleCalls.add(callNode);
}
}
return possibleCalls;
}
- private boolean isPossibleCall(Node candidateNode) {
- MethodCallNodeWrapper callNode = new MethodCallNodeWrapper(candidateNode);
+ private boolean isPossibleCall(MethodCallNodeWrapper callNode) {
if(config.getTargetMethod().isClassMethod() != callNode.isCallToClassMethod()){
return false;
}
@@ -193,7 +192,7 @@
}
} catch (NoClassNodeException e) {
- Node rootNode = config.getDocProvider().getRootNode();
+ Node rootNode = config.getDocProvider().getActiveFileRootNode();
Collection<MethodDefNode> methods = NodeProvider.getMethodNodes(rootNode);
ClassNodeProvider classes = new ClassNodeProvider(config.getDocProvider());
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/renamemethod/RenameMethodConfig.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -127,7 +127,7 @@
}
public Collection<MethodNodeWrapper> getAllMethodsInClass() throws NoClassNodeException {
- Node rootNode = docProvider.getRootNode();
+ Node rootNode = docProvider.getActiveFileRootNode();
ClassNodeWrapper enclosingClass = SelectionNodeProvider.getSelectedClassNode(rootNode, targetMethod.getWrappedNode().getPosition().getStartOffset());
IncludedClassesProvider classesProvider = new IncludedClassesProvider(docProvider);
ClassNodeWrapper wholeClass = classesProvider.getClassNode(enclosingClass.getName());
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/LocalVarFinder.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/LocalVarFinder.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/core/splittemp/LocalVarFinder.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -50,7 +50,7 @@
public Collection<LocalVarUsage> findLocalUsages(DocumentProvider doc, int caretPosition) {
- Node rootNode = doc.getRootNode();
+ Node rootNode = doc.getActiveFileRootNode();
INameNode selectedAssignment = (INameNode) SelectionNodeProvider.getSelectedNodeOfType(rootNode, caretPosition, LocalAsgnNode.class, DAsgnNode.class);
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -31,6 +31,8 @@
package org.rubypeople.rdt.refactoring.documentprovider;
import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.Map;
import org.jruby.ast.Node;
import org.jruby.ast.RootNode;
@@ -42,7 +44,11 @@
public abstract class DocumentProvider implements IDocumentProvider {
- private RootNode rootNode;
+ private Map<String, RootNode> cachedRootNodes;
+
+ public DocumentProvider() {
+ cachedRootNodes = new LinkedHashMap<String, RootNode>();
+ }
public ClassNodeProvider getClassNodeProvider() {
return new ClassNodeProvider(this);
@@ -56,20 +62,22 @@
return new IncludedClassesProvider(this);
}
- public RootNode getRootNode() {
-// if(rootNode == null) {
-// rootNode = NodeProvider.getRootNode(getActiveFileName(), getActiveFileContent());
-// }
-// return rootNode;
- return NodeProvider.getRootNode(getActiveFileName(), getActiveFileContent());
+ public RootNode getActiveFileRootNode() {
+ return getRootNode(getActiveFileName());
}
public Collection<Node> getAllNodes() {
- return NodeProvider.getAllNodes(getRootNode());
+ return NodeProvider.getAllNodes(getActiveFileRootNode());
}
public Collection<Node> getAllNodes(String fileName){
- Node rootNode = NodeProvider.getRootNode(fileName, getFileContent(fileName));
- return NodeProvider.getAllNodes(rootNode);
+ return NodeProvider.getAllNodes(getRootNode(fileName));
}
+
+ public RootNode getRootNode(String fileName) {
+ if(!cachedRootNodes.containsKey(fileName)) {
+ cachedRootNodes.put(fileName, NodeProvider.getRootNode(fileName, getFileContent(fileName)));
+ }
+ return cachedRootNodes.get(fileName);
+ }
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/DocumentWithIncluding.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -34,6 +34,7 @@
import org.jruby.ast.FCallNode;
import org.jruby.ast.Node;
+import org.jruby.ast.RootNode;
import org.jruby.ast.StrNode;
import org.jruby.lexer.yacc.SyntaxException;
import org.rubypeople.rdt.refactoring.classnodeprovider.ClassNodeProvider;
@@ -43,47 +44,38 @@
public class DocumentWithIncluding extends StringDocumentProvider {
- protected final IDocumentProvider mainFile;
+ protected final IDocumentProvider docProvider;
- public DocumentWithIncluding(IDocumentProvider start) {
- super(start.getActiveFileName(), start.getActiveFileContent());
-
- this.mainFile = start;
+ public DocumentWithIncluding(IDocumentProvider docProvider) {
+ super(docProvider.getActiveFileName(), docProvider.getActiveFileContent());
+ this.docProvider = docProvider;
searchForRelatedFiles();
}
private void searchForRelatedFiles() {
-
- ArrayList<DocumentProvider> candidateSet = new ArrayList<DocumentProvider>();
-
- for(String fileName : mainFile.getFileNames()) {
- candidateSet.add(new StringDocumentProvider(fileName, mainFile.getFileContent(fileName)));
- }
-
- ArrayList<DocumentProvider> markedForRemoval = new ArrayList<DocumentProvider>();
-
+ Collection<String> candidates = new ArrayList<String>(docProvider.getFileNames());
+ ArrayList<String> markedForRemoval = new ArrayList<String>();
HashSet<String> includedFiles = findAllIncludedFiles();
do {
markedForRemoval.clear();
- for(DocumentProvider doc : candidateSet) {
- String fileName = getFileNameWithoutPath(doc);
+ for(String actFileName : candidates) {
+ String fileName = getFileNameWithoutPath(actFileName);
if(includedFiles.contains(fileName)) {
- addFile(doc.getActiveFileName(), doc.getActiveFileContent());
- markedForRemoval.add(doc);
+ addFile(fileName, docProvider.getFileContent(fileName));
+ markedForRemoval.add(actFileName);
continue;
}
- for (FCallNode node : getRequires(doc)) {
+ for (FCallNode node : getRequires(actFileName)) {
if(nodeRequiresMe(node)) {
- addFile(doc.getActiveFileName(), doc.getActiveFileContent());
- markedForRemoval.add(doc);
+ addFile(fileName, docProvider.getFileContent(fileName));
+ markedForRemoval.add(actFileName);
}
}
}
+ removeMarkedFromCandidates(markedForRemoval, candidates);
- removeMarkedFromCandidates(markedForRemoval, candidateSet);
-
} while(markedForRemoval.size() > 0);
}
@@ -94,7 +86,7 @@
private HashSet<String> findAllIncludedFiles() {
HashSet<String> includedFiles = new HashSet<String>();
- ClassNodeProvider includedProvider = mainFile.getIncludedClassNodeProvider();
+ ClassNodeProvider includedProvider = docProvider.getIncludedClassNodeProvider();
for(ClassNodeWrapper classNode : includedProvider.getAllClassNodes()) {
for (PartialClassNodeWrapper partialClassNode : classNode.getPartialClassNodes()) {
String file = partialClassNode.getWrappedNode().getPosition().getFile();
@@ -106,21 +98,20 @@
return includedFiles;
}
- private String getFileNameWithoutPath(DocumentProvider doc) {
- String activeFileName = doc.getActiveFileName();
- if(activeFileName.contains("/")) {
- return activeFileName.substring(activeFileName.lastIndexOf("/") + 1, activeFileName.length());
+ private String getFileNameWithoutPath(String actFileName) {
+ if(actFileName.contains("/")) {
+ return actFileName.substring(actFileName.lastIndexOf("/") + 1);
}
- return activeFileName;
+ return actFileName;
}
private boolean nodeRequiresMe(FCallNode node) {
return isStrNode(node) && fileIsInResultSet(getRequiredFilename(node));
}
- private void removeMarkedFromCandidates(ArrayList<DocumentProvider> markedForRemoval, ArrayList<DocumentProvider> candidateSet) {
- for (DocumentProvider doc : markedForRemoval) {
- candidateSet.remove(doc);
+ private void removeMarkedFromCandidates(ArrayList<String> markedForRemoval, Collection<String> candidates) {
+ for (String actName : markedForRemoval) {
+ candidates.remove(actName);
}
}
@@ -128,9 +119,10 @@
return ((StrNode) node.getArgsNode().childNodes().iterator().next()).getValue();
}
- private Collection<FCallNode> getRequires(DocumentProvider doc) {
+ private Collection<FCallNode> getRequires(String fileName) {
try {
- return NodeProvider.getLoadAndRequireNodes(doc.getRootNode());
+ RootNode rootNode = docProvider.getRootNode(fileName);
+ return NodeProvider.getLoadAndRequireNodes(rootNode);
} catch(SyntaxException e) {
return new ArrayList<FCallNode>();
}
@@ -151,10 +143,8 @@
return true;
}
}
-
return false;
}
-
private boolean isStrNode(FCallNode node) {
return node.getArgsNode().childNodes().iterator().next() instanceof StrNode;
@@ -167,9 +157,6 @@
for(String currentFileName : getFileNames()){
allNodes.addAll(getAllNodes(currentFileName));
}
-
return allNodes;
}
-
-
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/IDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/IDocumentProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/IDocumentProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -52,7 +52,9 @@
public ClassNodeProvider getIncludedClassNodeProvider();
- public RootNode getRootNode();
+ public RootNode getActiveFileRootNode();
+
+ public RootNode getRootNode(String fileName);
public Collection<Node> getAllNodes();
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/documentprovider/StringDocumentProvider.java 2007-02-28 11:57:16 UTC (rev 2053)
@@ -36,7 +36,6 @@
public class StringDocumentProvider extends DocumentProvider {
- private static final String defaultDocName = "dummyDocument";
protected String document;
protected String docName;
@@ -49,10 +48,6 @@
files.put(documentName, document);
}
- public StringDocumentProvider(String document) {
- this(defaultDocName, document);
- }
-
public StringDocumentProvider(IDocumentProvider other) {
this(other.getActiveFileName(), other.getActiveFileContent());
}
Modified: trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodCallNodeWrapper.java
===================================================================
--- trunk/org.rubypeople.rdt.refactoring/src/org/rubypeople/rdt/refactoring/nodewrapper/MethodCallNodeWrapper.java 2007-02-27 15:24:41 UTC (rev 2052)
+++ trunk/org.rubypeo...
[truncated message content] |
|
From: <caw...@us...> - 2007-02-27 15:24:49
|
Revision: 2052
http://svn.sourceforge.net/rubyeclipse/?rev=2052&view=rev
Author: cawilliams
Date: 2007-02-27 07:24:41 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
when suggesting methods, don't suggest a method from a superclass if the subclass has overriden the method (and it's already in the list of suggestions). Also, sort method proposals by name.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java
Added Paths:
-----------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-27 14:48:01 UTC (rev 2051)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionEngine.java 2007-02-27 15:24:41 UTC (rev 2052)
@@ -2,9 +2,13 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IResource;
@@ -53,57 +57,66 @@
public class CompletionEngine {
private static final String CONSTRUCTOR_INVOKE_NAME = "new";
- private CompletionRequestor requestor;
- private CompletionContext context;
+ private CompletionRequestor fRequestor;
+ private CompletionContext fContext;
public CompletionEngine(CompletionRequestor requestor) {
- this.requestor = requestor;
+ this.fRequestor = requestor;
}
public void complete(IRubyScript script, int offset) throws RubyModelException {
- this.requestor.beginReporting();
- context = new CompletionContext(script, offset);
- if (context.emptyPrefix()) { // no prefix, so we could suggest anything
+ this.fRequestor.beginReporting();
+ fContext = new CompletionContext(script, offset);
+ if (fContext.emptyPrefix()) { // no prefix, so we could suggest anything
suggestTypeNames();
suggestConstantNames();
suggestGlobals();
getDocumentsRubyElementsInScope();
} else {
- if (context.isConstant()) { // type or constant
+ if (fContext.isConstant()) { // type or constant
suggestTypeNames();
suggestConstantNames();
}
- if (context.isMethodInvokation()) {
+ if (fContext.isMethodInvokation()) {
ITypeInferrer inferrer = new DefaultTypeInferrer();
- List<ITypeGuess> guesses = inferrer.infer(context.getCorrectedSource(), context.getOffset());
+ List<ITypeGuess> guesses = inferrer.infer(fContext.getCorrectedSource(), fContext.getOffset());
RubyElementRequestor requestor = new RubyElementRequestor(script);
for (ITypeGuess guess : guesses) {
String name = guess.getType();
IType[] types = requestor.findType(name); // FIXME When syntax is broken, grabbing type that is defined in same script like this just doesn't work!
for (int i = 0; i < types.length; i++) {
- suggestMethods(guess.getConfidence(), types[i]);
+ List<CompletionProposal> list = sort(suggestMethods(guess.getConfidence(), types[i]));
+ for (CompletionProposal proposal : list) {
+ fRequestor.accept(proposal);
+ }
}
}
} else {
// FIXME Traverse the IRubyElement model, not nodes (and don't reparse)?
getDocumentsRubyElementsInScope();
}
- if (context.isGlobal()) { // looks like a global
+ if (fContext.isGlobal()) { // looks like a global
suggestGlobals();
}
}
- this.requestor.endReporting();
- context = null;
+ this.fRequestor.endReporting();
+ fContext = null;
}
+
+ private List<CompletionProposal> sort(Map<String, CompletionProposal> proposals) {
+ List<CompletionProposal> list = new ArrayList<CompletionProposal>(proposals.values());
+ Collections.sort(list, new CompletionProposalComparator());
+ return list;
+ }
private void suggestGlobals() {
Set<String> globals = ExperimentalIndex.getGlobalNames();
// TODO Sort?
for (String name : globals) {
- if (!context.prefixStartsWith(name))
+ if (!fContext.prefixStartsWith(name))
continue;
- CompletionProposal proposal = createProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
- requestor.accept(proposal);
+ CompletionProposal proposal = createProposal(fContext.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ fRequestor.accept(proposal);
}
}
@@ -111,11 +124,11 @@
Set<String> types = ExperimentalIndex.getTypeNames();
// TODO Sort?
for (String name : types) {
- if (!context.prefixStartsWith(name))
+ if (!fContext.prefixStartsWith(name))
continue;
- CompletionProposal proposal = createProposal(context.getReplaceStart(), CompletionProposal.TYPE_REF, name);
+ CompletionProposal proposal = createProposal(fContext.getReplaceStart(), CompletionProposal.TYPE_REF, name);
proposal.setType(name);
- requestor.accept(proposal);
+ fRequestor.accept(proposal);
}
}
@@ -129,33 +142,37 @@
Set<String> types = ExperimentalIndex.getConstantNames();
// TODO Sort?
for (String name : types) {
- if (!context.prefixStartsWith(name))
+ if (!fContext.prefixStartsWith(name))
continue;
- CompletionProposal proposal = createProposal(context.getReplaceStart(), CompletionProposal.FIELD_REF, name);
- requestor.accept(proposal);
+ CompletionProposal proposal = createProposal(fContext.getReplaceStart(), CompletionProposal.FIELD_REF, name);
+ fRequestor.accept(proposal);
}
}
- private void suggestMethods(int confidence, IType type) throws RubyModelException {
+ private Map<String, CompletionProposal> suggestMethods(int confidence, IType type) throws RubyModelException {
+ Map<String, CompletionProposal> proposals = new HashMap<String, CompletionProposal>();
if (type == null)
- return;
+ return proposals;
IMethod[] methods = type.getMethods();
for (int k = 0; k < methods.length; k++) {
- suggestMethod(methods[k], type.getElementName(), confidence);
- }
- // FIXME If a method name matches an existing suggestion (i.e. its overriden in the subclass), don't suggest it again!
+ CompletionProposal proposal = suggestMethod(methods[k], type.getElementName(), confidence);
+ if (proposal != null && !proposals.containsKey(proposal.getName())) {
+ proposals.put(proposal.getName(), proposal); // If a method name matches an existing suggestion (i.e. its overriden in the subclass), don't suggest it again!
+ }
+ }
String superClass = type.getSuperclassName();
- if (superClass == null) return;
+ if (superClass == null) return proposals;
RubyElementRequestor requestor = new RubyElementRequestor(type.getRubyScript());
IType[] supers = requestor.findType(superClass);
for (int i = 0; i < supers.length; i++) {
IType superType = supers[i];
- suggestMethods(confidence, superType);
+ proposals.putAll(suggestMethods(confidence, superType));
}
+ return proposals;
}
- private void suggestMethod(IMethod method, String typeName, int confidence) {
- int start = context.getReplaceStart();
+ private CompletionProposal suggestMethod(IMethod method, String typeName, int confidence) {
+ int start = fContext.getReplaceStart();
String name = method.getElementName();
int flags = Flags.AccDefault;
if (method.isSingleton()) {
@@ -167,10 +184,10 @@
} else {
// Don't show instance methods if the thing we're working on is a class' name!
// FIXME We do want to show if it is a constant, but not a class name
- if (context.fullPrefixIsConstant()) return;
+ if (fContext.fullPrefixIsConstant()) return null;
}
- if (!context.prefixStartsWith(name))
- return;
+ if (!fContext.prefixStartsWith(name))
+ return null;
try {
switch (method.getVisibility()) {
@@ -199,8 +216,7 @@
if (declaringType != null)
declaringName = declaringType.getElementName();
proposal.setDeclaringType(declaringName);
- requestor.accept(proposal);
-
+ return proposal;
}
/**
@@ -216,13 +232,13 @@
// FIXME Try to stop all the multiple re-parsing of the source! Can
// we parse once and pass the root node around?
// Parse
- Node rootNode = (new RubyParser()).parse(context.getCorrectedSource());
+ Node rootNode = (new RubyParser()).parse(fContext.getCorrectedSource());
if (rootNode == null) {
return;
}
// Find the enclosing method to get locals and args
- Node enclosingMethodNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, context.getOffset(), new INodeAcceptor() {
+ Node enclosingMethodNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, fContext.getOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
return (node instanceof DefnNode || node instanceof DefsNode);
}
@@ -232,7 +248,7 @@
// Find the enclosing type (class or module) to get instance and
// classvars from
- Node enclosingTypeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, context.getOffset(), new INodeAcceptor() {
+ Node enclosingTypeNode = ClosestSpanningNodeLocator.Instance().findClosestSpanner(rootNode, fContext.getOffset(), new INodeAcceptor() {
public boolean doesAccept(Node node) {
return (node instanceof ClassNode || node instanceof ModuleNode);
}
@@ -260,15 +276,15 @@
List locals = Arrays.asList(scope.getVariables());
for (Iterator iter = locals.iterator(); iter.hasNext();) {
String local = (String) iter.next();
- if (!context.prefixStartsWith(local))
+ if (!fContext.prefixStartsWith(local))
continue;
matches.add(local);
}
}
for (String local : matches) { // Avoid duplicates
CompletionProposal proposal = new CompletionProposal(CompletionProposal.LOCAL_VARIABLE_REF, local, 100);
- proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + local.length());
- requestor.accept(proposal);
+ proposal.setReplaceRange(fContext.getReplaceStart(), fContext.getReplaceStart() + local.length());
+ fRequestor.accept(proposal);
}
}
}
@@ -339,7 +355,7 @@
if (methodDefinition instanceof DefsNode) {
name = ((DefsNode) methodDefinition).getName();
}
- if (!context.prefixStartsWith(name))
+ if (!fContext.prefixStartsWith(name))
continue;
NodeMethod method = new NodeMethod((MethodDefNode)methodDefinition);
suggestMethod(method, typeName, 100);
@@ -371,7 +387,7 @@
// Get the unique names of instance and class variables
for (Node varNode : instanceAndClassVars) {
String name = ASTUtil.getNameReflectively(varNode);
- if (!context.prefixStartsWith(name))
+ if (!fContext.prefixStartsWith(name))
continue;
fields.add(name);
}
@@ -380,14 +396,14 @@
List<String> attrs = AttributeLocator.Instance().findInstanceAttributesInScope(typeNode);
for (Iterator iter = attrs.iterator(); iter.hasNext();) {
String attr = (String) iter.next();
- if (!context.prefixStartsWith(attr))
+ if (!fContext.prefixStartsWith(attr))
continue;
fields.add(attr);
}
for (String field : fields) {
CompletionProposal proposal = new CompletionProposal(CompletionProposal.FIELD_REF, field, 100);
- proposal.setReplaceRange(context.getReplaceStart(), context.getReplaceStart() + field.length());
- requestor.accept(proposal);
+ proposal.setReplaceRange(fContext.getReplaceStart(), fContext.getReplaceStart() + field.length());
+ fRequestor.accept(proposal);
}
}
@@ -422,7 +438,7 @@
System.out.println("Being asked for the type decl node for " + typeName);
// Find the named type
- RubyElementRequestor requestor = new RubyElementRequestor(context.getScript());
+ RubyElementRequestor requestor = new RubyElementRequestor(fContext.getScript());
IType[] types = requestor.findType(typeName);
IType type = types[0];
@@ -462,7 +478,7 @@
}
private List<String> getIncludedMixinNames(String typeName) {
- IType rubyType = new RubyType((RubyElement)context.getScript(), typeName);
+ IType rubyType = new RubyType((RubyElement)fContext.getScript(), typeName);
try {
String[] includedModuleNames = rubyType.getIncludedModuleNames();
Added: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java (rev 0)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/codeassist/CompletionProposalComparator.java 2007-02-27 15:24:41 UTC (rev 2052)
@@ -0,0 +1,13 @@
+package org.rubypeople.rdt.internal.codeassist;
+
+import java.util.Comparator;
+
+import org.rubypeople.rdt.core.CompletionProposal;
+
+public class CompletionProposalComparator implements Comparator<CompletionProposal> {
+
+ public int compare(CompletionProposal o1, CompletionProposal o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+
+}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java 2007-02-27 14:48:01 UTC (rev 2051)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyCompletionProcessor.java 2007-02-27 15:24:41 UTC (rev 2052)
@@ -24,7 +24,6 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.IEditorPart;
import org.rubypeople.rdt.core.IRubyScript;
-import org.rubypeople.rdt.core.RubyCore;
import org.rubypeople.rdt.core.RubyModelException;
import org.rubypeople.rdt.internal.corext.template.ruby.RubyContextType;
import org.rubypeople.rdt.internal.ui.RubyPlugin;
@@ -111,6 +110,7 @@
cursorPosition = selection.getOffset() + selection.getLength();
List templates = determineTemplateProposals(viewer, documentOffset);
+ // FIXME Don't suggest templates or keywords if we are invoking a method?
ICompletionProposal[] templateArray = (ICompletionProposal[]) templates.toArray(new ICompletionProposal[templates
.size()]);
ICompletionProposal[] keyWordsAndTemplates = merge(templateArray, determineKeywordProposals(viewer,
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java 2007-02-27 14:48:01 UTC (rev 2051)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/RubyScriptCompletion.java 2007-02-27 15:24:41 UTC (rev 2052)
@@ -93,11 +93,11 @@
// TODO Handle potential method declarations
// acceptPotentialMethodDeclaration(proposal);
} else {
- IRubyCompletionProposal javaProposal= createRubyCompletionProposal(proposal);
- if (javaProposal != null) {
- fRubyProposals.add(javaProposal);
+ IRubyCompletionProposal rubyProposal= createRubyCompletionProposal(proposal);
+ if (rubyProposal != null) {
+ fRubyProposals.add(rubyProposal);
if (proposal.getKind() == CompletionProposal.KEYWORD)
- fKeywords.add(javaProposal);
+ fKeywords.add(rubyProposal);
}
}
} catch (IllegalArgumentException e) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-27 14:48:03
|
Revision: 2051
http://svn.sourceforge.net/rubyeclipse/?rev=2051&view=rev
Author: cawilliams
Date: 2007-02-27 06:48:01 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
add task markers to note that this dialog won't show all the classes in the system, and that to do so we'd need to do a full depth search via Rubyproject.getSourceFolders. Unfortunately thats way too slow, so we'd need to hook it up to the search engine like JDT does to get it to perform OK.
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java 2007-02-27 14:45:43 UTC (rev 2050)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java 2007-02-27 14:48:01 UTC (rev 2051)
@@ -31,6 +31,8 @@
* @return
*/
protected Object[] getElements() {
+ // FIXME This doesn't pick up all the classes in loadpaths (Ruby library)! We need to search through rubProject.getSourceFolders to do that.
+ // FIXME If we move to grabbing all types via source fodlers it gets way too slow. We need to make this set up liek JDT so it runs a search job based on input and caches results.
return getAllTypes();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-27 14:45:45
|
Revision: 2050
http://svn.sourceforge.net/rubyeclipse/?rev=2050&view=rev
Author: cawilliams
Date: 2007-02-27 06:45:43 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
post qualify types shown in this dialog
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java 2007-02-27 14:37:50 UTC (rev 2049)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/wizards/RubyTypeSelectionDialog.java 2007-02-27 14:45:43 UTC (rev 2050)
@@ -21,7 +21,7 @@
public class RubyTypeSelectionDialog extends ElementListSelectionDialog {
public RubyTypeSelectionDialog(Shell parent) {
- super(parent, new RubyElementLabelProvider());
+ super(parent, new RubyElementLabelProvider(RubyElementLabelProvider.SHOW_DEFAULT | RubyElementLabelProvider.SHOW_POST_QUALIFIED));
setElements(getElements());
setMultipleSelection(false);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-27 14:37:51
|
Revision: 2049
http://svn.sourceforge.net/rubyeclipse/?rev=2049&view=rev
Author: cawilliams
Date: 2007-02-27 06:37:50 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
change wording
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementLabels.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementLabels.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementLabels.java 2007-02-27 14:37:40 UTC (rev 2048)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/RubyElementLabels.java 2007-02-27 14:37:50 UTC (rev 2049)
@@ -607,10 +607,10 @@
}
/**
- * Appends the label for a compilation unit to a {@link StringBuffer}.
+ * Appends the label for a ruby script to a {@link StringBuffer}.
* Considers the CU_* flags.
*
- * @param cu
+ * @param script
* The element to render.
* @param flags
* The rendering flags. Flags with names starting with 'CU_' are
@@ -618,19 +618,19 @@
* @param buf
* The buffer to append the resulting label to.
*/
- public static void getRubyScriptLabel(IRubyScript cu, long flags, StringBuffer buf) {
+ public static void getRubyScriptLabel(IRubyScript script, long flags, StringBuffer buf) {
if (getFlag(flags, CU_QUALIFIED)) {
- ISourceFolder pack = (ISourceFolder) cu.getParent();
+ ISourceFolder pack = (ISourceFolder) script.getParent();
if (!pack.isDefaultPackage()) {
getSourceFolderLabel(pack, (flags & QUALIFIER_FLAGS), buf);
buf.append('.');
}
}
- buf.append(cu.getElementName());
+ buf.append(script.getElementName());
if (getFlag(flags, CU_POST_QUALIFIED)) {
buf.append(CONCAT_STRING);
- getSourceFolderLabel((ISourceFolder) cu.getParent(), flags & QUALIFIER_FLAGS, buf);
+ getSourceFolderLabel((ISourceFolder) script.getParent(), flags & QUALIFIER_FLAGS, buf);
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <caw...@us...> - 2007-02-27 14:37:42
|
Revision: 2048
http://svn.sourceforge.net/rubyeclipse/?rev=2048&view=rev
Author: cawilliams
Date: 2007-02-27 06:37:40 -0800 (Tue, 27 Feb 2007)
Log Message:
-----------
fix some stuff around grabbing source folders for a project and grabbing script from a member
Modified Paths:
--------------
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-27 12:21:13 UTC (rev 2047)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyProject.java 2007-02-27 14:37:40 UTC (rev 2048)
@@ -867,13 +867,33 @@
}
public ISourceFolder[] getSourceFolders() throws RubyModelException {
- Object[] children;
- int length;
- ISourceFolder[] roots;
+ ISourceFolderRoot[] roots = getSourceFolderRoots();
+ return getSourceFoldersInRoots(roots);
+ }
+
+ /**
+ * Returns all the source folders found in the specified
+ * source folder roots.
+ * @param roots ISourceFolderRoot[]
+ * @return ISourceFolder[]
+ */
+ public ISourceFolder[] getSourceFoldersInRoots(ISourceFolderRoot[] roots) {
- System.arraycopy(children = getChildren(), 0, roots = new ISourceFolder[length = children.length], 0, length);
-
- return roots;
+ ArrayList frags = new ArrayList();
+ for (int i = 0; i < roots.length; i++) {
+ ISourceFolderRoot root = roots[i];
+ try {
+ IRubyElement[] rootFragments = root.getChildren();
+ for (int j = 0; j < rootFragments.length; j++) {
+ frags.add(rootFragments[j]);
+ }
+ } catch (RubyModelException e) {
+ // do nothing
+ }
+ }
+ ISourceFolder[] fragments = new ISourceFolder[frags.size()];
+ frags.toArray(fragments);
+ return fragments;
}
/*
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-02-27 12:21:13 UTC (rev 2047)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/RubyType.java 2007-02-27 14:37:40 UTC (rev 2048)
@@ -158,15 +158,6 @@
return new RubyType(this, typeName);
}
- /*
- * (non-Rubydoc)
- *
- * @see org.rubypeople.rdt.core.IMember#getRubyScript()
- */
- public IRubyScript getRubyScript() {
- return ((RubyElement) getParent()).getRubyScript();
- }
-
public boolean equals(Object o) {
if (!(o instanceof RubyType)) return false;
return super.equals(o);
Modified: trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java
===================================================================
--- trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java 2007-02-27 12:21:13 UTC (rev 2047)
+++ trunk/org.rubypeople.rdt.core/src/org/rubypeople/rdt/internal/core/SourceRefElement.java 2007-02-27 14:37:40 UTC (rev 2048)
@@ -13,6 +13,7 @@
import org.rubypeople.rdt.core.IBuffer;
import org.rubypeople.rdt.core.IOpenable;
import org.rubypeople.rdt.core.IRubyElement;
+import org.rubypeople.rdt.core.IRubyScript;
import org.rubypeople.rdt.core.ISourceRange;
import org.rubypeople.rdt.core.ISourceReference;
import org.rubypeople.rdt.core.RubyModelException;
@@ -40,6 +41,15 @@
super(parent);
}
+ /*
+ * (non-Rubydoc)
+ *
+ * @see org.rubypeople.rdt.core.IMember#getRubyScript()
+ */
+ public IRubyScript getRubyScript() {
+ return ((RubyElement) getParent()).getRubyScript();
+ }
+
/**
* Returns the <code>ASTNode</code> that corresponds to this <code>RubyElement</code>
* or <code>null</code> if there is no corresponding node.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|