diff --git a/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/builditemtemplate/AdditionalTemplatePathTest.java b/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/builditemtemplate/AdditionalTemplatePathTest.java index 24e4306532a16..989a5fc5ed5ad 100644 --- a/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/builditemtemplate/AdditionalTemplatePathTest.java +++ b/extensions/qute/deployment/src/test/java/io/quarkus/qute/deployment/builditemtemplate/AdditionalTemplatePathTest.java @@ -54,6 +54,11 @@ public void testTemplate() { assertEquals("Hello M!", engine.getTemplate("foo/hello.txt").data("name", "M").render()); assertEquals("Hello M!", engine.getTemplate("foo/hello").data("name", "M").render()); assertEquals("And... Hello M!", engine.getTemplate("include").data("name", "M").render()); + + // Test that reload works for additional content-based paths + engine.clearTemplates(); + assertEquals("Hello M!", engine.getTemplate("foo/hello").data("name", "M").render()); + assertEquals("Hello M!", engine.getTemplate("foo/hello.txt").data("name", "M").render()); } } diff --git a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java index bc3d9c95225df..f6bbc3957396d 100644 --- a/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java +++ b/extensions/qute/runtime/src/main/java/io/quarkus/qute/runtime/EngineProducer.java @@ -369,7 +369,7 @@ private Optional locate(String path) { // Then try the template contents LOGGER.debugf("Locate template contents for %s", path); String content = templateContents.get(path); - if (path == null) { + if (content == null) { // Try path with suffixes for (String suffix : suffixes) { String pathWithSuffix = path + "." + suffix;