�� ������ ��ſ��� Pull Members Up �����丵 ��ɿ� ���� �������� overview �� how �� �����丵�� IntelliJ IDEA���� ���� �� �ִ°��� �����մϴ�.
Pull Members Up �����丵 ����� Ŭ���� ����� ����Ŭ���� �Ǵ� �������̽��� �̵��ϴ� ���� ������ݴϴ�.
���� ���, ����� ���� �ڵ带 �����ϴ�:
public class ClassParent {
void method1(){
//some code here
}
}
public class ClassChild extends ClassParent {
void method1() {
//some code here
}
void method2() {
//some code here
}
}
�׸��� ����� method2�� �θ� Ŭ������ �̵��� �ʿ䰡 �ֽ��ϴ�. ����� �ڵ��� �����丵 ���� �̰�ó�� ���� ���Դϴ�:
public class ClassParent {
void method1(){
//some code here
}
void method2() {
//some code here
}
}
public class ClassChild extends ClassParent {
void method1() {
//some code here
}
}
����� ����ø��� ��
|
Ŭ���� ����� ����ø��� ���ؼ�:
1. ������ �Ǵ� Project View / Commander ���� ����� ����ø� �ʿ䰡 �ִ� ����� �ø��� Ŭ���� ���� ij���� �����ϰ� ���� �޴� �Ǵ� ������ ��ư�� Ŭ���ϴ� �Ϳ� ���� �ҷ����� �˾� �޴����� Refactor
| Pull
Members Up... �� Ŭ���Ͻʽÿ�.
2. ����� Pull Members Up ���̾�α׸� �� �� �Դϴ�.

Pull up members
of a <package_name>.<class_name> to:
|
���-�ٿ� �ڽ����� ����� ���õ� Ŭ���� ����� ����ø��� Ŭ����/�������̽��� ������ �� �ֽ��ϴ�.
|
����÷����� ���
|
�� �г��� ���� Ŭ����, �������̽�, �ʵ�� �޼ҵ带 �����ϴ� ���� ����÷����� ��� Ŭ���� ����� ����� �����ݴϴ�.
����� ����ø��� ����, ����� �� ���ʿ��� üũ �ڽ��� �����ؾ߸� �մϴ�.
���� ����� �޼ҵ��� �������� �����ϴ� üũ �ڽ��� ǥ���ϸ�, ���� �÷����� �޼ҵ�� ���� Ŭ����/�������̽����� �߻����μ� ����� �� �ֽ��ϴ�. �׷���, ���� ����� �������̽��� ����� ����ø��� �� üũ �ڽ��� ���õǰ�, �Ұ����ϰ� �ϰ� �˴ϴ�.
���� ��� ������ ������ �ʷ��� ������ �ִٸ�, ����� Ư���� ���� ǥ�� Ư¡�� ���� ������ ���Դϴ�.
�����丵�� ��������� ���������� � ������ �������� �� ��, ����� �Ķ� ������� ��ũ�� ������ �� �Դϴ�. ���� ǥ�ð� �ִ� ��� ���� ǥ�ô� ���� ��Ȳ�� ��ġ�Ǹ�, �����丵�� ����ǰ� �� �Ŀ� ������ ��Ȯ�� ��Ÿ�� ���� ���� �����մϴ�.
���� ����� �����丵 ���μ����� ����ϱ�� �����ϸ� ��ſ��� Problems
Detected ���̾�αװ� ������Ʈ �� ���Դϴ�.

�����丵(�׷��� ��� �ڵ�� ������ ���� ���� ���Դϴ�)�� �����ϱ� ���� Continue �� �����ϴ�. �Ǵ� �ʿ��� ������ �ϱ� ���ؼ� Pull Members Up ���̾�α׷� ���ư��� ���ؼ� Cancel
�� �����ϴ�
������ ��� ������ �������� ������ ������ ���� ����, �װ� ������ ���콺 �����͸� ������Ű�ʽÿ�.
���� ������ �ִ� �˾� �޽����� ��Ÿ�� ���Դϴ�.

|
Javadoc for abstracts
|
����� �����ϴ� Javadoc �ڸ�Ʈ�� ������ �߻� �޼ҵ带 ����ø� �� ����� �Ƹ��� �װ͵��� �ٷ�⸦ ���ϴ� �� ����� ������ �� �Դϴ�.
����� As
is�� �����ϴ� ������ Ŭ�������� �װ͵��� ���� �� �ֽ��ϴ�, �Ǵ� �װ͵��� Copy�� �����ϴ� ���� Ŭ����/�������̽��� �װ͵��� �����ϰų� �Ǵ� Move �� ������ �ű⿡�� �װ͵��� �̵��� �� �ֽ��ϴ�.
|
|
����� ��� ����� ����÷������� ������ �Ŀ�, �׷��� � ������ �߰����� �ʾҽ��ϴ�, �����丵�� �����ϱ� ���� OK�� Ŭ���Ͻʽÿ�.
����� �����ڿ��� �ʱ�È�� �ʵ带 ����ø� �ʿ䰡 ���� �� ��Ȳ�� Ư���� ���Ǹ� �ؾ� �մϴ�. ���� ���, ����� ������ �ڵ��� �����ϴ�:
public class ClassParent {
public ClassParent( int a) {
//some code here
}
}
public class ClassChild extends ClassParent {
HashMap myMap;
public ClassChild() {
super (27);
myMap = new HashMap();
}
}
�� ��Ȳ����, �����丵�� ����� ��, �ʵ�� �� �ʱ�È�� �Բ� ����÷��� ���Դϴ�. �׸��� ������� �ڵ��� ������ ���� ���Դϴ�:
public class ClassParent {
HashMap myMap;
public ClassParent( int a) {
myMap = new HashMap();
//some code here
}
}
public class ClassChild extends ClassParent {
public ClassChild() {
super (27);
}
}
�׷��� �ʵ� �ʱ�È�� ������ ��쿡�� as is�� ���� ���� ���Դϴ�:
1. ���� �ʵ� �ʱ�È�� �ٸ� �����ڿ����� ���� �ʴٸ�.
2. ���� �ʵ� �ʱ�È�� ������ �� ������ �����ϸ�.
���� ���, ���� �ڵ�(������ ���� �����ϸé¼)���� �ʵ� �ʱ�È�� myMap �ʵ�� �Բ� ����÷����� ���� ���Դϴ�.
public class ClassChild extends ClassParent {
HashMap myMap;
public ClassChild() {
super (27);
myMap = new HashMap();
}
public ClassChild( int capacity) {
super (27);
myMap = new HashMap(capacity);
}
}
|