This case shows why Feature Envy refactoring cannot be reduced to
"find a target class and move the whole method." For
Segment.buildClassFile(int), the correct solution keeps
class-file assembly in Segment and moves only the
ClassBands-related data access logic. The baseline tools
therefore fail not only because validation rejects their results, but
also because their proposed transformations are structurally wrong.
MM-Assist: conflicting move
The IDEA Move Method conflict path is the key failure.
MM-Assist selects SegmentHeader in the forced
conflict-rescue path. This class owns header and default-version
metadata; it should not take over class-file assembly. During
execution, IDEA exposes private-member, visibility, and dependency
access conflicts. If "Refactor Anyway" is selected, the resulting
patch still fails the regression tests. MM-Assist therefore
reaches a refactoring workflow, but the destination is wrong and
the forced patch is not valid.
FETruth: non-actionable target
A target-class prediction is not an executable Ref-Plan.
FETruth predicts ClassConstantPool as the target
class. This destination reflects part of the constant-pool signal
inside the method, but FETruth still attempts to move the entire
buildClassFile(int) method. That would assign
class-file assembly to a constant-pool class and introduce reverse
dependencies on header, cpBands,
attrDefinitionBands, ClassBands, and
ClassFile. More importantly, this destination cannot
satisfy IDEA Move Method preconditions, so it cannot become an
executable refactoring.
SWE-agent: build failed
Free-form editing lacks refactoring precondition control.
SWE-agent uses free-form code editing, but it lacks a stable
refactoring boundary. A correct solution should preserve
Segment's assembly responsibility and move only the
ClassBands-related local logic. A free-form patch can
easily change both the assembly flow and the data-access logic,
breaking method dependencies. In the observed result, SWE-agent's
patch does not preserve buildability, so it fails before behavior
and smell-removal validation can accept it.
JDeodorant: no candidate
A fixed heuristic workflow has no viable operation here.
JDeodorant does not produce a viable candidate. Its fixed Feature
Envy / Move Method workflow is better suited to single-step method
moves, but this case requires a compositional
"Extract Method + Move Method + AST cleanup" plan. Because
JDeodorant cannot express that fine-grained Ref-Plan, it never
reaches an effective application and validation stage.