My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 877: ArrayIndexOutOfBoundsException on file diff when Ignore Whitespace is not set to 'None'
2 people starred this issue and may be notified of changes. Back to list
Status:  Duplicate
Merged:  issue 802
Owner:  ----
Closed:  May 2011


Sign in to add a comment
 
Project Member Reported by edwin.ke...@gmail.com, Mar 14, 2011
Affected Version: 2.1.6.1

What steps will reproduce the problem?
1. create a new repository
2. copy the attached file 'a.txt.1' as 'a.txt' into the repository
3. do add, commit, push to Gerrit and submit
4. overwrite 'a.txt' in the repository with the attached file 'a.txt.2'
5. do add, commit and push to Gerrit
6. open the change in the Gerrit WebUI and open the file diff for the file 'a.txt'
7. in the diff preferences choose 'At Line End' for the 'Ignore Whitespace' option
8. click on 'Update'

What is the expected output? What do you see instead?
It is expected that the file diff is properly displayed. Instead it fails with 'Application Error - Server Error- Internal Server Error'.

Please provide any additional information below.
The same problem occurs if the 'Ignore Whitespace' option is set to 'Leading, At Line End' or 'All'.

On server side the following stacktrace is produced:
00:00:47,785 [WARN] Error in patchScript
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: 12
 	at org.eclipse.jgit.util.IntList.get(IntList.java:82)
 	at org.eclipse.jgit.diff.RawText.getEnd(RawText.java:215)
 	at org.eclipse.jgit.diff.RawText.getString(RawText.java:187)
 	at org.eclipse.jgit.diff.RawText.getString(RawText.java:166)
 	at com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.packContent(PatchScriptBuilder.java:384)
 	at com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.build(PatchScriptBuilder.java:207)
 	at com.google.gerrit.httpd.rpc.patch.PatchScriptBuilder.toPatchScript(PatchScriptBuilder.java:125)
 	at com.google.gerrit.httpd.rpc.patch.PatchScriptFactory.call(PatchScriptFactory.java:155)
 	at com.google.gerrit.httpd.rpc.patch.PatchScriptFactory.call(PatchScriptFactory.java:1)
 	at com.google.gerrit.httpd.rpc.Handler.to(Handler.java:65)
 	at com.google.gerrit.httpd.rpc.patch.PatchDetailServiceImpl.patchScript(PatchDetailServiceImpl.java:101)
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 	at java.lang.reflect.Method.invoke(Unknown Source)
 	at com.google.gwtjsonrpc.server.MethodHandle.invoke(MethodHandle.java:91)
 	at com.google.gwtjsonrpc.server.JsonServlet.doService(JsonServlet.java:382)
 	at com.google.gwtjsonrpc.server.JsonServlet.service(JsonServlet.java:268)
 	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:216)
...

a.txt.1
58 bytes   View   Download
a.txt.2
67 bytes   View   Download
Mar 14, 2011
Project Member #1 edwin.ke...@gmail.com
Actually the stacktrace looks very similar to the one reported in  issue 802 . Maybe it's the same root cause?
May 20, 2011
Project Member #2 nas...@grainawi.org
Edwin, can you try this again now that 802 is fixed?
Status: AwaitingInformation
May 23, 2011
#3 sop@google.com
Based on the two files provided (a.txt.1, a.txt.2) this is the same issue.
Status: Duplicate
Mergedinto: 802
Sign in to add a comment

Powered by Google Project Hosting