Rename registerResourceIfNecessary to registerResource

This commit renames registerResourceIfNecessary() to registerResource()
and throws an exception if the class path resource does not exist.

Closes gh-29083
This commit is contained in:
Sam Brannen
2022-09-10 19:49:56 +02:00
parent d883c8fbb3
commit 6d83a959fb
5 changed files with 25 additions and 18 deletions

View File

@@ -22,7 +22,7 @@ import org.springframework.core.io.ClassPathResource;
/**
* {@link RuntimeHintsRegistrar} implementation that registers resource
* hints for web util classes.
* hints for web util resources.
*
* @author Sebastien Deleuze
* @since 6.0
@@ -31,7 +31,8 @@ class WebUtilRuntimeHints implements RuntimeHintsRegistrar {
@Override
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
hints.resources().registerResourceIfNecessary(
hints.resources().registerResource(
new ClassPathResource("HtmlCharacterEntityReferences.properties", getClass()));
}
}