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

cziegeler pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-resolver.git


The following commit(s) were added to refs/heads/master by this push:
     new f6f3b1f  Clean up code
f6f3b1f is described below

commit f6f3b1ffcd1541f5d669838b1666950b6ff0c9c3
Author: Carsten Ziegeler <[email protected]>
AuthorDate: Wed Dec 28 12:55:24 2022 +0100

    Clean up code
---
 .../servlets/resolver/internal/bundle/BundledScriptServlet.java     | 3 ---
 .../servlets/resolver/internal/bundle/BundledScriptTracker.java     | 1 -
 .../sling/servlets/resolver/internal/resource/ServletMounter.java   | 4 ++--
 .../servlets/resolver/internal/console/WebConsolePluginTest.java    | 6 +++---
 4 files changed, 5 insertions(+), 9 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptServlet.java
 
b/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptServlet.java
index 37a826f..a49d1ef 100644
--- 
a/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptServlet.java
+++ 
b/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptServlet.java
@@ -24,7 +24,6 @@ import java.util.Collection;
 import java.util.Set;
 import java.util.stream.Collectors;
 
-import javax.script.ScriptException;
 import javax.servlet.GenericServlet;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
@@ -34,9 +33,7 @@ import org.apache.sling.api.SlingConstants;
 import org.apache.sling.api.SlingException;
 import org.apache.sling.api.SlingHttpServletRequest;
 import org.apache.sling.api.SlingHttpServletResponse;
-import org.apache.sling.api.SlingServletException;
 import org.apache.sling.api.resource.type.ResourceType;
-import org.apache.sling.api.scripting.ScriptEvaluationException;
 import org.apache.sling.scripting.spi.bundle.BundledRenderUnit;
 import org.apache.sling.scripting.spi.bundle.TypeProvider;
 import org.jetbrains.annotations.NotNull;
diff --git 
a/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
 
b/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
index 1cbb434..a1a99ae 100644
--- 
a/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
+++ 
b/src/main/java/org/apache/sling/servlets/resolver/internal/bundle/BundledScriptTracker.java
@@ -168,7 +168,6 @@ public class BundledScriptTracker implements 
BundleTrackerCustomizer<List<Servic
                     inheritanceChain.add(baseTypeProvider);
                     if 
(!bundledRenderUnitCapability.getResourceTypes().isEmpty()) {
                         LinkedHashSet<String> 
resourceTypesRegistrationValueSet = new LinkedHashSet<>();
-                        int rtIndex = 0;
                         for (ResourceType resourceType : 
bundledRenderUnitCapability.getResourceTypes()) {
                             
resourceTypesRegistrationValueSet.add(resourceType.toString());
                         }
diff --git 
a/src/main/java/org/apache/sling/servlets/resolver/internal/resource/ServletMounter.java
 
b/src/main/java/org/apache/sling/servlets/resolver/internal/resource/ServletMounter.java
index 5ed286f..c855b79 100644
--- 
a/src/main/java/org/apache/sling/servlets/resolver/internal/resource/ServletMounter.java
+++ 
b/src/main/java/org/apache/sling/servlets/resolver/internal/resource/ServletMounter.java
@@ -148,7 +148,7 @@ public class ServletMounter {
         destroyAllServlets(refs);
 
         if (providerRegs != null) {
-            for (ServiceRegistration reg : providerRegs) {
+            for (ServiceRegistration<?> reg : providerRegs) {
                 try {
                     reg.unregister();
                 } catch (IllegalStateException ex) {
@@ -238,7 +238,7 @@ public class ServletMounter {
                         if (pathProviders) {
                             outer: for (final String path : 
srProvider.getServletPaths()) {
                                 String root = path.indexOf('/', 1) != -1 ? 
path.substring(0, path.indexOf('/', 1) + 1) : path;
-                                for (ServiceRegistration reg : providerRegs) {
+                                for (ServiceRegistration<?> reg : 
providerRegs) {
                                     if 
(root.equals(reg.getReference().getProperty(ResourceProvider.PROPERTY_ROOT))) {
                                         continue outer;
                                     }
diff --git 
a/src/test/java/org/apache/sling/servlets/resolver/internal/console/WebConsolePluginTest.java
 
b/src/test/java/org/apache/sling/servlets/resolver/internal/console/WebConsolePluginTest.java
index 61b886f..f70aeea 100644
--- 
a/src/test/java/org/apache/sling/servlets/resolver/internal/console/WebConsolePluginTest.java
+++ 
b/src/test/java/org/apache/sling/servlets/resolver/internal/console/WebConsolePluginTest.java
@@ -106,7 +106,7 @@ public class WebConsolePluginTest {
         String jsonString = stringWriter.toString();
         String json = Json.createReader(new 
StringReader(jsonString)).readObject().toString();
 
-        Map<String, Object> expectedJsonPaths = new HashMap(){{
+        Map<String, Object> expectedJsonPaths = new HashMap<String, Object>(){{
             put("$.candidates", null);
             put("$.candidates.allowedServlets.length()", 1);
             put("$.candidates.deniedServlets.length()", 0);
@@ -150,7 +150,7 @@ public class WebConsolePluginTest {
         String jsonString = stringWriter.toString();
         String json = Json.createReader(new 
StringReader(jsonString)).readObject().toString();
 
-        Map<String, Object> expectedJsonPaths = new HashMap(){{
+        Map<String, Object> expectedJsonPaths = new HashMap<String, Object>(){{
             put("$.method", "GET");
         }};
 
@@ -188,7 +188,7 @@ public class WebConsolePluginTest {
         String jsonString = stringWriter.toString();
         String json = Json.createReader(new 
StringReader(jsonString)).readObject().toString();
 
-        Map<String, Object> expectedJsonPaths = new HashMap(){{
+        Map<String, Object> expectedJsonPaths = new HashMap<String, Object>(){{
             put("$.candidates", null);
             put("$.candidates.allowedServlets.length()", 0);
             put("$.candidates.deniedServlets.length()", 1);

Reply via email to