Integrated: 8279669: test/jdk/com/sun/jdi/TestScaffold.java uses wrong condition

zzambers duke at openjdk.java.net
Tue Jan 11 13:18:38 UTC 2022


On Wed, 1 Dec 2021 19:19:02 GMT, zzambers <duke at openjdk.java.net> wrote:

> Condition is obviously wrong, because if name starts with "java." other 2 conditions are always true. Intent, as I understand it, was to redefine class where debug event took place (in case of test classes), unless it took place in class of jdk itself, in which case redefine test's main class (if redefineAtEvents is true of course). Check for class names starting with "jdk." was added with later commit [1], not touching that wrong condition (check for classes belonging to jdk) and putting check to else branch instead (therefore not doing any redefinition in case name starts with "jdk.").
> 
> Actually fix is done to be then backported to jdk8u, where com/sun/jdi/RedefineCrossEvent.java test stared failing after recent backport [2], due to missing check for classes starting with "jdk." [3]:
> ...
> Redefining class jdk.internal.misc.TerminatingThreadLocal (no class loader)
> FAIL: redefine - unexpected exception: java.io.FileNotFoundException: /home/tester/test.1638289866/jdk/JTwork/classes/com/sun/jdi/jdk/internal/misc/TerminatingThreadLocal.class (No such file or directory)
> ...
> 
> This test actually passes for (latest) jdk. However fixing this condition before doing backport, rather than backporting it in current form seems like right thing to do. I tested this locally and jdi tests are passing with this change for latest jdk (and also for jdk8u).
> 
> [1]  https://github.com/zzambers/jdk/commit/426873751c710061d0f9bc713a0de47373e51418#diff-778880449f85966d3c6b219b8ceb41fdbbe7acc5e520d2aa27aada3f33bf1eab
> [2] https://bugs.openjdk.java.net/browse/JDK-8273772
> [3] https://github.com/openjdk/jdk8u/blob/7d3c0bede34930cadd76644e58bf56f2a83c3d01/jdk/test/com/sun/jdi/TestScaffold.java#L535

This pull request has now been integrated.

Changeset: 4c52eb39
Author:    Zdenek Zambersky <zzambers at redhat.com>
Committer: Severin Gehwolf <sgehwolf at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/4c52eb39431c2479b0d140907bdcc0311d30f871
Stats:     7 lines in 1 file changed: 1 ins; 2 del; 4 mod

8279669: test/jdk/com/sun/jdi/TestScaffold.java uses wrong condition

Reviewed-by: amenkov, sspitsyn

-------------

PR: https://git.openjdk.java.net/jdk/pull/6652


More information about the serviceability-dev mailing list