|
From: <caw...@us...> - 2007-08-01 18:52:28
|
Revision: 2915
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2915&view=rev
Author: cawilliams
Date: 2007-08-01 11:52:24 -0700 (Wed, 01 Aug 2007)
Log Message:
-----------
try to avoid index out of bounds exception
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java 2007-08-01 18:52:17 UTC (rev 2914)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java 2007-08-01 18:52:24 UTC (rev 2915)
@@ -205,7 +205,12 @@
private int indexOf(String opening, String string) {
String trimmed = opening.trim();
- int diff = opening.indexOf(trimmed.charAt(0)); // Count leading whitespace
+ int diff;
+ if (trimmed.length() == 0) {
+ diff = opening.length();
+ } else {
+ diff = opening.indexOf(trimmed.charAt(0)); // Count leading whitespace
+ }
int lowest = -1;
for (int i = 0; i < string.length(); i++) {
char c = string.charAt(i);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|