Skip to content

Commit

Permalink
Auto-close projectClassLoader in CompilerMojo
Browse files Browse the repository at this point in the history
  • Loading branch information
casid committed Jun 16, 2023
1 parent 89e55d1 commit b6832db
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,7 @@ private void deleteGeneratedSourceFiles(Path target, List<String> generatedSourc
}

private HtmlPolicy createHtmlPolicy(String htmlPolicyClass) {
try {
URLClassLoader projectClassLoader = createProjectClassLoader();
try (URLClassLoader projectClassLoader = createProjectClassLoader()) {
Class<?> clazz = projectClassLoader.loadClass(htmlPolicyClass);
return (HtmlPolicy) clazz.getConstructor().newInstance();
} catch (Exception e) {
Expand Down

0 comments on commit b6832db

Please sign in to comment.