Refactoring Errors
Main.RefactoringErrors History
Hide minor edits - Show changes to markup
Push Down Method
Push Down Method Leads to Undiagnosed Shadowing of a Method:
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { public int k(long i) { return 23; } <:vspace> public int m() { return k(2); } } public class B extends A { public int k(int i) { return 42; } <:vspace> public int main() { return m(); } <:vspace> }(:cell:)
public class A { public int k(long i) { return 23; } } public class B extends A { public int k(int i) { return 42; } <:vspace> public int main() { return m(); } <:vspace> public int m() { return k(2); } <:vspace> }(:tableend:)
The method B.main() returns 23. Pushing down A.m() into B just moves the method without any adjustments, so in the resulting program, the method B.main() returns 42.
Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { public int k(long i){ return 23; } } <:vspace> public class B extends A { public int m(){ return k(2); } } <:vspace> public class C extends B { public int main(){ return m(); } public int k(int i){ return 42; } <:vspace> }(:cell:)
public class A { public int k(long i){ return 23; } } <:vspace> public class B extends A { } <:vspace> public class C extends B { public int main(){ return m(); } public int k(int i){ return 42; } public int m() { return Name_0(2); } }(:tableend:)
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
Incorrect handling of super accesses:
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { public int k() { return 23; } } <:vspace> public class B extends A { public int k() { return 42; } public int m() { return super.k(); } } <:vspace> public class C extends B { public int main() { return m(); } }(:cell:)
public class A { public int k() { return 23; } } <:vspace> public class B extends A { public int k() { return 42; } } <:vspace> public class C extends B { public int main() { return m(); } public int m() { return super.k(); } }(:tableend:)
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
Push Down Method Leads to change the method invoked with super accesses to a method with different signature
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { public int k(long i) { return 23; } } <:vspace> public class B extends A { public int k(int i) { return 42; } <:vspace> public int m() { return super.k(2); } } <:vspace> public class C extends B { public int main() { return m(); } }(:cell:)
public class A { public int k(long i) { return 23; } } <:vspace> public class B extends A { public int k(int i) { return 42; } } <:vspace> public class C extends B { public int main() { return m(); } <:vspace> <:vspace> public int m() { return super.k(2); } }(:tableend:)
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
Incorrect handling of field accesses
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { protected int x = 23; <:vspace> public int m() { return x; } } <:vspace> public class B extends A { protected int x = 42; <:vspace> public int main() { return new B().m(); } }(:cell:)
public class A { protected int x = 23; } <:vspace> public class B extends A { protected int x = 42; <:vspace> public int main() { return new B().m(); } <:vspace> public int m() { return x; } }(:tableend:)
The method B.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in resulting program, B.main() returns 42.
Incorrect Handling of Type Accesses:
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { class B { public int getX() { return 23; } } <:vspace> public int m() { return new B().getX(); } } <:vspace> public class C extends A { class B { public int getX() { return 42; } } <:vspace> public int main() { return new C().m(); <:vspace> } }(:cell:)
public class A { class B { public int getX() { return 23; } } } <:vspace> public class C extends A { class B { public int getX() { return 42; } } <:vspace> public int main() { return new C().m(); <:vspace> } <:vspace> public int m() { return new B().getX(); } }(:tableend:)
The method C.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in the resulting program, C.main() returns 42.
Incorrect Handling of Private Method Accesses:
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { private int k() { return 23; } <:vspace> int m() { return k(); } } <:vspace> public class B extends A { protected int k() { return 42; } <:vspace> public int main() { return new B().m(); } }(:cell:)
public class A { protected int k() { return 23; } } <:vspace> public class B extends A { protected int k() { return 42; } <:vspace> public int main() { return new B().m(); } <:vspace> int m() { return k(); } }(:tableend:)
The method B.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in the resulting program, B.main() returns 42.
The method C.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in the resulting program, C.main() returns 42.
The method C.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in the resulting program, C.main() returns 42.
Incorrect Handling of Private Method Accesses:
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { private int k() { return 23; } <:vspace> int m() { return k(); } } <:vspace> public class B extends A { protected int k() { return 42; } <:vspace> public int main() { return new B().m(); } }(:cell:)
public class A { protected int k() { return 23; } } <:vspace> public class B extends A { protected int k() { return 42; } <:vspace> public int main() { return new B().m(); } <:vspace> int m() { return k(); } }(:tableend:)
The method B.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in the resulting program, B.main() returns 42.
public int getTamanho() {
public int getX() {
return new B().getTamanho();
return new B().getX();
public int getTamanho() {
public int getX() {
public int getTamanho() {
public int getX() {
public int getTamanho() {
public int getX() {
return new B().getTamanho();
return new B().getX();
The method B.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in resulting program, B.main() returns 42.
The method B.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in resulting program, B.main() returns 42.
Incorrect Handling of Type Accesses:
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { class B { public int getTamanho() { return 23; } } <:vspace> public int m() { return new B().getTamanho(); } } <:vspace> public class C extends A { class B { public int getTamanho() { return 42; } } <:vspace> public int main() { return new C().m(); <:vspace> } }(:cell:)
public class A { class B { public int getTamanho() { return 23; } } } <:vspace> public class C extends A { class B { public int getTamanho() { return 42; } } <:vspace> public int main() { return new C().m(); <:vspace> } <:vspace> public int m() { return new B().getTamanho(); } }(:tableend:)
The method C.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in the resulting program, C.main() returns 42.
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
Incorrect handling of field accesses
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { protected int x = 23; <:vspace> public int m() { return x; } } <:vspace> public class B extends A { protected int x = 42; <:vspace> public int main() { return new B().m(); } }(:cell:)
public class A { protected int x = 23; } <:vspace> public class B extends A { protected int x = 42; <:vspace> public int main() { return new B().m(); } <:vspace> public int m() { return x; } }(:tableend:)
The method B.main() returns 23. Pushing down A.m into B just moves the method without any adjustments, so in resulting program, B.main() returns 42.
Push Down Method Leads to change the method invoked with super accesses to a method with different signature
Push Down Method Leads to change the method invoked with super accesses to a method with different signature
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { public int k(long i) { return 23; } } <:vspace> public class B extends A { public int k(int i) { return 42; } <:vspace> public int m() { return super.k(2); } } <:vspace> public class C extends B { public int main() { return m(); } }(:cell:)
public class A { public int k(long i) { return 23; } } <:vspace> public class B extends A { public int k(int i) { return 42; } } <:vspace> public class C extends B { public int main() { return m(); } <:vspace> <:vspace> public int m() { return super.k(2); } }(:tableend:)
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { public int k() { return 23; } } <:vspace> public class B extends A { public int k() { return 42; } public int m() { return super.k(); } } <:vspace> public class C extends B { public int main() { return m(); } } <:vspace> }(:cell:)
public class A { public int k() { return 23; } } <:vspace> public class B extends A { public int k() { return 42; } } <:vspace> public class C extends B { public int main() { return m(); } public int m() { return super.k(); } }(:tableend:)
# Push Down Method Leads to Undiagnosed Shadowing of a Method:
Push Down Method Leads to Undiagnosed Shadowing of a Method:
# !Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
# Incorrect handling of super accesses:
# Push Down Method Leads to change the method invoked with super accesses to a method with different signature
Incorrect handling of super accesses:
Push Down Method Leads to change the method invoked with super accesses to a method with different signature
# Push Down Method Leads to Undiagnosed Shadowing of a Method:
# Push Down Method Leads to Undiagnosed Shadowing of a Method:
# !!!Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
# !Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
# !!!Incorrect handling of super accesses:
# !!!Push Down Method Leads to change the method invoked with super accesses to a method with different signature
# Incorrect handling of super accesses:
# Push Down Method Leads to change the method invoked with super accesses to a method with different signature
# !!! Push Down Method Leads to Undiagnosed Shadowing of a Method:
# Push Down Method Leads to Undiagnosed Shadowing of a Method:
# !!!Push Down Method Leads to Undiagnosed Shadowing of a Method:
# !!! Push Down Method Leads to Undiagnosed Shadowing of a Method:
# Push Down Method Leads to Undiagnosed Shadowing of a Method:
# !!!Push Down Method Leads to Undiagnosed Shadowing of a Method:
# Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
# !!!Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
# Incorrect handling of super accesses:
# Push Down Method Leads to change the method invoked with super accesses to a method with different signature
# !!!Incorrect handling of super accesses:
# !!!Push Down Method Leads to change the method invoked with super accesses to a method with different signature
The method B.main() returns 23. Pushing down A.m() into B just moves the method without any adjustments, so in the resulting program, the method C.test returns 42.
The method B.main() returns 23. Pushing down A.m() into B just moves the method without any adjustments, so in the resulting program, the method B.main() returns 42.
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
public class A { <:vspace> public int k(long i){ <:vspace> return 23; <:vspace> } <:vspace> } <:vspace> public class B extends A { <:vspace> public int m(){ <:vspace> return k(2); <:vspace> } <:vspace> } <:vspace> public class C extends B { <:vspace> public int main(){ <:vspace> return m(); <:vspace> } <:vspace> public int k(int i){ <:vspace> return 42; <:vspace> } <:vspace> }(:cell:)
public class A { <:vspace> public int k(long i){ <:vspace> return 23; <:vspace> } <:vspace> } <:vspace> public class B extends A { <:vspace> } <:vspace> public class C extends B { <:vspace> public int main(){ <:vspace> return m(); <:vspace> } <:vspace> public int k(int i){ <:vspace> return 42; <:vspace> } <:vspace> public int m() { <:vspace> return Name_0(2); <:vspace> } <:vspace> }(:tableend:)
The method C.main() returns 23. Pushing down B.m() into C just moves the method without any adjustments, so in the resulting program, the method C.main() returns 42.
The method B.main() returns 23. Pushing down A.m() into B just moves the method without any adjustments, so in the resulting program, the method C.test returns 42.
public int m() { return k(2); }
}
public int m() { return k(2);
cell 1 |
cell 2 ||
(:table width=100% :) (:cellnr:)
Source
(:cell:)
Target
(:cellnr:)
(:cell:)
public class A { public int k(long i) { return 23; } <:vspace> public int m() { return k(2); } } public class B extends A { public int k(int i) { return 42; } <:vspace> public int main() { return m(); } <:vspace> }(:tableend:)
[@ background-color:#ffffcc"
[@
public int k(long i) {return 23;} public int m() {return k(2);} } public class B extends A { public int k(int i) { return 42;
public int k(long i) { return 23;
public int m() { return k(2); } } public class B extends A { public int k(int i) { return 42; }
(:div class="green" style="font-style:italic; border:0px solid blue; background-color:#ffffcc":)
public class A {
->public int k(long i) {return 23;}
->public int m() {return k(2);}
->}
public class B extends A { public int k(int i) { return 42;} public int main() { return m(); } }
(:divend:)
[@
[@ background-color:#ffffcc"
public class A { public int k(long i) {return 23;} public int m() {return k(2);} } public class B extends A { public int k(int i) { return 42; } public int main() { return m(); } <:vspace> }
public class A {
->public int k(long i) {return 23;}
->public int m() {return k(2);}\\
public class A {
->public int k(long i) {return 23;}
->public int m() {return k(2);}
public class A {
public int k(long i) {return 23;} public int m() {return k(2);} }
public class A {
->public int k(long i) {return 23;}
->public int m() {return k(2);}
->}
public class A {
---- public int k(long i) {return 23;}\\
public class A { public int k(long i) {return 23;}
public int k(long i) {return 23;}\\
---- public int k(long i) {return 23;}\\
public int k(long i) {return 23;} public int m() {return k(2);}
public int k(long i) {return 23;}
public int m() {return k(2);}
public class A { public int k(long i) {return 23;} public int m() {return k(2);} }
public class A { public int k(long i) {return 23;} public int m() {return k(2);} }
(:div class="green" style="font-style:italic; border:1px solid blue; background-color:#ffffcc":)
(:div class="green" style="font-style:italic; border:0px solid blue; background-color:#ffffcc":)
public int k(int i) { return 42;}
public int k(int i) { return 42;}
public int k(int i) { return 42; } public int main() { return m(); }
public int k(int i) { return 42;}
public int main() { return m(); }
Everything after the above line is styled with green italic text,
This includes preformatted text * lists -> indented items
public class A { public int k(long i) {return 23;} public int m() {return k(2);} } public class B extends A { public int k(int i) { return 42; } public int main() { return m(); }
}
(:table class="green" style="font-style:italic; border:1px solid blue; background-color:#ffffcc":) (:cellnr:)
(:div class="green" style="font-style:italic; border:1px solid blue; background-color:#ffffcc":)
(:tableend:)
(:divend:)
The wikistyle specification at the beginning of this line applies to the entire paragraph, even if there are other wikistyle specifications in the middle of the paragraph.
(:table class="green" style="font-style:italic; border:1px solid blue; background-color:#ffffcc":) (:cellnr:) Everything after the above line is styled with green italic text,
This includes preformatted text * lists -> indented items (:tableend:)
(:table class="green" style="font-style:italic; border:1px solid blue; background-color:#ffffcc":) (:cellnr:) Everything after the above line is styled with green italic text,
This includes preformatted text * lists -> indented items (:tableend:)
style="font-style:italic; border:1px solid blue; background-color:#ffffcc"
styled with green italic text, ||
This includes |
preformatted text |
* lists |
-> indented items |
The wikistyle specification at the beginning of this line applies to the entire paragraph, even if there are other wikistyle specifications in the middle of the paragraph.
>>blue font-style:italic bgcolor=#ffffcc<<
(:table class="green" style="font-style:italic; border:1px solid blue; background-color:#ffffcc":) (:cellnr:)
styled with blue italic text,
styled with green italic text,
>><<
(:tableend:)
style="font-style:italic; border:1px solid blue; background-color:#ffffcc"
styled with green italic text, ||
This includes |
preformatted text |
* lists |
-> indented items |
>>blue font-style:italic bgcolor=#ffffcc<< Everything after the above line is styled with blue italic text,
This includes preformatted text * lists -> indented items >><<
Push Down Method
# Push Down Method Leads to Undiagnosed Shadowing of a Method:
# Push Down Method Leads to Undiagnosed Shadowing of a Method (ii):
# Incorrect handling of super accesses:
# Push Down Method Leads to change the method invoked with super accesses to a method with different signature