| Summary: | [search] ArrayIndexOutOfBoundsException in DiskIndex during problem detection | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] JSDT | Reporter: | Patric Rufflar <patric> | ||||||
| Component: | General | Assignee: | Project Inbox <jsdt.javascript-inbox> | ||||||
| Status: | RESOLVED WORKSFORME | QA Contact: | Chris Jaun <cmjaun> | ||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | cmjaun, earlyster, Michael_Rennie, vrubezhny | ||||||
| Version: | unspecified | ||||||||
| Target Milestone: | 3.5.1 | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows XP | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Patric Rufflar
Created attachment 194748 [details]
file which will reproduce the bug
open the file.
Created attachment 215127 [details]
The patch fixes the issue
For some reason (maybe as result of syntax errors or mixing a JSP,PHP and JS code in the example file) there is possible to achieve an empty name for a token which will be passed as a key parameter of org.eclipse.wst.jsdt.internal.core.index.DiskIndex.addQueryResults(char[][], char[], int, MemoryIndex) method from a MethodPattern search pattern.
The addQueryIndex(...) method has a handling for a null-key, but never checks that the key may be an empty array of characters. So, I've added a check for (key.length == 0) which is made the addQueryResults(...) method to act exactly as the null-key is passed to the method (it caches all the words for all the categories into a search result instead of trying to compare an empty key with a word from a category).
Per this thread [1] vjet team was asked to look at this bug to see if it also applies to vjet. This bug doesn't apply to VJET currently. There is currently wired off support for JS authoring inside HTML files / JSP files / PHP files. There is currently a request to add JS authoring support for HTML/JSP/PHP files 395973 and 398937. [1] http://dev.eclipse.org/mhonarc/lists/vjet-dev/msg00022.html I can't reproduce this issue in the 8/29 WTP 3.5.1 driver even before applying the patch. If this is still an issue, please re-open. |