You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/05/04 14:50:00 UTC
[jira] [Commented] (FELIX-6402) ConcurrentModificationException
results in null value while converting to an array
[ https://issues.apache.org/jira/browse/FELIX-6402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17339053#comment-17339053 ]
Konrad Windszus commented on FELIX-6402:
----------------------------------------
PR at [https://github.com/apache/felix-dev/pull/74.] [~cziegeler] Can you have a look?
> ConcurrentModificationException results in null value while converting to an array
> ----------------------------------------------------------------------------------
>
> Key: FELIX-6402
> URL: https://issues.apache.org/jira/browse/FELIX-6402
> Project: Felix
> Issue Type: Bug
> Components: Converter
> Affects Versions: converter-1.0.14
> Reporter: Carsten Ziegeler
> Priority: Minor
> Fix For: converter-1.0.16
>
>
> As reported in SLING-10273 it sometimes happens that a conversion to a String[] results in "null" to be returned by the converter. According to the spec, a converter will always return a String array (might be empty).
> This got traced down in the issue to a ConcurrentModificationException (see below) which is catched at [1] and then null is returned.
> It is probably better to raise a ConversionException in this case to make the problem known to the caller - and also avoiding the unexpected null return value
> [1] https://github.com/apache/felix-dev/blob/master/converter/converter/src/main/java/org/osgi/util/converter/ConvertingImpl.java#L312
> {noformat}
> java.util.ConcurrentModificationException
> at java.base/java.util.HashMap$HashIterator.nextNode(HashMap.java:1493)
> at java.base/java.util.HashMap$KeyIterator.next(HashMap.java:1516)
> at org.osgi.util.converter.ConvertingImpl.convertToArray(ConvertingImpl.java:306)
> at org.osgi.util.converter.ConvertingImpl.to(ConvertingImpl.java:207)
> at org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:183)
> at org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:151)
> at org.osgi.util.converter.CustomConverterImpl$ConvertingWrapper.to(CustomConverterImpl.java:139)
> at org.apache.sling.auth.core.impl.SlingAuthenticatorServiceListener.modifiedService(SlingAuthenticatorServiceListener.java:369)
> at org.apache.sling.auth.core.impl.SlingAuthenticatorServiceListener.process(SlingAuthenticatorServiceListener.java:280)
> at org.apache.sling.auth.core.impl.SlingAuthenticatorServiceListener.processQueue(SlingAuthenticatorServiceListener.java:257)
> at org.apache.sling.auth.core.impl.SlingAuthenticatorServiceListener.lambda$schedule$0(SlingAuthenticatorServiceListener.java:166)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:834)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)