Open pouryafard75 opened 8 months ago
@pouryafard75 Is it possible to fix this issue on our side?
@tsantalis It is possible, However this will make tools incompatible.
Can we make a PR to gumtree? but then they need to make a new maven release. The incompatibility is not a problem, because we have 3.0.3 as compatible release.
@tsantalis All the perfect diffs at the moment, work based on 3.0 tree structure. I assume around 200 cases might need change if we change the structure!
@pouryafard75 Could we submit a PR resolving the issue opened at Gumtree repository, now that the issue has been checked by Jean-Rémy?
@tsantalis I did these two commits to resolve the issue: fix: add typeArguments subtrees to the receiver of the method invocation for jdt add test for typeArguments of the method invocation in jdt
I have also tested the diff to ensure the correctness:
@tsantalis PR submitted https://github.com/GumTreeDiff/gumtree/pull/327
@pouryafard75
SuperMethodInvocation
has type arguments too. Can we update the PR to handle this case?
SuperMethodInvocation: [ ClassName . ] super . [ < Type { , Type } > ] Identifier ( [ Expression { , Expression } ] )
@pouryafard75
ClassInstanceCreation
has type arguments too.
ClassInstanceCreation: [ Expression . ] new [ < Type { , Type } > ] Type ( [ Expression { , Expression } ] ) [ AnonymousClassDeclaration ]
@pouryafard75
SuperMethodInvocation
has type arguments too. Can we update the PR to handle this case?SuperMethodInvocation: [ ClassName . ] super . [ < Type { , Type } > ] Identifier ( [ Expression { , Expression } ] )
@tsantalis
super.<String>emptyList();
--->
SuperMethodInvocation [35,60]
SimpleType [42,48]
SimpleName: String [42,48]
SimpleName: emptyList [49,58]
this.<String>emptyList();
--->
MethodInvocation [35,59]
METHOD_INVOCATION_RECEIVER [35,39]
ThisExpression [35,39]
SimpleType [41,47]
SimpleName: String [41,47]
SimpleName: emptyList [48,57]
This is default GumTree 3.0 output, They dont override the visitor for these ASTNodes, Method invocation is the only one which has been overwritten.
ClassInstanceCreation
@tsantalis Can you give me an example for this here?
new A().<String>emptyList();
-->
MethodInvocation [35,62]
METHOD_INVOCATION_RECEIVER [35,42]
ClassInstanceCreation [35,42]
SimpleType [39,40]
SimpleName: A [39,40]
SimpleType [44,50]
SimpleName: String [44,50]
SimpleName: emptyList [51,60]
If you meant this, its already supported.
new A().<String>emptyList()
This is a method invocation with class instance creation as receiver.
The case I am talking about looks like
new <Category> Payload(arg1, arg2)
@tsantalis Thanks for the clarification.
new <Category> Payload(arg1, arg2);
-->
ClassInstanceCreation [35,69]
SimpleType [40,48]
SimpleName: Category [40,48]
SimpleType [50,57]
SimpleName: Payload [50,57]
SimpleName: arg1 [58,62]
SimpleName: arg2 [64,68]
Case: https://github.com/pouryafard75/TestCases/commit/58b8350a98ed4f93e2410a080fa011aa3158aeee
Due to the dependency to gumtree 3.0 jdt tree generator, the differences are not highlighted:
Surprisingly, 2.1 tree generator contains this information: