Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skeleton should reflect the exact overloaded called method #403

Closed
HDouss opened this issue Feb 28, 2020 · 23 comments
Closed

Skeleton should reflect the exact overloaded called method #403

HDouss opened this issue Feb 28, 2020 · 23 comments
Labels

Comments

@HDouss
Copy link
Contributor

HDouss commented Feb 28, 2020

Today, the skeleton reflects method calls by their name. For example, the skeleton for OverloadMethods.java have:

               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="(Ljava/lang/String;)D"
                       name="methodOne"
                       static="false"
                       visibility="public">
                  <args>
                     <arg type="Ljava/lang/String">?</arg>
                  </args>
                  <return>D</return>
                  <ops>
                     <op code="get">num</op>
                     <op code="put">num</op>
                     <op code="call">OverloadMethods.methodOne</op>
                  </ops>
               </method>
               <method abstract="false"
                       bridge="false"
                       ctor="false"
                       desc="(Ljava/lang/String;Ljava/lang/String;)D"
                       name="methodOne"
                       static="false"
                       visibility="public">
                  <args>
                     <arg type="Ljava/lang/String">?</arg>
                     <arg type="Ljava/lang/String">?</arg>
                  </args>
                  <return>D</return>
                  <ops>
                     <op code="get">num</op>
                     <op code="put">num</op>
                     <op code="call">OverloadMethods.methodOne</op>
                  </ops>
               </method>

The two calls are reported in <op code="call"> elements are OverloadMethods.methodOne and no information is given on which overloaded method is called. This is specially important to calculate LCOM4.

@0crat
Copy link
Collaborator

0crat commented Feb 28, 2020

@paulodamaso/z please, pay attention to this issue

@paulodamaso
Copy link
Collaborator

@HDouss You are proposing that we should add this information to skeleton?

@HDouss
Copy link
Contributor Author

HDouss commented Mar 6, 2020

@paulodamaso yes this information is clearly lacking. See the example in the ticket description. Looking to the skeleton, we don't know which method is called, we just know that its name is methodOne, but there are 4 methodOnes in the class.

@paulodamaso
Copy link
Collaborator

@HDouss Okay, thanks for the clarification

@paulodamaso
Copy link
Collaborator

@0crat in

@0crat
Copy link
Collaborator

0crat commented Mar 12, 2020

The job #403 assigned to @dgarus/z, here is why; the budget is 30 minutes, see §4; please, read §8 and §9; if the task is not clear, read this and this; there will be a monetary reward for this job

@0crat
Copy link
Collaborator

0crat commented Mar 17, 2020

@dgarus/z this job was assigned to you 5days ago. It will be taken away from you soon, unless you close it, see §8. Read this and this, please.

@dgarus
Copy link
Contributor

dgarus commented Mar 18, 2020

@HDouss @paulodamaso

@HDouss You are proposing that we should add this information to skeleton?

I've read the issue and links double and didn`t find what is this information.
Should I propose a new structure of tag or that structure already exists?

@dgarus
Copy link
Contributor

dgarus commented Mar 18, 2020

@0crat wait

@HDouss
Copy link
Contributor Author

HDouss commented Mar 18, 2020

@dgarus When analyzing a class and calculating its metric, jpeek starts by building a skeleton. The skeleton is an XML representation of the class, its method, its attributes, and the instructions in each method. For now, the skeleton produced contains the method calls instructions. These method calls instructions contains only the name of the called method. This is not enough to know which method is actually called, because many methods could have the same name.

@dgarus
Copy link
Contributor

dgarus commented Mar 18, 2020

@HDouss I got it but I asked

we should add this information to skeleton

"This information" is already described or I should propose a new structure to describe this information?

@HDouss
Copy link
Contributor Author

HDouss commented Mar 18, 2020

@HDouss I got it but I asked

we should add this information to skeleton

"This information" is already described or I should propose a new structure to describe this information?

@dgarus It is not described. The most important thing is that it exists. I could suggest this:

<op code="call">OverloadMethods.methodOne(Ljava/lang/String;Ljava/lang/String;)D</op>

or

<op code="call">
    <name>OverloadMethods.methodOne</name>
    <signature>(Ljava/lang/String;Ljava/lang/String;)D</signature>
</op>

@0crat 0crat added the waiting label Mar 18, 2020
@dgarus
Copy link
Contributor

dgarus commented Mar 18, 2020

@HDouss Ok, I got it. Thx!
I like your second variant.
I thought about this way

<op code="call">
    <name>OverloadMethods.methodOne</name>
    <args>
    	<arg type="Ljava/lang/String">?</arg>
    	<arg type="Ljava/lang/String">?</arg>
    </args>
</op>

It seems more formal. WDYT?

@HDouss
Copy link
Contributor Author

HDouss commented Mar 18, 2020

@dgarus agree. Note that this will have a rather big impact on the current metrics calculations. @paulodamaso What do you think?

@paulodamaso
Copy link
Collaborator

@HDouss I think that it would be a good idea. Which metrics will be affected by this change?

@HDouss
Copy link
Contributor Author

HDouss commented Mar 19, 2020

@paulodamaso it isn't the metrics, but the way to calculate them. Nearly every xsl file should be modified to adapt its xpath that selects called methods.

@0pdd
Copy link
Collaborator

0pdd commented Apr 1, 2020

@HDouss the puzzle #437 is still not solved.

@dgarus
Copy link
Contributor

dgarus commented Apr 1, 2020

@HDouss could you please close the issue?

@HDouss
Copy link
Contributor Author

HDouss commented Apr 2, 2020

@dgarus Thanks

@HDouss HDouss closed this as completed Apr 2, 2020
@0crat 0crat removed the waiting label Apr 2, 2020
@0crat
Copy link
Collaborator

0crat commented Apr 2, 2020

@sereshqua/z please review this job completed by @dgarus/z, as in §30; the job will be fully closed and all payments will be made when the quality review is completed

@0crat 0crat removed the scope label Apr 2, 2020
@sereshqua
Copy link

@0crat quality good

@0pdd
Copy link
Collaborator

0pdd commented Apr 29, 2020

@HDouss 2 puzzles #469, #470 are still not solved; solved: #437.

@0pdd
Copy link
Collaborator

0pdd commented Jun 29, 2020

@HDouss the puzzle #469 is still not solved; solved: #437, #470.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants