[
https://issues.apache.org/jira/browse/GROOVY-10881?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17654603#comment-17654603
]
ASF GitHub Bot commented on GROOVY-10881:
-----------------------------------------
royteeuwen commented on PR #1836:
URL: https://github.com/apache/groovy/pull/1836#issuecomment-1371305256
> Will this cause many passes of class scanning and
`DefaultFastStringService` instances? How are `loadService()` and
`getService()` used?
INSTANCE s a static field, meaning that at the class loading of
FastStringUtils it will be initialized by calling loadService(). This will only
be done once
getService() will just return that same static instance all the time
> FastStringUtils does not work in an OSGi environment
> ----------------------------------------------------
>
> Key: GROOVY-10881
> URL: https://issues.apache.org/jira/browse/GROOVY-10881
> Project: Groovy
> Issue Type: Bug
> Components: JSON
> Reporter: Roy Teeuwen
> Priority: Major
>
> Using the FastStringUtils does not work in an OSGi environment. The
> FastStringUtils will be called by the classloader of another bundle, making
> the code at
> https://github.com/apache/groovy/blob/master/subprojects/groovy-json/src/main/java/org/apache/groovy/json/internal/FastStringUtils.java#L39
> not find the default service loader.
> To counter this, I'd like to propose to at least fall back to the
> DefaultFastStringService when no FastStringServiceFactory is found
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)