changeset 8043:a0275a47fa78

8006637: Failure to filter out native frame events on Solaris Summary: Test is confused by other threads calling String.intern(). Add a thread filter to avoid this. Reviewed-by: sspitsyn, alanb
author sla
date Tue, 19 Mar 2013 09:53:36 +0100
parents ec8229b26dbc
children e766da5575fa
files test/com/sun/jdi/NativeInstanceFilter.java
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/jdi/NativeInstanceFilter.java	Sun Mar 17 09:55:03 2013 +0000
+++ b/test/com/sun/jdi/NativeInstanceFilter.java	Tue Mar 19 09:53:36 2013 +0100
@@ -57,6 +57,7 @@
 
     static EventRequestManager requestManager = null;
     static MethodExitRequest request = null;
+    static ThreadReference mainThread = null;
 
     private void listen() {
         TargetAdapter adapter = new TargetAdapter() {
@@ -77,6 +78,7 @@
                     requestManager.deleteEventRequest(request);
                     request = requestManager.createMethodExitRequest();
                     request.addInstanceFilter(instance);
+                    request.addThreadFilter(mainThread);
                     request.enable();
                 } else if (instance != null && name.equals("intern")) {
                     // If not for the filter, this will be called twice
@@ -101,10 +103,12 @@
 
         // VM has started, but hasn't started running the test program yet.
         requestManager = vm().eventRequestManager();
-        ReferenceType referenceType =
-            resumeToPrepareOf("NativeInstanceFilterTarg").referenceType();
+        ClassPrepareEvent e = resumeToPrepareOf("NativeInstanceFilterTarg");
+        ReferenceType referenceType = e.referenceType();
+        mainThread = e.thread();
 
         request = requestManager.createMethodExitRequest();
+        request.addThreadFilter(mainThread);
         request.enable();
 
         listen();