|
From: <caw...@us...> - 2007-06-05 14:52:07
|
Revision: 2578
http://svn.sourceforge.net/rubyeclipse/?rev=2578&view=rev
Author: cawilliams
Date: 2007-06-05 07:52:04 -0700 (Tue, 05 Jun 2007)
Log Message:
-----------
fix some issues with detecting file paths on console
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/StackTraceLine.java
Modified: trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java 2007-06-01 18:56:59 UTC (rev 2577)
+++ trunk/org.rubypeople.rdt.debug.ui/src/org/rubypeople/rdt/internal/debug/ui/console/RubyConsoleTracker.java 2007-06-05 14:52:04 UTC (rev 2578)
@@ -26,6 +26,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.ui.console.IConsole;
import org.eclipse.debug.ui.console.IConsoleLineTracker;
@@ -56,8 +57,16 @@
public boolean fileExists(String filename) {
File file = new File(filename);
if (file.exists()) return true;
- IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(filename));
- if (iFile != null) return true;
+ IPath path = new Path(filename);
+ if (!path.isValidPath(filename)) {
+ return false;
+ }
+ try {
+ IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+ if (iFile != null) return iFile.exists();
+ } catch (IllegalArgumentException e) {
+ return false;
+ }
return false;
}
}
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/StackTraceLine.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/StackTraceLine.java 2007-06-01 18:56:59 UTC (rev 2577)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/util/StackTraceLine.java 2007-06-05 14:52:04 UTC (rev 2578)
@@ -86,7 +86,8 @@
private boolean isRelativePath() {
if (fFilename.startsWith("./")) return true;
- if (!fFilename.startsWith("/") && fFilename.charAt(fFilename.indexOf('/') - 1) != ':' ) return true;
+ int index = fFilename.indexOf('/');
+ if (index != -1 && !fFilename.startsWith("/") && fFilename.charAt(index - 1) != ':' ) return true;
return false;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|