ld3.addParentDelegation("java.lang.String");
- // loading BarPassFoo
+ // loading and linking BarPassFoo
ct.expect("requested", ld2, "BarPassFoo");
+ ct.expectLoadFromSystem(ld2, "java.lang.Object");
ct.expect("defined", ld2, "<BarPassFoo>");
ct.expect("loaded", ld2, "<BarPassFoo>");
Class cls = ct.loadClass(ld2, "BarPassFoo");
- // linking BarPassFoo
- ct.expectLoadFromSystem(ld2, "java.lang.Object");
-
// executing BarPassFoo.passDerivedFooInstance: new DerivedFoo
- ct.expectDelegationAndDefinition(ld2, ld3, "DerivedFoo");
+ ct.expectDelegation(ld2, ld3, "DerivedFoo");
// linking (ld3, DerivedFoo)
ct.expect("requested", ld3, "Foo");
- ct.expect("defined", ld3, "<Foo>");
ct.expectLoadFromSystem(ld3, "java.lang.Object");
+ ct.expect("defined", ld3, "<Foo>");
+ ct.expectDelegationDefinition(ld2, ld3, "DerivedFoo");
// resolving Foo.virtualId
// the deferred subtype check ((ld2, DerivedFoo) subtypeof (ld2, Foo)) is done
- ct.expectDelegationAndDefinition(ld2, ld1, "Foo");
+ ct.expectDelegation(ld2, ld1, "Foo");
// ...linking (ld2, Foo) == (ld1, Foo)
ct.expectLoadFromSystem(ld1, "java.lang.Object");
+ ct.expectDelegationDefinition(ld2, ld1, "Foo");
// the subtype constraint ((ld2, DerivedFoo) subtypeof (ld2, Foo)) is violated
ct.expect("exception", "java.lang.LinkageError", "<BarPassFoo>");