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

前端 未结 2 981
北荒
北荒 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:16

    I think you will have to write your own refactoring plugin. The tests for org.eclipse.jdt.ui.tests.refactoring are an interesting place to start.

    Some interesting reads on the topic:

    • http://www.eclipse.org/articles/article.php?file=Article-Unleashing-the-Power-of-Refactoring/index.html
    • http://www.eclipse.org/articles/Article-LTK/ltk.html
    0 讨论(0)
  • 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.

    0 讨论(0)
提交回复
热议问题