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

Merge Conditional not shown in the diff #77

Open
tsantalis opened this issue Apr 20, 2023 · 4 comments
Open

Merge Conditional not shown in the diff #77

tsantalis opened this issue Apr 20, 2023 · 4 comments

Comments

@tsantalis
Copy link

tsantalis commented Apr 20, 2023

JetBrains/intellij-community@8d7a26e#diff-e65c0dd996f6794ca3aa6ae2e05c9666a944ad8d912b89f6e2f1a0660a2aab94L1176-L1182

We should check all new cases added in the oracle
tsantalis@d8bb59b#diff-6dacce79421f046bc43455a79cf254020e0880c9b86ed2f6242ef2b9943ac5fc

There is a Merge Conditional refactoring
Merge Conditional [if(getVirtualFile().isValid()), if(getVirtualFile() == null)] to return virtualFile == null || !virtualFile.isValid() ? null : virtualFile; in method public getData(dataId String) : Object from class com.intellij.openapi.vcs.history.FileHistoryPanelImpl
but the expressions of the if statements are not matched with the conditions of the ternary operator.

We should allow getter call getVirtualFile() to be replaced with variable SimpleName virtualFile and vice versa.

Screenshot from 2023-04-19 22-01-43

@tsantalis
Copy link
Author

tsantalis commented Apr 20, 2023

thymeleaf/thymeleaf@378ba37

Extract Variable structure : char[] in method public read(cbuf char[], off int, len int) : int from class org.thymeleaf.templateparser.reader.BlockAwareReader

Invert Condition if(!this.insideComment) to final char[] structure=(this.insideComment ? this.suffix : this.prefix); in method public read(cbuf char[], off int, len int) : int from class org.thymeleaf.templateparser.reader.BlockAwareReader

Screenshot from 2023-04-30 20-58-01

@tsantalis
Copy link
Author

tsantalis commented Apr 20, 2023

infinispan/infinispan@ce4f629

Split Conditional int localTopologyId=cacheTopology != null ? cacheTopology.getTopologyId() : -1; to [int localTopologyId=cacheTopology.getTopologyId();, if(cacheTopology == null)] in method public forwardCommandIfNeeded(command TopologyAffectedCommand, affectedKeys Set<Object>, origin Address) : Map<Address,Response> from class org.infinispan.statetransfer.StateTransferManagerImpl

Screenshot from 2023-04-30 21-01-16

@tsantalis
Copy link
Author

tsantalis commented Apr 20, 2023

jersey/jersey@d57b140

Extract Variable injectingLocator : ServiceLocator in method public inject(t Object, cc CreationalContext) : void from class org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider.Hk2InjectedCdiTarget

Screenshot from 2023-04-30 21-07-48

@tsantalis
Copy link
Author

tsantalis commented Apr 20, 2023

NLPchina/ansj_seg@913704e

Merge Conditional [return 1;, if(this.score < o.score)] to return this.score < o.score ? 1 : -1; in method public compareTo(o Keyword) : int from class org.ansj.app.keyword.Keyword

Merge Conditional [return -1;, if(this.score < o.score)] to return this.score < o.score ? 1 : -1; in method public compareTo(o Keyword) : int from class org.ansj.app.keyword.Keyword

Screenshot from 2023-04-30 21-11-42

pouryafard75 added a commit that referenced this issue Apr 29, 2023
Modify the matchers to enable the matching of composite and non-composite with GeneralMatcher

Better naming for the method
pouryafard75 added a commit that referenced this issue Apr 29, 2023
Modify the matchers to enable the matching of composite and non-composite with GeneralMatcher

Better naming for the method
tsantalis pushed a commit to tsantalis/RefactoringMiner that referenced this issue May 1, 2023
Modify the matchers to enable the matching of composite and non-composite with GeneralMatcher

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

No branches or pull requests

1 participant