// The first time thru the loop in start, // "Before update..." should be printed. // After the first redefine, "After update..." should be printed // After the 2nd redefine, "abcde..." should be printed. // The bug is that "After update..." is printed instead because // stat() calls version 2 of doSomething() instead of // version 3. privatevoid doSomething() {
System.out.println("Before update..."); // @1 commentout // @1 uncomment System.out.println("After update..."); // @2 commentout // @2 uncomment System.out.println("abcde...");
}
publicvoid start() { for (int i=0; i < 3; i++) {
doSomething(); // @1 breakpoint here line 16
System.out.println("field1 = " + field1);
System.out.println("field2 = " + field2);
} // Redefinex myx = new Redefinex(); // for (int i = 0; i < 5; i++) { // myx.methodx1(); // line 22 // System.out.println("fieldx1 = " + myx.fieldx1); // System.out.println("fieldx2 = " + myx.fieldx2); // }
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.