You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2018/11/19 07:31:18 UTC
[sling-org-apache-sling-feature-analyser] branch master updated:
SLING-8119 : Improve configuration handling
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git
The following commit(s) were added to refs/heads/master by this push:
new a45ef96 SLING-8119 : Improve configuration handling
a45ef96 is described below
commit a45ef96f4e2916f123d0873b2a3854aecd9355c6
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Mon Nov 19 08:31:05 2018 +0100
SLING-8119 : Improve configuration handling
---
.../feature/scanner/impl/ContentPackageScanner.java | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackageScanner.java b/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackageScanner.java
index 5720166..ce17c74 100644
--- a/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackageScanner.java
+++ b/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackageScanner.java
@@ -330,24 +330,17 @@ public class ContentPackageScanner {
id = configFile.getName().substring(0, lastDot);
}
- final String pid, factoryPid;
+ final String pid;
final int slashPos = id.indexOf('-');
if ( slashPos == -1 ) {
pid = id;
- factoryPid = null;
} else {
- pid = id.substring(slashPos + 1);
- factoryPid = id.substring(0, slashPos);
+ pid = id.substring(0, slashPos) + '~' + id.substring(slashPos + 1);
}
- final Configuration cfg;
- if ( factoryPid != null ) {
- cfg = new Configuration(factoryPid, pid);
- } else {
- cfg = new Configuration(pid);
- }
- cfg.getProperties().put("content-path", contentPath);
- cfg.getProperties().put("content-package", packageArtifact.getId().toMvnId());
+ final Configuration cfg = new Configuration(pid);
+ cfg.getProperties().put(Configuration.PROP_PREFIX + "content-path", contentPath);
+ cfg.getProperties().put(Configuration.PROP_PREFIX + "content-package", packageArtifact.getId().toMvnId());
return cfg;
}