Community
Participate
Working Groups
When I try to make a search references on my project an error dialog pops up and with the following message : An error occured during the search operation Assertion failed; When I look in the log I see the following entry with a stack trace: !ENTRY org.eclipse.jdt.ui 4 10001 May 20, 2003 12:33:41.791 !MESSAGE Internal Error !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:283) at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:357) at org.eclipse.jdt.ui.actions.FindAction.run(FindAction.java:292) at org.eclipse.jdt.ui.actions.FindReferencesAction.run (FindReferencesAction.java:83) at org.eclipse.jdt.ui.actions.FindAction.run(FindAction.java:238) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun (SelectionDispatchAction.java:193) at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run (SelectionDispatchAction.java:169) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:456) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java:403) at org.eclipse.jface.action.ActionContributionItem.access$0 (ActionContributionItem.java:397) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java:72) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1838) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1545) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:291) at org.eclipse.core.launcher.Main.run(Main.java:747) at org.eclipse.core.launcher.Main.main(Main.java:583) Caused by: org.eclipse.jdt.internal.core.Assert$AssertionFailedException: Assertion failed; at org.eclipse.jdt.internal.core.Assert.isTrue(Assert.java:87) at org.eclipse.jdt.internal.core.Assert.isTrue(Assert.java:74) at org.eclipse.jdt.internal.core.SourceType.<init>(SourceType.java:44) at org.eclipse.jdt.internal.core.CompilationUnit.getType (CompilationUnit.java:516) at org.eclipse.jdt.internal.core.search.matching.PotentialMatch.getQualifiedName (PotentialMatch.java:123) at org.eclipse.jdt.internal.core.search.matching.PotentialMatch.<init> (PotentialMatch.java:46) at org.eclipse.jdt.internal.core.search.matching.MatchLocator2.addPotentialMatch (MatchLocator2.java:198) at org.eclipse.jdt.internal.core.search.matching.MatchLocator2.locateMatches (MatchLocator2.java:841) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:471) at org.eclipse.jdt.core.search.SearchEngine.search (SearchEngine.java:400) at org.eclipse.jdt.internal.ui.search.JavaSearchOperation.execute (JavaSearchOperation.java:90) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run (WorkspaceModifyOperation.java:71) at org.eclipse.core.internal.resources.Workspace.run (Workspace.java:1595) at org.eclipse.ui.actions.WorkspaceModifyOperation.run (WorkspaceModifyOperation.java:85) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run (ModalContext.java:101) I found a workaround, by creating a working set. This work around does not work if I try to move a class from one package to another and ask to update the references, it seems to do internally a search references on the workspace instead of using the current working set.
Could you please try to turn on the Java search trace? 1. Exit Eclipse 2. Add a .options file as a sibling of eclipse.exe with the following contents: # Turn on debug tracing for org.eclipse.jdt.core plugin org.eclipse.jdt.core/debug=true # Reports java search activity org.eclipse.jdt.core/debug/search=true 3. Start eclipse with the debug options: eclipse.exe -data <path to your workspace> -debug -vm <path to your vm> e.g. eclipse -data d:\eclipse\workspace -debug -vm d:\jdk1.3.1\jre\bin\java.exe 4. Do the search and report the trace you see in the console.
Java search traces from the execution of the search references: Startup: using configuration file:C:\Program Files\eclipse\workspace\.metadata\.config\platform.cfg Boot URL: file:C:/Program Files/eclipse/plugins/org.eclipse.core.boot_2.1.0/boot.jar Startup: splash path = C:\Program Files\eclipse\plugins\org.eclipse.platform_2.1.0\splash.bmp Workspace location: workspace Debug-Options: file:C:/Program Files/eclipse/.options Install URL: file:C:/Program Files/eclipse/ Searching for TypeReferencePattern: pkg<portal.filter>, type<CentralOfficesController>, exact match, case sensitive in JavaWorkspaceScope Locating matches in files [ /portail/structureApp/portal/structure/filter/FilterController.java /portail/actionPlanApp/portal/actionPlan/filter/FilterController.java /portail/adminApp/portal/admin/CentralOfficesAssocController.java /portail/adminApp/portal/admin/ui/SCCS/s.CentralOfficesAssocController.j ava /portail/testAdminApp/portal/admin/ui/ShowCentralOfficesFilterDialog.jav a /portail/testFilter/portal/filter/TestCentralOfficesController.java /portail/actionPlanApp/portal/actionPlan/filter/SCCS/s.FilterController. java /portail/structureApp/portal/structure/filter/SCCS/s.FilterController.ja va /portail/testFilter/portal/filter/ui/ShowCentralOfficesPanel.java ] and working copies [ [Working copy] ShowCentralOfficesFilterDialog.java [in portal.admin.ui [ in testAdminApp [in portail]]] [Working copy] CentralOfficesController.java [in portal.filter [in filter [in portail]]] ]
Thanks Patrice. Somehow the 2 files 's.FilterController.java' have been indexed when they should not have been. Could you please try something else? 1. Exit Eclipse 2. Go to <path to your workpace>\.metadata\.plugins\org.eclipse.jdt.core 3. Delete all .index files and the savedIndexNames.txt file. 4. Restart Eclipse. This will force all indexes to be recomputed on the first query. 5. Run your search query again and see if this fails.
Thanks, it fixed the problem.
Closing. Please reopen if you see the problem again indicating the steps you followed to get into this state.