Skip to content

Commit

Permalink
[GR-24151] Reset BootLoader.CLASS_LOADER_VALUE_MAP.
Browse files Browse the repository at this point in the history
PullRequest: graal/6451
  • Loading branch information
Christian Wimmer committed Jun 11, 2020
2 parents 8796c5c + 2fff6ad commit 25c5fb3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,16 @@ private static URL findResource(String name) {
private static Enumeration<URL> findResources(String name) throws IOException {
return ClassLoader.getSystemClassLoader().getResources(name);
}

/**
* All ClassLoaderValue are reset at run time for now. See also
* {@link Target_java_lang_ClassLoader#classLoaderValueMap} for resetting of individual class
* loaders.
*/
// Checkstyle: stop
@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.NewInstance, declClass = ConcurrentHashMap.class)//
static ConcurrentHashMap<?, ?> CLASS_LOADER_VALUE_MAP;
// Checkstyle: resume
}

/** Dummy class to have a class with the file's name. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,14 @@ Class<?> loadClass(Target_java_lang_Module module, String name) {
return ClassForNameSupport.forNameOrNull(name, false);
}

/**
* All ClassLoaderValue are reset at run time for now. See also
* {@link Target_jdk_internal_loader_BootLoader#CLASS_LOADER_VALUE_MAP} for resetting of the
* boot class loader.
*/
@Alias @RecomputeFieldValue(kind = Kind.NewInstance, declClass = ConcurrentHashMap.class)//
@TargetElement(onlyWith = JDK11OrLater.class)//
private ConcurrentHashMap<?, ?> classLoaderValueMap;
ConcurrentHashMap<?, ?> classLoaderValueMap;

@Substitute //
@TargetElement(onlyWith = JDK11OrLater.class) //
Expand Down

0 comments on commit 25c5fb3

Please sign in to comment.