holgerfriedrich commented on code in PR #2983:
URL: https://github.com/apache/karaf/pull/2983#discussion_r4227439770


##########
features/core/src/test/java/org/apache/karaf/features/internal/support/TestBundle.java:
##########
@@ -56,8 +56,12 @@ public TestBundle(long bundleId, String location, int state, 
Hashtable<String, S
     public void update(Hashtable<String, String> headers) throws 
BundleException {
         this.headers.clear();
         this.headers.putAll(headers);
-        this.caps.clear();
-        this.reqs.clear();
+        // felix-utils 1.11.10 made ResourceImpl#caps and ResourceImpl#reqs 
private, the two clear()
+        // calls below rely on an implementation quirk, not to be used in real 
code: with a null
+        // namespace, getCapabilities and getRequirements return the internal 
lists.
+        // These calls bypass ResourceImpl's private resetHash(), which is 
safe here because TestBundle overrides hashCode()
+        getCapabilities(null).clear();

Review Comment:
   @jbonofre WDYT?



-- 
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