You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "niekraaijmakers (via GitHub)" <gi...@apache.org> on 2023/02/17 17:19:46 UTC
[GitHub] [sling-org-apache-sling-feature-cpconverter] niekraaijmakers opened a new pull request, #158: Work in progress - Sling 11777 2
niekraaijmakers opened a new pull request, #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158
Solving Sling 11777 with repoinit statements only
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Sling 11777 2 - improve segmentprocessing
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435986849
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [98.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435982405
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [98.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] rombert closed pull request #158: [Shelved] Sling 11777 2 - improve segmentprocessing
Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert closed pull request #158: [Shelved] Sling 11777 2 - improve segmentprocessing
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] anchela commented on a diff in pull request #158: Sling 11777 2 - improve segmentprocessing
Posted by "anchela (via GitHub)" <gi...@apache.org>.
anchela commented on code in PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#discussion_r1112682836
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
+ if(set.covers(repositoryPath) && (set.getImportMode() != ImportMode.MERGE && set.getImportMode() != ImportMode.MERGE_PROPERTIES)){
+ //found a path with a mode other than merge, proceed to replace the type definitions
+ merge = false;
+ }else if(set.covers(repositoryPath)){
Review Comment:
formatting
in addition: you have twice the condition `set.covers(repositoryPath)` in both the if and the else-if. that doesn't look good. i believe this could be heavily improved in terms of readability if you would extract that into a separate method.... e.g. 'doMerge'
also note: merge is already the default in the init of the boolean.... so this looks a bit odd at a first glance and becomes only understandable in the context of the for-loop and with the comment.
added benefit of extracting into a separate method: the complexity of the method does down, which will avoid having sonar complaining about it
finally: there is not 'else'.... it would be good to either refactor the code that it's a simple if-else of alternatively add a comment about your 'else' that is missing. what happens in that case?
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435128388
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [100.0% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435640906
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [96.3% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] anchela commented on a diff in pull request #158: Sling 11777 2 - improve segmentprocessing
Posted by "anchela (via GitHub)" <gi...@apache.org>.
anchela commented on code in PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#discussion_r1112667194
##########
src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java:
##########
@@ -328,19 +337,23 @@ private void secondPass(@NotNull Collection<VaultPackage> orderedContentPackages
// finally serialize the Feature Model(s) file(s)
aclManager.addRepoinitExtension(assemblers, featuresManager);
- bundleSlingInitialContentExtractor.addRepoInitExtension(assemblers, featuresManager);
indexManager.addRepoinitExtension(featuresManager);
logger.info("Conversion complete!");
-
+ persistedAssemblerList.addAll(assemblers);
+
+ //for the last feature, we add the repoinit extensions, because we got all the information
+ if(!vaultPackageIterator.hasNext()){
Review Comment:
missing spaces again.... please let the formatter of your IDE fix the formatting before you create a PR. your code adhere to the same coding style as the rest of the module.... the converter is a beast and i want to avoid having broken-window-syndrom because it looks ugly when everyone just does his/her thing.
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435986351
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [98.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] niekraaijmakers commented on a diff in pull request #158: [Shelved] Sling 11777 2 - improve segmentprocessing
Posted by "niekraaijmakers (via GitHub)" <gi...@apache.org>.
niekraaijmakers commented on code in PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#discussion_r1112737327
##########
src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java:
##########
@@ -286,11 +295,9 @@ public void convert(@NotNull File... contentPackages) throws IOException, Conver
// analyze sub-content packages in order to filter out
// possible outdated conflicting packages
recollectorVaultPackageScanner.traverse(pack);
-
logger.info("content-package '{}' successfully read!", contentPackage);
aclManager.reset();
- bundleSlingInitialContentExtractor.reset();
Review Comment:
Basically it didn't do anything in the past ... it was added because acl manager etc did reset something.. the paths were cleared but empty to begin with :(
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] rombert commented on pull request #158: [Shelved] Sling 11777 2 - improve segmentprocessing
Posted by "rombert (via GitHub)" <gi...@apache.org>.
rombert commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1452044637
@niekraaijmakers - if this is shelved, can it be closed and reopened when needed?
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] anchela commented on a diff in pull request #158: Sling 11777 2 - improve segmentprocessing
Posted by "anchela (via GitHub)" <gi...@apache.org>.
anchela commented on code in PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#discussion_r1112675670
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
Review Comment:
formatting
##########
src/main/java/org/apache/sling/feature/cpconverter/ContentPackage2FeatureModelConverter.java:
##########
@@ -286,11 +295,9 @@ public void convert(@NotNull File... contentPackages) throws IOException, Conver
// analyze sub-content packages in order to filter out
// possible outdated conflicting packages
recollectorVaultPackageScanner.traverse(pack);
-
logger.info("content-package '{}' successfully read!", contentPackage);
aclManager.reset();
- bundleSlingInitialContentExtractor.reset();
Review Comment:
@niekraaijmakers , the method '`reset`' on the `BundleSlingInitialContentExtractor` is now no longer used anywhere..... but it is still present in the code.
please remove it....
and on a second look: could it be a problem that the reset method is never called? after all it was there for a reason, wasn't it?
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
+ if(set.covers(repositoryPath) && (set.getImportMode() != ImportMode.MERGE && set.getImportMode() != ImportMode.MERGE_PROPERTIES)){
Review Comment:
formatting
in addition: this condition is too complex to read -> i would suggest to extract it into a separate method that helps understanding what you are doing.
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
+ if(set.covers(repositoryPath) && (set.getImportMode() != ImportMode.MERGE && set.getImportMode() != ImportMode.MERGE_PROPERTIES)){
+ //found a path with a mode other than merge, proceed to replace the type definitions
+ merge = false;
+ }else if(set.covers(repositoryPath)){
+ // merge is flipped to true again by another filter defined after the previous ones
+ merge = true;
}
}
+ if(merge){
+ // we already got the path defined by an earlier package. only proceed to replace if the filter is not merge.
+ continue;
+ }
}
- if (!segmentAdded) {
- //use sling:Folder (defined by repo-init runtime module)
- cp.addSegment(part, null);
+
+ File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
+ if (currentContent.exists() && currentContent.isFile()) {
+ //collect the primary Data up ahead
+ collectTypeData(repositoryPath, currentContent);
}
}
- return foundType;
}
- private static boolean addSegment(@NotNull CreatePath cp, @NotNull String part, @NotNull File currentContent) {
+
+ private boolean collectTypeData(String repositoryPath, @NotNull File currentContent) {
Review Comment:
please add annotation to repositoryPath param. i believe you don't expect this to be null and thus it should have notnull annotation.
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
Review Comment:
formatting
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
+ if(set.covers(repositoryPath) && (set.getImportMode() != ImportMode.MERGE && set.getImportMode() != ImportMode.MERGE_PROPERTIES)){
+ //found a path with a mode other than merge, proceed to replace the type definitions
+ merge = false;
+ }else if(set.covers(repositoryPath)){
+ // merge is flipped to true again by another filter defined after the previous ones
+ merge = true;
}
}
+ if(merge){
+ // we already got the path defined by an earlier package. only proceed to replace if the filter is not merge.
+ continue;
Review Comment:
wait-what.... ? ah.... that's the outer for-loop.....
that code looks quite brittle IMHO. plese refactor the code such that you don't need the 'continue' and make the code easy to understand/read/maintain.
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
Review Comment:
i believe you want 'part' to be notnull... -> add nullable or notnull annotations.
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
Review Comment:
please add notnull/nullable annotation. (i believe you want it to be notnull)
missing space before {
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
Review Comment:
formatting
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
Review Comment:
formatting... you even don't do it consistently in your own code :(
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
+ if(set.covers(repositoryPath) && (set.getImportMode() != ImportMode.MERGE && set.getImportMode() != ImportMode.MERGE_PROPERTIES)){
+ //found a path with a mode other than merge, proceed to replace the type definitions
+ merge = false;
+ }else if(set.covers(repositoryPath)){
+ // merge is flipped to true again by another filter defined after the previous ones
+ merge = true;
}
}
+ if(merge){
Review Comment:
formatting
##########
src/main/java/org/apache/sling/feature/cpconverter/repoinit/createpath/CreatePathSegmentProcessor.java:
##########
@@ -27,52 +29,97 @@
import java.io.FileInputStream;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import static org.apache.jackrabbit.vault.util.Constants.DOT_CONTENT_XML;
public class CreatePathSegmentProcessor {
- private CreatePathSegmentProcessor() {
+ private final RepoPath path;
+ private final Collection<VaultPackageAssembler> packageAssemblers;
+ private final CreatePath cp;
+ private boolean foundType = false;
+ private String repositoryPath = "";
+
+ private Map<String,String> primaryTypeMap = new LinkedHashMap<>();
+ private Map<String,List<String>> mixinTypeMap = new LinkedHashMap<>();
+
+ public CreatePathSegmentProcessor(@NotNull RepoPath path,
+ @NotNull Collection<VaultPackageAssembler> packageAssemblers,
+ @NotNull CreatePath cp) {
+ this.path = path;
+ this.packageAssemblers = packageAssemblers;
+ this.cp = cp;
}
/**
* Process segments of a repopath to createpath, checking packageassemblers for existing primaryType definitions.
- *
- * @param path
- * @param packageAssemblers
- * @param cp
* @return
*/
- public static boolean processSegments(@NotNull RepoPath path, @NotNull Collection<VaultPackageAssembler> packageAssemblers, @NotNull CreatePath cp) {
- String repositoryPath = "";
- boolean foundType = false;
+ public boolean processSegments() {
for (final String part : path.getSegments()) {
- final String platformName = PlatformNameFormat.getPlatformName(part);
- repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+ repositoryPath = processSegment(part);
+ }
+ return foundType;
+ }
- boolean segmentAdded = false;
- //loop all package assemblers and check if .content.xml is defined
- for (VaultPackageAssembler packageAssembler : packageAssemblers) {
- File currentContent = packageAssembler.getFileEntry(repositoryPath.concat(ConverterConstants.SLASH).concat(DOT_CONTENT_XML));
- if (currentContent.exists() && currentContent.isFile()) {
- //add segment if jcr:primaryType is defined.
- segmentAdded = addSegment(cp, part, currentContent);
- if (segmentAdded) {
- foundType = true;
- break;
+ @NotNull
+ private String processSegment(String part) {
+ final String platformName = PlatformNameFormat.getPlatformName(part);
+ repositoryPath = repositoryPath.concat(ConverterConstants.SLASH).concat(platformName);
+
+ //loop all package assemblers and check if .content.xml is defined
+ collectTypeDataForSegment();
+ addSegment(part);
+
+ return repositoryPath;
+ }
+
+ private void addSegment(String part){
+ //add segment if jcr:primaryType is defined.
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ cp.addSegment(
+ part,
+ primaryTypeMap.get(repositoryPath),
+ mixinTypeMap.get(repositoryPath)
+ );
+ }else{
+ cp.addSegment(part, null);
+ }
+ }
+
+ private void collectTypeDataForSegment() {
+ for (VaultPackageAssembler packageAssembler : packageAssemblers) {
+
+ if(primaryTypeMap.containsKey(repositoryPath)){
+ boolean merge = true;
+ for(PathFilterSet set: packageAssembler.getFilter().getFilterSets()){
+ if(set.covers(repositoryPath) && (set.getImportMode() != ImportMode.MERGE && set.getImportMode() != ImportMode.MERGE_PROPERTIES)){
+ //found a path with a mode other than merge, proceed to replace the type definitions
+ merge = false;
+ }else if(set.covers(repositoryPath)){
Review Comment:
formatting
in addition: you have twice the condition `set.covers(repositoryPath)` in both the if and the else-if. that doesn't look good. i believe this could be heavily improved in terms of readability if you would extract that into a separate method.... e.g. 'doMerge'
also note: merge is already the default in the init of the boolean.... so this looks a bit odd at a first glance and becomes only understandable in the context of the for-loop and with the comment.
added benefit of extracting into a separate method: the complexity of the method does down, which will avoid having sonar complaining about it
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] niekraaijmakers commented on pull request #158: Sling 11777 2 - improve segmentprocessing
Posted by "niekraaijmakers (via GitHub)" <gi...@apache.org>.
niekraaijmakers commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435986559
yes, I know about the newlines, but other then that ready for scrutiny.
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435909609
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [96.1% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435921366
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [96.1% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Sling 11777 2 - improve segmentprocessing
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435987628
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [98.7% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435705398
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [96.4% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] niekraaijmakers commented on pull request #158: Work in progress - Sling 11777 2
Posted by "niekraaijmakers (via GitHub)" <gi...@apache.org>.
niekraaijmakers commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435642132
@DominikSuess @anchela @rombert @karlpauls @cziegeler - I am now going to test this internally. I tested it locally with various packages and looked good. Feel free to shoot some holes.
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] commented on pull request #158: Work in progress - Sling 11777 2
Posted by "sonarcloud[bot] (via GitHub)" <gi...@apache.org>.
sonarcloud[bot] commented on PR #158:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/158#issuecomment-1435903443
Kudos, SonarCloud Quality Gate passed! [](https://sonarcloud.io/dashboard?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=BUG)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=VULNERABILITY)
[](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=SECURITY_HOTSPOT)
[](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL) [2 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&resolved=false&types=CODE_SMELL)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list) [96.1% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_coverage&view=list)
[](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=158&metric=new_duplicated_lines_density&view=list)
--
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: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org