Bug 547136 - [9][search] CoreException when searching for modules encounters a project-as-automodule
Summary: [9][search] CoreException when searching for modules encounters a project-as-...
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.12   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug bulk move
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2019-05-09 08:09 EDT by Stephan Herrmann CLA
Modified: 2023-09-13 17:02 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Herrmann CLA 2019-05-09 08:09:49 EDT
This can be triggered by:

Have a plugin project in you workspace, which defines Automatic-Module-Name.
Open the new Java Build Path/Module Dependencies tab of any Java9+ project
Select any module and click "Add Reads...".

This triggers a search that will throw like this:

Thread [Worker-23: Searching modules in workspace] (Suspended (breakpoint at line 2963 in JavaModelManager))	
	JavaModelManager.getLocalFile(IPath) line: 2963	
	MatchLocator.locateMatches(SearchDocument[]) line: 1510	
	JavaSearchParticipant.locateMatches(SearchDocument[], SearchPattern, IJavaSearchScope, SearchRequestor, IProgressMonitor) line: 112	
	BasicSearchEngine.findMatches(SearchPattern, SearchParticipant[], IJavaSearchScope, SearchRequestor, IProgressMonitor) line: 250	
	BasicSearchEngine.search(SearchPattern, SearchParticipant[], IJavaSearchScope, SearchRequestor, IProgressMonitor) line: 595	
	SearchEngine.search(SearchPattern, SearchParticipant[], IJavaSearchScope, SearchRequestor, IProgressMonitor) line: 670	
	ModuleSelectionDialog.searchAvailableModules(IProgressMonitor) line: 180	
	ModuleSelectionDialog.access$0(ModuleSelectionDialog, IProgressMonitor) line: 167	
	ModuleSelectionDialog$1.run(IProgressMonitor) line: 147	
	Worker.run() line: 63	

S.o. assumes that an automatic module is a file, but our implementation also recognizes the source version of this artifact as an auto module.
Comment 1 Stephan Herrmann CLA 2019-05-09 08:12:40 EDT
FWIW, the search is invoked with workspace scope and this pattern:

SearchPattern.createPattern("*", IJavaSearchConstants.MODULE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_PATTERN_MATCH|SearchPattern.R_CASE_SENSITIVE);
Comment 2 Manoj N Palat CLA 2019-08-27 01:15:48 EDT
Bulk move to 4.14
Comment 3 Manoj N Palat CLA 2019-08-27 02:06:30 EDT
Bulk move out of 4.13
Comment 4 Sravan Kumar Lakkimsetti CLA 2019-09-30 02:27:46 EDT
I am not able to reproduce this problem on the following eclipse. version. Can you please confirm whether this problem still exists? Tested on 

Eclipse SDK
Version: 2019-12 (4.14)
Build id: I20190923-1800
OS: Linux, v.4.15.0-64-generic, x86_64 / gtk 3.22.30
Java version: 1.8.0_222

The java projects created are having java 11 compliance
Comment 5 Eclipse Genie CLA 2021-09-20 19:51:38 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Eclipse Genie CLA 2023-09-13 17:02:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.