| Summary: | [Java-KDM] missing code elements while transforming from java code model to KDM model | ||
|---|---|---|---|
| Product: | [Modeling] MoDisco | Reporter: | Suhrit Rimal <rimalsuhrit> |
| Component: | Technologies | Assignee: | Project Inbox <modisco.web-inbox> |
| Status: | NEW --- | QA Contact: | |
| Severity: | major | ||
| Priority: | P5 | CC: | barbier.gabriel, fabien.giquel, gdupe, nicolas.bros, rimalsuhrit |
| Version: | 0.9.0 | Flags: | gdupe:
kepler+
|
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Hello, I've added a test to check this bug. It is available in svn at revision 4019. And located in tests/org.eclipse.gmt.modisco.java.discoverer.tests There is specific resources in "workspace" folder, the test class is JavaProject2KdmTest. Regards Gabriel Thanx will post regarding further progress soon. (In reply to comment #1) > Hello, > I've added a test to check this bug. It is available in svn at revision 4019. > > And located in tests/org.eclipse.gmt.modisco.java.discoverer.tests > > There is specific resources in "workspace" folder, the test class is > JavaProject2KdmTest. > > Regards > Gabriel I commit a small fix on new Junit test and AllTest class. (In reply to comment #3) > I commit a small fix on new Junit test and AllTest class. I applied the same fix on "org.eclipse.modisco.java.discoverer.tests" in revision 4030. I'm really sorry, but to guaranty maintainability of MoDisco (and EMF Facet) we have to focus this year on the move to EMF Facet. That's why I cannot plan this bug for Juno (of course if someone provides the fix we will commit it). This kind of bug will come back on the top just after the move to EMF Facet. Regards, Gregoire Dupe |
I installed Indigo and Modisco 9. When I compare helios+8.X model and indigo +9.0 model its same. I think some information gets lost in KDM model when being trasnformed from Java Model. I am using following code: public class test { public void echo(){ String message = "hello"; String newMessage ="world"; System.out.println(message+newMessage); } } In Java Model What I can see is that message and newMessage gets add the information is still there but when it comes to KDM Model Information gets lost. I tried different variation. If inside println function we keep direct string something like System.out.println("hello"+"world"); the information is preserved but variables are never there even if it is direct string + some variable. Seecorresponding JavaCodeModel and KDM Model. JavaCodeModel <statements xsi:type="java:ExpressionStatement" originalCompilationUnit="//@compilationUnits.0"> <expression xsi:type="java:MethodInvocation" originalCompilationUnit="//@compilationUnits.0" method=" //@ownedElements.1/@ownedPackages.1/@ownedElements.1/@bodyDe clarations.0 "> <arguments xsi:type="java:InfixExpression" originalCompilationUnit="//@compilationUnits.0" operator="+"> <rightOperand xsi:type="java:SingleVariableAccess" variable=" //@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@bod y/@statements.1/@fragments.0 "/> <leftOperand xsi:type="java:SingleVariableAccess" variable=" //@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@bod y/@statements.0/@fragments.0 "/> </arguments> <expression xsi:type="java:SingleVariableAccess" variable=" //@ownedElements.1/@ownedPackages.0/@ownedElements.3/@bodyDe clarations.0/@fragments.0 "> <qualifier xsi:type="java:TypeAccess" type="//@ownedElements.1/@ownedPackages.0/@ownedElements.3"/ > </expression> </expression> </statements> KDM model: <codeElement xsi:type="action:ActionElement" name="expression statement" kind="expression statement"> <source language="java"> <region file="//@model.2/@inventoryElement.0" language="java"/> </source> <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="action:ActionElement" name="+" kind="infix expression"> <source language="java"> <region file="//@model.2/@inventoryElement.0" language="java"/> </source> </codeElement> <actionRelation xsi:type="action:Calls" to=" //@model.1/@codeElement.0/@codeElement.1/@codeElement.1/@cod eElement.0 " from=" //@model.0/@codeElement.0/@codeElement.0/@codeElement.0/@cod eElement.1/@codeElement.2/@codeElement.0 "/> </codeElement> </codeElement> Well I dont know whether its a bug or KDM is just not meant to hold that much of information. If I change message to "hello" inside function println I can see following things: Java Code: System.out.println("hello"+newMessage); Java Model: <statements xsi:type="java:ExpressionStatement" originalCompilationUnit="//@compilationUnits.0"> <expression xsi:type="java:MethodInvocation" originalCompilationUnit="//@compilationUnits.0" method=" //@ownedElements.1/@ownedPackages.1/@ownedElements.1/@bodyDe clarations.0 "> <arguments xsi:type="java:InfixExpression" originalCompilationUnit="//@compilationUnits.0" operator="+"> <rightOperand xsi:type="java:SingleVariableAccess" variable=" //@ownedElements.0/@ownedElements.0/@bodyDeclarations.0/@bod y/@statements.1/@fragments.0 "/> <leftOperand xsi:type="java:StringLiteral" originalCompilationUnit="//@compilationUnits.0" escapedValue=""hello""/> </arguments> <expression xsi:type="java:SingleVariableAccess" variable=" //@ownedElements.1/@ownedPackages.0/@ownedElements.3/@bodyDe clarations.0/@fragments.0 "> <qualifier xsi:type="java:TypeAccess" type="//@ownedElements.1/@ownedPackages.0/@ownedElements.3"/ > </expression> </expression> </statements> KDM MOdel <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="action:ActionElement" name="+" kind="infix expression"> <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=""hello""> <source language="java"> <region file="//@model.2/@inventoryElement.0" language="java"/> </source> </codeElement> </codeElement> <actionRelation xsi:type="action:Calls" to=" //@model.1/@codeElement.0/@codeElement.1/@codeElement.1/@cod eElement.0 " from=" //@model.0/@codeElement.0/@codeElement.0/@codeElement.0/@cod eElement.1/@codeElement.2/@codeElement.0 "/> </codeElement> SO my thoughts are that there is CodeElement missing for newMessage storable unit where infix operation is performed.