You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Robert Munteanu (Jira)" <ji...@apache.org> on 2022/04/01 11:02:00 UTC

[jira] [Commented] (SLING-11240) Content packages with invalid Long properties cause index definition extraction to fail

    [ https://issues.apache.org/jira/browse/SLING-11240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17515867#comment-17515867 ] 

Robert Munteanu commented on SLING-11240:
-----------------------------------------

[~kwin] - I am getting the data from the filevault {{DocViewParser}}, who is apparently happy to send over a property value of "2.0" and type {{Long}}. I assume that the parsing/conversion is something that happens in Vault further down the line. Is this something that can be moved over to the parsers to simplify consumption of should I handle it in the cp converter?

> Content packages with invalid Long properties cause index definition extraction to fail
> ---------------------------------------------------------------------------------------
>
>                 Key: SLING-11240
>                 URL: https://issues.apache.org/jira/browse/SLING-11240
>             Project: Sling
>          Issue Type: Bug
>          Components: Feature Model
>    Affects Versions: Content-Package to Feature Model Converter 1.1.14
>            Reporter: Robert Munteanu
>            Assignee: Robert Munteanu
>            Priority: Major
>             Fix For: Content-Package to Feature Model Converter 1.1.16
>
>
> Certain content packages contain invalid attribute definitions, such as
> {noformat}
> ...
>   <jcrTitle jcr:primaryType="nt:unstructured" name="jcr:content/jcr:title" boost="{Long}2.0" />
> ...
> {noformat}
> Although the intention is clear - a boot value of 2 - parsing fails
> {noformat}
> java.lang.NumberFormatException: For input string: "2.0"
> 	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> 	at java.base/java.lang.Long.parseLong(Long.java:692)
> 	at java.base/java.lang.Long.parseLong(Long.java:817)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.lambda$write$2(IndexDefinitionsJsonWriter.java:94)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.write(IndexDefinitionsJsonWriter.java:143)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.write(IndexDefinitionsJsonWriter.java:94)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.write(IndexDefinitionsJsonWriter.java:134)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.write(IndexDefinitionsJsonWriter.java:134)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.write(IndexDefinitionsJsonWriter.java:134)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.write(IndexDefinitionsJsonWriter.java:134)
> 	at org.apache.sling.feature.cpconverter.index.IndexDefinitionsJsonWriter.writeAsJson(IndexDefinitionsJsonWriter.java:69)
> 	at org.apache.sling.feature.cpconverter.index.DefaultIndexManager.addRepoinitExtension(DefaultIndexManager.java:38)
> 	at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.secondPass(ContentPackage2FeatureModelConverter.java:331)
> 	at org.apache.sling.feature.cpconverter.ContentPackage2FeatureModelConverter.convert(ContentPackage2FeatureModelConverter.java:266){noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)