-
Notifications
You must be signed in to change notification settings - Fork 140
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
Does not show all deleted files on a PR #715
Comments
There is an inner class in To me is seems that many classes were extracted from VM.java to their own files, @pouryafard75 |
These are all the class refactorings reported by the tool
From this I can conclude that only the inner class |
With the last UI updates, it is more clear now where is |
@koppor |
@koppor |
@koppor Extract Class |
After the last update, there are 3 additional diffs you can inspect. The new ones: Clearly, |
Interesting. Yes, basically I splitted some of the classes, but... |
TestVM.java → BstFunctionsTest.java #715
@koppor @calixtus Some of the interesting findings: Also many of the tests have been renamed, which makes it more challenging for our tool. I think the improvements we made can help to understand better the changes. I just pushed a new Docker image, if you want to check the improvements. |
Thank you for the continuous improvement here. We are trying to use RM now to check whether the ANTLR4 port of that PR can be fixed or if we need to switch back to ANTLR3 to keep our BibTeX BSTVM working. |
Currently, we don't highlight inline comments, because they are not part of the AST. But this comment is deleted. |
@koppor The comments have become the javadoc of these methods. Our tool can actually detect this kind of refactoring (Extract and Move Method), Where is the following method called in the PR? |
@koppor and This is a kind of indirect Extract and Move Method, which our tool does not currently support. |
The solution was to fix two issues:
public Integer visitBstFunction(BstParser.BstFunctionContext ctx) {
String name = ctx.getChild(0).getText();
- if (bstVMContext.functions().containsKey(name)) {
- bstVMContext.functions().get(name).execute(this, ctx, selectedBstEntry);
- } else {
- visit(ctx.getChild(0));
- }
-
+ LOGGER.trace("Resolving name {} at visitBstFunction", name);
+ resolveIdentifier(name, ctx);
I "wild guess" fixed it at. - if (startI < 0) {
- startI += s.length() + 1;
- startI = Math.max(1, (startI + 1) - lenI);
+ if (start < 0) {
+ int endOneBased = string.length() + start + 1;
+ start = Math.max(1, endOneBased - length + 1);
+ length = endOneBased - start + 1;
+ } Full PR: JabRef/jabref#11304 Spontaneous thought. If RefactoringMinor would filter out moves and semantically equal rewrites, I could investigate the real new code and think. Maybe, I would have found the issue at For a support of |
Oh, OK. I am somehow used to the OpenRewrite AST, which has explicit offers for comments (org.openrewrite.java.tree.J#getComments) (J.java)
It appears slightly modified (last line got an HTML tag) at org.jabref.logic.bst.BstFunctions.BstCallTypeFunction. |
the same interface (issue #715) Move And Rename Method public execute(context BstEntry) : void from class org.jabref.logic.bst.FormatNameFunction to private bstFormatName(visitor BstVMVisitor, ctx ParserRuleContext) : void from class org.jabref.logic.bst.BstFunctions Move And Rename Method public execute(context BstEntry) : void from class org.jabref.logic.bst.WidthFunction to private bstWidth(visitor BstVMVisitor, ctx ParserRuleContext) : void from class org.jabref.logic.bst.BstFunctions Move And Rename Method public execute(context BstEntry) : void from class org.jabref.logic.bst.PurifyFunction to private bstPurify(visitor BstVMVisitor, ctx ParserRuleContext) : void from class org.jabref.logic.bst.BstFunctions Move And Rename Method public execute(context BstEntry) : void from class org.jabref.logic.bst.ChangeCaseFunction to private bstChangeCase(visitor BstVMVisitor, ctx ParserRuleContext) : void from class org.jabref.logic.bst.BstFunctions Move And Rename Method public execute(context BstEntry) : void from class org.jabref.logic.bst.TextPrefixFunction to private bstTextPrefix(visitor BstVMVisitor, ctx ParserRuleContext) : void from class org.jabref.logic.bst.BstFunctions
Extract And Move Method public execute(visitor BstVMVisitor, ctx ParserRuleContext, bstEntry BstEntry) : void extracted from private VM(tree CommonTree) in class org.jabref.logic.bst.VM & moved to class org.jabref.logic.bst.BstFunctions.BstAssignFunction Inline Method private assign(context BstEntry, o1 Object, o2 Object) : boolean inlined to public execute(visitor BstVMVisitor, ctx ParserRuleContext, bstEntry BstEntry) : void in class org.jabref.logic.bst.BstFunctions.BstAssignFunction
throw new VMException("Can only compare two integers with <"); throw new BstVMException("Can only compare two integers with < (line %d)".formatted(ctx.start.getLine()));
Inline Method private assign(context BstEntry, o1 Object, o2 Object) : boolean inlined to public execute(visitor BstVMVisitor, ctx ParserRuleContext, bstEntry BstEntry) : void in class org.jabref.logic.bst.BstFunctions.BstAssignFunction is reported now as Move And Inline Method private assign(context BstEntry, o1 Object, o2 Object) : boolean moved from class org.jabref.logic.bst.VM to class org.jabref.logic.bst.BstFunctions.BstAssignFunction & inlined to public execute(visitor BstVMVisitor, ctx ParserRuleContext, bstEntry BstEntry) : void
@koppor @calixtus @pouryafard75 We have done a huge progress on improving the diff quality for this PR. All following classes had one of their methods moved to We also use a different icon and arrow to differentiate between a file being moved/renamed itself, |
The commit causes test to fail. Test needs to be updated. liferay/liferay-portal@59fd9e6
The Javadoc is moved from a deleted class (issue #715)
I wanted to work on JabRef/jabref#8934 and to see if there is some easy fix for a bug introduced there. The GitHub diff (https://github.com/JabRef/jabref/pull/8934/files) doesn't help much.
However, RefactoringMiner does not show all files deleted.
VM.java
is shown deleted on GitHub, but not shown by RefactoringMiner at all (or do I overlook something)?The text was updated successfully, but these errors were encountered: