标签:out sys 重构 omd 重命名 stat rename oid alc
private String bcd;//光标在bcd处,按Shift+F6,改为lastname
public String getFullName(String abc){//光标在abc处,按Shift+F6,改为firstname
System.out.println("your firstname: "+abc);
System.out.println("your lastname: "+this.bcd);
String fullName=abc+this.bcd;
System.out.println("your fullname: "+fullName);
this.sayHello(abc);
return fullName;
}
private String lastname;
public String getFullName(String firstname){
System.out.println("your firstname: "+firstname);
System.out.println("your lastname: "+this.lastname);
String fullName=firstname+this.lastname;
System.out.println("your fullname: "+fullName);
this.sayHello(firstname);
return fullName;
}
public String getFullName(String firstname){
//
this.sayHello(firstname);//2.此处出现红波浪,手动添加,lastname
//
}
private void sayHello(String firstname) {//1.在此处按Ctrl+F6 ,即出现一个弹框,在里面点+,输入String lastname即可
}
public String getFullName(String firstname){
//
this.sayHello(firstname);//1.此处添加,lastname,按下Alt+Enter,选择Add String as 2nd parameter to method sayHello
//
}
private void sayHello(String firstname) {//2.此处自动变为private void sayHello(String firstname, String lastname)
}
public void foo(){
getFullname("san");//光标放在san上,Ctrl+Alt+v, replace all 6 occurrebces
getFullname("san");
getFullname("san");
getFullname("san");
getFullname("san");
getFullname("san");
}
public void foo(){
String lastname = "san";
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
}
public void foo(){
getFullname("san");//光标放在san上,Ctrl+Alt+c, replace all 6 occurrebces
getFullname("san");
getFullname("san");
getFullname("san");
getFullname("san");
getFullname("san");
}
public static final String LASTNAME = "san";
public void foo(){
getFullname(LASTNAME);
getFullname(LASTNAME);
getFullname(LASTNAME);
getFullname(LASTNAME);
getFullname(LASTNAME);
getFullname(LASTNAME);
}
public void foo(){
getFullname("san");//光标放在san上,Ctrl+Alt+f, replace all 6 occurrebces
getFullname("san");
getFullname("san");
getFullname("san");
getFullname("san");
getFullname("san");
}
private String lastname;
public void foo(){
lastname = "san";
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
getFullname(lastname);
}
private String firstName;
private String getFullname(String lastName) {
String fullName= this.firstName +","+lastName;//光标放在firstName,Ctrl+Alt+p
return fullName;
}
public void foo(){
getFullname("san");
}
private String firstName;
private String getFullname(String lastName, String firstName) {
String fullName= firstName +","+lastName;
return fullName;
}
public void foo(){
getFullname("san", this.firstName);
}
public void foo(){
step1();
step2();//选中他俩,按Ctrl+Alt+m,在弹框中输入validate
step3();
step4();//选中他俩,按Ctrl+Alt+m,在弹框中输入loadDataFromDB
step5();
step6();//选中他俩,按Ctrl+Alt+m,在弹框中输入calc
}
public void foo(){
validate();//校验参数
loadDataFromDB();//数据库加载数据
calc();//逻辑运算
}
private void calc() {
step5();
step6();
}
private void loadDataFromDB() {
step3();
step4();
}
private void validate() {
step1();
step2();
}
标签:out sys 重构 omd 重命名 stat rename oid alc
原文地址:https://www.cnblogs.com/chanaichao/p/9254625.html