pouryafard75 / RM-ASTDiff

MIT License
2 stars 1 forks source link

Merge Conditional not shown in the diff #77

Open tsantalis opened 1 year ago

tsantalis commented 1 year ago

https://github.com/JetBrains/intellij-community/commit/8d7a26edd1fedb9505b4f2b4fe57b2d2958b4dd9#diff-e65c0dd996f6794ca3aa6ae2e05c9666a944ad8d912b89f6e2f1a0660a2aab94L1176-L1182

We should check all new cases added in the oracle https://github.com/tsantalis/RefactoringMiner/commit/d8bb59b25d0409e8ab07fa7e1b2495b371334c9b#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 commented 1 year ago

https://github.com/thymeleaf/thymeleaf/commit/378ba37750a9cb1b19a6db434dfa59308f721ea6

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 commented 1 year ago

https://github.com/infinispan/infinispan/commit/ce4f6292d6350a2c6b82d995352fdf6d07042c9c

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 commented 1 year ago

https://github.com/jersey/jersey/commit/d57b1401f874f96a53f1ec1c0f8a6089ae66a4ce

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 commented 1 year ago

https://github.com/NLPchina/ansj_seg/commit/913704e835169255530c7408cad11ce9a714d4ec

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