Clone Tools
  • last updated a few seconds ago
Constraints
Constraints: committers
 
Constraints: files
Constraints: dates
Fix `ClassNotFoundExeception` when loading objects whose class is defined in a build script from the instant execution cache, after recreating the cache from a daemon process that has previously successfully used the cache.

For example, running `gradle taskA`, `gradle taskA`, `gradle taskB`, `gradle taskB` would fail if `taskB` uses types from a build script.

This was happening because the script ClassLoaders are cached and reused, but the association between ClassLoader and scope was lost, and this association is what instant execution uses to know how to load the class.

This change fixes one case of this problem, but the same problem can still happen if the set of build scripts being referenced changes.

    • -2
    • +4
    ./DefaultClassLoaderFactoryTest.groovy
  1. … 25 more files in changeset.
Remove ClassLoaderHasher

There is no need to separate this from HashingClassLoaderFactory.

    • -3
    • +3
    ./ConfigurableClassLoaderHierarchyHasherTest.groovy
  1. … 6 more files in changeset.
Remove ClassLoaderHasher

There is no need to separate this from HashingClassLoaderFactory.

    • -3
    • +3
    ./ConfigurableClassLoaderHierarchyHasherTest.groovy
  1. … 6 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 2 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 2 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 2 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 2 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Simplify daemon groovy compiler classpath filter

  1. … 3 more files in changeset.
Fix equals/hashcode of mutable classloaders

When a parent was added to a MultiParentClassLoader, its hashcode

would change, meaning that it could no longer be found in any Sets

or Maps we put it in. This lead to severe memory leaks when used in

conjunction with configure-on-demand, where adding parents late is common.

These classloaders now use an identity hashcode and equals implementation.

    • -6
    • +21
    ./MultiParentClassLoaderTest.groovy
  1. … 1 more file in changeset.
Named classloaders (#6834)

This should help give some more context while debugging classloading issues.

    • -2
    • +2
    ./DefaultClassLoaderFactoryTest.groovy
  1. … 37 more files in changeset.
Faster classloader filtering using a trie (#6815)

Use Trie to check for package prefixes in filtering classloader

  1. … 9 more files in changeset.
Use MD5 as the default hashing function

    • -1
    • +1
    ./ConfigurableClassLoaderHierarchyHasherTest.groovy
  1. … 38 more files in changeset.
Remove deprecated Class.newInstance() (#6496)

`Class.newInstance()` was deprecated in Java 9.

    • -1
    • +1
    ./DefaultClassLoaderFactoryTest.groovy
  1. … 34 more files in changeset.
Don't use ClassLoader.getDefinedPackages() on Java 9 (#5477)

Prior to this change, FilteringClassLoader invokes

ClassLoader.getSystemClassLoader().getParent().getDefinedPackages()

to get all system packages on Java 9, which is not correct.

ClassLoader.getDefinedPackages() only fetches packages defined by

the ClassLoader itself, not including its parent's. The consequence is,

on Java 9, most Java SE and JDK packages (e.g. java.lang) are not included in

FilteringClassLoader.SYSTEM_PACKAGES.

This PR fixes this problem by using ClassLoader.getPackages() all the time.

  1. … 4 more files in changeset.
Use umodifiable list in DefaultClassPath

This makes accidental mutation impossible and reduces some

of the repeated wrapping.

  1. … 37 more files in changeset.
Use Lookup to invoke defineClass on Java 9+ (#4976)

Use Lookup to invoke defineClass on Java 9+

    • -0
    • +41
    ./ClassLoaderUtilsTest.groovy
  1. … 2 more files in changeset.
Cache resources in caching classloader

This is especially important for looking up plugin descriptors

for missing plugins. For instance, in a build with 100 projects

which all call `plugins.withId('foo')`, the plugin descriptor for

the 'foo' plugin would be looked up 100 times, because each project

could potentially contain it. Every one of those lookups will usually hit

the same classloader (if all dependencies are defined in the root project).

Caching those lookups improves configuration time a lot in those cases.

  1. … 1 more file in changeset.
Prevent creatig byte array copies when hashing hash codes

Should reduce garbage creation a little.

    • -1
    • +1
    ./ConfigurableClassLoaderHierarchyHasherTest.groovy
  1. … 8 more files in changeset.
Fix test on Windows

Simplify logic

    • -65
    • +0
    ./ClassLoaderWithCustomSchemeTest.groovy
    • -64
    • +0
    ./ClassLoaderWithCustomSchemeTestHelper.java
    • -0
    • +39
    ./ClasspathUtilTest.groovy
  1. … 1 more file in changeset.
Issue #3223: Test to illustrate breaking behavior (#3224)

Filter non-file URLs

One use case for this change is to support embedding the Tooling API into a fat JAR.

    • -0
    • +65
    ./ClassLoaderWithCustomSchemeTest.groovy
    • -0
    • +64
    ./ClassLoaderWithCustomSchemeTestHelper.java
  1. … 1 more file in changeset.
Use our own hashing architecture, take 2 (#2817)

This replaces Guava's hashing. We need this for two reasons:

- it allows the addition of custom hash functions, like BLAKE2b which would not be possible with Guava's closed design

- it fixes a few performance issues that Guava only fixes in version 20 (which we can't upgrade to right now, because we still need to support Java 5 in places)

    • -6
    • +5
    ./ConfigurableClassLoaderHierarchyHasherTest.groovy
  1. … 159 more files in changeset.