mreutegg commented on code in PR #2947:
URL: https://github.com/apache/jackrabbit-oak/pull/2947#discussion_r3403016866


##########
oak-core-spi/src/main/java/org/apache/jackrabbit/oak/spi/toggle/Feature.java:
##########
@@ -60,7 +70,10 @@ private Feature(AtomicBoolean value, Registration 
registration) {
      * @return the feature toggle.
      */
     public static Feature newFeature(String name, Whiteboard whiteboard) {
-        AtomicBoolean value = new AtomicBoolean();
+        // by default the initial value is false, but it can be overridden by 
a system property
+        AtomicBoolean value = new AtomicBoolean(
+                SystemPropertySupplier.create("oak-feature." + name, false).

Review Comment:
   I'm not too happy with this change. One of the goals of the toggle SPI is to 
provide an abstraction for feature toggles. The SPI is currently independent of 
any source where the toggle information comes from. Controlling the toggle 
through system properties is just one option. I'm also a bit concerned there is 
no way to opt out. This change introduces hard-coded link between system 
properties and feature toggles. I would prefer an implementation that is opt in 
if a user wants to control feature toggles through system properties and then 
maintain that implementation in a differnt package / bundle.



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