Ignore:
Timestamp:
11/05/10 16:46:19 (14 years ago)
Author:
zeiss
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/de.ugoe.cs.swe.bnftools.ebnf.ui/src/de/ugoe/cs/swe/bnftools/ui/formatter/EbnfFormatterVisitor.java

    r37 r41  
    144144                StringBuffer whiteSpaces = new StringBuffer(); 
    145145                int currentPosition = position; 
    146                 while (isWhitespace(str.charAt(currentPosition))) { 
     146                if (currentPosition >= str.length() || currentPosition < 0) 
     147                        return ""; 
     148                char ch; 
     149                ch = str.charAt(currentPosition); 
     150                while (isWhitespace(ch)) { 
    147151                        whiteSpaces.append(str.charAt(currentPosition)); 
    148152                        currentPosition--; 
     153                        if (currentPosition < 0) 
     154                                break; 
     155                        ch = str.charAt(currentPosition); 
    149156                } 
    150157                return whiteSpaces.toString(); 
Note: See TracChangeset for help on using the changeset viewer.