RefactoringMiner icon indicating copy to clipboard operation
RefactoringMiner copied to clipboard

Missing statement mapping (Extract And Move Method)

Open pedramnoori opened this issue 2 years ago • 0 comments

Problem

Two statement mapping are missing within the bodyMapper of an Extract and Move Method refactoring

Commit

Here

Refactoring

Extract And Move Method public serialize(gen JsonGenerator, value Object, prov DefaultSerializerProvider) : void extracted from private _writeCloseable(gen JsonGenerator, value Object, cfg SerializationConfig) : void in class com.fasterxml.jackson.databind.ObjectWriter & moved to class com.fasterxml.jackson.databind.ObjectWriter.Prefetch

Explanation

Within the bodyMapper of the aforementioned refactoring (there are two other similar refactoring in this commit, within them the problem is the same), one pair of statements reported in non-mapped leaves and one pair reported in non-mapped nodes, which they should be matched together:

First (leaves):

  • _serializerProvider(cfg).serializePolymorphic(gen,value,_prefetch.rootType,_prefetch.typeSerializer); Line 1120 parent
  • prov.serializePolymorphic(gen,value,rootType,valueSerializer,typeSerializer); Line 1440 child

Second (nodes along with the corresponding blocks):

  • if(_prefetch.typeSerializer != null) Line 1119 parent
  • if(typeSerializer != null) Line 1439 child

pedramnoori avatar Apr 04 '23 17:04 pedramnoori