/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 4628726
* @summary Test class redefinition - method data line numbers and local vars,
*
* @author Robert Field
*
* @library ..
* @run build TestScaffold VMConnection TargetListener TargetAdapter
* @run compile -g RedefineTest.java
* @run shell RedefineSetUp.sh
* @run main RedefineTest -repeat 3
* @run main RedefineTest
*/
/********** target program **********/
class RedefineTarg {
}
}
/********** test program **********/
// isObsolete, linenumber, lv name, lv value, lv isArg
"+ 3",
"+ 6 eights 888 T",
"+ 11 rot 4 F",
"+ 15",
"+ 20 myArg 56 T paramy 12 F",
"+ 24",
"+ 28",
"+ 33" };
"+ 5",
"O",
"O",
"+ 16",
"+ 21 whoseArg 56 T parawham 12 F",
"+ 25",
"O",
"+ 34" };
"+ 5",
"+ 9 eights 88 T",
"+ 13",
"+ 16",
"+ 21 whoseArg 56 T parawham 12 F",
"+ 25" };
"+ 5",
"+ 9 eights 88 T",
"+ 13",
"+ 16",
"+ 21 whoseArg 56 T parawham 12 F",
"+ 25",
"+ 29",
"+ 34" };
{"+ 16"},
{"+ 21 myArg 56 T paramy 12 F"},
{"+ 25"},
{"+ 34"} };
return args2;
} else {
return args;
}
}
super(args);
}
}
/********** event handlers **********/
try {
}
}
}
/********** test assists **********/
// isObsolete, linenumber, lv name, lv value, lv isArg
// equals: ref type (always), method (not obsolete)
return; // might be bad class, but might have run past bottom
}
if (meth.isObsolete()) {
if (!expectObs) {
}
} else {
if (expectObs) {
break; // no more data to read
}
}
}
// local var matching
int lvCnt = 0;
while (st.hasMoreTokens()) {
++lvCnt;
"' -- " + errInfo);
} else {
}
}
}
}
}
}
}
}
try {
for (int i = 0; i < redefineRepeat; ++i) {
}
}
}
}
try {
final BreakpointRequest request =
}
}
/********** test core **********/
startToMain("RedefineTarg");
println("------ Before Redefine ------");
println("------ After Redefine ------");
doRedefine("Different_RedefineSubTarg.class");
println("------ Static 2 ------");
toTop();
println("------ Instance ------");
toTop();
println("------ Re-entered ------");
toTop();
println("------ Breakpoints ------");
doRedefine("RedefineSubTarg.class");
}
/*
* resume the target listening for events
*/
}
/*
* deal with results of test
* if anything has called failure("foo") testFailed will be true
*/
if (!testFailed) {
println("RedefineTest(method): passed");
} else {
throw new Exception("RedefineTest(method): failed");
}
}
}