Community
Participate
Working Groups
The WTP JSP Editor uses SearchParticipant API. If a searchDocument path doesn't point to something that exists in the workspace, the index container path is set to equal the document path. For the call to: SearchParticipant#scheduleDocumentIndexing(document, indexLocation) Our JSPSearchDocument#getPath() points to a compilation unit that doesn't actually exist in the workspace (only in memory). This causes: IPath containerPath = resource == null ? documentPath : resource.getProject().getFullPath(); to set containerPath = to the document path This in turn causes an IllegalArgumentException in Index as of M7 (because documentPath == containerPath): Index#containerRelativePath(documentPath) If the resource doesn't actually exist in the workspace, can the first segment of the searchDocumentPath be considered the containerPath? Or might this have side effects that I haven't anticipated?
This causes major loss of function for JSP including search and refactoring, so I'm raising severity.
Unfortunately, it's too late for RC1. I'll try to do my best for (early) RC2...
I get some trouble to get this IAE... Could you provide a simple test case to help me to verify that my fix I'm thinking about would really fix your problem? TIA
Created attachment 22152 [details] unit test You will probably have to change the INDEX_LOCATION field and package to run this unit test. This should expose the problem (I run as JUnit plugin test w/ -debug -consolelog option)
*** Bug 98045 has been marked as a duplicate of this bug. ***
I cannot reproduce this exception even with your JUnit test case or installing JST and create project/exit eclipse/delete project/restart eclipse...:-( Don't know how to verify this... Can I attach a patch text-file that you can apply or perhaps send you a new org.eclipse.jdt.core.jar file?
A patch would be fine for me to test. Strange that the unit test didn't work though...I thought I wrote it so that JST wasn't required.
My fault. Your test is correct. I just forgot to create INDEX_LOCATION folder on my box (or change it to point on a existing one). I now get the exception in console and I have verified that my fix works well :-) It should be released today and available in tomorrow's nightly build...
Fixed and released in HEAD. Modify way to get resource (using JavaModel.getTarget(...)) to keep documentPath for external jar files. When object is neither an IResource nor a File (ie. null), then keep only first segment of document path. [jdt-core internal] Changes done in SearchParticipant.scheduleDocumentIndexing(SearchDocument, IPath). No test case added but verify that exception does no longer occur with provide JUnit test case. If time permit, I'll try to modify this test to put in our model JUnit tests.
Verified using N20050606-0010 + JDT/Core HEAD
Verified with I20050610-0010
*** Bug 99242 has been marked as a duplicate of this bug. ***