You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2026/01/15 14:40:23 UTC

(sling-org-apache-sling-mcp-server) 17/27: chore(mcp): fix formatting

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-mcp-server.git

commit 918490755076ec9edee06d9d6be69942ef47af8b
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Thu Dec 11 17:48:39 2025 +0100

    chore(mcp): fix formatting
---
 .../mcp/server/impl/contribs/RepositoryPromptsRegistrar.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/mcp/server/impl/contribs/RepositoryPromptsRegistrar.java b/src/main/java/org/apache/sling/mcp/server/impl/contribs/RepositoryPromptsRegistrar.java
index 5d1b47c..990de0d 100644
--- a/src/main/java/org/apache/sling/mcp/server/impl/contribs/RepositoryPromptsRegistrar.java
+++ b/src/main/java/org/apache/sling/mcp/server/impl/contribs/RepositoryPromptsRegistrar.java
@@ -102,7 +102,12 @@ public class RepositoryPromptsRegistrar {
                         }
                     }
                 },
-                new Hashtable<>(Map.of(ResourceChangeListener.PATHS, PROMPT_LIBS_DIR, ResourceChangeListener.CHANGES, new String[] { ResourceChangeListener.CHANGE_ADDED, ResourceChangeListener.CHANGE_CHANGED, ResourceChangeListener.CHANGE_REMOVED } )));
+                new Hashtable<>(Map.of(
+                        ResourceChangeListener.PATHS, PROMPT_LIBS_DIR, ResourceChangeListener.CHANGES, new String[] {
+                            ResourceChangeListener.CHANGE_ADDED,
+                            ResourceChangeListener.CHANGE_CHANGED,
+                            ResourceChangeListener.CHANGE_REMOVED
+                        })));
 
         // TODO - use service user
         try (ResourceResolver resolver = rrf.getAdministrativeResourceResolver(null)) {
@@ -136,7 +141,7 @@ public class RepositoryPromptsRegistrar {
 
         // remove prefix
         String promptName = path.substring(PROMPT_LIBS_DIR.length() + 1); // account for trailing slash
-        
+
         // remove optional /jcr:content node name
         if (promptName.endsWith("/jcr:content")) {
             promptName = promptName.substring(0, promptName.length() - "/jcr:content".length());
@@ -159,7 +164,7 @@ public class RepositoryPromptsRegistrar {
             try {
                 Resource promptResource = resolver.getResource(promptPath);
                 String encoding = promptResource.getResourceMetadata().getCharacterEncoding();
-                if ( encoding == null ) {
+                if (encoding == null) {
                     encoding = StandardCharsets.UTF_8.name();
                 }
                 try (InputStream stream = promptResource.adaptTo(InputStream.class)) {