stefanseifert commented on code in PR #13:
URL: 
https://github.com/apache/sling-org-apache-sling-testing-sling-mock/pull/13#discussion_r886579516


##########
core/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java:
##########
@@ -217,9 +217,9 @@ private void 
registerInjectActivateServiceByClassName(@NotNull String @NotNull .
     protected void tearDown() {
 
         if (this.request != null) {
-            MockSlingBindings slingBindings = 
(MockSlingBindings)this.request.getAttribute(SlingBindings.class.getName());
-            if (slingBindings != null) {
-                slingBindings.tearDown();
+            SlingBindings slingBindings = 
(SlingBindings)this.request.getAttribute(SlingBindings.class.getName());
+            if (slingBindings != null && slingBindings instanceof 
MockSlingBindings) {

Review Comment:
   sonarcube reports: Remove this unnecessary null check; "instanceof" returns 
false for nulls.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to