Is there a way to apply a refactoring script just for its side-effects?

前端 未结 2 1002
北荒
北荒 2021-02-02 00:43

I\'ve got a library that was changed to introduce a factory method to replace a constructor (the reasons aren\'t important right now, in the current case it was for improved typ

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-02 01:22

    This is not a way to apply refactoring to callers only but it may get you past your problem.

    Would it be possible to add to your project a fake MyContainer.java file that has the same signatures as that in the library, apply your refactoring and then discard the java file? You could even use decompiled soure, though you might have to generify it yourself.

提交回复
热议问题