You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2020/11/06 12:19:55 UTC
[GitHub] [sling-org-apache-sling-feature-cpconverter] DominikSuess opened a new pull request #32: Issue/sling 9881
DominikSuess opened a new pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32
----------------------------------------------------------------
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.
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 #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
rombert commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-724797688
@DominikSuess - can you please force-push a single commit with all the changes? I will then merge
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] rombert commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r520425955
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
+ // Date was never properly supported as osgi configs don't support dates so converting to millis
+ // Scenario should just be theoretical
+ attributeQName += ":Long";
+ value = Lists.transform(strValues, new Function<String, Long>() {
+ public Long apply(String s) {
+ Long res = null;
+ if (s != null) {
+ Calendar cal = ISO8601.parse(s);
+ if (cal != null) {
+ res = cal.getTimeInMillis();
+ }
+ }
+ return res;
+ }
+ }).toArray();
+ break;
+ case PropertyType.DOUBLE:
+ attributeQName += ":Double";
+ value = Lists.transform(strValues, new Function<String, Double>() {
+ public Double apply(String s) {
+ Double res = null;
+ try {
+ res = Double.parseDouble(s);
+ } catch ( NumberFormatException ex ){
+ // ignore as nonexisting
Review comment:
Wouldn't the below OSGi config snippet be silently ignored with this change?
```xml
alertThreshold="{Double}high"
```
?
I think such invalid inputs should halt the conversion process.
----------------------------------------------------------------
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.
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 #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-724571619
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullReq
uest=32&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [5 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90.png' alt='90.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list) [90.9% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list)
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning.png' alt='warning' width='16' height='16' /> The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.
Read more [here](https://sonarcloud.io/documentation/upcoming/)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] removed a comment on pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-724571619
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullReq
uest=32&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [5 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90.png' alt='90.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list) [90.9% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list)
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning.png' alt='warning' width='16' height='16' /> The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.
Read more [here](https://sonarcloud.io/documentation/upcoming/)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] DominikSuess commented on pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
DominikSuess commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-724570793
Reverted the switch of separator that was accidentially commited along but was found to no longer be a concrete issue (fix wouldn't change failing conditions)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] bosschaert commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
bosschaert commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r518742805
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/vltpkg/VaultPackageAssembler.java
##########
@@ -105,7 +105,7 @@ private static VaultPackageAssembler create(VaultPackage vaultPackage, Workspace
Properties properties = new Properties();
properties.setProperty(PackageProperties.NAME_VERSION,
packageProperties.getProperty(PackageProperties.NAME_VERSION)
- + '-'
+ + '.'
Review comment:
Is this change related?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] DominikSuess commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
DominikSuess commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r520420067
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
+ // Date was never properly supported as osgi configs don't support dates so converting to millis
+ // Scenario should just be theoretical
+ attributeQName += ":Long";
+ value = Lists.transform(strValues, new Function<String, Long>() {
+ public Long apply(String s) {
+ Long res = null;
+ if (s != null) {
+ Calendar cal = ISO8601.parse(s);
+ if (cal != null) {
+ res = cal.getTimeInMillis();
+ }
+ }
+ return res;
+ }
+ }).toArray();
+ break;
+ case PropertyType.DOUBLE:
+ attributeQName += ":Double";
+ value = Lists.transform(strValues, new Function<String, Double>() {
+ public Double apply(String s) {
+ Double res = null;
+ try {
+ res = Double.parseDouble(s);
+ } catch ( NumberFormatException ex ){
+ // ignore as nonexisting
Review comment:
@rombert - as those are typed representations (it is a string representation of a typed property in the end) the only "valid" case of not being a number is an unset value. Therefore I saw no scenario where an explicit handling would do anything here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] rombert commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r518727709
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
+ // Date was never properly supported as osgi configs don't support dates so converting to millis
+ // Scenario should just be theoretical
+ attributeQName += ":Long";
+ value = Lists.transform(strValues, new Function<String, Long>() {
+ public Long apply(String s) {
+ Long res = null;
+ if (s != null) {
+ Calendar cal = ISO8601.parse(s);
+ if (cal != null) {
+ res = cal.getTimeInMillis();
+ }
+ }
+ return res;
+ }
+ }).toArray();
+ break;
+ case PropertyType.DOUBLE:
+ attributeQName += ":Double";
+ value = Lists.transform(strValues, new Function<String, Double>() {
+ public Double apply(String s) {
+ Double res = null;
+ try {
+ res = Double.parseDouble(s);
+ } catch ( NumberFormatException ex ){
+ // ignore as nonexisting
Review comment:
Are you sure that we should just skip invalid values for doubles and longs and not fail the conversion process?
----------------------------------------------------------------
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.
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 #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-723053179
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullReq
uest=32&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [5 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90.png' alt='90.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list) [90.9% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list)
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning.png' alt='warning' width='16' height='16' /> The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.
Read more [here](https://sonarcloud.io/documentation/upcoming/)
----------------------------------------------------------------
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.
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 #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-725306690
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullReq
uest=32&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [5 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90.png' alt='91.2%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list) [91.2% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list)
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning.png' alt='warning' width='16' height='16' /> The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.
Read more [here](https://sonarcloud.io/documentation/upcoming/)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] DominikSuess commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
DominikSuess commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r520572507
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
+ // Date was never properly supported as osgi configs don't support dates so converting to millis
+ // Scenario should just be theoretical
+ attributeQName += ":Long";
+ value = Lists.transform(strValues, new Function<String, Long>() {
+ public Long apply(String s) {
+ Long res = null;
+ if (s != null) {
+ Calendar cal = ISO8601.parse(s);
+ if (cal != null) {
+ res = cal.getTimeInMillis();
+ }
+ }
+ return res;
+ }
+ }).toArray();
+ break;
+ case PropertyType.DOUBLE:
+ attributeQName += ":Double";
+ value = Lists.transform(strValues, new Function<String, Double>() {
+ public Double apply(String s) {
+ Double res = null;
+ try {
+ res = Double.parseDouble(s);
+ } catch ( NumberFormatException ex ){
+ // ignore as nonexisting
Review comment:
@rombert ok - in theory they shouldn't exist but yes you are right if somebody crafted a broken vault package that may happen - I can make this throw an exception.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] rombert commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
rombert commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r520663352
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
+ // Date was never properly supported as osgi configs don't support dates so converting to millis
+ // Scenario should just be theoretical
+ attributeQName += ":Long";
+ value = Lists.transform(strValues, new Function<String, Long>() {
+ public Long apply(String s) {
+ Long res = null;
+ if (s != null) {
+ Calendar cal = ISO8601.parse(s);
+ if (cal != null) {
+ res = cal.getTimeInMillis();
+ }
+ }
+ return res;
+ }
+ }).toArray();
+ break;
+ case PropertyType.DOUBLE:
+ attributeQName += ":Double";
+ value = Lists.transform(strValues, new Function<String, Double>() {
+ public Double apply(String s) {
+ Double res = null;
+ try {
+ res = Double.parseDouble(s);
+ } catch ( NumberFormatException ex ){
+ // ignore as nonexisting
Review comment:
Great, thanks!
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] sonarcloud[bot] removed a comment on pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] removed a comment on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-723053179
Kudos, SonarCloud Quality Gate passed!
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=BUG)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=VULNERABILITY) (and [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullReq
uest=32&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=SECURITY_HOTSPOT) to review)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' />](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL) [5 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&resolved=false&types=CODE_SMELL)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/90.png' alt='90.9%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list) [90.9% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_coverage&view=list)
[<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.0%' width='16' height='16' />](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-feature-cpconverter&pullRequest=32&metric=new_duplicated_lines_density&view=list)
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/message_warning.png' alt='warning' width='16' height='16' /> The version of Java (1.8.0_252) you have used to run this analysis is deprecated and we will stop accepting it accepting it soon.Please update to at least Java 11.
Read more [here](https://sonarcloud.io/documentation/upcoming/)
----------------------------------------------------------------
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.
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 #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
rombert commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-724815672
@kwin - we settled on a 'squash, rebase and merge' approach which is not possible with the GitHub UI, see the "Merging pull requests from contributors" section in https://cwiki.apache.org/confluence/display/SLING/Using+Git+with+Sling .
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] bosschaert merged pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
bosschaert merged pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] DominikSuess commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
DominikSuess commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r520418736
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
Review comment:
@bosschaert I only handle what the sling osgi installer supports and handles - other types wouldn't work in sling:OsgiConfig nodes anyhow. The cnd doesn't constrain it but the other properties woud be handled as String representations in the osgi installer as well.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] bosschaert commented on a change in pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
bosschaert commented on a change in pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#discussion_r518742489
##########
File path: src/main/java/org/apache/sling/feature/cpconverter/handlers/XmlConfigurationEntryHandler.java
##########
@@ -65,13 +74,77 @@ protected void onJcrRootElement(String uri, String localName, String qName, Attr
if (attributeValue != null && !attributeValue.isEmpty()) {
DocViewProperty property = DocViewProperty.parse(attributeQName, attributeValue);
-
+ Object value = property.values;
+ List<String> strValues = Arrays.asList(property.values);
+ switch (property.type) {
+ case PropertyType.DATE:
Review comment:
The JCR https://docs.adobe.com/docs/en/spec/javax.jcr/javadocs/jcr-2.0/javax/jcr/PropertyType.html contains more types than explicitly handled here. Are we sure that we cover all the ones we need?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [sling-org-apache-sling-feature-cpconverter] kwin commented on pull request #32: Issue/sling 9881
Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #32:
URL: https://github.com/apache/sling-org-apache-sling-feature-cpconverter/pull/32#issuecomment-724813809
@rombert Why not using https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/about-pull-request-merges#squash-and-merge-your-pull-request-commits?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org