You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2019/12/09 11:01:02 UTC

[sling-org-apache-sling-feature-analyser] branch feature/SLING-8900 created (now 537dc86)

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

rombert pushed a change to branch feature/SLING-8900
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git.


      at 537dc86  SLING-8900 - Rename sourceId attribute to source-ids

This branch includes the following new commits:

     new 537dc86  SLING-8900 - Rename sourceId attribute to source-ids

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-feature-analyser] 01/01: SLING-8900 - Rename sourceId attribute to source-ids

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feature/SLING-8900
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git

commit 537dc86e7bf1773bbc2781d99c465829e12a57a2
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Dec 9 12:00:30 2019 +0100

    SLING-8900 - Rename sourceId attribute to source-ids
---
 .../sling/feature/analyser/task/impl/CheckApisJarsProperties.java   | 6 +++---
 .../feature/analyser/task/impl/CheckApisJarsPropertiesTest.java     | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsProperties.java b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsProperties.java
index 01f1177..c73af1f 100644
--- a/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsProperties.java
+++ b/src/main/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsProperties.java
@@ -37,7 +37,7 @@ import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
 public class CheckApisJarsProperties implements AnalyserTask {
     
     // TODO - also defined in ApisJarMojo
-    private static final String SOURCE_ID = "sourceId";
+    private static final String SOURCE_IDS = "source-ids";
 
     @Override
     public String getId() {
@@ -54,12 +54,12 @@ public class CheckApisJarsProperties implements AnalyserTask {
 
         ctx.getFeature().getBundles().getBundlesByStartOrder().values().stream()
             .flatMap( List::stream )
-            .filter ( artifact -> artifact.getMetadata().containsKey(SOURCE_ID) )
+            .filter ( artifact -> artifact.getMetadata().containsKey(SOURCE_IDS) )
             .forEach( artifact -> checkSourceIdValidity(artifact, ctx));
     }
     
     private void checkSourceIdValidity(Artifact a, AnalyserTaskContext ctx) {
-        String sourceId = a.getMetadata().get(SOURCE_ID);
+        String sourceId = a.getMetadata().get(SOURCE_IDS);
         Arrays.stream(sourceId.split(","))
             .map( String::trim )
             .filter( el -> el.length() > 0)
diff --git a/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsPropertiesTest.java b/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsPropertiesTest.java
index 7307b25..34ea6f6 100644
--- a/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsPropertiesTest.java
+++ b/src/test/java/org/apache/sling/feature/analyser/task/impl/CheckApisJarsPropertiesTest.java
@@ -97,7 +97,7 @@ public class CheckApisJarsPropertiesTest {
         public void addArtifactWithSourceId(String artifactId, String sourceId) {
             Artifact artifact = new Artifact(ArtifactId.parse(artifactId));
             if ( sourceId != null )
-                artifact.getMetadata().put("sourceId", sourceId);
+                artifact.getMetadata().put("source-ids", sourceId);
             
             getBundles().add(artifact);
         }