Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 342548

Summary: [Java Discovery] Illegal parameter initializer for ELEMENTS_TO_ANALYZE
Product: [Modeling] MoDisco Reporter: Fabien Giquel <fabien.giquel>
Component: TechnologiesAssignee: Nicolas Bros <nicolas.bros>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: hugo.bruneliere, modisco.web-inbox, nicolas.bros
Version: 0.9.0Flags: nicolas.bros: indigo+
Target Milestone: 0.9.0 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
stack trace none

Description Fabien Giquel CLA 2011-04-12 07:33:09 EDT
When creating some Discovery Launch Config, and selecting oem.java.discover.fromProject, and opening ELEMENTS_TO_SERIALIZE widget without providing an input project, there are two thrown exceptions :

- Illegal parameter initializer for ELEMENTS_TO_ANALYZE
- IllegalArgumentException: Path for project must have only one segment

See stackTrace for details.
Comment 1 Fabien Giquel CLA 2011-04-12 07:33:54 EDT
Created attachment 193034 [details]
stack trace
Comment 2 Nicolas Bros CLA 2011-04-14 04:41:36 EDT
Fixed in revision 4297.
Comment 3 Fabien Giquel CLA 2011-04-14 06:00:58 EDT
I have updated the modifications but still have the exceptions.

More precisions about use case :
1 - going "Run Configurations..."
2 - creating conf Discoverer
3 - choosing in combo the discoverer "oem.java.discover.project"
--> immediatly two new entries in log error
--> if open widget "Elemnts_to_analyse", another exceptions in log error
Comment 4 Nicolas Bros CLA 2011-04-14 09:29:54 EDT
I committed a new fix in revision 4301.

There was a problem when the source field was empty : it resulted in the workspace root to be returned, which doesn't have the expected type.
So, I added a cell editor and dialog that deal specifically with IProjects.
Comment 5 Fabien Giquel CLA 2011-04-19 09:30:36 EDT
Hi Nicolas,

i tested the fix. It works for "oem.java.discover.project" but i still have the exception for "oem.java.discover.javaProject".

I had a look at the fix in "JavaElementsToAnalyzeComposite" and understood that the problem should be that a change source event has been sent when choosing "oem.java.discover.javaProject", and so one ElementsToAnalyze instance has been created.

Moreover I think that "JavaElementsToAnalyzeComposite" class should not deduce, from one "ElementsToAnalyze" null value, that the discovery source is still null. So "You must first select a Java project as source." message should be replaced with some neutral "No Java elements to analyze" message.
Comment 6 Nicolas Bros CLA 2011-04-20 03:20:43 EDT
(In reply to comment #5)
> I still have the exception for "oem.java.discover.javaProject".
Fixed in revision 4326 by never creating an instance of ElementsToAnalyze for a null source.

I also changed the error message in the dialog box.
Comment 7 Hugo Bruneliere CLA 2011-08-18 08:06:18 EDT
Bug solved.