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

Replacement Inaccuracy #465

Open
pedramnoori opened this issue May 8, 2023 · 0 comments
Open

Replacement Inaccuracy #465

pedramnoori opened this issue May 8, 2023 · 0 comments

Comments

@pedramnoori
Copy link

Problem

Replacement inaccuracy within four Extract and Move Method refactorings

Commit

bitcoinj/bitcoinj@1260265

Refactorings

1- Extract And Move Method public getSerializer(parseLazy boolean, parseRetain boolean) : BitcoinSerializer extracted from public testLazyParsing() : void in class org.bitcoinj.core.BitcoinSerializerTest & moved to class org.bitcoinj.params.AbstractBitcoinNetParams

2- Extract And Move Method public getSerializer(parseLazy boolean, parseRetain boolean) : BitcoinSerializer extracted from private testCachedParsing(lazy boolean) : void in class org.bitcoinj.core.BitcoinSerializerTest & moved to class org.bitcoinj.params.AbstractBitcoinNetParams

3- Extract And Move Method public getSerializer(parseLazy boolean, parseRetain boolean) : BitcoinSerializer extracted from public testBlock(blockBytes byte[], isChild boolean, lazy boolean, retain boolean) : void in class org.bitcoinj.core.LazyParseByteCacheTest & moved to class org.bitcoinj.params.AbstractBitcoinNetParams

4- Extract And Move Method public getSerializer(parseLazy boolean, parseRetain boolean) : BitcoinSerializer extracted from public testTransaction(params NetworkParameters, txBytes byte[], isChild boolean, lazy boolean, retain boolean) : void in class org.bitcoinj.core.LazyParseByteCacheTest & moved to class org.bitcoinj.params.AbstractBitcoinNetParams

Description

There is one similar statement mapping within the aforementioned refactorings, which is as follows:

BitcoinSerializer bs=new BitcoinSerializer(MainNetParams.get(),true,false);
Mapped with:
return new BitcoinSerializer(this,parseLazy,parseRetain);

There should be three replacements about the BitconSerializer constructor's arguments corresponding the above mentioned mapping. But, RefactoringMiner reported inaccurate replacements, which caused PurityChecker fail to report this change as a pure modification. The reported inaccurate replacements by RefactoringMiner are as follows:

replacements

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