| Summary: | Dav: Mapping page - StringIndexOutOfBoundsException | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Kevin McGuire <Kevin_McGuire> |
| Component: | WebDAV | Assignee: | DJ Houghton <dj.houghton> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | Dave_Thomson |
| Version: | 2.0 | ||
| Target Milestone: | 2.0 F2 | ||
| Hardware: | Other | ||
| OS: | other | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 16524 | ||
|
Description
Kevin McGuire
Note that there is *a lot* of content on that site - 455 files/folders. A good big test case! By breaking on StringIndexOutOfBoundsException was able to get the following stack. Trimmed bottom of stack for brevity. Moving to Core as the exception appears to be caused in org.eclipse.webdav.internal.utils.URLDecoder.decode Thread [main] (Suspended (exception java.lang.StringIndexOutOfBoundsException)) java.lang.String.charAt(int) line: 508 [local variables unavailable] org.eclipse.webdav.internal.utils.URLDecoder.decodeSegment (java.lang.String) line: 127 org.eclipse.webdav.internal.utils.URLDecoder.decode(java.lang.String, java.lang.String) line: 80 org.eclipse.webdav.internal.utils.URLDecoder.decode(java.net.URL) line: 109 org.eclipse.webdav.internal.utils.URLDecoder.decode(java.lang.String) line: 44 org.eclipse.webdav.dom.ElementEditor.decodeHref(java.lang.String) line: 420 org.eclipse.webdav.dom.ResponseBody.getHref() line: 323 org.eclipse.webdav.client.CollectionHandle (org.eclipse.webdav.client.AbstractResourceHandle).extractPropStats (org.eclipse.webdav.dom.MultiStatus) line: 355 org.eclipse.webdav.client.CollectionHandle (org.eclipse.webdav.client.AbstractResourceHandle).getProperties (java.util.Collection, java.lang.String) line: 557 org.eclipse.webdav.client.CollectionHandle.getMembers() line: 260 org.eclipse.team.internal.webdav.core.DavRemoteTargetResource.members (org.eclipse.core.runtime.IProgressMonitor) line: 170 org.eclipse.team.internal.ui.target.RemoteResourceElement$1.run (org.eclipse.core.runtime.IProgressMonitor) line: 63 org.eclipse.team.internal.ui.TeamUIPlugin$2.run() line: 142 org.eclipse.swt.custom.BusyIndicator.showWhile (org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 56 org.eclipse.team.internal.ui.TeamUIPlugin.runWithProgress (org.eclipse.swt.widgets.Shell, boolean, org.eclipse.jface.operation.IRunnableWithProgress) line: 139 org.eclipse.team.internal.ui.target.RemoteResourceElement.getChildren (java.lang.Object) line: 60 org.eclipse.team.internal.ui.target.SiteElement.getChildren (java.lang.Object) line: 56 org.eclipse.team.internal.ui.target.SiteLazyContentProvider This time really moving to core :) Following patch is a quick hack which may work (have other problems with test
case but seems to get further now). Code should probably be restructured
though:
Index: URLDecoder.java
===================================================================
RCS
file: /home/eclipse/org.eclipse.webdav/src/interface/org/eclipse/webdav/internal
/utils/URLDecoder.java,v
retrieving revision 1.5
diff -u -r1.5 URLDecoder.java
--- URLDecoder.java 17 May 2002 17:56:25 -0000 1.5
+++ URLDecoder.java 21 May 2002 04:45:31 -0000
@@ -119,11 +119,12 @@
for(int i = 0; i < segment.length(); ++i){
char c = segment.charAt(i);
if(c == '%'){
- while(c == '%'){
+ while(c == '%' && i < segment.length()){
String hex = segment.substring(i + 1, i + 3);
buff.write(Integer.parseInt(hex, 16));
i = i + 3;
- c = segment.charAt(i);
+ if(i < segment.length())
+ c = segment.charAt(i);
}
try {
result.append(buff.toString("UTF8")); //$NON-
NLS-1$
*** Bug 18397 has been marked as a duplicate of this bug. *** Fixed a bug in org.eclipse.webdav.internal.utils.URLDecoder#decodeSegment
(String) in builds > 20020531.
Simple test case is:
org.eclispe.webdav.internal.utils.URLDecoder.decodeSegment("Can you decode this
%40");
Leaving the bug report open until we verify this was the cause of the reported
problem.
Verified fix against URL below. Closing. |