ASF Bugzilla – Attachment 19768 Details for
Bug 41076
StringIndexOutOfBoundsException when extracting text from a Word document.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Here is a proposed fix to this issue.
TextPiece-fix-bugzilla-41076.txt (text/plain), 1.09 KB, created by
Steve Polyak
on 2007-03-21 09:56:21 UTC
(
hide
)
Description:
Here is a proposed fix to this issue.
Filename:
MIME Type:
Creator:
Steve Polyak
Created:
2007-03-21 09:56:21 UTC
Size:
1.09 KB
patch
obsolete
>Index: C:/Documents and Settings/polyst/workspace3.2/poi/src/scratchpad/src/org/apache/poi/hwpf/model/TextPiece.java >=================================================================== >--- C:/Documents and Settings/polyst/workspace3.2/poi/src/scratchpad/src/org/apache/poi/hwpf/model/TextPiece.java (revision 520483) >+++ C:/Documents and Settings/polyst/workspace3.2/poi/src/scratchpad/src/org/apache/poi/hwpf/model/TextPiece.java (working copy) >@@ -20,6 +20,7 @@ > > > import java.io.UnsupportedEncodingException; >+import java.lang.StringIndexOutOfBoundsException; > /** > * Lightweight representation of a text piece. > * >@@ -84,8 +85,13 @@ > public String substring(int start, int end) > { > int denominator = _usesUnicode ? 2 : 1; >- >- return ((StringBuffer)_buf).substring(start/denominator, end/denominator); >+ String string = ""; >+ try { >+ string = ((StringBuffer)_buf).substring(start/denominator, end/denominator); >+ } catch(StringIndexOutOfBoundsException e) { >+ string = ""; >+ } >+ return string; > } > > public void adjustForDelete(int start, int length)
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 41076
:
19200
|
19768
|
19798
|
22957