| Summary: | Generation of KDM model from Java: Missing parameter entry | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] MoDisco | Reporter: | Florian <ffi> | ||||||
| Component: | Main | Assignee: | Project Inbox <modisco.web-inbox> | ||||||
| Status: | NEW --- | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P5 | CC: | gdupe | ||||||
| Version: | 0.10.0 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | Windows 7 | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
Hello, Thanks for reporting this job. I’ m not sure that we will have time to fix this bug in the next month (MoDisco team is working hard to finish the migration to EMF Facet). If you can write a path and contribute it, this would help to decrease the fixing delay. Please, can you precise the EMF Facet's version in which you found this bug. Regards, Gregoire Dupe Created attachment 206091 [details]
Changes to javaToKdm.atl
(In reply to comment #2) > Created attachment 206091 [details] > Changes to javaToKdm.atl Hello, I have fixed the "bug". It had something to do with the exclusion of SingleVariableAccess (in the ATL file) and not handling it in every method. I also had to wrap an ActionElement around the Reads Element (that is proposed by OMG) because the order of elements is destroyed otherwise. 3 Methods handle SingleVariableAccess on their own. About 10 methods need no special handling (and are really missing SingleVariableAccess handling). Therefore, I propose to write a second helper method for the 3 methods (the old filterExpression). The new filterExpression method, that resolves many missing elements, is attached as a patch. Best Regards, Florian Created attachment 206092 [details]
javaToKdm.atl patch
Hello, Thank you for this patch. The version 0.10.0 has not been released yet. Are you using a nightly build ? (It’s not recommended to use a nightly build). If this bug exists in 0.9 we could commit this path for second service release (0.9.2, February 2012). Otherwise, we would only have to commit this bug in the trunk (corresponding to the version 0.10.0 which will be released in June 2012). Please, can you check those details? This will help me to plan the release of this patch. Please, could you also provide a unit test? This is really help full to do the code review. Regards, Grégoire (In reply to comment #5) Hello, I tested it with Version 0.9, 0.9.1 and 0.10.0 and the bug is existing in all versions. Unit Testing these changes would consume too much time for me right now, sorry. It would include about 13 generated elements and testing with two and one variable accesses. I saw a unit test in JavaProject2KdmTest.java with the method "testBug338874_InfixExpressionWithVariables" which would be a test method for the infix expression and variable accesses. Same scheme can be applied to other elements. Regards, Florian |
int i = 3; int x = method2(i, "example", method3()); generates a HasValue for x, pointing to: <codeElement xsi:type="action:ActionElement" name="method invocation" kind="method invocation"> <source language="java"> <region file="//@model.2/@inventoryElement.0" language="java"/> </source> <codeElement xsi:type="code:Value" name="string literal" type="//@model.0/@codeElement.1/@codeElement.9" ext=""example""> <source language="java"> <region file="//@model.2/@inventoryElement.0" language="java"/> </source> </codeElement> <codeElement xsi:type="action:ActionElement" name="method invocation" kind="method invocation"> <source language="java"> <region file="//@model.2/@inventoryElement.0" language="java"/> </source> <actionRelation xsi:type="action:Calls" to="//@model.0/@codeElement.0/@codeElement.0/@codeElement.3" from="//@model.1/@codeElement.3/@codeElement.1"/> </codeElement> <actionRelation xsi:type="action:Calls" to="//@model.0/@codeElement.0/@codeElement.0/@codeElement.2" from="//@model.1/@codeElement.3"/> </codeElement> The string "example" and the invocation of "method3()" is listed. However, that "i" is a parameter to method2 is not included.