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

Backport-of: 1451642317dbe9f941172945e9f366000434653f
  • Loading branch information
GoeLin committed May 8, 2023
1 parent 05f1562 commit 20fea6c
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

1 comment on commit 20fea6c

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.