【发布时间】:2015-09-28 13:02:22
【问题描述】:
我尝试在 Eclipse IDE (JDT) 中执行以下重构步骤,但找不到所需的重构,并且不记得所有步骤的名称。我检查了SourceMacking 的重构,但没有找到正确的。
我们以下面的场景为例:
class A {
method(B b) {
doSomethingWithA();
b.doSomethingWithB();
}
[...]
}
class B {
[...]
}
1)制作方法static(缺少重构名称?):
class A {
static method(A a, B b) {
a.doSomethingWithA();
b.doSomethingWithB();
}
[...]
}
class B {
[...]
}
2) 移动方法:
class A {
[...]
}
class B {
static method(A a, B b) {
a.doSomethingWithA();
b.doSomethingWithB();
}
[...]
}
3) 转换为实例方法:
class A {
[...]
}
class B {
method(A a) {
a.doSomethingWithA();
doSomethingWithB();
}
[...]
}
因此,欢迎任何知道在 Eclipse 中逐步执行此操作或知道重构名称的人。目标是为每一步都提供 IDE 支持。
【问题讨论】:
标签: java eclipse ide refactoring eclipse-jdt