/[classpath]/classpath/javax/swing/text/GapContent.java
ViewVC logotype

Diff of /classpath/javax/swing/text/GapContent.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by rabbit78, Fri Aug 12 15:33:03 2005 UTC revision 1.22 by rabbit78, Thu Aug 25 19:19:19 2005 UTC
# Line 274  public class GapContent Line 274  public class GapContent
274    public String getString(int where, int len) throws BadLocationException    public String getString(int where, int len) throws BadLocationException
275    {    {
276      Segment seg = new Segment();      Segment seg = new Segment();
277      getChars(where, len, seg);      try
278      return new String(seg.array, seg.offset, seg.count);        {
279            getChars(where, len, seg);
280            return new String(seg.array, seg.offset, seg.count);
281          }
282        catch (StringIndexOutOfBoundsException ex)
283          {
284            int invalid = 0;
285            if (seg.offset < 0 || seg.offset >= seg.array.length)
286              invalid = seg.offset;
287            else
288              invalid = seg.offset + seg.count;
289            throw new BadLocationException("Illegal location: array.length = "
290                                           + seg.array.length + ", offset = "
291                                           + seg.offset + ", count = "
292                                           + seg.count, invalid);
293          }
294    }    }
295    
296    /**    /**

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26