[
https://issues.apache.org/jira/browse/ARIES-1321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322230#comment-16322230
]
ASF GitHub Bot commented on ARIES-1321:
---------------------------------------
GitHub user mnlipp opened a pull request:
https://github.com/apache/aries/pull/82
Support variable as argument for ServiceLoader.load.
Fixes [#1321](https://issues.apache.org/jira/browse/ARIES-1321). (Took me
*hours* to find out that the problem wasn't my configuration of
osgi.serviceloader but a critical(!) bug in the implementation opened 2.5 years
ago.) The fix is based on [Olivier
Nouguier](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=cheleb)'s
patch. I improved it a bit to handle an additional possible problem and added
test cases.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mnlipp/aries 1321-fix-NPE
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/aries/pull/82.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #82
----
commit 47cf4fed2809a9ffa3c842edd2f04712dea10d94
Author: Michael N. Lipp <mnl@...>
Date: 2018-01-11T13:39:25Z
Support variable as argument for ServiceLoader.load.
Fixes #1321.
----
> NPE when calling ServiceLoader.load with a variable
> ---------------------------------------------------
>
> Key: ARIES-1321
> URL: https://issues.apache.org/jira/browse/ARIES-1321
> Project: Aries
> Issue Type: Bug
> Components: SPI Fly
> Affects Versions: spifly-1.0.2
> Reporter: Olivier NOUGUIER
> Priority: Critical
> Attachments: ARIES-1321.diff
>
>
> When ServiceLoader is called with a variable (aka not a constant):
> aMethod(Class<T> type ){
> ServiceLoader.load(type).
> }
> Then the weaver result in a NPE in TCCLMethodVisitor because lastLDCType is
> null.
> Patch provided.
>
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)