Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix for previous commit.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 1 more file in changeset.
Simplify tests that look for rich content in the console output.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 16 more files in changeset.
Simplify tests that look for rich content in the console output.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 16 more files in changeset.
Simplify tests that look for rich content in the console output.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 16 more files in changeset.
Simplify tests that look for rich content in the console output.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 16 more files in changeset.
Simplify tests that look for rich content in the console output.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 16 more files in changeset.
Simplify tests that look for rich content in the console output.

    • -96
    • +0
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 16 more files in changeset.
Fix file leak in ClassLoaderUtilsIntegrationTest

    • -2
    • +2
    ./ClassLoaderUtilsIntegrationTest.groovy
Fix file leak in ClassLoaderUtilsIntegrationTest

    • -2
    • +2
    ./ClassLoaderUtilsIntegrationTest.groovy
Separate defineClass and decorateClass (#6028)

After https://github.com/gradle/gradle/pull/5811 is merged, I was surprised that the illegal reflective access warnings still appear:

> Illegal reflective access using Lookup on org.gradle.internal.classloader.ClassLoaderUtils

It turns out that a lookup object which is accessible to the target class class loader must be provided. For example, if we want to invoke `MyClassLoader.defineClass` via `Lookup`, we must provide a lookup object from `privateLookupIn(MyClassLoader.class)`, not `privateLookupIn(ClassLoader.class)`. Otherwise, we'll get the warning and potential failure in the future.

See more information in the https://mydailyjava.blogspot.com/2018/04/jdk-11-and-proxies-in-world-past.html

Also, this PR does a tiny improvement: it uses `Lookup.defineClass` as much as possible. `Lookup.defineClass` is expected to replace `Unsafe.defineClass` by JDK team, but `Lookup.defineClass` has a limitation: it can only `defines a class to the same class loader and in the same runtime package and protection domain as this lookup's lookup class`. If we're decorating a class, this is gonna be fine and we use this API, otherwise we use `Lookup` to invoke `ClassLoader.defineClass` as a fallback.

    • -0
    • +96
    ./ClassLoaderUtilsIntegrationTest.groovy
  1. … 4 more files in changeset.