moosetechnology / Famix

An abstract representation of source code. Famix is generic and can describe applications in multiple programming languages.
MIT License
12 stars 22 forks source link

Example method is not FamixJavaParametricMethod according to the documentation #786

Open fuhrmanator opened 2 weeks ago

fuhrmanator commented 2 weeks ago

In the test test3 (which is helpful for documentation) there is an example Java method private void method(Integer num, String s, V v) {} that is then modeled using FamixJavaParametricMethod.

https://github.com/moosetechnology/Famix/blob/5eddf959cba61451e5859a94e68ab65a2dd2d897/src/Famix-Java-Tests/FamixJavaParametricTest.class.st#L53-L76

However, it seems that since the V (modeled as FamixJavaParameterType) comes from the class definition, it implies that the type for V would always be the same in that method of the class. As such, it is (just) a FamixJavaMethod.

The distinction is pointed out in the blog at https://modularmoose.org/posts/2023-07-13-parametric under the heading "Generic method".

Perhaps test3 could include both the non-generic method (renamed to methodNotParametric and a truly generic one, e.g., public <V> methodParametric(V v) {}, following the example of the blog.

(Apologies if I assigned the wrong Gabriel)