[
https://issues.apache.org/jira/browse/LANG-1773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Gary D. Gregory resolved LANG-1773.
-----------------------------------
Fix Version/s: 3.18.0
Assignee: Gary D. Gregory
Resolution: Fixed
TY [~eamonnmcmanus]
The PR is now in git master. Please verify a local clone of git master or a
snapshot build from
https://repository.apache.org/content/repositories/snapshots/
> Apache Commons Lang no longer builds on Android
> -----------------------------------------------
>
> Key: LANG-1773
> URL: https://issues.apache.org/jira/browse/LANG-1773
> Project: Commons Lang
> Issue Type: Bug
> Components: lang.reflect.*
> Reporter: Éamonn McManus
> Assignee: Gary D. Gregory
> Priority: Major
> Fix For: 3.18.0
>
>
> Google periodically imports various open source projects into the [Google
> Monorepo|https://research.google/pubs/why-google-stores-billions-of-lines-of-code-in-a-single-repository]
>
> [.|https://research.google/pubs/why-google-stores-billions-of-lines-of-code-in-a-single-repository/].]
> When I attempted to do that for Commons Lang, I found that it no longer
> builds against the Android API. The reason is that [this
> commit|https://github.com/apache/commons-lang/commit/c4007c4a24eafbed53109e4b0376b4fd0ba01b56]
> introduced a usage of `java.lang.reflect.AnnotatedType`, but that interface
> doesn't exist on Android ([Android
> `java.lang.reflect`|https://developer.android.com/reference/java/lang/reflect/package-summary]).
> The open-source Commons Lang is probably not built against the Android API,
> but the built artifacts get used there, and this code could lead to bizarre
> runtime failures.
> I was able to patch the code so that it uses reflection to access
> `AnnotatedType`, and I could make a PR with that change if that is helpful.
> Then if `AnnotatedType` doesn't exist, the private `TypeUtils.isCyclical`
> method just returns false. Or perhaps the test for these cyclical types could
> work some other way that doesn't involve `AnnotatedType`.
> Alternatively, if this is unlikely to be useful to users outside Google, we
> can maintain a private patch.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)