Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8244976: vmTestbase/nsk/jdi/Event/request/request001.java doesn' initialize eName #9624

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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