Community
Participate
Working Groups
Trying to find an existing class in the type dialog results in the error message "Could not uniquely map the name to a type. Path is .." The type dialog ('s indexing) seems to fail when the project name contains a dot '.'. Also see attached workspace.
Created attachment 39273 [details] Workspace demonstrating the problem Try to open MyClass from projectTest.jar - this fails with the described error message Try to open MyClass from TestProjectWithoutDot - OK
Thanks for the workspace. Reproduced with 20060424-0010 There are two types MyClass in two projects: The first has as 'path' reported be the search engine /TestProjectWithoutDot/test-src/com/test/myclass/MyClassTest.java the second /Test.jar|test-src/com/test/myclass/MyClassTest.java But 'Test.jar' is a project name in this workspace. Moving to jdt.core
The documentPath given to the requestor is wrong. It assumes it is a jar document path (i.e "/Test.jar|src/p/MyClass.java"). Problem comes from InternalSearchPattern#documentPath(String, String) that assumes that a container path ending with .jar is a jar file path.
One possible fix would be to encode the fact that it is a jar path in the container path (by adding '|' to the path for example).
Since this bug existed in 3.1, this is not a regression. Fixing it at this stage of 3.2 is too risky. Will keep for post 3.2.
*** Bug 140117 has been marked as a duplicate of this bug. ***
The problem persists in 3.3 stream, but in a worse fashion as the Open Type dialog is now even more broken. Where previously only the opening of the type was failing, now searching with patterns matching a type in a ".jar" project fails to show any type, from the ".jar" project, but also from any other projects or referenced libraries.
(In reply to comment #7) It sounds like a different problem. Please open a separate bug with detailed steps to reproduce.
Tested the original workspace again in 3.3. Type Dialog now produces an error message. 'Items filtering (Time of error: July 13, 2007 9:39:21 AM GMT+2:00) Reason: Class file name must end with .class' See below .log file from the workspace !ENTRY org.eclipse.core.jobs 4 2 2007-07-13 09:39:21.586 !MESSAGE An internal error occurred during: "Items filtering". !STACK 0 java.lang.IllegalArgumentException: Class file name must end with .class at org.eclipse.jdt.internal.core.PackageFragment.getClassFile(PackageFragment.java:188) at org.eclipse.jdt.internal.core.search.TypeNameMatchRequestorWrapper.createTypeFromJar(TypeNameMatchRequestorWrapper.java:146) at org.eclipse.jdt.internal.core.search.TypeNameMatchRequestorWrapper.acceptType(TypeNameMatchRequestorWrapper.java:108) at org.eclipse.jdt.internal.core.search.BasicSearchEngine$2.acceptIndexMatch(BasicSearchEngine.java:767) at org.eclipse.jdt.internal.core.search.matching.InternalSearchPattern.acceptMatch(InternalSearchPattern.java:45) at org.eclipse.jdt.internal.core.search.matching.InternalSearchPattern.findIndexMatches(InternalSearchPattern.java:89) at org.eclipse.jdt.internal.core.search.matching.MatchLocator.findIndexMatches(MatchLocator.java:325) at org.eclipse.jdt.internal.core.search.PatternSearchJob.search(PatternSearchJob.java:114) at org.eclipse.jdt.internal.core.search.PatternSearchJob.execute(PatternSearchJob.java:64) at org.eclipse.jdt.internal.core.search.processing.JobManager.performConcurrentJob(JobManager.java:279) at org.eclipse.jdt.internal.core.search.BasicSearchEngine.searchAllTypeNames(BasicSearchEngine.java:778) at org.eclipse.jdt.core.search.SearchEngine.searchAllTypeNames(SearchEngine.java:781) at org.eclipse.jdt.internal.ui.dialogs.FilteredTypesSelectionDialog.fillContentProvider(FilteredTypesSelectionDialog.java:593) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.filterContent(FilteredItemsSelectionDialog.java:2059) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.internalRun(FilteredItemsSelectionDialog.java:2001) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.doRun(FilteredItemsSelectionDialog.java:1973) at org.eclipse.ui.dialogs.FilteredItemsSelectionDialog$FilterJob.run(FilteredItemsSelectionDialog.java:1960) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
(In reply to comment #9) This is also a different problem (different error message). Please enter a separate bug with steps to reproduce.
registered bug #199392 'Type Dialog Error 'Items filtering ... Reason: Class file name must end with .class'' Marked this bug as invalid for version 3.3.
Reopen as it appears finally that it was the same issue than bug 199392. The message has changed because Open Type dialog uses a different API method from SearchEngine (TypeNameMatchRequestor instead of TypeNameRequestor) since 3.3...
*** Bug 199392 has been marked as a duplicate of this bug. ***
Created attachment 75775 [details] Proposed patch All JDT/Core model and JDT/UI tests pass with this patch.
Created attachment 75822 [details] New proposed patch New patch using char for separator instead of string to reduce memory allocation and speed-up concatenation just a little bit...
Released for 3.4M2 in HEAD stream.
Verified for 3.4 M2 using build I20070917-0010.
Might be fixed in R3_3_maintenance by fix for bug 204652. Frederic please verify that assumption.
(In reply to comment #18) > Might be fixed in R3_3_maintenance by fix for bug 204652. Frederic please > verify that assumption. > Unfortunately not, as we get a "Class file name must ends with .class" error with the fix released in maintenance stream for bug 204652. JavaSearchScope behaves correctly with the patch, but in comment 2 test case, there's a java file (MyClass.java) in the source folder and this error is raised as the TypeNameMatchRequestorWrapper expects to find a class file in a jar file (method #createTypeFromJar(String, int))... So, to definitely avoid this error, the only way is not to jump into this method reserved to Jar files and I currently do not see any simple workaround to fix this in maintenance stream...
Created attachment 118873 [details] Patch for Eclipse 3.2.2 RAD 7.0 (based on Eclipse 3.2.2) is facing this problem. I have prepared a patch, so that it could be included in one of the future fixes fix for RAD 7.0.
Looking at the patch from comment 20, "ResourcesPlugin.getWorkspace().getRoot().getProject(containerPath) != null" always returns true (so it is not needed), but more importantly it doesn't work if the path to the jar is "C:\mylib.jar" since "(new Path(containerPath).segmentCount() == 1" returns true in this case. Frederic, do you agree that this patch is not correct?
(In reply to comment #21) > Looking at the patch from comment 20, > "ResourcesPlugin.getWorkspace().getRoot().getProject(containerPath) != null" > always returns true (so it is not needed), but more importantly it doesn't work > if the path to the jar is "C:\mylib.jar" since "(new > Path(containerPath).segmentCount() == 1" returns true in this case. > > Frederic, do you agree that this patch is not correct? > Definitely agree
Correct fix would involve backporting the fix from comment 15 + the fix from bug 200064.
Created attachment 120216 [details] Proposed patch for R3_2_maintenance branch
Created attachment 120225 [details] Proposed patch for R3_3_maintenance branch
(In reply to comment #24) > Created an attachment (id=120216) [details] > Proposed patch for R3_2_maintenance branch > Released in R3_2_maintenance branch
(In reply to comment #25) > Created an attachment (id=120225) [details] > Proposed patch for R3_3_maintenance branch > Released in R3_3_maintenance branch
I currently have an Eclipse 3.5.2 workspace (my RTC install) which is exibiting this problem. I can't use the Open Type dialog anymore because of the error: java.lang.IllegalArgumentException: Class file name must end with .class It looks like this workitem was resolved in Eclipse 3.4, so should I open a new workitem to track the problem in 3.5? Or should I reopen this one? Also, is there any workaround I can use to restore the use of the Open Type dialog?
(In reply to comment #28) > I currently have an Eclipse 3.5.2 workspace (my RTC install) which is exibiting > this problem. I can't use the Open Type dialog anymore because of the error: > java.lang.IllegalArgumentException: Class file name must end with .class > > It looks like this workitem was resolved in Eclipse 3.4, so should I open a new > workitem to track the problem in 3.5? Or should I reopen this one? > > Also, is there any workaround I can use to restore the use of the Open Type > dialog? Jared, Your problem sounds more like bug 286379 than this one. Unfortunately, there's no workaround for it. Perhaps removing all the index files to trigger a new full re-indexing, as described in bug 286379 comment 38, could make this issue disappearing for a while...
(In reply to comment #29) > Your problem sounds more like bug 286379 than this one. Unfortunately, there's > no workaround for it. Perhaps removing all the index files to trigger a new > full re-indexing, as described in bug 286379 comment 38, could make this issue > disappearing for a while... This workaround fixed the problem. Thanks.