[hg] main-silver: #224860: Load FX service agent by the QuantumT...

  • From:
  • To:
  • Subject: [hg] main-silver: #224860: Load FX service agent by the QuantumT...
  • Date: Mon, 14 Jan 2013 12:57:02 -0800

changeset 258d3f30f7e0 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/258d3f30f7e0
description:
        #224860: Load FX service agent by the QuantumToolkit's class loader.

diffstat:

 
debugger.jpda.visual/src/org/netbeans/modules/debugger/jpda/visual/RemoteServices.java
 |  35 +++++++++-
 1 files changed, 34 insertions(+), 1 deletions(-)

diffs (59 lines):

diff --git 
a/debugger.jpda.visual/src/org/netbeans/modules/debugger/jpda/visual/RemoteServices.java
 
b/debugger.jpda.visual/src/org/netbeans/modules/debugger/jpda/visual/RemoteServices.java
--- 
a/debugger.jpda.visual/src/org/netbeans/modules/debugger/jpda/visual/RemoteServices.java
+++ 
b/debugger.jpda.visual/src/org/netbeans/modules/debugger/jpda/visual/RemoteServices.java
@@ -178,6 +178,28 @@
         return bcl;
     }
     
+    private static ObjectReference getContextClassLoader(ThreadReference 
tawt, VirtualMachine vm) throws InvalidTypeException, 
ClassNotLoadedException, IncompatibleThreadStateException, 
InvocationException, IOException, PropertyVetoException, 
InternalExceptionWrapper, VMDisconnectedExceptionWrapper, 
ObjectCollectedExceptionWrapper, UnsupportedOperationExceptionWrapper, 
ClassNotPreparedExceptionWrapper {
+        ReferenceType threadType = tawt.referenceType();
+        Method getContextCl = 
ClassTypeWrapper.concreteMethodByName((ClassType) threadType, 
"getContextClassLoader", "()Ljava/lang/ClassLoader;");
+        ObjectReference cl = (ObjectReference) 
ObjectReferenceWrapper.invokeMethod(tawt, tawt, getContextCl, 
Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
+        ClassType classLoaderClass = null;
+        if (cl == null) {
+            classLoaderClass = getClass(vm, ClassLoader.class.getName());
+            Method getSystemClassLoader = 
ClassTypeWrapper.concreteMethodByName(classLoaderClass, 
"getSystemClassLoader", "()Ljava/lang/ClassLoader;");
+            cl = (ObjectReference) 
ClassTypeWrapper.invokeMethod(classLoaderClass, tawt, getSystemClassLoader, 
Collections.EMPTY_LIST, ObjectReference.INVOKE_SINGLE_THREADED);
+        }
+        return cl;
+    }
+    
+    private static ObjectReference 
getQuantumTookitClassLoader(VirtualMachine vm) throws 
InternalExceptionWrapper, VMDisconnectedExceptionWrapper, 
ObjectCollectedExceptionWrapper {
+        ClassType classQuantumToolkit = getClass(vm, 
"com.sun.javafx.tk.quantum.QuantumToolkit");
+        if (classQuantumToolkit == null) {
+            return null;
+        }
+        ClassLoaderReference cl = 
ReferenceTypeWrapper.classLoader(classQuantumToolkit);
+        return cl;
+    }
+    
     public static ClassObjectReference uploadBasicClasses(JPDAThreadImpl t, 
ServiceType sType) throws InvalidTypeException, ClassNotLoadedException, 
IncompatibleThreadStateException, InvocationException, IOException, 
PropertyVetoException, InternalExceptionWrapper, 
VMDisconnectedExceptionWrapper, ObjectCollectedExceptionWrapper, 
UnsupportedOperationExceptionWrapper, ClassNotPreparedExceptionWrapper {
         ThreadReference tawt = t.getThreadReference();
         VirtualMachine vm = tawt.virtualMachine();
@@ -203,7 +225,15 @@
                 }
                 // Suppose that when there's the basic class loaded, there 
are all.
                 if (basicClass == null) {  // Load the classes only if 
there's not the basic one.
-                    ObjectReference cl = getBootstrapClassLoader(tawt, vm);
+                    ObjectReference cl;
+                    if (sType == ServiceType.AWT) {
+                        cl = getBootstrapClassLoader(tawt, vm);
+                    } else {
+                        cl = getQuantumTookitClassLoader(vm);
+                        if (cl == null) {
+                            cl = getContextClassLoader(tawt, vm);
+                        }
+                    }
                     ClassType classLoaderClass = (ClassType) 
ObjectReferenceWrapper.referenceType(cl);
 
                     for (RemoteClass rc : remoteClasses) {
@@ -1000,6 +1030,9 @@
                 break;
             }
         }
+        if (clazz == null && classList.size() > 0) {
+            clazz = classList.get(0);
+        }
         return (ClassType) clazz;
     }
     

[hg] main-silver: #224860: Load FX service agent by the QuantumT...

mentlicher 01/14/2013

Project Features

About this Project

Debugger was started in November 2009, is owned by tpavek, and has 29 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close