Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 81452 Details for
Bug 207743
StringIndexOutOfBoundsException in ConsoleDocumentAdapter
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
bug207743.patch (text/plain), 2.10 KB, created by
Darin Wright
on 2007-10-29 09:54:57 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Darin Wright
Created:
2007-10-29 09:54:57 EDT
Size:
2.10 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.console >Index: src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java,v >retrieving revision 1.25 >diff -u -r1.25 ConsoleDocumentAdapter.java >--- src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java 24 Aug 2007 19:38:53 -0000 1.25 >+++ src/org/eclipse/ui/internal/console/ConsoleDocumentAdapter.java 29 Oct 2007 13:53:52 -0000 >@@ -320,34 +320,37 @@ > // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4994840 > // see bug 84641 > int offset = string.length() - 1; >- while (string.charAt(offset) == '\r') { >+ while (offset >= 0 && string.charAt(offset) == '\r') { > offset--; > count++; > } >- if (offset < (string.length() - 1)) { >- string = string.substring(0, offset); >- } >- >- int lastIndex = 0; >- int index = 0; >- >- Matcher matcher = pattern.matcher(string); >- >- while (matcher.find()) { >- index = matcher.start(); >+ // if offset == 0, the line was all '\r' and there is no string to search for matches (bug 207743) >+ if (offset > 0) { >+ if (offset < (string.length() - 1)) { >+ string = string.substring(0, offset); >+ } > >- if (index == 0) >- count++; >- else if (index!=string.length()) >- count++; >+ int lastIndex = 0; >+ int index = 0; > >- if (consoleWidth > 0) { >- int lineLen = index - lastIndex + 1; >- if (index == 0) lineLen += lengths[regionCount-1]; >- count += lineLen/consoleWidth; >- } >+ Matcher matcher = pattern.matcher(string); > >- lastIndex = index; >+ while (matcher.find()) { >+ index = matcher.start(); >+ >+ if (index == 0) >+ count++; >+ else if (index!=string.length()) >+ count++; >+ >+ if (consoleWidth > 0) { >+ int lineLen = index - lastIndex + 1; >+ if (index == 0) lineLen += lengths[regionCount-1]; >+ count += lineLen/consoleWidth; >+ } >+ >+ lastIndex = index; >+ } > } > return count; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 207743
: 81452