Consider a wrapper class W, wrapping C, this meaning that for most attributes of C, there is a correspondent attribute A on W, its logic consisting in nothing more than delegation to C‘s A. This situation can be most precisely depicted with the sketch shown below:
class W {
private C c;
getX() { return c.getX(); }
getY() { return c.getY(); }
}
The trouble is that I’ve decided that I wan’t to get rid of getX(), and I’d prefer to either as a transitory step to put C c as public, having all the calling code of W do a w.c.getX() or w.c.getY() or alternatively to put create a W.getC(), and have all calls to getX() and getY() go through it.
What this all boils down is to an “un-encapsulate” refactoring. Is there anything performing this much needed task either in Eclipse or Intellij?
getC()method.getX()to bereturn getC().getX().getX().The same goes for
y.