You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/04/26 09:05:18 UTC

[sling-whiteboard] branch master updated: [Feature Model] Remove SlingConstants

This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new ddfac0c  [Feature Model] Remove SlingConstants
ddfac0c is described below

commit ddfac0c7e5a3a2c2c100867d0cb05b401532eff5
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Thu Apr 26 09:54:15 2018 +0100

    [Feature Model] Remove SlingConstants
    
    The 2 constants left in SlingConstants were only used once. Moved them
    to the place they were used. With this the
    org.apache.sling.feature.support package is now empty. I removed the
    pacakge-info.java as well.
---
 .../feature/scanner/impl/RepoInitScanner.java      |  9 ++++--
 .../sling/feature/karaf/KarafFeatureWriter.java    |  7 +++--
 .../sling/feature/support/SlingConstants.java      | 32 ----------------------
 .../apache/sling/feature/support/package-info.java | 23 ----------------
 4 files changed, 11 insertions(+), 60 deletions(-)

diff --git a/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java b/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java
index e30e879..97fa3b7 100644
--- a/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java
+++ b/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java
@@ -16,17 +16,22 @@
  */
 package org.apache.sling.feature.scanner.impl;
 
+import org.apache.felix.utils.resource.RequirementImpl;
 import org.apache.sling.feature.Extension;
 import org.apache.sling.feature.ExtensionType;
 import org.apache.sling.feature.FeatureConstants;
 import org.apache.sling.feature.io.ArtifactManager;
 import org.apache.sling.feature.scanner.ContainerDescriptor;
 import org.apache.sling.feature.scanner.spi.ExtensionScanner;
-import org.apache.sling.feature.support.SlingConstants;
+import org.osgi.resource.Requirement;
 
 import java.io.IOException;
+import java.util.Collections;
 
 public class RepoInitScanner implements ExtensionScanner {
+    private static final Requirement REQUIREMENT_REPOINIT = new RequirementImpl(null, "osgi.implementation",
+            Collections.singletonMap("filter", "(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))"),
+                    null);
 
     @Override
     public String getId() {
@@ -51,7 +56,7 @@ public class RepoInitScanner implements ExtensionScanner {
 
         final ContainerDescriptor cd = new ContainerDescriptor() {};
 
-        cd.getRequirements().add(SlingConstants.REQUIREMENT_REPOINIT);
+        cd.getRequirements().add(REQUIREMENT_REPOINIT);
 
         cd.lock();
 
diff --git a/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java b/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java
index dc00bc1..6bea0f7 100644
--- a/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java
+++ b/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java
@@ -25,7 +25,6 @@ import org.apache.sling.feature.Feature;
 import org.apache.sling.feature.FeatureConstants;
 import org.apache.sling.feature.io.ArtifactHandler;
 import org.apache.sling.feature.io.ArtifactManager;
-import org.apache.sling.feature.support.SlingConstants;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -48,6 +47,9 @@ import java.util.zip.ZipOutputStream;
  *
  */
 public class KarafFeatureWriter {
+    private static final String REQUIRE_REPOINIT_CAPABILITY =
+            "osgi.implementation;filter:=\"(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))\"";
+
 
     public static void writeKAR(final OutputStream os,
             final Feature feature,
@@ -74,8 +76,7 @@ public class KarafFeatureWriter {
                     if ( repoinitExt == null ) {
                         map = null;
                     } else {
-                        map = Collections.singletonMap("Require-Capability",
-                                SlingConstants.REQUIRE_REPOINIT_CAPABILITY);
+                        map = Collections.singletonMap("Require-Capability", REQUIRE_REPOINIT_CAPABILITY);
                     }
                     ConfigurationUtil.createConfiguratorBundle(os,
                             configs,
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/SlingConstants.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/SlingConstants.java
deleted file mode 100644
index 7c05f96..0000000
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/SlingConstants.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with this
- * work for additional information regarding copyright ownership. The ASF
- * licenses this file to You under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.apache.sling.feature.support;
-
-import org.apache.felix.utils.resource.RequirementImpl;
-import org.osgi.resource.Requirement;
-
-import java.util.Collections;
-
-public abstract class SlingConstants {
-
-    public static final String REQUIRE_REPOINIT_CAPABILITY =
-            "osgi.implementation;filter:=\"(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))\"";
-
-    public static final Requirement REQUIREMENT_REPOINIT = new RequirementImpl(null, "osgi.implementation",
-            Collections.singletonMap("filter", "(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))"),
-                    null);
-}
diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/package-info.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/package-info.java
deleted file mode 100644
index 8eae6a4..0000000
--- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/package-info.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-@org.osgi.annotation.versioning.Version("1.0.0")
-package org.apache.sling.feature.support;
-
-

-- 
To stop receiving notification emails like this one, please contact
davidb@apache.org.