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

Invalid Change History - org.eclipse.jgit/src/org.eclipse.jgit.api.PullCommand#call()$if(232-235) #130

Open
flozender opened this issue Feb 6, 2023 · 4 comments
Labels
history-attached The correct expected changes from the oracle are appended to the issue incorrect-mapping Code element is mapped to a wrong element

Comments

@flozender
Copy link
Collaborator

flozender commented Feb 6, 2023

In commit 0210e0e299bed69176e0a929d0b67f3cf9fb1e37 and file org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java, element org.eclipse.jgit/src/org.eclipse.jgit.api.PullCommand#call()$if(280-283) was tracked.

This code element is mapped to code element org.eclipse.jgit/src/org.eclipse.jgit.api.PullCommand#call()$if(232-235) in commit db55d13f5f4b641a9390076ced6b1775bcfcd6f6 as the next change in history, however, it should be matched with org.eclipse.jgit/src/org.eclipse.jgit.api.PullCommand#call()$if(192-192) in the same commit and file.

Oracle filename: jgit-PullCommand-call-IF_STATEMENT-9.json

@flozender flozender added the incorrect-mapping Code element is mapped to a wrong element label Feb 6, 2023
@flozender
Copy link
Collaborator Author

flozender commented Feb 6, 2023

Correct change history:

"expectedChanges": [
    {
      "parentCommitId": "2160c09dd4f678c5f2f8e730945be637210b39de",
      "commitId": "db55d13f5f4b641a9390076ced6b1775bcfcd6f6",
      "commitTime": 1286546248,
      "changeType": "introduced",
      "elementFileBefore": "org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java",
      "elementNameBefore": "org.eclipse.jgit/src/org.eclipse.jgit.api.PullCommand#call()$if(192-195)",
      "elementFileAfter": "org.eclipse.jgit/src/org/eclipse/jgit/api/PullCommand.java",
      "elementNameAfter": "org.eclipse.jgit/src/org.eclipse.jgit.api.PullCommand#call()$if(192-195)",
      "comment": "added with method"
    }
  ]

@flozender flozender added the history-attached The correct expected changes from the oracle are appended to the issue label Jul 27, 2023
@tsantalis
Copy link
Collaborator

tsantalis commented Oct 16, 2023

@flozender
There are two identical statements in the method.

if (monitor.isCancelled())
			throw new CanceledException(MessageFormat.format(
					JGitText.get().operationCanceled,
					JGitText.get().pullTaskName));

At some point, these two should have been matched incorrectly one with the other and vice-versa.
But I cannot find in which commit this happened.
I debugged commit-by-commit up to https://github.com/flozender/jgit/commit/770c733687d9f2f71f30822f9691427bf83b7577
but I didn't find any issue.
Can you help to find this problematic commit?

@flozender
Copy link
Collaborator Author

flozender commented Oct 16, 2023

@tsantalis

Yes, the problematic commit is 7668a46.

The mapping here is (leftBlock <--> rightBlock):

if(232-235)<0544c9a> <--> if(198-201)<7668a46>

Hope this helps!

@tsantalis
Copy link
Collaborator

Screenshot from 2023-10-18 00-14-56

Screenshot from 2023-10-18 00-16-48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
history-attached The correct expected changes from the oracle are appended to the issue incorrect-mapping Code element is mapped to a wrong element
Projects
None yet
Development

No branches or pull requests

2 participants