Skip to content

Commit

Permalink
8244976: vmTestbase/nsk/jdi/Event/request/request001.java doesn' init…
Browse files Browse the repository at this point in the history
…ialize eName

Reviewed-by: shade, sspitsyn, cjplummer
  • Loading branch information
lmesnik committed Jul 26, 2022
1 parent 8159a1a commit 1451642
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 36 deletions.
20 changes: 10 additions & 10 deletions test/hotspot/jtreg/vmTestbase/nsk/jdi/Event/request/request001.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -525,18 +525,14 @@ private void testRun()
log2(":::::::::vm.resume();");
vm.resume();

Event event1 = null;
int flagsCopy = flags;
String eName = null;
int index = 0;
int flagsCopy = flags;

log2("......getting and checking up on Events");
for (int n4 = 0; n4 < namesRef.length(); n4++) {
int flag;

getEventSet();
event1 = eventIterator.nextEvent();
Event event1 = eventIterator.nextEvent();

int index;
if (event1 instanceof AccessWatchpointEvent) {
index = 0;
} else if (event1 instanceof ModificationWatchpointEvent ) {
Expand All @@ -554,11 +550,15 @@ private void testRun()
} else {
log3("ERROR: else clause in detecting type of event1");
testExitCode = FAILED;
throw new JDITestRuntimeException("** unexpected event ** " + event1);
}
log2("--------> got: " + event1 + " index: " + index);

flag = 1 << index;
int flag = 1 << index;
if ((flagsCopy & flag) == 0) {
log3("ERROR: event duplication: " + eName);
log3("ERROR: event duplication. event " + event1
+ " flagsCopy = " + Integer.toBinaryString(flagsCopy)
+ " flag = " + Integer.toBinaryString(flag));
testExitCode = FAILED;
} else {
flagsCopy ^= flag;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -514,18 +514,15 @@ private void testRun()
log2(":::::::::vm.resume();");
vm.resume();

Event event1 = null;
int flagsCopy = flags;
String eName = null;
int index = 0;
int flagsCopy = flags;

log2("......getting and checking up on Events");
for (int n4 = 0; n4 < namesRef.length(); n4++) {
int flag;

getEventSet();
event1 = eventIterator.nextEvent();
Event event1 = eventIterator.nextEvent();

int index;
if (event1 instanceof AccessWatchpointEvent) {
index = 0;
} else if (event1 instanceof ModificationWatchpointEvent ) {
Expand All @@ -543,11 +540,15 @@ private void testRun()
} else {
log3("ERROR: else clause in detecting type of event1");
testExitCode = FAILED;
throw new JDITestRuntimeException("** unexpected event ** " + event1);
}
log2("--------> got: " + event1 + " index: " + index);

flag = 1 << index;
int flag = 1 << index;
if ((flagsCopy & flag) == 0) {
log3("ERROR: event duplication: " + eName);
log3("ERROR: event duplication. event " + event1
+ " flagsCopy = " + Integer.toBinaryString(flagsCopy)
+ " flag = " + Integer.toBinaryString(flag));
testExitCode = FAILED;
} else {
flagsCopy ^= flag;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -417,45 +417,35 @@ private void testRun()
log2(":::::::::vm.resume();");
vm.resume();

Event event1 = null;
String threadName = null;
int flagsCopy = flags;
String eName = null;

log2("......getting and checking up on Events");
for (int n4 = 0; n4 < namesRef.length(); n4++) {
int flag;
int index;
getEventSet();
event1 = eventIterator.nextEvent();
Event event1 = eventIterator.nextEvent();

int index;
if (event1 instanceof AccessWatchpointEvent) {
eName = "AccessWatchpointEvent";
index = 0;
} else if (event1 instanceof ModificationWatchpointEvent ) {
eName = "ModificationWatchpointEvent";
index = 1;
} else if (event1 instanceof BreakpointEvent ) {
eName = "BreakpointEvent";
index = 2;
} else if (event1 instanceof ExceptionEvent ) {
eName = "ExceptionEvent";
index = 3;
} else if (event1 instanceof MethodEntryEvent ) {
eName = "MethodEntryEvent";
index = 4;
} else if (event1 instanceof MethodExitEvent ) {
eName = "MethodExitEvent";
index = 5;
} else if (event1 instanceof StepEvent ) {
eName = "StepEvent";
index = 6;
} else {
log3("ERROR: else clause in detecting type of event1");
testExitCode = FAILED;
throw new JDITestRuntimeException("** unexpected event **");
throw new JDITestRuntimeException("** unexpected event ** " + event1);
}
log2("--------> got: " + eName);
log2("--------> got: " + event1 + " index: " + index);

ThreadReference threadRef = ((LocatableEvent) event1).thread();

Expand All @@ -472,9 +462,11 @@ private void testRun()
log3(" thread's name == " + threadRef.name());
}

flag = 1 << index;
int flag = 1 << index;
if ((flagsCopy & flag) == 0) {
log3("ERROR: event duplication: " + eName);
log3("ERROR: event duplication. event " + event1
+ " flagsCopy = " + Integer.toBinaryString(flagsCopy)
+ " flag = " + Integer.toBinaryString(flag));
testExitCode = FAILED;
} else {
flagsCopy ^= flag;
Expand Down

3 comments on commit 1451642

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin
Copy link
Member

@GoeLin GoeLin commented on 1451642 Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 1451642 Apr 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GoeLin the backport was successfully created on the branch GoeLin-backport-14516423 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 14516423 from the openjdk/jdk repository.

The commit being backported was authored by Leonid Mesnik on 26 Jul 2022 and was reviewed by Aleksey Shipilev, Serguei Spitsyn and Chris Plummer.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git GoeLin-backport-14516423:GoeLin-backport-14516423
$ git checkout GoeLin-backport-14516423
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git GoeLin-backport-14516423

Please sign in to comment.