Skip to content

Commit

Permalink
Eliminate calls within exact mappings when searching for Move+Inline
Browse files Browse the repository at this point in the history
dbeaver/dbeaver@fc41746
False refactoring:
Move And Inline Method	public getContext() : SQLCompletionContext moved from class org.jkiss.dbeaver.model.sql.completion.SQLCompletionProposalBase to class org.jkiss.dbeaver.model.sql.semantics.completion.SQLQueryCompletionContext & inlined to public prepare(scriptItem SQLScriptItemAtOffset, requestOffset int, dbcExecutionContext DBCExecutionContext, syntaxInspectionResult LSMInspections.SyntaxInspectionResult, context SQLQueryDataContext, lexicalItem SQLQueryLexicalScopeItem, nameNodes STMTreeTermNode[], hasPeriod boolean) : SQLQueryCompletionContext
  • Loading branch information
tsantalis committed Dec 24, 2024
1 parent b8d499c commit 31e727e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/gr/uom/java/xmi/diff/UMLModelDiff.java
Original file line number Diff line number Diff line change
Expand Up @@ -3807,6 +3807,19 @@ private void checkForMovedAndInlinedOperations(List<UMLOperationBodyMapper> mapp
removedOperationInvocations.add(invocation);
}
}
for(AbstractCodeMapping mapping : mapper.getMappings()) {
if(mapping.isExact() && mapping.getReplacementsInvolvingMethodInvocation().isEmpty()) {
for(AbstractCall invocation : mapping.getFragment1().getMethodInvocations()) {
for(ListIterator<AbstractCall> iterator = removedOperationInvocations.listIterator(); iterator.hasNext();) {
AbstractCall matchingInvocation = iterator.next();
if(invocation == matchingInvocation || invocation.actualString().equals(matchingInvocation.actualString())) {
iterator.remove();
break;
}
}
}
}
}
if(removedOperationInvocations.size() > 0) {
for(AbstractCall removedOperationInvocation : removedOperationInvocations) {
if(!invocationMatchesWithAddedOperation(removedOperationInvocation, mapper.getContainer1(), mapper.getClassDiff(), mapper.getContainer2().getAllOperationInvocations())) {
Expand Down

0 comments on commit 31e727e

Please sign in to comment.