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

Konrad Windszus commented on SLING-11240:
-----------------------------------------

IMHO failure is expected and the only reasonable thing to do here. When you try 
to import such package with FileVault it will fail as well (in strict mode) and 
in no case it tries to convert the value but in the lenient case just skips the 
property. Establishing a different/more lenient behaviour in cp2fm doesn't feel 
right to me. Any particular reason why you think you need to accept such 
invalid DocView XML files?

> 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: Content-Package to Feature Model Converter
>    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)

Reply via email to