FELIX-3649 Remove CT workaround because it is not needed any longer

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1380118 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/Activator.java b/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
index 5b4961a..33b3a66 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/Activator.java
@@ -69,10 +69,6 @@
     //  thread acting upon configurations
     private ComponentActorThread m_componentActor;
 
-    // whether to support two workarounds to run the OSGi R 4.2 CT
-    // See hasCtWorkaround()
-    private static boolean m_ctWorkaround;
-
     /**
      * Registers this instance as a (synchronous) bundle listener and loads the
      * components of already registered bundles.
@@ -99,9 +95,6 @@
         log( LogService.LOG_INFO, context.getBundle(), " Version = "
             + context.getBundle().getHeaders().get( Constants.BUNDLE_VERSION ), null );
 
-        // check whether we workaround OSGi CT issues
-        m_ctWorkaround = ScrConfiguration.hasCtWorkaround( context );
-
         // create and start the component actor
         m_componentActor = new ComponentActorThread();
         Thread t = new Thread(m_componentActor, "SCR Component Actor");
@@ -455,33 +448,4 @@
 
         return m_packageAdmin.getService();
     }
-
-
-    /**
-     * Returns <code>true</code> if the <code>ds.ctworkaround</code> framework
-     * property has been set to <code>true</code>. Otherwise <code>false</code>
-     * is returned.
-     * <p>
-     * If this method returns <code>true</code>, two workarounds for the OSGi
-     * Compendium R 4.2 CT for Declarative Services are active:
-     * <ul>
-     * <li>The <code>ComponentContext.getProperties()</code> implementation
-     * always returns the same writeable <code>Dictionary</code> instead of
-     * a read-only dictionary</li>
-     * <li>Location binding of <code>Configuration</code> objects supplied to
-     * components is ignored.</li>
-     * </ul>
-     * <p>
-     * Setting the <code>ds.ctworkaround</code> framework property is required
-     * to pass the CT but setting the property in a productive environment
-     * is strongly discouraged.
-     *
-     * @return <code>true</code> if the <code>ds.ctworkaround</code> framework
-     *      property is set to <code>true</code>.
-     * @see <a href="https://issues.apache.org/jira/browse/FELIX-2526">FELIX-2526</a>
-     */
-    public static boolean hasCtWorkaround()
-    {
-        return m_ctWorkaround;
-    }
 }
\ No newline at end of file
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java b/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
index 645164c..03acf07 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/ScrCommand.java
@@ -358,11 +358,6 @@
         out.println(scrConfiguration.getLogLevel());
         out.print("Component Factory with Factory Configuration: ");
         out.println(scrConfiguration.isFactoryEnabled() ? "Supported" : "Unsupported");
-
-        if (ScrConfiguration.hasCtWorkaround(bundleContext))
-        {
-            out.println("CT Issue workaround enabled");
-        }
     }
 
     private String pad(String value, int size)
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java b/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
index d46c565..4d07515 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
@@ -256,7 +256,7 @@
         try
         {
             final Configuration cfg = ca.getConfiguration(pid);
-            if (bundleLocation.equals(cfg.getBundleLocation()) || Activator.hasCtWorkaround())
+            if (bundleLocation.equals(cfg.getBundleLocation()))
             {
                 return cfg.getProperties();
             }
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java b/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java
index 018cc7f..8a67c01 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/config/ScrConfiguration.java
@@ -22,7 +22,6 @@
 import java.util.Dictionary;
 import java.util.Hashtable;
 
-import org.apache.felix.scr.impl.Activator;
 import org.osgi.framework.BundleContext;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceRegistration;
@@ -64,9 +63,6 @@
 
     public static final String PROP_LOGLEVEL = "ds.loglevel";
 
-    // framework property to enable the CT workarounds (see FELIX-2526)
-    private static final String PROP_CT_WORKAROUND = "ds.ctworkaround";
-
     private static final String LOG_LEVEL_DEBUG = "debug";
 
     private static final String LOG_LEVEL_INFO = "info";
@@ -167,28 +163,6 @@
     }
 
 
-    public static boolean hasCtWorkaround( final BundleContext bundleContext )
-    {
-        boolean ctWorkaround = VALUE_TRUE.equals( bundleContext.getProperty( PROP_CT_WORKAROUND ) );
-        if ( ctWorkaround )
-        {
-            Activator
-                .log(
-                    LogService.LOG_WARNING,
-                    bundleContext.getBundle(),
-                    "OSGi CT Workaround enabled. This Declarative Services instance is not operating specification compliant:",
-                    null );
-            Activator.log( LogService.LOG_WARNING, bundleContext.getBundle(),
-                " - Dictionary returned from ComponentContext.getProperties() is writeable", null );
-            Activator.log( LogService.LOG_WARNING, bundleContext.getBundle(),
-                " - Location Binding of Configuration is ignored", null );
-            Activator.log( LogService.LOG_WARNING, bundleContext.getBundle(), "Remove " + PROP_CT_WORKAROUND
-                + " framework property to operate specification compliant", null );
-        }
-        return ctWorkaround;
-    }
-
-
     private boolean getDefaultFactoryEnabled()
     {
         return VALUE_TRUE.equals( bundleContext.getProperty( PROP_FACTORY_ENABLED ) );
diff --git a/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java b/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
index 6fd2b45..9df5fb3 100644
--- a/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
+++ b/scr/src/main/java/org/apache/felix/scr/impl/manager/ComponentContextImpl.java
@@ -22,7 +22,6 @@
 import java.util.Dictionary;
 
 import org.apache.felix.scr.component.ExtComponentContext;
-import org.apache.felix.scr.impl.Activator;
 import org.apache.felix.scr.impl.helper.ReadOnlyDictionary;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
@@ -54,11 +53,7 @@
     {
         // 112.12.3.5 The Dictionary is read-only and cannot be modified
         Dictionary ctxProperties = m_componentManager.getProperties();
-        if ( !Activator.hasCtWorkaround() )
-        {
-            ctxProperties = new ReadOnlyDictionary( ctxProperties );
-        }
-        return ctxProperties;
+        return new ReadOnlyDictionary( ctxProperties );
     }