Community
Participate
Working Groups
The issue is always reproducible, both with Juno and Indigo releases, with any Java projet A which references one Java project B in workspace. Choose "Discovery....->Discover Java and Inventory Model..." Choose in ELEMENTS_TO_ANALYZE, the prject A and also the project B. --> IAE "No Null constraint violated". I join the stacktrace
Created attachment 219537 [details] stack trace
Looking at code reveal that the "kdm inventory model" discovery works on java project selection but does not create elements for referenced java projects selected in ELEMENTS_TO_ANALYZE. The generic "AbstractComposedKDMSourceDiscoverer2.discoverKDMSourceModel" method may be specialized.
Hi Gregoire, I noticed that your have reduced the priority for this issue. Is there a reason for this? Cheers Benjamin
(In reply to comment #3) Yes, that means that we may not have enough time to solve this bug before the release of Kepler. Regards, Grégoire
Created attachment 234474 [details] Patch make the Java and SourceModel Discoverer working for multiple projects I have investigated into this issue and found a solution to make this working. The patch includes the required modification. # The source of the issues was: Only the main JavaProject is discovered not any configured additional "elements to analyze". As a result only InventoryContainer (Project) exists in the InventoryModel (SourceModel) An the weaving process combining Java and Source Model assumed only one InventoryContainer and was not able to handle multiple. # The solution: ## Plugin: org.eclipse.modisco.kdm.source.extension - AbstractComposedKDMSourceDiscoverer2 new method handleDiscoveredSourceModel() to save a new SourceModel or merge the newly discovered with an existing one ## Plugin: org.eclipse.modisco.java.composition.discoverer - DiscoverKDMSourceAndJavaModelFromJavaProject & DiscoverKDMSourceAndJavaModelFromProject finishBuildingModel() overridden to first discover the KDM SourceModel for the additional elements to analyze before calling the super.finishBuildingModel() of the AbstractDiscoverKDMSourceAndJavaModel<T> This has to be done in the type specific discoverers and can not be implemented on the abstract type T due to required type checks (instanceof IProject / instanceof IJavaProject). - AbstractDiscoverKDMSourceAndJavaModel<T> switched class member container from single InventoryContainer to Set<InventoryContainer> modified getKDMProjectForWeaving to return a Set<InventoryContainer> and to fill all InventoryContainers from the Inventory model into it. Also the invocations of this method (in weaveCompilationUnit(), weaveArchiveFile(), and manageJava2DirectoryCreation()) have been adapted to process all returned InventoryContainers
I am running into the same problem. Unfortunately, the code has meanwhile changed that much that I am not able within the time I have to figure out how to apply the provided patch manually. Any idea if this bug will be fixed? Tested on Eclipse Luna SR1 (installed using install Modeling components wizard).