kwin commented on a change in pull request #14:
URL:
https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/14#discussion_r756068175
##########
File path:
test-services/src/main/java/org/apache/sling/testing/mock/osgi/testsvc/osgiserviceutil/activatedeactivate/Service8.java
##########
@@ -40,7 +40,8 @@ private void activate(BundleContext bundleContext) {
@Deactivate
private void deactivate(BundleContext bundleContext) {
serviceRegistration.unregister();
- //serviceRegistration = null; // this may cause a NPE with subsequent
deactivate() calls
+ // explicitly set to null to ensure deactivate is never called twice
+ serviceRegistration = null;
Review comment:
This will lead to another exception (NPE instead of ISE)
--
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]