modules/host-android/src/main/java/org/apache/tuscany/sca/host/embedded/SCATestCaseRunner.java [216:254]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void execute(Class<?> annotationClass) {
        if (annotationClass == null) {
            throw new RuntimeException(new NoSuchMethodException());
        }
        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        try {
            // Thread.currentThread().setContextClassLoader(classLoader);
            // Allow privileged access to set class loader. Requires RuntimePermission
            // setContextClassLoader in security policy.
            final ClassLoader finalClassLoader = classLoader;
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    Thread.currentThread().setContextClassLoader(finalClassLoader);
                    return null;
                }
            });                     

            for (Method method : testCaseClass.getDeclaredMethods()) {
                for (Annotation annotation : method.getAnnotations()) {
                    if (annotation.annotationType() == annotationClass) {
                        method.invoke(testCase);
                    }
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            // Thread.currentThread().setContextClassLoader(tccl);
            // Allow privileged access to set class loader. Requires RuntimePermission
            // setContextClassLoader in security policy.
            final ClassLoader finaltccl = tccl;
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    Thread.currentThread().setContextClassLoader(finaltccl);
                    return null;
                }
            });
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



modules/host-embedded/src/main/java/org/apache/tuscany/sca/host/embedded/SCATestCaseRunner.java [216:254]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private void execute(Class<?> annotationClass) {
        if (annotationClass == null) {
            throw new RuntimeException(new NoSuchMethodException());
        }
        ClassLoader tccl = Thread.currentThread().getContextClassLoader();
        try {
            // Thread.currentThread().setContextClassLoader(classLoader);
            // Allow privileged access to set class loader. Requires RuntimePermission
            // setContextClassLoader in security policy.
            final ClassLoader finalClassLoader = classLoader;
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    Thread.currentThread().setContextClassLoader(finalClassLoader);
                    return null;
                }
            });                     

            for (Method method : testCaseClass.getDeclaredMethods()) {
                for (Annotation annotation : method.getAnnotations()) {
                    if (annotation.annotationType() == annotationClass) {
                        method.invoke(testCase);
                    }
                }
            }
        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            // Thread.currentThread().setContextClassLoader(tccl);
            // Allow privileged access to set class loader. Requires RuntimePermission
            // setContextClassLoader in security policy.
            final ClassLoader finaltccl = tccl;
            AccessController.doPrivileged(new PrivilegedAction<Object>() {
                public Object run() {
                    Thread.currentThread().setContextClassLoader(finaltccl);
                    return null;
                }
            });
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



