Open mkshiblu opened 3 years ago
@tsantalis what's the motivation behind className for case 2? Shouldn't it be ".A.main"? As in my opinion, it is technically declared inside method main and then passed to anoArg method as an argument.
If we stick to this same convention, is it safe to assume that for "passing as an argument" scenarios, we will use the callee functions name in the className similar as current concept?
The class names for anonymous classes was an attempt to make more a more human-readable path to locate the anonymous class from the refactoring descriptions. In Java anonymous classes are named with numbers, such as OuterClass$1
OuterClass$1$2
which will be impossible for humans to understand where the anonymous class is located in the file.
The idead for generating the human-readable path is to concatenate all simpleName identifiers that exist in the path to the root class. SimpleNames exist in method call names and variables.
Thanks for the clear explanation. We will stick to it
Case 1: When assigned to a variable (b) class name of m1() is
.A.main.b
Here the class name of the m1() method in RefactoringMiner is .A.main.b. Although JSR miner currently does not have classes, we need to check if the parent names of the container are being generated correctly.
Case 2: When passed as an argument to a function anoArg className of m1() is
..A.main.anoArg
Here the immediate container of m10 is set to as the function name of annoArg